Main Page | Class List | File List | Class Members | File Members

netdevice.h File Reference

#include <linux/if.h>
#include <linux/if_ether.h>
#include <linux/if_packet.h>
#include <asm/atomic.h>
#include <asm/cache.h>
#include <asm/byteorder.h>
#include <linux/config.h>
#include <linux/cache.h>
#include <linux/skbuff.h>
#include <linux/interrupt.h>
#include <linux/notifier.h>

Go to the source code of this file.

Classes

struct  net_device_stats
struct  netif_rx_stats
struct  dev_mc_list
struct  hh_cache
struct  netdev_boot_setup
struct  net_device
struct  packet_type
struct  softnet_data

Defines

#define SET_ETHTOOL_OPS(netdev, ops)   ( (netdev)->ethtool_ops = (ops) )
#define HAVE_ALLOC_NETDEV
#define HAVE_FREE_NETDEV
#define NET_XMIT_SUCCESS   0
#define NET_XMIT_DROP   1
#define NET_XMIT_CN   2
#define NET_XMIT_POLICED   3
#define NET_XMIT_BYPASS   4
#define NET_RX_SUCCESS   0
#define NET_RX_DROP   1
#define NET_RX_CN_LOW   2
#define NET_RX_CN_MOD   3
#define NET_RX_CN_HIGH   4
#define NET_RX_BAD   5
#define net_xmit_errno(e)   ((e) != NET_XMIT_CN ? -ENOBUFS : 0)
#define MAX_ADDR_LEN   8
#define LL_MAX_HEADER   32
#define MAX_HEADER   LL_MAX_HEADER
#define HH_DATA_MOD   16
#define HH_DATA_OFF(__len)   (HH_DATA_MOD - ((__len) & (HH_DATA_MOD - 1)))
#define HH_DATA_ALIGN(__len)   (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1))
#define NETDEV_BOOT_SETUP_MAX   8
#define NETIF_F_SG   1
#define NETIF_F_IP_CSUM   2
#define NETIF_F_NO_CSUM   4
#define NETIF_F_HW_CSUM   8
#define NETIF_F_DYNALLOC   16
#define NETIF_F_HIGHDMA   32
#define NETIF_F_FRAGLIST   64
#define NETIF_F_HW_VLAN_TX   128
#define NETIF_F_HW_VLAN_RX   256
#define NETIF_F_HW_VLAN_FILTER   512
#define NETIF_F_VLAN_CHALLENGED   1024
#define HAVE_NETDEV_POLL
#define HAVE_MULTICAST
#define HAVE_SET_MAC_ADDR
#define HAVE_PRIVATE_IOCTL
#define HAVE_SET_CONFIG
#define HAVE_HEADER_CACHE
#define HAVE_CHANGE_MTU
#define HAVE_TX_TIMEOUT
#define HAVE_NETIF_QUEUE
#define HAVE_NETIF_RX   1
#define HAVE_NETIF_RECEIVE_SKB   1
#define __dev_put(dev)   atomic_dec(&(dev)->refcnt)
#define dev_hold(dev)   atomic_inc(&(dev)->refcnt)
#define HAVE_NETIF_MSG   1
#define netif_msg_drv(p)   ((p)->msg_enable & NETIF_MSG_DRV)
#define netif_msg_probe(p)   ((p)->msg_enable & NETIF_MSG_PROBE)
#define netif_msg_link(p)   ((p)->msg_enable & NETIF_MSG_LINK)
#define netif_msg_timer(p)   ((p)->msg_enable & NETIF_MSG_TIMER)
#define netif_msg_ifdown(p)   ((p)->msg_enable & NETIF_MSG_IFDOWN)
#define netif_msg_ifup(p)   ((p)->msg_enable & NETIF_MSG_IFUP)
#define netif_msg_rx_err(p)   ((p)->msg_enable & NETIF_MSG_RX_ERR)
#define netif_msg_tx_err(p)   ((p)->msg_enable & NETIF_MSG_TX_ERR)
#define netif_msg_tx_queued(p)   ((p)->msg_enable & NETIF_MSG_TX_QUEUED)
#define netif_msg_intr(p)   ((p)->msg_enable & NETIF_MSG_INTR)
#define netif_msg_tx_done(p)   ((p)->msg_enable & NETIF_MSG_TX_DONE)
#define netif_msg_rx_status(p)   ((p)->msg_enable & NETIF_MSG_RX_STATUS)
#define netif_msg_pktdata(p)   ((p)->msg_enable & NETIF_MSG_PKTDATA)
#define netif_msg_hw(p)   ((p)->msg_enable & NETIF_MSG_HW)
#define netif_msg_wol(p)   ((p)->msg_enable & NETIF_MSG_WOL)

Typedefs

typedef int gifconf_func_t (struct net_device *dev, char *bufptr, int len)

Enumerations

enum  {
  IF_PORT_UNKNOWN = 0, IF_PORT_10BASE2, IF_PORT_10BASET, IF_PORT_AUI,
  IF_PORT_100BASET, IF_PORT_100BASETX, IF_PORT_100BASEFX
}
enum  netdev_state_t {
  __LINK_STATE_XOFF = 0, __LINK_STATE_START, __LINK_STATE_PRESENT, __LINK_STATE_SCHED,
  __LINK_STATE_NOCARRIER, __LINK_STATE_RX_SCHED
}
enum  {
  NETIF_MSG_DRV = 0x0001, NETIF_MSG_PROBE = 0x0002, NETIF_MSG_LINK = 0x0004, NETIF_MSG_TIMER = 0x0008,
  NETIF_MSG_IFDOWN = 0x0010, NETIF_MSG_IFUP = 0x0020, NETIF_MSG_RX_ERR = 0x0040, NETIF_MSG_TX_ERR = 0x0080,
  NETIF_MSG_TX_QUEUED = 0x0100, NETIF_MSG_INTR = 0x0200, NETIF_MSG_TX_DONE = 0x0400, NETIF_MSG_RX_STATUS = 0x0800,
  NETIF_MSG_PKTDATA = 0x1000, NETIF_MSG_HW = 0x2000, NETIF_MSG_WOL = 0x4000
}

Functions

int netdev_boot_setup_add (char *name, struct ifmap *map)
int netdev_boot_setup_check (struct net_device *dev)
net_devicedev_getbyhwaddr (unsigned short type, char *hwaddr)
void dev_add_pack (struct packet_type *pt)
void dev_remove_pack (struct packet_type *pt)
int dev_get (const char *name)
net_devicedev_get_by_flags (unsigned short flags, unsigned short mask)
net_device__dev_get_by_flags (unsigned short flags, unsigned short mask)
net_devicedev_get_by_name (const char *name)
net_device__dev_get_by_name (const char *name)
net_devicedev_alloc (const char *name, int *err)
int dev_alloc_name (struct net_device *dev, const char *name)
int dev_open (struct net_device *dev)
int dev_close (struct net_device *dev)
int dev_queue_xmit (struct sk_buff *skb)
int register_netdevice (struct net_device *dev)
int unregister_netdevice (struct net_device *dev)
int register_netdevice_notifier (struct notifier_block *nb)
int unregister_netdevice_notifier (struct notifier_block *nb)
int dev_new_index (void)
net_devicedev_get_by_index (int ifindex)
net_device__dev_get_by_index (int ifindex)
int dev_restart (struct net_device *dev)
int register_gifconf (unsigned int family, gifconf_func_t *gifconf)
int unregister_gifconf (unsigned int family)
void __netif_schedule (struct net_device *dev)
void netif_schedule (struct net_device *dev)
void netif_start_queue (struct net_device *dev)
void netif_wake_queue (struct net_device *dev)
void netif_stop_queue (struct net_device *dev)
int netif_queue_stopped (struct net_device *dev)
int netif_running (struct net_device *dev)
void dev_kfree_skb_irq (struct sk_buff *skb)
void dev_kfree_skb_any (struct sk_buff *skb)
int netif_rx (struct sk_buff *skb)
int netif_receive_skb (struct sk_buff *skb)
int dev_ioctl (unsigned int cmd, void *)
int dev_ethtool (struct ifreq *)
int dev_change_flags (struct net_device *, unsigned)
void dev_queue_xmit_nit (struct sk_buff *skb, struct net_device *dev)
void dev_init (void)
int netif_rx_ni (struct sk_buff *skb)
void dev_init_buffers (struct net_device *dev)
int netdev_finish_unregister (struct net_device *dev)
void dev_put (struct net_device *dev)
int netif_carrier_ok (struct net_device *dev)
void __netdev_watchdog_up (struct net_device *dev)
void netif_carrier_on (struct net_device *dev)
void netif_carrier_off (struct net_device *dev)
int netif_device_present (struct net_device *dev)
void netif_device_detach (struct net_device *dev)
void netif_device_attach (struct net_device *dev)
int netif_rx_schedule_prep (struct net_device *dev)
void __netif_rx_schedule (struct net_device *dev)
void netif_rx_schedule (struct net_device *dev)
int netif_rx_reschedule (struct net_device *dev, int undo)
void netif_rx_complete (struct net_device *dev)
void netif_poll_disable (struct net_device *dev)
void netif_poll_enable (struct net_device *dev)
void __netif_rx_complete (struct net_device *dev)
void netif_tx_disable (struct net_device *dev)
void ether_setup (struct net_device *dev)
void fddi_setup (struct net_device *dev)
void tr_setup (struct net_device *dev)
void fc_setup (struct net_device *dev)
void fc_freedev (struct net_device *dev)
net_devicealloc_netdev (int sizeof_priv, const char *name, void(*setup)(struct net_device *))
int register_netdev (struct net_device *dev)
void unregister_netdev (struct net_device *dev)
void dev_mc_upload (struct net_device *dev)
int dev_mc_delete (struct net_device *dev, void *addr, int alen, int all)
int dev_mc_add (struct net_device *dev, void *addr, int alen, int newonly)
void dev_mc_discard (struct net_device *dev)
void dev_set_promiscuity (struct net_device *dev, int inc)
void dev_set_allmulti (struct net_device *dev, int inc)
void netdev_state_change (struct net_device *dev)
void dev_load (const char *name)
void dev_mcast_init (void)
int netdev_register_fc (struct net_device *dev, void(*stimul)(struct net_device *dev))
void netdev_unregister_fc (int bit)
int netdev_set_master (struct net_device *dev, struct net_device *master)
sk_buffskb_checksum_help (struct sk_buff *skb)
void free_netdev (struct net_device *dev)

Variables

const char * if_port_text []
netif_rx_stats ____cacheline_aligned
netif_rx_stats netdev_rx_stat []
net_device loopback_dev
net_devicedev_base
rwlock_t dev_base_lock
softnet_data softnet_data [NR_CPUS]
int netdev_nit
int netdev_max_backlog
int weight_p
unsigned long netdev_fc_xoff
atomic_t netdev_dropping


Define Documentation

#define __dev_put dev   )     atomic_dec(&(dev)->refcnt)
 

Definition at line 644 of file netdevice.h.

Referenced by ip_mc_find_dev(), and vif_add().

#define dev_hold dev   )     atomic_inc(&(dev)->refcnt)
 

Definition at line 645 of file netdevice.h.

Referenced by __netif_rx_schedule(), alloc_divert_blk(), dev_get_by_flags(), dev_get_by_index(), dev_get_by_name(), dst_dev_event(), fib_check_nh(), inetdev_init(), ip_dev_find(), ip_route_input_mc(), ip_route_input_slow(), ip_route_output_slow(), ip_rt_redirect(), ipgre_fb_tunnel_init(), ipgre_tunnel_locate(), ipip_fb_tunnel_init(), ipip_tunnel_locate(), neigh_create(), net_dev_init(), netdev_set_master(), netif_rx(), nf_queue(), pneigh_enqueue(), register_netdevice(), and vif_add().

#define HAVE_ALLOC_NETDEV
 

Definition at line 50 of file netdevice.h.

#define HAVE_CHANGE_MTU
 

Definition at line 421 of file netdevice.h.

#define HAVE_FREE_NETDEV
 

Definition at line 52 of file netdevice.h.

#define HAVE_HEADER_CACHE
 

Definition at line 415 of file netdevice.h.

#define HAVE_MULTICAST
 

Definition at line 404 of file netdevice.h.

#define HAVE_NETDEV_POLL
 

Definition at line 395 of file netdevice.h.

#define HAVE_NETIF_MSG   1
 

Definition at line 697 of file netdevice.h.

#define HAVE_NETIF_QUEUE
 

Definition at line 530 of file netdevice.h.

#define HAVE_NETIF_RECEIVE_SKB   1
 

Definition at line 609 of file netdevice.h.

#define HAVE_NETIF_RX   1
 

Definition at line 607 of file netdevice.h.

#define HAVE_PRIVATE_IOCTL
 

Definition at line 409 of file netdevice.h.

#define HAVE_SET_CONFIG
 

Definition at line 412 of file netdevice.h.

#define HAVE_SET_MAC_ADDR
 

Definition at line 406 of file netdevice.h.

#define HAVE_TX_TIMEOUT
 

Definition at line 424 of file netdevice.h.

#define HH_DATA_ALIGN __len   )     (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1))
 

Definition at line 205 of file netdevice.h.

Referenced by ip_direct_send(), and ip_finish_output2().

#define HH_DATA_MOD   16
 

Definition at line 202 of file netdevice.h.

#define HH_DATA_OFF __len   )     (HH_DATA_MOD - ((__len) & (HH_DATA_MOD - 1)))
 

Definition at line 203 of file netdevice.h.

#define LL_MAX_HEADER   32
 

Definition at line 82 of file netdevice.h.

Referenced by ipgre_tunnel_init(), ipgre_tunnel_init_gen(), and ipip_tunnel_init_gen().

#define MAX_ADDR_LEN   8
 

Definition at line 74 of file netdevice.h.

Referenced by dev_ifsioc(), ip_mc_filter_add(), and ip_mc_filter_del().

#define MAX_HEADER   LL_MAX_HEADER
 

Definition at line 93 of file netdevice.h.

Referenced by inet_rtm_getroute().

#define NET_RX_BAD   5
 

Definition at line 68 of file netdevice.h.

Referenced by ip_forward().

#define NET_RX_CN_HIGH   4
 

Definition at line 67 of file netdevice.h.

Referenced by get_sample_stats().

#define NET_RX_CN_LOW   2
 

Definition at line 65 of file netdevice.h.

Referenced by get_sample_stats().

#define NET_RX_CN_MOD   3
 

Definition at line 66 of file netdevice.h.

Referenced by get_sample_stats().

#define NET_RX_DROP   1
 

Definition at line 64 of file netdevice.h.

Referenced by deliver_to_old_ones(), get_sample_stats(), handle_bridge(), ip_forward(), ip_rcv(), ip_rcv_finish(), netif_receive_skb(), netif_rx(), and raw_rcv_skb().

#define NET_RX_SUCCESS   0
 

Definition at line 63 of file netdevice.h.

Referenced by get_sample_stats(), ip_do_nat(), ip_forward(), and raw_rcv_skb().

#define NET_XMIT_BYPASS   4
 

Definition at line 58 of file netdevice.h.

Referenced by dev_queue_xmit().

#define NET_XMIT_CN   2
 

Definition at line 56 of file netdevice.h.

Referenced by tcp_transmit_skb(), and tcp_v4_send_synack().

#define NET_XMIT_DROP   1
 

Definition at line 55 of file netdevice.h.

#define net_xmit_errno  )     ((e) != NET_XMIT_CN ? -ENOBUFS : 0)
 

Definition at line 70 of file netdevice.h.

Referenced by ip_build_xmit(), and ip_build_xmit_slow().

#define NET_XMIT_POLICED   3
 

Definition at line 57 of file netdevice.h.

#define NET_XMIT_SUCCESS   0
 

Definition at line 54 of file netdevice.h.

Referenced by dev_queue_xmit().

#define NETDEV_BOOT_SETUP_MAX   8
 

Definition at line 234 of file netdevice.h.

Referenced by netdev_boot_setup_add(), and netdev_boot_setup_check().

#define NETIF_F_DYNALLOC   16
 

Definition at line 377 of file netdevice.h.

Referenced by dst_dev_event(), ipgre_tunnel_locate(), ipip_tunnel_locate(), netdev_finish_unregister(), and unregister_netdevice().

#define NETIF_F_FRAGLIST   64
 

Definition at line 379 of file netdevice.h.

Referenced by dev_queue_xmit().

#define NETIF_F_HIGHDMA   32
 

Definition at line 378 of file netdevice.h.

#define NETIF_F_HW_CSUM   8
 

Definition at line 376 of file netdevice.h.

Referenced by dev_queue_xmit(), and register_netdevice().

#define NETIF_F_HW_VLAN_FILTER   512
 

Definition at line 382 of file netdevice.h.

#define NETIF_F_HW_VLAN_RX   256
 

Definition at line 381 of file netdevice.h.

#define NETIF_F_HW_VLAN_TX   128
 

Definition at line 380 of file netdevice.h.

#define NETIF_F_IP_CSUM   2
 

Definition at line 374 of file netdevice.h.

Referenced by dev_queue_xmit(), ethtool_op_get_tx_csum(), ethtool_op_set_tx_csum(), and register_netdevice().

#define NETIF_F_NO_CSUM   4
 

Definition at line 375 of file netdevice.h.

Referenced by dev_queue_xmit(), and register_netdevice().

#define NETIF_F_SG   1
 

Definition at line 373 of file netdevice.h.

Referenced by dev_queue_xmit(), ethtool_op_get_sg(), ethtool_op_set_sg(), register_netdevice(), select_size(), tcp_sendmsg(), and tcp_sendpage().

#define NETIF_F_VLAN_CHALLENGED   1024
 

Definition at line 383 of file netdevice.h.

#define netif_msg_drv  )     ((p)->msg_enable & NETIF_MSG_DRV)
 

Definition at line 717 of file netdevice.h.

#define netif_msg_hw  )     ((p)->msg_enable & NETIF_MSG_HW)
 

Definition at line 730 of file netdevice.h.

#define netif_msg_ifdown  )     ((p)->msg_enable & NETIF_MSG_IFDOWN)
 

Definition at line 721 of file netdevice.h.

#define netif_msg_ifup  )     ((p)->msg_enable & NETIF_MSG_IFUP)
 

Definition at line 722 of file netdevice.h.

#define netif_msg_intr  )     ((p)->msg_enable & NETIF_MSG_INTR)
 

Definition at line 726 of file netdevice.h.

#define netif_msg_link  )     ((p)->msg_enable & NETIF_MSG_LINK)
 

Definition at line 719 of file netdevice.h.

#define netif_msg_pktdata  )     ((p)->msg_enable & NETIF_MSG_PKTDATA)
 

Definition at line 729 of file netdevice.h.

#define netif_msg_probe  )     ((p)->msg_enable & NETIF_MSG_PROBE)
 

Definition at line 718 of file netdevice.h.

#define netif_msg_rx_err  )     ((p)->msg_enable & NETIF_MSG_RX_ERR)
 

Definition at line 723 of file netdevice.h.

#define netif_msg_rx_status  )     ((p)->msg_enable & NETIF_MSG_RX_STATUS)
 

Definition at line 728 of file netdevice.h.

#define netif_msg_timer  )     ((p)->msg_enable & NETIF_MSG_TIMER)
 

Definition at line 720 of file netdevice.h.

#define netif_msg_tx_done  )     ((p)->msg_enable & NETIF_MSG_TX_DONE)
 

Definition at line 727 of file netdevice.h.

#define netif_msg_tx_err  )     ((p)->msg_enable & NETIF_MSG_TX_ERR)
 

Definition at line 724 of file netdevice.h.

#define netif_msg_tx_queued  )     ((p)->msg_enable & NETIF_MSG_TX_QUEUED)
 

Definition at line 725 of file netdevice.h.

#define netif_msg_wol  )     ((p)->msg_enable & NETIF_MSG_WOL)
 

Definition at line 731 of file netdevice.h.

#define SET_ETHTOOL_OPS netdev,
ops   )     ( (netdev)->ethtool_ops = (ops) )
 

Definition at line 47 of file netdevice.h.


Typedef Documentation

typedef int gifconf_func_t(struct net_device *dev, char *bufptr, int len)
 

Definition at line 502 of file netdevice.h.

Referenced by register_gifconf().


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
IF_PORT_UNKNOWN 
IF_PORT_10BASE2 
IF_PORT_10BASET 
IF_PORT_AUI 
IF_PORT_100BASET 
IF_PORT_100BASETX 
IF_PORT_100BASEFX 
Definition at line 138 of file netdevice.h.
00138 { 00139 IF_PORT_UNKNOWN = 0, 00140 IF_PORT_10BASE2, 00141 IF_PORT_10BASET, 00142 IF_PORT_AUI, 00143 IF_PORT_100BASET, 00144 IF_PORT_100BASETX, 00145 IF_PORT_100BASEFX 00146 };

anonymous enum
 

Enumeration values:
NETIF_MSG_DRV 
NETIF_MSG_PROBE 
NETIF_MSG_LINK 
NETIF_MSG_TIMER 
NETIF_MSG_IFDOWN 
NETIF_MSG_IFUP 
NETIF_MSG_RX_ERR 
NETIF_MSG_TX_ERR 
NETIF_MSG_TX_QUEUED 
NETIF_MSG_INTR 
NETIF_MSG_TX_DONE 
NETIF_MSG_RX_STATUS 
NETIF_MSG_PKTDATA 
NETIF_MSG_HW 
NETIF_MSG_WOL 
Definition at line 699 of file netdevice.h.
00699 { 00700 NETIF_MSG_DRV = 0x0001, 00701 NETIF_MSG_PROBE = 0x0002, 00702 NETIF_MSG_LINK = 0x0004, 00703 NETIF_MSG_TIMER = 0x0008, 00704 NETIF_MSG_IFDOWN = 0x0010, 00705 NETIF_MSG_IFUP = 0x0020, 00706 NETIF_MSG_RX_ERR = 0x0040, 00707 NETIF_MSG_TX_ERR = 0x0080, 00708 NETIF_MSG_TX_QUEUED = 0x0100, 00709 NETIF_MSG_INTR = 0x0200, 00710 NETIF_MSG_TX_DONE = 0x0400, 00711 NETIF_MSG_RX_STATUS = 0x0800, 00712 NETIF_MSG_PKTDATA = 0x1000, 00713 NETIF_MSG_HW = 0x2000, 00714 NETIF_MSG_WOL = 0x4000, 00715 };

enum netdev_state_t
 

Enumeration values:
__LINK_STATE_XOFF 
__LINK_STATE_START 
__LINK_STATE_PRESENT 
__LINK_STATE_SCHED 
__LINK_STATE_NOCARRIER 
__LINK_STATE_RX_SCHED 
Definition at line 215 of file netdevice.h.


Function Documentation

struct net_device* __dev_get_by_flags unsigned short  flags,
unsigned short  mask
 

Definition at line 582 of file dev.c.

References dev_base, and net_device::next.

Referenced by dev_get_by_flags().

00583 { 00584 struct net_device *dev; 00585 00586 for (dev = dev_base; dev != NULL; dev = dev->next) { 00587 if (((dev->flags ^ if_flags) & mask) == 0) 00588 return dev; 00589 } 00590 return NULL; 00591 }

struct net_device* __dev_get_by_index int  ifindex  ) 
 

Definition at line 487 of file dev.c.

References dev_base, and net_device::next.

Referenced by dev_get_by_index(), dev_ifname(), dev_new_index(), fib_check_nh(), inet_rtm_getroute(), inet_rtm_newaddr(), inetdev_by_index(), ip_setsockopt(), ipgre_tunnel_init(), and ipip_tunnel_init().

00488 { 00489 struct net_device *dev; 00490 00491 for (dev = dev_base; dev != NULL; dev = dev->next) { 00492 if (dev->ifindex == ifindex) 00493 return dev; 00494 } 00495 return NULL; 00496 }

struct net_device* __dev_get_by_name const char *  name  ) 
 

Definition at line 412 of file dev.c.

References dev_base, and net_device::next.

Referenced by arp_ioctl(), bind_mcastif_addr(), dev_alloc_name(), dev_ethtool(), dev_get(), dev_get_by_name(), dev_ifsioc(), devinet_ioctl(), fib_convert_rtentry(), inet_rtm_newrule(), ipgre_tunnel_locate(), ipip_tunnel_locate(), ipmr_new_tunnel(), join_mcast_group(), set_mcast_if(), setup_inject(), and wireless_process_ioctl().

00413 { 00414 struct net_device *dev; 00415 00416 for (dev = dev_base; dev != NULL; dev = dev->next) { 00417 if (strncmp(dev->name, name, IFNAMSIZ) == 0) 00418 return dev; 00419 } 00420 return NULL; 00421 }

void __netdev_watchdog_up struct net_device dev  ) 
 

Referenced by netif_carrier_on(), and netif_device_attach().

void __netif_rx_complete struct net_device dev  )  [inline, static]
 

Definition at line 823 of file netdevice.h.

References __LINK_STATE_RX_SCHED, net_device::poll_list, and net_device::state.

00824 { 00825 if (!test_bit(__LINK_STATE_RX_SCHED, &dev->state)) BUG(); 00826 list_del(&dev->poll_list); 00827 smp_mb__before_clear_bit(); 00828 clear_bit(__LINK_STATE_RX_SCHED, &dev->state); 00829 }

void __netif_rx_schedule struct net_device dev  )  [inline, static]
 

Definition at line 745 of file netdevice.h.

References dev_hold, softnet_data::poll_list, net_device::poll_list, net_device::quota, softnet_data, and net_device::weight.

Referenced by netif_rx_schedule().

00746 { 00747 unsigned long flags; 00748 int cpu = smp_processor_id(); 00749 00750 local_irq_save(flags); 00751 dev_hold(dev); 00752 list_add_tail(&dev->poll_list, &softnet_data[cpu].poll_list); 00753 if (dev->quota < 0) 00754 dev->quota += dev->weight; 00755 else 00756 dev->quota = dev->weight; 00757 __cpu_raise_softirq(cpu, NET_RX_SOFTIRQ); 00758 local_irq_restore(flags); 00759 }

void __netif_schedule struct net_device dev  )  [inline, static]
 

Definition at line 532 of file netdevice.h.

References __LINK_STATE_SCHED, net_device::next_sched, softnet_data::output_queue, softnet_data, and net_device::state.

Referenced by netif_schedule(), and netif_wake_queue().

00533 { 00534 if (!test_and_set_bit(__LINK_STATE_SCHED, &dev->state)) { 00535 unsigned long flags; 00536 int cpu = smp_processor_id(); 00537 00538 local_irq_save(flags); 00539 dev->next_sched = softnet_data[cpu].output_queue; 00540 softnet_data[cpu].output_queue = dev; 00541 cpu_raise_softirq(cpu, NET_TX_SOFTIRQ); 00542 local_irq_restore(flags); 00543 } 00544 }

struct net_device* alloc_netdev int  sizeof_priv,
const char *  name,
void(*  setup)(struct net_device *)
 

void dev_add_pack struct packet_type pt  ) 
 

Definition at line 234 of file dev.c.

References packet_type::data, packet_type::dev, netdev_nit, packet_type::next, ptype_all, ptype_base, and packet_type::type.

Referenced by arp_init(), and ip_init().

00235 { 00236 int hash; 00237 00238 br_write_lock_bh(BR_NETPROTO_LOCK); 00239 00240 #ifdef CONFIG_NET_FASTROUTE 00241 /* Hack to detect packet socket */ 00242 if ((pt->data) && ((int)(pt->data)!=1)) { 00243 netdev_fastroute_obstacles++; 00244 dev_clear_fastroute(pt->dev); 00245 } 00246 #endif 00247 if (pt->type == htons(ETH_P_ALL)) { 00248 netdev_nit++; 00249 pt->next=ptype_all; 00250 ptype_all=pt; 00251 } else { 00252 hash=ntohs(pt->type)&15; 00253 pt->next = ptype_base[hash]; 00254 ptype_base[hash] = pt; 00255 } 00256 br_write_unlock_bh(BR_NETPROTO_LOCK); 00257 }

struct net_device* dev_alloc const char *  name,
int *  err
 

Definition at line 649 of file dev.c.

References dev_alloc_name().

00650 { 00651 struct net_device *dev=kmalloc(sizeof(struct net_device), GFP_KERNEL); 00652 if (dev == NULL) { 00653 *err = -ENOBUFS; 00654 return NULL; 00655 } 00656 memset(dev, 0, sizeof(struct net_device)); 00657 *err = dev_alloc_name(dev, name); 00658 if (*err < 0) { 00659 kfree(dev); 00660 return NULL; 00661 } 00662 return dev; 00663 }

int dev_alloc_name struct net_device dev,
const char *  name
 

Definition at line 605 of file dev.c.

References __dev_get_by_name(), and net_device::name.

Referenced by dev_alloc(), and net_dev_init().

00606 { 00607 int i; 00608 char buf[32]; 00609 char *p; 00610 00611 /* 00612 * Verify the string as this thing may have come from 00613 * the user. There must be either one "%d" and no other "%" 00614 * characters, or no "%" characters at all. 00615 */ 00616 p = strchr(name, '%'); 00617 if (p && (p[1] != 'd' || strchr(p+2, '%'))) 00618 return -EINVAL; 00619 00620 /* 00621 * If you need over 100 please also fix the algorithm... 00622 */ 00623 for (i = 0; i < 100; i++) { 00624 snprintf(buf,sizeof(buf),name,i); 00625 if (__dev_get_by_name(buf) == NULL) { 00626 strcpy(dev->name, buf); 00627 return i; 00628 } 00629 } 00630 return -ENFILE; /* Over 100 of the things .. bail out! */ 00631 }

int dev_change_flags struct net_device ,
unsigned 
 

Definition at line 1987 of file dev.c.

References dev_close(), dev_mc_upload(), dev_open(), dev_set_allmulti(), dev_set_promiscuity(), net_device::flags, net_device::gflags, netdev_chain, and rtmsg_ifinfo().

Referenced by dev_ifsioc(), devinet_ioctl(), ic_close_devs(), and ic_open_devs().

01988 { 01989 int ret; 01990 int old_flags = dev->flags; 01991 01992 /* 01993 * Set the flags on our device. 01994 */ 01995 01996 dev->flags = (flags & (IFF_DEBUG|IFF_NOTRAILERS|IFF_NOARP|IFF_DYNAMIC| 01997 IFF_MULTICAST|IFF_PORTSEL|IFF_AUTOMEDIA)) | 01998 (dev->flags & (IFF_UP|IFF_VOLATILE|IFF_PROMISC|IFF_ALLMULTI)); 01999 02000 /* 02001 * Load in the correct multicast list now the flags have changed. 02002 */ 02003 02004 dev_mc_upload(dev); 02005 02006 /* 02007 * Have we downed the interface. We handle IFF_UP ourselves 02008 * according to user attempts to set it, rather than blindly 02009 * setting it. 02010 */ 02011 02012 ret = 0; 02013 if ((old_flags^flags)&IFF_UP) /* Bit is different ? */ 02014 { 02015 ret = ((old_flags & IFF_UP) ? dev_close : dev_open)(dev); 02016 02017 if (ret == 0) 02018 dev_mc_upload(dev); 02019 } 02020 02021 if (dev->flags&IFF_UP && 02022 ((old_flags^dev->flags)&~(IFF_UP|IFF_PROMISC|IFF_ALLMULTI|IFF_VOLATILE))) 02023 notifier_call_chain(&netdev_chain, NETDEV_CHANGE, dev); 02024 02025 if ((flags^dev->gflags)&IFF_PROMISC) { 02026 int inc = (flags&IFF_PROMISC) ? +1 : -1; 02027 dev->gflags ^= IFF_PROMISC; 02028 dev_set_promiscuity(dev, inc); 02029 } 02030 02031 /* NOTE: order of synchronization of IFF_PROMISC and IFF_ALLMULTI 02032 is important. Some (broken) drivers set IFF_PROMISC, when 02033 IFF_ALLMULTI is requested not asking us and not reporting. 02034 */ 02035 if ((flags^dev->gflags)&IFF_ALLMULTI) { 02036 int inc = (flags&IFF_ALLMULTI) ? +1 : -1; 02037 dev->gflags ^= IFF_ALLMULTI; 02038 dev_set_allmulti(dev, inc); 02039 } 02040 02041 if (old_flags^dev->flags) 02042 rtmsg_ifinfo(RTM_NEWLINK, dev, old_flags^dev->flags); 02043 02044 return ret; 02045 }

int dev_close struct net_device dev  ) 
 

Definition at line 832 of file dev.c.

References __LINK_STATE_RX_SCHED, __LINK_STATE_START, dev_deactivate(), net_device::flags, netdev_chain, net_device::owner, net_device::state, and net_device::stop.

Referenced by dev_change_flags(), and unregister_netdevice().

00833 { 00834 if (!(dev->flags&IFF_UP)) 00835 return 0; 00836 00837 /* 00838 * Tell people we are going down, so that they can 00839 * prepare to death, when device is still operating. 00840 */ 00841 notifier_call_chain(&netdev_chain, NETDEV_GOING_DOWN, dev); 00842 00843 dev_deactivate(dev); 00844 00845 clear_bit(__LINK_STATE_START, &dev->state); 00846 00847 /* Synchronize to scheduled poll. We cannot touch poll list, 00848 * it can be even on different cpu. So just clear netif_running(), 00849 * and wait when poll really will happen. Actually, the best place 00850 * for this is inside dev->stop() after device stopped its irq 00851 * engine, but this requires more changes in devices. */ 00852 00853 smp_mb__after_clear_bit(); /* Commit netif_running(). */ 00854 while (test_bit(__LINK_STATE_RX_SCHED, &dev->state)) { 00855 /* No hurry. */ 00856 current->state = TASK_INTERRUPTIBLE; 00857 schedule_timeout(1); 00858 } 00859 00860 /* 00861 * Call the device specific close. This cannot fail. 00862 * Only if device is UP 00863 * 00864 * We allow it to be called even after a DETACH hot-plug 00865 * event. 00866 */ 00867 00868 if (dev->stop) 00869 dev->stop(dev); 00870 00871 /* 00872 * Device is now down. 00873 */ 00874 00875 dev->flags &= ~IFF_UP; 00876 #ifdef CONFIG_NET_FASTROUTE 00877 dev_clear_fastroute(dev); 00878 #endif 00879 00880 /* 00881 * Tell people we are down 00882 */ 00883 notifier_call_chain(&netdev_chain, NETDEV_DOWN, dev); 00884 00885 /* 00886 * Drop the module refcount 00887 */ 00888 if (dev->owner) 00889 __MOD_DEC_USE_COUNT(dev->owner); 00890 00891 return(0); 00892 }

int dev_ethtool struct ifreq *   ) 
 

Definition at line 607 of file ethtool.c.

References __dev_get_by_name(), ethtool_get_coalesce(), ethtool_get_drvinfo(), ethtool_get_eeprom(), ethtool_get_link(), ethtool_get_msglevel(), ethtool_get_pauseparam(), ethtool_get_regs(), ethtool_get_ringparam(), ethtool_get_rx_csum(), ethtool_get_settings(), ethtool_get_sg(), ethtool_get_stats(), ethtool_get_strings(), ethtool_get_tx_csum(), ethtool_get_wol(), ethtool_nway_reset(), ethtool_phys_id(), ethtool_self_test(), ethtool_set_coalesce(), ethtool_set_eeprom(), ethtool_set_msglevel(), ethtool_set_pauseparam(), ethtool_set_ringparam(), ethtool_set_rx_csum(), ethtool_set_settings(), ethtool_set_sg(), ethtool_set_tx_csum(), ethtool_set_wol(), and netif_device_present().

Referenced by dev_ioctl().

00608 { 00609 struct net_device *dev = __dev_get_by_name(ifr->ifr_name); 00610 void *useraddr = (void *) ifr->ifr_data; 00611 u32 ethcmd; 00612 00613 /* 00614 * XXX: This can be pushed down into the ethtool_* handlers that 00615 * need it. Keep existing behaviour for the moment. 00616 */ 00617 if (!capable(CAP_NET_ADMIN)) 00618 return -EPERM; 00619 00620 if (!dev || !netif_device_present(dev)) 00621 return -ENODEV; 00622 00623 if (!dev->ethtool_ops) 00624 goto ioctl; 00625 00626 if (copy_from_user(&ethcmd, useraddr, sizeof (ethcmd))) 00627 return -EFAULT; 00628 00629 switch (ethcmd) { 00630 case ETHTOOL_GSET: 00631 return ethtool_get_settings(dev, useraddr); 00632 case ETHTOOL_SSET: 00633 return ethtool_set_settings(dev, useraddr); 00634 case ETHTOOL_GDRVINFO: 00635 return ethtool_get_drvinfo(dev, useraddr); 00636 case ETHTOOL_GREGS: 00637 return ethtool_get_regs(dev, useraddr); 00638 case ETHTOOL_GWOL: 00639 return ethtool_get_wol(dev, useraddr); 00640 case ETHTOOL_SWOL: 00641 return ethtool_set_wol(dev, useraddr); 00642 case ETHTOOL_GMSGLVL: 00643 return ethtool_get_msglevel(dev, useraddr); 00644 case ETHTOOL_SMSGLVL: 00645 return ethtool_set_msglevel(dev, useraddr); 00646 case ETHTOOL_NWAY_RST: 00647 return ethtool_nway_reset(dev); 00648 case ETHTOOL_GLINK: 00649 return ethtool_get_link(dev, useraddr); 00650 case ETHTOOL_GEEPROM: 00651 return ethtool_get_eeprom(dev, useraddr); 00652 case ETHTOOL_SEEPROM: 00653 return ethtool_set_eeprom(dev, useraddr); 00654 case ETHTOOL_GCOALESCE: 00655 return ethtool_get_coalesce(dev, useraddr); 00656 case ETHTOOL_SCOALESCE: 00657 return ethtool_set_coalesce(dev, useraddr); 00658 case ETHTOOL_GRINGPARAM: 00659 return ethtool_get_ringparam(dev, useraddr); 00660 case ETHTOOL_SRINGPARAM: 00661 return ethtool_set_ringparam(dev, useraddr); 00662 case ETHTOOL_GPAUSEPARAM: 00663 return ethtool_get_pauseparam(dev, useraddr); 00664 case ETHTOOL_SPAUSEPARAM: 00665 return ethtool_set_pauseparam(dev, useraddr); 00666 case ETHTOOL_GRXCSUM: 00667 return ethtool_get_rx_csum(dev, useraddr); 00668 case ETHTOOL_SRXCSUM: 00669 return ethtool_set_rx_csum(dev, useraddr); 00670 case ETHTOOL_GTXCSUM: 00671 return ethtool_get_tx_csum(dev, useraddr); 00672 case ETHTOOL_STXCSUM: 00673 return ethtool_set_tx_csum(dev, useraddr); 00674 case ETHTOOL_GSG: 00675 return ethtool_get_sg(dev, useraddr); 00676 case ETHTOOL_SSG: 00677 return ethtool_set_sg(dev, useraddr); 00678 case ETHTOOL_TEST: 00679 return ethtool_self_test(dev, useraddr); 00680 case ETHTOOL_GSTRINGS: 00681 return ethtool_get_strings(dev, useraddr); 00682 case ETHTOOL_PHYS_ID: 00683 return ethtool_phys_id(dev, useraddr); 00684 case ETHTOOL_GSTATS: 00685 return ethtool_get_stats(dev, useraddr); 00686 default: 00687 return -EOPNOTSUPP; 00688 } 00689 00690 ioctl: 00691 if (dev->do_ioctl) 00692 return dev->do_ioctl(dev, ifr, SIOCETHTOOL); 00693 return -EOPNOTSUPP; 00694 }

int dev_get const char *  name  ) 
 

Definition at line 466 of file dev.c.

References __dev_get_by_name(), and dev_base_lock.

00467 { 00468 struct net_device *dev; 00469 00470 read_lock(&dev_base_lock); 00471 dev = __dev_get_by_name(name); 00472 read_unlock(&dev_base_lock); 00473 return dev != NULL; 00474 }

struct net_device* dev_get_by_flags unsigned short  flags,
unsigned short  mask
 

Definition at line 560 of file dev.c.

References __dev_get_by_flags(), dev_base_lock, and dev_hold.

00561 { 00562 struct net_device *dev; 00563 00564 read_lock(&dev_base_lock); 00565 dev = __dev_get_by_flags(if_flags, mask); 00566 if (dev) 00567 dev_hold(dev); 00568 read_unlock(&dev_base_lock); 00569 return dev; 00570 }

struct net_device* dev_get_by_index int  ifindex  ) 
 

Definition at line 509 of file dev.c.

References __dev_get_by_index(), dev_base_lock, and dev_hold.

Referenced by fib_create_info(), ip_expire(), ip_route_output_slow(), neigh_add(), and neigh_delete().

00510 { 00511 struct net_device *dev; 00512 00513 read_lock(&dev_base_lock); 00514 dev = __dev_get_by_index(ifindex); 00515 if (dev) 00516 dev_hold(dev); 00517 read_unlock(&dev_base_lock); 00518 return dev; 00519 }

struct net_device* dev_get_by_name const char *  name  ) 
 

Definition at line 434 of file dev.c.

References __dev_get_by_name(), dev_base_lock, and dev_hold.

Referenced by append_to_chain(), check_args(), insert_in_chain(), ip_fw_ctl(), and sock_setsockopt().

00435 { 00436 struct net_device *dev; 00437 00438 read_lock(&dev_base_lock); 00439 dev = __dev_get_by_name(name); 00440 if (dev) 00441 dev_hold(dev); 00442 read_unlock(&dev_base_lock); 00443 return dev; 00444 }

struct net_device* dev_getbyhwaddr unsigned short  type,
char *  hwaddr
 

Definition at line 535 of file dev.c.

References dev_base, and net_device::next.

Referenced by arp_req_set().

00536 { 00537 struct net_device *dev; 00538 00539 ASSERT_RTNL(); 00540 00541 for (dev = dev_base; dev != NULL; dev = dev->next) { 00542 if (dev->type == type && 00543 memcmp(dev->dev_addr, ha, dev->addr_len) == 0) 00544 return dev; 00545 } 00546 return NULL; 00547 }

void dev_init void   ) 
 

void dev_init_buffers struct net_device dev  )  [inline, static]
 

Definition at line 631 of file netdevice.h.

00632 { 00633 /* WILL BE REMOVED IN 2.5.0 */ 00634 }

int dev_ioctl unsigned int  cmd,
void * 
 

Definition at line 2234 of file dev.c.

References dev_base_lock, dev_ethtool(), dev_ifconf(), dev_ifname(), dev_ifsioc(), dev_load(), rtnl_lock(), rtnl_unlock(), and wireless_process_ioctl().

Referenced by inet_ioctl().

02235 { 02236 struct ifreq ifr; 02237 int ret; 02238 char *colon; 02239 02240 /* One special case: SIOCGIFCONF takes ifconf argument 02241 and requires shared lock, because it sleeps writing 02242 to user space. 02243 */ 02244 02245 if (cmd == SIOCGIFCONF) { 02246 rtnl_shlock(); 02247 ret = dev_ifconf((char *) arg); 02248 rtnl_shunlock(); 02249 return ret; 02250 } 02251 if (cmd == SIOCGIFNAME) { 02252 return dev_ifname((struct ifreq *)arg); 02253 } 02254 02255 if (copy_from_user(&ifr, arg, sizeof(struct ifreq))) 02256 return -EFAULT; 02257 02258 ifr.ifr_name[IFNAMSIZ-1] = 0; 02259 02260 colon = strchr(ifr.ifr_name, ':'); 02261 if (colon) 02262 *colon = 0; 02263 02264 /* 02265 * See which interface the caller is talking about. 02266 */ 02267 02268 switch(cmd) 02269 { 02270 /* 02271 * These ioctl calls: 02272 * - can be done by all. 02273 * - atomic and do not require locking. 02274 * - return a value 02275 */ 02276 02277 case SIOCGIFFLAGS: 02278 case SIOCGIFMETRIC: 02279 case SIOCGIFMTU: 02280 case SIOCGIFHWADDR: 02281 case SIOCGIFSLAVE: 02282 case SIOCGIFMAP: 02283 case SIOCGIFINDEX: 02284 case SIOCGIFTXQLEN: 02285 dev_load(ifr.ifr_name); 02286 read_lock(&dev_base_lock); 02287 ret = dev_ifsioc(&ifr, cmd); 02288 read_unlock(&dev_base_lock); 02289 if (!ret) { 02290 if (colon) 02291 *colon = ':'; 02292 if (copy_to_user(arg, &ifr, sizeof(struct ifreq))) 02293 return -EFAULT; 02294 } 02295 return ret; 02296 02297 case SIOCETHTOOL: 02298 dev_load(ifr.ifr_name); 02299 rtnl_lock(); 02300 ret = dev_ethtool(&ifr); 02301 rtnl_unlock(); 02302 if (!ret) { 02303 if (colon) 02304 *colon = ':'; 02305 if (copy_to_user(arg, &ifr, 02306 sizeof(struct ifreq))) 02307 ret = -EFAULT; 02308 } 02309 return ret; 02310 02311 /* 02312 * These ioctl calls: 02313 * - require superuser power. 02314 * - require strict serialization. 02315 * - return a value 02316 */ 02317 02318 case SIOCGMIIPHY: 02319 case SIOCGMIIREG: 02320 if (!capable(CAP_NET_ADMIN)) 02321 return -EPERM; 02322 dev_load(ifr.ifr_name); 02323 dev_probe_lock(); 02324 rtnl_lock(); 02325 ret = dev_ifsioc(&ifr, cmd); 02326 rtnl_unlock(); 02327 dev_probe_unlock(); 02328 if (!ret) { 02329 if (colon) 02330 *colon = ':'; 02331 if (copy_to_user(arg, &ifr, sizeof(struct ifreq))) 02332 return -EFAULT; 02333 } 02334 return ret; 02335 02336 /* 02337 * These ioctl calls: 02338 * - require superuser power. 02339 * - require strict serialization. 02340 * - do not return a value 02341 */ 02342 02343 case SIOCSIFFLAGS: 02344 case SIOCSIFMETRIC: 02345 case SIOCSIFMTU: 02346 case SIOCSIFMAP: 02347 case SIOCSIFHWADDR: 02348 case SIOCSIFSLAVE: 02349 case SIOCADDMULTI: 02350 case SIOCDELMULTI: 02351 case SIOCSIFHWBROADCAST: 02352 case SIOCSIFTXQLEN: 02353 case SIOCSIFNAME: 02354 case SIOCSMIIREG: 02355 case SIOCBONDENSLAVE: 02356 case SIOCBONDRELEASE: 02357 case SIOCBONDSETHWADDR: 02358 case SIOCBONDSLAVEINFOQUERY: 02359 case SIOCBONDINFOQUERY: 02360 case SIOCBONDCHANGEACTIVE: 02361 if (!capable(CAP_NET_ADMIN)) 02362 return -EPERM; 02363 dev_load(ifr.ifr_name); 02364 dev_probe_lock(); 02365 rtnl_lock(); 02366 ret = dev_ifsioc(&ifr, cmd); 02367 rtnl_unlock(); 02368 dev_probe_unlock(); 02369 return ret; 02370 02371 case SIOCGIFMEM: 02372 /* Get the per device memory space. We can add this but currently 02373 do not support it */ 02374 case SIOCSIFMEM: 02375 /* Set the per device memory buffer space. Not applicable in our case */ 02376 case SIOCSIFLINK: 02377 return -EINVAL; 02378 02379 /* 02380 * Unknown or private ioctl. 02381 */ 02382 02383 default: 02384 if (cmd == SIOCWANDEV || 02385 (cmd >= SIOCDEVPRIVATE && 02386 cmd <= SIOCDEVPRIVATE + 15)) { 02387 dev_load(ifr.ifr_name); 02388 dev_probe_lock(); 02389 rtnl_lock(); 02390 ret = dev_ifsioc(&ifr, cmd); 02391 rtnl_unlock(); 02392 dev_probe_unlock(); 02393 if (!ret && copy_to_user(arg, &ifr, sizeof(struct ifreq))) 02394 return -EFAULT; 02395 return ret; 02396 } 02397 #ifdef WIRELESS_EXT 02398 /* Take care of Wireless Extensions */ 02399 if (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) { 02400 /* If command is `set a parameter', or 02401 * `get the encoding parameters', check if 02402 * the user has the right to do it */ 02403 if (IW_IS_SET(cmd) || (cmd == SIOCGIWENCODE)) { 02404 if(!capable(CAP_NET_ADMIN)) 02405 return -EPERM; 02406 } 02407 dev_load(ifr.ifr_name); 02408 rtnl_lock(); 02409 /* Follow me in net/core/wireless.c */ 02410 ret = wireless_process_ioctl(&ifr, cmd); 02411 rtnl_unlock(); 02412 if (!ret && IW_IS_GET(cmd) && 02413 copy_to_user(arg, &ifr, sizeof(struct ifreq))) 02414 return -EFAULT; 02415 return ret; 02416 } 02417 #endif /* WIRELESS_EXT */ 02418 return -EINVAL; 02419 } 02420 }

void dev_kfree_skb_any struct sk_buff skb  )  [inline, static]
 

Definition at line 599 of file netdevice.h.

References dev_kfree_skb, and dev_kfree_skb_irq().

00600 { 00601 if (in_irq()) 00602 dev_kfree_skb_irq(skb); 00603 else 00604 dev_kfree_skb(skb); 00605 }

void dev_kfree_skb_irq struct sk_buff skb  )  [inline, static]
 

Definition at line 582 of file netdevice.h.

References softnet_data::completion_queue, sk_buff::next, softnet_data, and sk_buff::users.

Referenced by dev_kfree_skb_any().

00583 { 00584 if (atomic_dec_and_test(&skb->users)) { 00585 int cpu =smp_processor_id(); 00586 unsigned long flags; 00587 00588 local_irq_save(flags); 00589 skb->next = softnet_data[cpu].completion_queue; 00590 softnet_data[cpu].completion_queue = skb; 00591 cpu_raise_softirq(cpu, NET_TX_SOFTIRQ); 00592 local_irq_restore(flags); 00593 } 00594 }

void dev_load const char *  name  )  [inline]
 

Definition at line 702 of file dev.c.

Referenced by dev_ioctl(), and devinet_ioctl().

00702 {;}

int dev_mc_add struct net_device dev,
void *  addr,
int  alen,
int  newonly
 

Definition at line 154 of file dev_mcast.c.

References __dev_mc_upload(), dev_mc_list::dmi_users, net_device::mc_count, net_device::mc_list, dev_mc_list::next, and net_device::xmit_lock.

Referenced by dev_ifsioc(), and ip_mc_filter_add().

00155 { 00156 int err = 0; 00157 struct dev_mc_list *dmi, *dmi1; 00158 00159 dmi1 = (struct dev_mc_list *)kmalloc(sizeof(*dmi), GFP_ATOMIC); 00160 00161 spin_lock_bh(&dev->xmit_lock); 00162 for (dmi = dev->mc_list; dmi != NULL; dmi = dmi->next) { 00163 if (memcmp(dmi->dmi_addr, addr, dmi->dmi_addrlen) == 0 && 00164 dmi->dmi_addrlen == alen) { 00165 if (glbl) { 00166 int old_glbl = dmi->dmi_gusers; 00167 dmi->dmi_gusers = 1; 00168 if (old_glbl) 00169 goto done; 00170 } 00171 dmi->dmi_users++; 00172 goto done; 00173 } 00174 } 00175 00176 if ((dmi = dmi1) == NULL) { 00177 spin_unlock_bh(&dev->xmit_lock); 00178 return -ENOMEM; 00179 } 00180 memcpy(dmi->dmi_addr, addr, alen); 00181 dmi->dmi_addrlen = alen; 00182 dmi->next = dev->mc_list; 00183 dmi->dmi_users = 1; 00184 dmi->dmi_gusers = glbl ? 1 : 0; 00185 dev->mc_list = dmi; 00186 dev->mc_count++; 00187 00188 __dev_mc_upload(dev); 00189 00190 spin_unlock_bh(&dev->xmit_lock); 00191 return 0; 00192 00193 done: 00194 spin_unlock_bh(&dev->xmit_lock); 00195 if (dmi1) 00196 kfree(dmi1); 00197 return err; 00198 }

int dev_mc_delete struct net_device dev,
void *  addr,
int  alen,
int  all
 

Definition at line 103 of file dev_mcast.c.

References __dev_mc_upload(), net_device::mc_count, net_device::mc_list, dev_mc_list::next, and net_device::xmit_lock.

Referenced by dev_ifsioc(), and ip_mc_filter_del().

00104 { 00105 int err = 0; 00106 struct dev_mc_list *dmi, **dmip; 00107 00108 spin_lock_bh(&dev->xmit_lock); 00109 00110 for (dmip = &dev->mc_list; (dmi = *dmip) != NULL; dmip = &dmi->next) { 00111 /* 00112 * Find the entry we want to delete. The device could 00113 * have variable length entries so check these too. 00114 */ 00115 if (memcmp(dmi->dmi_addr, addr, dmi->dmi_addrlen) == 0 && 00116 alen == dmi->dmi_addrlen) { 00117 if (glbl) { 00118 int old_glbl = dmi->dmi_gusers; 00119 dmi->dmi_gusers = 0; 00120 if (old_glbl == 0) 00121 break; 00122 } 00123 if (--dmi->dmi_users) 00124 goto done; 00125 00126 /* 00127 * Last user. So delete the entry. 00128 */ 00129 *dmip = dmi->next; 00130 dev->mc_count--; 00131 00132 kfree(dmi); 00133 00134 /* 00135 * We have altered the list, so the card 00136 * loaded filter is now wrong. Fix it 00137 */ 00138 __dev_mc_upload(dev); 00139 00140 spin_unlock_bh(&dev->xmit_lock); 00141 return 0; 00142 } 00143 } 00144 err = -ENOENT; 00145 done: 00146 spin_unlock_bh(&dev->xmit_lock); 00147 return err; 00148 }

void dev_mc_discard struct net_device dev  ) 
 

Definition at line 204 of file dev_mcast.c.

References net_device::mc_count, net_device::mc_list, dev_mc_list::next, and net_device::xmit_lock.

Referenced by unregister_netdevice().

00205 { 00206 spin_lock_bh(&dev->xmit_lock); 00207 00208 while (dev->mc_list != NULL) { 00209 struct dev_mc_list *tmp = dev->mc_list; 00210 dev->mc_list = tmp->next; 00211 if (tmp->dmi_users > tmp->dmi_gusers) 00212 printk("dev_mc_discard: multicast leakage! dmi_users=%d\n", tmp->dmi_users); 00213 kfree(tmp); 00214 } 00215 dev->mc_count = 0; 00216 00217 spin_unlock_bh(&dev->xmit_lock); 00218 }

void dev_mc_upload struct net_device dev  ) 
 

Definition at line 92 of file dev_mcast.c.

References __dev_mc_upload(), and net_device::xmit_lock.

Referenced by dev_change_flags(), dev_open(), dev_set_allmulti(), and dev_set_promiscuity().

00093 { 00094 spin_lock_bh(&dev->xmit_lock); 00095 __dev_mc_upload(dev); 00096 spin_unlock_bh(&dev->xmit_lock); 00097 }

void dev_mcast_init void   ) 
 

Definition at line 269 of file dev_mcast.c.

Referenced by net_dev_init().

00270 { 00271 #ifdef CONFIG_PROC_FS 00272 create_proc_read_entry("net/dev_mcast", 0, 0, dev_mc_read_proc, NULL); 00273 #endif 00274 }

int dev_new_index void   ) 
 

Definition at line 2431 of file dev.c.

References __dev_get_by_index().

Referenced by net_dev_init(), and register_netdevice().

02432 { 02433 static int ifindex; 02434 for (;;) { 02435 if (++ifindex <= 0) 02436 ifindex=1; 02437 if (__dev_get_by_index(ifindex) == NULL) 02438 return ifindex; 02439 } 02440 }

int dev_open struct net_device dev  ) 
 

Definition at line 726 of file dev.c.

References __LINK_STATE_START, dev_activate(), dev_mc_upload(), net_device::flags, netdev_chain, netif_device_present(), net_device::open, net_device::owner, and net_device::state.

Referenced by dev_change_flags(), and ipmr_new_tunnel().

00727 { 00728 int ret = 0; 00729 00730 /* 00731 * Is it already up? 00732 */ 00733 00734 if (dev->flags&IFF_UP) 00735 return 0; 00736 00737 /* 00738 * Is it even present? 00739 */ 00740 if (!netif_device_present(dev)) 00741 return -ENODEV; 00742 00743 /* 00744 * Call device private open method 00745 */ 00746 if (try_inc_mod_count(dev->owner)) { 00747 set_bit(__LINK_STATE_START, &dev->state); 00748 if (dev->open) { 00749 ret = dev->open(dev); 00750 if (ret != 0) { 00751 clear_bit(__LINK_STATE_START, &dev->state); 00752 if (dev->owner) 00753 __MOD_DEC_USE_COUNT(dev->owner); 00754 } 00755 } 00756 } else { 00757 ret = -ENODEV; 00758 } 00759 00760 /* 00761 * If it went open OK then: 00762 */ 00763 00764 if (ret == 0) 00765 { 00766 /* 00767 * Set the flags. 00768 */ 00769 dev->flags |= IFF_UP; 00770 00771 /* 00772 * Initialize multicasting status 00773 */ 00774 dev_mc_upload(dev); 00775 00776 /* 00777 * Wakeup transmit queue engine 00778 */ 00779 dev_activate(dev); 00780 00781 /* 00782 * ... and announce new interface. 00783 */ 00784 notifier_call_chain(&netdev_chain, NETDEV_UP, dev); 00785 } 00786 return(ret); 00787 }

void dev_put struct net_device dev  )  [inline, static]
 

Definition at line 638 of file netdevice.h.

References netdev_finish_unregister(), and net_device::refcnt.

Referenced by check_args(), dst_destroy(), dst_dev_event(), free_divert_blk(), free_fib_info(), in_dev_finish_destroy(), inject(), ip_expire(), ip_route_output_slow(), ip_setsockopt(), ipgre_tunnel_uninit(), ipip_tunnel_uninit(), neigh_add(), neigh_delete(), neigh_destroy(), neigh_proxy_process(), net_dev_init(), net_rx_action(), netdev_set_master(), nf_queue(), nf_reinject(), pneigh_queue_purge(), process_backlog(), sock_setsockopt(), unregister_netdevice(), and vif_delete().

00639 { 00640 if (atomic_dec_and_test(&dev->refcnt)) 00641 netdev_finish_unregister(dev); 00642 }

int dev_queue_xmit struct sk_buff skb  ) 
 

Definition at line 1035 of file dev.c.

References CHECKSUM_HW, sk_buff::dev, dev_queue_xmit_nit(), illegal_highdma, sk_buff::ip_summed, kfree_skb(), net_ratelimit(), NET_XMIT_BYPASS, NET_XMIT_SUCCESS, netdev_nit, NETIF_F_FRAGLIST, NETIF_F_HW_CSUM, NETIF_F_IP_CSUM, NETIF_F_NO_CSUM, NETIF_F_SG, netif_queue_stopped(), sk_buff::protocol, qdisc_run(), skb_checksum_help(), skb_linearize(), and skb_shinfo.

Referenced by arp_send(), dn_rt_send(), neigh_compat_output(), net_dev_init(), netif_receive_skb(), and rt_cache_get_info().

01036 { 01037 struct net_device *dev = skb->dev; 01038 struct Qdisc *q; 01039 01040 if (skb_shinfo(skb)->frag_list && 01041 !(dev->features&NETIF_F_FRAGLIST) && 01042 skb_linearize(skb, GFP_ATOMIC) != 0) { 01043 kfree_skb(skb); 01044 return -ENOMEM; 01045 } 01046 01047 /* Fragmented skb is linearized if device does not support SG, 01048 * or if at least one of fragments is in highmem and device 01049 * does not support DMA from it. 01050 */ 01051 if (skb_shinfo(skb)->nr_frags && 01052 (!(dev->features&NETIF_F_SG) || illegal_highdma(dev, skb)) && 01053 skb_linearize(skb, GFP_ATOMIC) != 0) { 01054 kfree_skb(skb); 01055 return -ENOMEM; 01056 } 01057 01058 /* If packet is not checksummed and device does not support 01059 * checksumming for this protocol, complete checksumming here. 01060 */ 01061 if (skb->ip_summed == CHECKSUM_HW && 01062 (!(dev->features&(NETIF_F_HW_CSUM|NETIF_F_NO_CSUM)) && 01063 (!(dev->features&NETIF_F_IP_CSUM) || 01064 skb->protocol != htons(ETH_P_IP)))) { 01065 if ((skb = skb_checksum_help(skb)) == NULL) 01066 return -ENOMEM; 01067 } 01068 01069 /* Grab device queue */ 01070 spin_lock_bh(&dev->queue_lock); 01071 q = dev->qdisc; 01072 if (q->enqueue) { 01073 int ret = q->enqueue(skb, q); 01074 01075 qdisc_run(dev); 01076 01077 spin_unlock_bh(&dev->queue_lock); 01078 return ret == NET_XMIT_BYPASS ? NET_XMIT_SUCCESS : ret; 01079 } 01080 01081 /* The device has no queue. Common case for software devices: 01082 loopback, all the sorts of tunnels... 01083 01084 Really, it is unlikely that xmit_lock protection is necessary here. 01085 (f.e. loopback and IP tunnels are clean ignoring statistics counters.) 01086 However, it is possible, that they rely on protection 01087 made by us here. 01088 01089 Check this and shot the lock. It is not prone from deadlocks. 01090 Either shot noqueue qdisc, it is even simpler 8) 01091 */ 01092 if (dev->flags&IFF_UP) { 01093 int cpu = smp_processor_id(); 01094 01095 if (dev->xmit_lock_owner != cpu) { 01096 spin_unlock(&dev->queue_lock); 01097 spin_lock(&dev->xmit_lock); 01098 dev->xmit_lock_owner = cpu; 01099 01100 if (!netif_queue_stopped(dev)) { 01101 if (netdev_nit) 01102 dev_queue_xmit_nit(skb,dev); 01103 01104 if (dev->hard_start_xmit(skb, dev) == 0) { 01105 dev->xmit_lock_owner = -1; 01106 spin_unlock_bh(&dev->xmit_lock); 01107 return 0; 01108 } 01109 } 01110 dev->xmit_lock_owner = -1; 01111 spin_unlock_bh(&dev->xmit_lock); 01112 if (net_ratelimit()) 01113 printk(KERN_CRIT "Virtual device %s asks to queue packet!\n", dev->name); 01114 kfree_skb(skb); 01115 return -ENETDOWN; 01116 } else { 01117 /* Recursion is detected! It is possible, unfortunately */ 01118 if (net_ratelimit()) 01119 printk(KERN_CRIT "Dead loop on virtual device %s, fix it urgently!\n", dev->name); 01120 } 01121 } 01122 spin_unlock_bh(&dev->queue_lock); 01123 01124 kfree_skb(skb); 01125 return -ENETDOWN; 01126 }

void dev_queue_xmit_nit struct sk_buff skb,
struct net_device dev
 

Definition at line 935 of file dev.c.

References sk_buff::dev, net_device::name, net_ratelimit(), packet_type::next, ptype_all, sk_buff::sk, skb_clone(), and sk_buff::stamp.

Referenced by dev_queue_xmit().

00936 { 00937 struct packet_type *ptype; 00938 do_gettimeofday(&skb->stamp); 00939 00940 br_read_lock(BR_NETPROTO_LOCK); 00941 for (ptype = ptype_all; ptype!=NULL; ptype = ptype->next) 00942 { 00943 /* Never send packets back to the socket 00944 * they originated from - MvS (miquels@drinkel.ow.org) 00945 */ 00946 if ((ptype->dev == dev || !ptype->dev) && 00947 ((struct sock *)ptype->data != skb->sk)) 00948 { 00949 struct sk_buff *skb2; 00950 if ((skb2 = skb_clone(skb, GFP_ATOMIC)) == NULL) 00951 break; 00952 00953 /* skb->nh should be correctly 00954 set by sender, so that the second statement is 00955 just protection against buggy protocols. 00956 */ 00957 skb2->mac.raw = skb2->data; 00958 00959 if (skb2->nh.raw < skb2->data || skb2->nh.raw > skb2->tail) { 00960 if (net_ratelimit()) 00961 printk(KERN_CRIT "protocol %04x is buggy, dev %s\n", skb2->protocol, dev->name); 00962 skb2->nh.raw = skb2->data; 00963 } 00964 00965 skb2->h.raw = skb2->nh.raw; 00966 skb2->pkt_type = PACKET_OUTGOING; 00967 ptype->func(skb2, skb->dev, ptype); 00968 } 00969 } 00970 br_read_unlock(BR_NETPROTO_LOCK); 00971 }

void dev_remove_pack struct packet_type pt  ) 
 

Definition at line 270 of file dev.c.

References packet_type::data, netdev_nit, packet_type::next, ptype_all, ptype_base, and packet_type::type.

00271 { 00272 struct packet_type **pt1; 00273 00274 br_write_lock_bh(BR_NETPROTO_LOCK); 00275 00276 if (pt->type == htons(ETH_P_ALL)) { 00277 netdev_nit--; 00278 pt1=&ptype_all; 00279 } else { 00280 pt1=&ptype_base[ntohs(pt->type)&15]; 00281 } 00282 00283 for (; (*pt1) != NULL; pt1 = &((*pt1)->next)) { 00284 if (pt == (*pt1)) { 00285 *pt1 = pt->next; 00286 #ifdef CONFIG_NET_FASTROUTE 00287 if (pt->data) 00288 netdev_fastroute_obstacles--; 00289 #endif 00290 br_write_unlock_bh(BR_NETPROTO_LOCK); 00291 return; 00292 } 00293 } 00294 br_write_unlock_bh(BR_NETPROTO_LOCK); 00295 printk(KERN_WARNING "dev_remove_pack: %p not found.\n", pt); 00296 }

int dev_restart struct net_device dev  ) 
 

void dev_set_allmulti struct net_device dev,
int  inc
 

Definition at line 1976 of file dev.c.

References net_device::allmulti, dev_mc_upload(), and net_device::flags.

Referenced by dev_change_flags(), vif_add(), and vif_delete().

01977 { 01978 unsigned short old_flags = dev->flags; 01979 01980 dev->flags |= IFF_ALLMULTI; 01981 if ((dev->allmulti += inc) == 0) 01982 dev->flags &= ~IFF_ALLMULTI; 01983 if (dev->flags^old_flags) 01984 dev_mc_upload(dev); 01985 }

void dev_set_promiscuity struct net_device dev,
int  inc
 

Definition at line 1943 of file dev.c.

References dev_mc_upload(), net_device::flags, net_device::name, and net_device::promiscuity.

Referenced by dev_change_flags().

01944 { 01945 unsigned short old_flags = dev->flags; 01946 01947 dev->flags |= IFF_PROMISC; 01948 if ((dev->promiscuity += inc) == 0) 01949 dev->flags &= ~IFF_PROMISC; 01950 if (dev->flags^old_flags) { 01951 #ifdef CONFIG_NET_FASTROUTE 01952 if (dev->flags&IFF_PROMISC) { 01953 netdev_fastroute_obstacles++; 01954 dev_clear_fastroute(dev); 01955 } else 01956 netdev_fastroute_obstacles--; 01957 #endif 01958 dev_mc_upload(dev); 01959 printk(KERN_INFO "device %s %s promiscuous mode\n", 01960 dev->name, (dev->flags&IFF_PROMISC) ? "entered" : "left"); 01961 } 01962 }

void ether_setup struct net_device dev  ) 
 

void fc_freedev struct net_device dev  ) 
 

void fc_setup struct net_device dev  ) 
 

void fddi_setup struct net_device dev  ) 
 

void free_netdev struct net_device dev  )  [inline, static]
 

Definition at line 875 of file netdevice.h.

00876 { 00877 kfree(dev); 00878 }

int netdev_boot_setup_add char *  name,
struct ifmap *  map
 

Definition at line 316 of file dev.c.

References dev_boot_setup, and NETDEV_BOOT_SETUP_MAX.

Referenced by netdev_boot_setup().

00317 { 00318 struct netdev_boot_setup *s; 00319 int i; 00320 00321 s = dev_boot_setup; 00322 for (i = 0; i < NETDEV_BOOT_SETUP_MAX; i++) { 00323 if (s[i].name[0] == '\0' || s[i].name[0] == ' ') { 00324 memset(s[i].name, 0, sizeof(s[i].name)); 00325 strcpy(s[i].name, name); 00326 memcpy(&s[i].map, map, sizeof(s[i].map)); 00327 break; 00328 } 00329 } 00330 00331 if (i >= NETDEV_BOOT_SETUP_MAX) 00332 return 0; 00333 00334 return 1; 00335 }

int netdev_boot_setup_check struct net_device dev  ) 
 

Definition at line 346 of file dev.c.

References net_device::base_addr, dev_boot_setup, net_device::irq, net_device::mem_end, net_device::mem_start, net_device::name, and NETDEV_BOOT_SETUP_MAX.

Referenced by net_dev_init().

00347 { 00348 struct netdev_boot_setup *s; 00349 int i; 00350 00351 s = dev_boot_setup; 00352 for (i = 0; i < NETDEV_BOOT_SETUP_MAX; i++) { 00353 if (s[i].name[0] != '\0' && s[i].name[0] != ' ' && 00354 !strncmp(dev->name, s[i].name, strlen(s[i].name))) { 00355 dev->irq = s[i].map.irq; 00356 dev->base_addr = s[i].map.base_addr; 00357 dev->mem_start = s[i].map.mem_start; 00358 dev->mem_end = s[i].map.mem_end; 00359 return 1; 00360 } 00361 } 00362 return 0; 00363 }

int netdev_finish_unregister struct net_device dev  ) 
 

Definition at line 2560 of file dev.c.

References net_device::deadbeaf, net_device::destructor, net_device::dn_ptr, net_device::features, net_device::ip6_ptr, net_device::ip_ptr, net_device::name, and NETIF_F_DYNALLOC.

Referenced by dev_put().

02561 { 02562 BUG_TRAP(dev->ip_ptr==NULL); 02563 BUG_TRAP(dev->ip6_ptr==NULL); 02564 BUG_TRAP(dev->dn_ptr==NULL); 02565 02566 if (!dev->deadbeaf) { 02567 printk(KERN_ERR "Freeing alive device %p, %s\n", dev, dev->name); 02568 return 0; 02569 } 02570 #ifdef NET_REFCNT_DEBUG 02571 printk(KERN_DEBUG "netdev_finish_unregister: %s%s.\n", dev->name, 02572 (dev->features & NETIF_F_DYNALLOC)?"":", old style"); 02573 #endif 02574 if (dev->destructor) 02575 dev->destructor(dev); 02576 if (dev->features & NETIF_F_DYNALLOC) 02577 kfree(dev); 02578 return 0; 02579 }

int netdev_register_fc struct net_device dev,
void(*  stimul)(struct net_device *dev)
 

int netdev_set_master struct net_device dev,
struct net_device master
 

Definition at line 1904 of file dev.c.

References dev_hold, dev_put(), net_device::flags, net_device::master, and rtmsg_ifinfo().

01905 { 01906 struct net_device *old = slave->master; 01907 01908 ASSERT_RTNL(); 01909 01910 if (master) { 01911 if (old) 01912 return -EBUSY; 01913 dev_hold(master); 01914 } 01915 01916 br_write_lock_bh(BR_NETPROTO_LOCK); 01917 slave->master = master; 01918 br_write_unlock_bh(BR_NETPROTO_LOCK); 01919 01920 if (old) 01921 dev_put(old); 01922 01923 if (master) 01924 slave->flags |= IFF_SLAVE; 01925 else 01926 slave->flags &= ~IFF_SLAVE; 01927 01928 rtmsg_ifinfo(RTM_NEWLINK, slave, IFF_SLAVE); 01929 return 0; 01930 }

void netdev_state_change struct net_device dev  ) 
 

Definition at line 674 of file dev.c.

References net_device::flags, netdev_chain, and rtmsg_ifinfo().

Referenced by ipgre_tunnel_ioctl(), and ipip_tunnel_ioctl().

00675 { 00676 if (dev->flags&IFF_UP) { 00677 notifier_call_chain(&netdev_chain, NETDEV_CHANGE, dev); 00678 rtmsg_ifinfo(RTM_NEWLINK, dev, 0); 00679 } 00680 }

void netdev_unregister_fc int  bit  ) 
 

void netif_carrier_off struct net_device dev  )  [inline, static]
 

Definition at line 666 of file netdevice.h.

References __LINK_STATE_NOCARRIER, and net_device::state.

00667 { 00668 set_bit(__LINK_STATE_NOCARRIER, &dev->state); 00669 }

int netif_carrier_ok struct net_device dev  )  [inline, static]
 

Definition at line 652 of file netdevice.h.

References __LINK_STATE_NOCARRIER, and net_device::state.

Referenced by dev_ifsioc(), ethtool_op_get_link(), and rtnetlink_fill_ifinfo().

00653 { 00654 return !test_bit(__LINK_STATE_NOCARRIER, &dev->state); 00655 }

void netif_carrier_on struct net_device dev  )  [inline, static]
 

Definition at line 659 of file netdevice.h.

References __LINK_STATE_NOCARRIER, __netdev_watchdog_up(), netif_running(), and net_device::state.

00660 { 00661 clear_bit(__LINK_STATE_NOCARRIER, &dev->state); 00662 if (netif_running(dev)) 00663 __netdev_watchdog_up(dev); 00664 }

void netif_device_attach struct net_device dev  )  [inline, static]
 

Definition at line 685 of file netdevice.h.

References __LINK_STATE_PRESENT, __netdev_watchdog_up(), netif_running(), netif_wake_queue(), and net_device::state.

00686 { 00687 if (!test_and_set_bit(__LINK_STATE_PRESENT, &dev->state) && 00688 netif_running(dev)) { 00689 netif_wake_queue(dev); 00690 __netdev_watchdog_up(dev); 00691 } 00692 }

void netif_device_detach struct net_device dev  )  [inline, static]
 

Definition at line 677 of file netdevice.h.

References __LINK_STATE_PRESENT, netif_running(), netif_stop_queue(), and net_device::state.

00678 { 00679 if (test_and_clear_bit(__LINK_STATE_PRESENT, &dev->state) && 00680 netif_running(dev)) { 00681 netif_stop_queue(dev); 00682 } 00683 }

int netif_device_present struct net_device dev  )  [inline, static]
 

Definition at line 672 of file netdevice.h.

References __LINK_STATE_PRESENT, and net_device::state.

Referenced by __dev_mc_upload(), dev_ethtool(), dev_ifsioc(), dev_open(), and wireless_process_ioctl().

00673 { 00674 return test_bit(__LINK_STATE_PRESENT, &dev->state); 00675 }

void netif_poll_disable struct net_device dev  )  [inline, static]
 

Definition at line 806 of file netdevice.h.

References __LINK_STATE_RX_SCHED, and net_device::state.

00807 { 00808 while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) { 00809 /* No hurry. */ 00810 current->state = TASK_INTERRUPTIBLE; 00811 schedule_timeout(1); 00812 } 00813 }

void netif_poll_enable struct net_device dev  )  [inline, static]
 

Definition at line 815 of file netdevice.h.

References __LINK_STATE_RX_SCHED, and net_device::state.

Referenced by process_backlog().

00816 { 00817 clear_bit(__LINK_STATE_RX_SCHED, &dev->state); 00818 }

int netif_queue_stopped struct net_device dev  )  [inline, static]
 

Definition at line 568 of file netdevice.h.

References __LINK_STATE_XOFF, and net_device::state.

Referenced by dev_queue_xmit(), inject(), and qdisc_run().

00569 { 00570 return test_bit(__LINK_STATE_XOFF, &dev->state); 00571 }

int netif_receive_skb struct sk_buff skb  ) 
 

Definition at line 1461 of file dev.c.

References net_device::br_port, sk_buff::data, deliver_to_old_ones(), sk_buff::dev, dev_queue_xmit(), netif_rx_stats::fastroute_deferred_out, sk_buff::h, handle_bridge(), kfree_skb(), NET_RX_DROP, netdev_rx_stat, packet_type::next, sk_buff::nh, sk_buff::pkt_type, sk_buff::protocol, ptype_all, ptype_base, skb_bond(), sk_buff::stamp, netif_rx_stats::total, and sk_buff::users.

Referenced by process_backlog().

01462 { 01463 struct packet_type *ptype, *pt_prev; 01464 int ret = NET_RX_DROP; 01465 unsigned short type = skb->protocol; 01466 01467 if (skb->stamp.tv_sec == 0) 01468 do_gettimeofday(&skb->stamp); 01469 01470 skb_bond(skb); 01471 01472 netdev_rx_stat[smp_processor_id()].total++; 01473 01474 #ifdef CONFIG_NET_FASTROUTE 01475 if (skb->pkt_type == PACKET_FASTROUTE) { 01476 netdev_rx_stat[smp_processor_id()].fastroute_deferred_out++; 01477 return dev_queue_xmit(skb); 01478 } 01479 #endif 01480 01481 skb->h.raw = skb->nh.raw = skb->data; 01482 01483 pt_prev = NULL; 01484 for (ptype = ptype_all; ptype; ptype = ptype->next) { 01485 if (!ptype->dev || ptype->dev == skb->dev) { 01486 if (pt_prev) { 01487 if (!pt_prev->data) { 01488 ret = deliver_to_old_ones(pt_prev, skb, 0); 01489 } else { 01490 atomic_inc(&skb->users); 01491 ret = pt_prev->func(skb, skb->dev, pt_prev); 01492 } 01493 } 01494 pt_prev = ptype; 01495 } 01496 } 01497 01498 #ifdef CONFIG_NET_DIVERT 01499 if (skb->dev->divert && skb->dev->divert->divert) 01500 ret = handle_diverter(skb); 01501 #endif /* CONFIG_NET_DIVERT */ 01502 01503 #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) 01504 if (skb->dev->br_port != NULL && 01505 br_handle_frame_hook != NULL) { 01506 return handle_bridge(skb, pt_prev); 01507 } 01508 #endif 01509 01510 for (ptype=ptype_base[ntohs(type)&15];ptype;ptype=ptype->next) { 01511 if (ptype->type == type && 01512 (!ptype->dev || ptype->dev == skb->dev)) { 01513 if (pt_prev) { 01514 if (!pt_prev->data) { 01515 ret = deliver_to_old_ones(pt_prev, skb, 0); 01516 } else { 01517 atomic_inc(&skb->users); 01518 ret = pt_prev->func(skb, skb->dev, pt_prev); 01519 } 01520 } 01521 pt_prev = ptype; 01522 } 01523 } 01524 01525 if (pt_prev) { 01526 if (!pt_prev->data) { 01527 ret = deliver_to_old_ones(pt_prev, skb, 1); 01528 } else { 01529 ret = pt_prev->func(skb, skb->dev, pt_prev); 01530 } 01531 } else { 01532 kfree_skb(skb); 01533 /* Jamal, now you will not able to escape explaining 01534 * me how you were going to use this. :-) 01535 */ 01536 ret = NET_RX_DROP; 01537 } 01538 01539 return ret; 01540 }

int netif_running struct net_device dev  )  [inline, static]
 

Definition at line 573 of file netdevice.h.

References __LINK_STATE_START, and net_device::state.

Referenced by call_commit_handler(), dev_ifsioc(), inject(), neigh_proxy_process(), netif_carrier_on(), netif_device_attach(), netif_device_detach(), netif_rx_schedule_prep(), rtnetlink_fill_ifinfo(), and setup_inject().

00574 { 00575 return test_bit(__LINK_STATE_START, &dev->state); 00576 }

int netif_rx struct sk_buff skb  ) 
 

Definition at line 1275 of file dev.c.

References __skb_queue_tail(), sk_buff::dev, dev_hold, netif_rx_stats::dropped, get_sample_stats(), kfree_skb(), NET_RX_DROP, netdev_dropping, netdev_max_backlog, netdev_rx_stat, netif_rx_schedule(), softnet_data, sk_buff::stamp, netif_rx_stats::throttled, and netif_rx_stats::total.

Referenced by ip_dev_loopback_xmit(), ipgre_rcv(), ipip_rcv(), and netif_rx_ni().

01276 { 01277 int this_cpu = smp_processor_id(); 01278 struct softnet_data *queue; 01279 unsigned long flags; 01280 01281 if (skb->stamp.tv_sec == 0) 01282 do_gettimeofday(&skb->stamp); 01283 01284 /* The code is rearranged so that the path is the most 01285 short when CPU is congested, but is still operating. 01286 */ 01287 queue = &softnet_data[this_cpu]; 01288 01289 local_irq_save(flags); 01290 01291 netdev_rx_stat[this_cpu].total++; 01292 if (queue->input_pkt_queue.qlen <= netdev_max_backlog) { 01293 if (queue->input_pkt_queue.qlen) { 01294 if (queue->throttle) 01295 goto drop; 01296 01297 enqueue: 01298 dev_hold(skb->dev); 01299 __skb_queue_tail(&queue->input_pkt_queue,skb); 01300 local_irq_restore(flags); 01301 #ifndef OFFLINE_SAMPLE 01302 get_sample_stats(this_cpu); 01303 #endif 01304 return queue->cng_level; 01305 } 01306 01307 if (queue->throttle) { 01308 queue->throttle = 0; 01309 #ifdef CONFIG_NET_HW_FLOWCONTROL 01310 if (atomic_dec_and_test(&netdev_dropping)) 01311 netdev_wakeup(); 01312 #endif 01313 } 01314 01315 netif_rx_schedule(&queue->blog_dev); 01316 goto enqueue; 01317 } 01318 01319 if (queue->throttle == 0) { 01320 queue->throttle = 1; 01321 netdev_rx_stat[this_cpu].throttled++; 01322 #ifdef CONFIG_NET_HW_FLOWCONTROL 01323 atomic_inc(&netdev_dropping); 01324 #endif 01325 } 01326 01327 drop: 01328 netdev_rx_stat[this_cpu].dropped++; 01329 local_irq_restore(flags); 01330 01331 kfree_skb(skb); 01332 return NET_RX_DROP; 01333 }

void netif_rx_complete struct net_device dev  )  [inline, static]
 

Definition at line 794 of file netdevice.h.

References __LINK_STATE_RX_SCHED, net_device::poll_list, and net_device::state.

00795 { 00796 unsigned long flags; 00797 00798 local_irq_save(flags); 00799 if (!test_bit(__LINK_STATE_RX_SCHED, &dev->state)) BUG(); 00800 list_del(&dev->poll_list); 00801 smp_mb__before_clear_bit(); 00802 clear_bit(__LINK_STATE_RX_SCHED, &dev->state); 00803 local_irq_restore(flags); 00804 }

int netif_rx_ni struct sk_buff skb  )  [inline, static]
 

Definition at line 623 of file netdevice.h.

References netif_rx().

00624 { 00625 int err = netif_rx(skb); 00626 if (softirq_pending(smp_processor_id())) 00627 do_softirq(); 00628 return err; 00629 }

int netif_rx_reschedule struct net_device dev,
int  undo
[inline, static]
 

Definition at line 772 of file netdevice.h.

References netif_rx_schedule_prep(), softnet_data::poll_list, net_device::poll_list, net_device::quota, and softnet_data.

00773 { 00774 if (netif_rx_schedule_prep(dev)) { 00775 unsigned long flags; 00776 int cpu = smp_processor_id(); 00777 00778 dev->quota += undo; 00779 00780 local_irq_save(flags); 00781 list_add_tail(&dev->poll_list, &softnet_data[cpu].poll_list); 00782 __cpu_raise_softirq(cpu, NET_RX_SOFTIRQ); 00783 local_irq_restore(flags); 00784 return 1; 00785 } 00786 return 0; 00787 }

void netif_rx_schedule struct net_device dev  )  [inline, static]
 

Definition at line 763 of file netdevice.h.

References __netif_rx_schedule(), and netif_rx_schedule_prep().

Referenced by netif_rx().

00764 { 00765 if (netif_rx_schedule_prep(dev)) 00766 __netif_rx_schedule(dev); 00767 }

int netif_rx_schedule_prep struct net_device dev  )  [inline, static]
 

Definition at line 735 of file netdevice.h.

References __LINK_STATE_RX_SCHED, netif_running(), and net_device::state.

Referenced by netif_rx_reschedule(), and netif_rx_schedule().

00736 { 00737 return netif_running(dev) && 00738 !test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state); 00739 }

void netif_schedule struct net_device dev  )  [inline, static]
 

Definition at line 546 of file netdevice.h.

References __LINK_STATE_XOFF, __netif_schedule(), and net_device::state.

Referenced by net_tx_action().

00547 { 00548 if (!test_bit(__LINK_STATE_XOFF, &dev->state)) 00549 __netif_schedule(dev); 00550 }

void netif_start_queue struct net_device dev  )  [inline, static]
 

Definition at line 552 of file netdevice.h.

References __LINK_STATE_XOFF, and net_device::state.

00553 { 00554 clear_bit(__LINK_STATE_XOFF, &dev->state); 00555 }

void netif_stop_queue struct net_device dev  )  [inline, static]
 

Definition at line 563 of file netdevice.h.

References __LINK_STATE_XOFF, and net_device::state.

Referenced by netif_device_detach(), and netif_tx_disable().

00564 { 00565 set_bit(__LINK_STATE_XOFF, &dev->state); 00566 }

void netif_tx_disable struct net_device dev  )  [inline, static]
 

Definition at line 831 of file netdevice.h.

References netif_stop_queue(), and net_device::xmit_lock.

00832 { 00833 spin_lock_bh(&dev->xmit_lock); 00834 netif_stop_queue(dev); 00835 spin_unlock_bh(&dev->xmit_lock); 00836 }

void netif_wake_queue struct net_device dev  )  [inline, static]
 

Definition at line 557 of file netdevice.h.

References __LINK_STATE_XOFF, __netif_schedule(), and net_device::state.

Referenced by netif_device_attach().

00558 { 00559 if (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state)) 00560 __netif_schedule(dev); 00561 }

int register_gifconf unsigned int  family,
gifconf_func_t gifconf
 

Definition at line 1663 of file dev.c.

References gifconf_func_t, gifconf_list, and NPROTO.

Referenced by devinet_init(), and unregister_gifconf().

01664 { 01665 if (family>=NPROTO) 01666 return -EINVAL; 01667 gifconf_list[family] = gifconf; 01668 return 0; 01669 }

int register_netdev struct net_device dev  ) 
 

Referenced by ipgre_init(), and ipip_init().

int register_netdevice struct net_device dev  ) 
 

Definition at line 2464 of file dev.c.

References __LINK_STATE_PRESENT, alloc_divert_blk(), default_rebuild_header(), dev_base, dev_base_lock, dev_boot_phase, dev_hold, dev_init_scheduler(), dev_new_index(), net_device::features, free_divert_blk(), net_device::ifindex, net_device::iflink, net_device::init, net_device::name, net_dev_init(), net_run_sbin_hotplug, netdev_chain, NETIF_F_HW_CSUM, NETIF_F_IP_CSUM, NETIF_F_NO_CSUM, NETIF_F_SG, net_device::next, net_device::queue_lock, net_device::rebuild_header, net_device::state, net_device::xmit_lock, and net_device::xmit_lock_owner.

Referenced by ipgre_tunnel_locate(), and ipip_tunnel_locate().

02465 { 02466 struct net_device *d, **dp; 02467 #ifdef CONFIG_NET_DIVERT 02468 int ret; 02469 #endif 02470 02471 spin_lock_init(&dev->queue_lock); 02472 spin_lock_init(&dev->xmit_lock); 02473 dev->xmit_lock_owner = -1; 02474 #ifdef CONFIG_NET_FASTROUTE 02475 dev->fastpath_lock=RW_LOCK_UNLOCKED; 02476 #endif 02477 02478 if (dev_boot_phase) 02479 net_dev_init(); 02480 02481 #ifdef CONFIG_NET_DIVERT 02482 ret = alloc_divert_blk(dev); 02483 if (ret) 02484 return ret; 02485 #endif /* CONFIG_NET_DIVERT */ 02486 02487 dev->iflink = -1; 02488 02489 /* Init, if this function is available */ 02490 if (dev->init && dev->init(dev) != 0) { 02491 #ifdef CONFIG_NET_DIVERT 02492 free_divert_blk(dev); 02493 #endif 02494 return -EIO; 02495 } 02496 02497 dev->ifindex = dev_new_index(); 02498 if (dev->iflink == -1) 02499 dev->iflink = dev->ifindex; 02500 02501 /* Check for existence, and append to tail of chain */ 02502 for (dp=&dev_base; (d=*dp) != NULL; dp=&d->next) { 02503 if (d == dev || strcmp(d->name, dev->name) == 0) { 02504 #ifdef CONFIG_NET_DIVERT 02505 free_divert_blk(dev); 02506 #endif 02507 return -EEXIST; 02508 } 02509 } 02510 02511 /* Fix illegal SG+CSUM combinations. */ 02512 if ((dev->features & NETIF_F_SG) && 02513 !(dev->features & (NETIF_F_IP_CSUM | 02514 NETIF_F_NO_CSUM | 02515 NETIF_F_HW_CSUM))) { 02516 printk("%s: Dropping NETIF_F_SG since no checksum feature.\n", 02517 dev->name); 02518 dev->features &= ~NETIF_F_SG; 02519 } 02520 02521 /* 02522 * nil rebuild_header routine, 02523 * that should be never called and used as just bug trap. 02524 */ 02525 02526 if (dev->rebuild_header == NULL) 02527 dev->rebuild_header = default_rebuild_header; 02528 02529 /* 02530 * Default initial state at registry is that the 02531 * device is present. 02532 */ 02533 02534 set_bit(__LINK_STATE_PRESENT, &dev->state); 02535 02536 dev->next = NULL; 02537 dev_init_scheduler(dev); 02538 write_lock_bh(&dev_base_lock); 02539 *dp = dev; 02540 dev_hold(dev); 02541 dev->deadbeaf = 0; 02542 write_unlock_bh(&dev_base_lock); 02543 02544 /* Notify protocols, that a new device appeared. */ 02545 notifier_call_chain(&netdev_chain, NETDEV_REGISTER, dev); 02546 02547 net_run_sbin_hotplug(dev, "register"); 02548 02549 return 0; 02550 }

int register_netdevice_notifier struct notifier_block *  nb  ) 
 

Definition at line 910 of file dev.c.

References netdev_chain.

Referenced by arp_init(), devinet_init(), dst_init(), fib_rules_init(), init(), init_or_cleanup(), ip_fib_init(), ip_mr_init(), ipfw_init_or_cleanup(), and rtnetlink_init().

00911 { 00912 return notifier_chain_register(&netdev_chain, nb); 00913 }

struct sk_buff* skb_checksum_help struct sk_buff skb  ) 
 

Definition at line 977 of file dev.c.

References CHECKSUM_NONE, sk_buff::csum, csum_fold(), sk_buff::data, sk_buff::h, sk_buff::ip_summed, sk_buff::len, skb_checksum(), and sk_buff::tail.

Referenced by dev_queue_xmit(), ip_queue_xmit2(), and nf_hook_slow().

00978 { 00979 int offset; 00980 unsigned int csum; 00981 00982 offset = skb->h.raw - skb->data; 00983 if (offset > (int)skb->len) 00984 BUG(); 00985 csum = skb_checksum(skb, offset, skb->len-offset, 0); 00986 00987 offset = skb->tail - skb->h.raw; 00988 if (offset <= 0) 00989 BUG(); 00990 if (skb->csum+2 > offset) 00991 BUG(); 00992 00993 *(u16*)(skb->h.raw + skb->csum) = csum_fold(csum); 00994 skb->ip_summed = CHECKSUM_NONE; 00995 return skb; 00996 }

void tr_setup struct net_device dev  ) 
 

int unregister_gifconf unsigned int  family  )  [inline, static]
 

Definition at line 504 of file netdevice.h.

References register_gifconf().

00505 { 00506 return register_gifconf(family, 0); 00507 }

void unregister_netdev struct net_device dev  ) 
 

Referenced by ipip_fini().

int unregister_netdevice struct net_device dev  ) 
 

Definition at line 2594 of file dev.c.

References net_device::deadbeaf, dev_base, dev_base_lock, dev_boot_phase, dev_close(), dev_mc_discard(), dev_put(), dev_shutdown(), net_device::features, net_device::flags, free_divert_blk(), net_device::master, net_device::name, net_run_sbin_hotplug, netdev_chain, NETIF_F_DYNALLOC, net_device::next, net_device::refcnt, and net_device::uninit.

Referenced by ipgre_tunnel_ioctl(), ipip_tunnel_ioctl(), ipmr_new_tunnel(), and vif_delete().

02595 { 02596 unsigned long now, warning_time; 02597 struct net_device *d, **dp; 02598 02599 /* If device is running, close it first. */ 02600 if (dev->flags & IFF_UP) 02601 dev_close(dev); 02602 02603 BUG_TRAP(dev->deadbeaf==0); 02604 dev->deadbeaf = 1; 02605 02606 /* And unlink it from device chain. */ 02607 for (dp = &dev_base; (d=*dp) != NULL; dp=&d->next) { 02608 if (d == dev) { 02609 write_lock_bh(&dev_base_lock); 02610 *dp = d->next; 02611 write_unlock_bh(&dev_base_lock); 02612 break; 02613 } 02614 } 02615 if (d == NULL) { 02616 printk(KERN_DEBUG "unregister_netdevice: device %s/%p never was registered\n", dev->name, dev); 02617 return -ENODEV; 02618 } 02619 02620 /* Synchronize to net_rx_action. */ 02621 br_write_lock_bh(BR_NETPROTO_LOCK); 02622 br_write_unlock_bh(BR_NETPROTO_LOCK); 02623 02624 if (dev_boot_phase == 0) { 02625 #ifdef CONFIG_NET_FASTROUTE 02626 dev_clear_fastroute(dev); 02627 #endif 02628 02629 /* Shutdown queueing discipline. */ 02630 dev_shutdown(dev); 02631 02632 net_run_sbin_hotplug(dev, "unregister"); 02633 02634 /* Notify protocols, that we are about to destroy 02635 this device. They should clean all the things. 02636 */ 02637 notifier_call_chain(&netdev_chain, NETDEV_UNREGISTER, dev); 02638 02639 /* 02640 * Flush the multicast chain 02641 */ 02642 dev_mc_discard(dev); 02643 } 02644 02645 if (dev->uninit) 02646 dev->uninit(dev); 02647 02648 /* Notifier chain MUST detach us from master device. */ 02649 BUG_TRAP(dev->master==NULL); 02650 02651 #ifdef CONFIG_NET_DIVERT 02652 free_divert_blk(dev); 02653 #endif 02654 02655 if (dev->features & NETIF_F_DYNALLOC) { 02656 #ifdef NET_REFCNT_DEBUG 02657 if (atomic_read(&dev->refcnt) != 1) 02658 printk(KERN_DEBUG "unregister_netdevice: holding %s refcnt=%d\n", dev->name, atomic_read(&dev->refcnt)-1); 02659 #endif 02660 dev_put(dev); 02661 return 0; 02662 } 02663 02664 /* Last reference is our one */ 02665 if (atomic_read(&dev->refcnt) == 1) { 02666 dev_put(dev); 02667 return 0; 02668 } 02669 02670 #ifdef NET_REFCNT_DEBUG 02671 printk("unregister_netdevice: waiting %s refcnt=%d\n", dev->name, atomic_read(&dev->refcnt)); 02672 #endif 02673 02674 /* EXPLANATION. If dev->refcnt is not now 1 (our own reference) 02675 it means that someone in the kernel still has a reference 02676 to this device and we cannot release it. 02677 02678 "New style" devices have destructors, hence we can return from this 02679 function and destructor will do all the work later. As of kernel 2.4.0 02680 there are very few "New Style" devices. 02681 02682 "Old style" devices expect that the device is free of any references 02683 upon exit from this function. 02684 We cannot return from this function until all such references have 02685 fallen away. This is because the caller of this function will probably 02686 immediately kfree(*dev) and then be unloaded via sys_delete_module. 02687 02688 So, we linger until all references fall away. The duration of the 02689 linger is basically unbounded! It is driven by, for example, the 02690 current setting of sysctl_ipfrag_time. 02691 02692 After 1 second, we start to rebroadcast unregister notifications 02693 in hope that careless clients will release the device. 02694 02695 */ 02696 02697 now = warning_time = jiffies; 02698 while (atomic_read(&dev->refcnt) != 1) { 02699 if ((jiffies - now) > 1*HZ) { 02700 /* Rebroadcast unregister notification */ 02701 notifier_call_chain(&netdev_chain, NETDEV_UNREGISTER, dev); 02702 } 02703 current->state = TASK_INTERRUPTIBLE; 02704 schedule_timeout(HZ/4); 02705 current->state = TASK_RUNNING; 02706 if ((jiffies - warning_time) > 10*HZ) { 02707 printk(KERN_EMERG "unregister_netdevice: waiting for %s to " 02708 "become free. Usage count = %d\n", 02709 dev->name, atomic_read(&dev->refcnt)); 02710 warning_time = jiffies; 02711 } 02712 } 02713 dev_put(dev); 02714 return 0; 02715 }

int unregister_netdevice_notifier struct notifier_block *  nb  ) 
 

Definition at line 925 of file dev.c.

References netdev_chain.

Referenced by fini(), init_or_cleanup(), and ipfw_init_or_cleanup().

00926 { 00927 return notifier_chain_unregister(&netdev_chain,nb); 00928 }


Variable Documentation

struct linux_mib ____cacheline_aligned
 

struct net_device* dev_base
 

Referenced by __dev_get_by_flags(), __dev_get_by_index(), __dev_get_by_name(), dev_getbyhwaddr(), dev_ifconf(), ic_open_devs(), inet_dump_ifaddr(), inet_select_addr(), ip_mc_procinfo(), ip_mcf_procinfo(), net_dev_init(), register_netdevice(), rtnetlink_dump_ifinfo(), and unregister_netdevice().

rwlock_t dev_base_lock
 

Referenced by dev_get(), dev_get_by_flags(), dev_get_by_index(), dev_get_by_name(), dev_ifname(), dev_ioctl(), inet_dump_ifaddr(), inet_select_addr(), inetdev_by_index(), ip_mc_procinfo(), ip_mcf_procinfo(), net_dev_init(), register_netdevice(), rtnetlink_dump_ifinfo(), and unregister_netdevice().

const char* if_port_text[]
 

Definition at line 127 of file dev.c.

struct net_device loopback_dev
 

Referenced by dst_dev_event(), inetdev_event(), ip_route_input_mc(), ip_route_input_slow(), ip_route_output_slow(), and ip_vs_in().

atomic_t netdev_dropping
 

Referenced by netif_rx(), and process_backlog().

unsigned long netdev_fc_xoff
 

int netdev_max_backlog
 

Definition at line 1133 of file dev.c.

Referenced by get_sample_stats(), net_rx_action(), and netif_rx().

int netdev_nit
 

Definition at line 207 of file dev.c.

Referenced by dev_add_pack(), dev_queue_xmit(), and dev_remove_pack().

struct netif_rx_stats netdev_rx_stat[]
 

Definition at line 1144 of file dev.c.

Referenced by net_rx_action(), netif_receive_skb(), and netif_rx().

struct softnet_data softnet_data[NR_CPUS]
 

Referenced by __netif_rx_schedule(), __netif_schedule(), dev_kfree_skb_irq(), get_sample_stats(), net_dev_init(), net_rx_action(), net_tx_action(), netif_rx(), netif_rx_reschedule(), and process_backlog().

int weight_p
 

Definition at line 1134 of file dev.c.

Referenced by net_dev_init().


Generated on Wed Dec 1 21:25:38 2004 for Linux 2.4.23 Networking by doxygen 1.3.8