dev.c File Reference

Go to the source code of this file.

Classes

struct  dev_gso_cb

: name of interface

dev_load - load a network module : the applicable net namespace

If a network interface is not present and the process has suitable privileges this function loads the module.

If module loading is not available in this kernel then it becomes a nop.

#define DEV_GSO_CB(skb)   ((struct dev_gso_cb *)(skb)->cb)
#define handle_bridge(skb, pt_prev, ret, orig_dev)   (skb)
#define handle_macvlan(skb, pt_prev, ret, orig_dev)   (skb)
#define dev_proc_init()   0
static struct list_head
ptype_base[PTYPE_HASH_SIZE] 
__read_mostly = 1000
static int dev_boot_phase = 1
static atomic_t netstamp_needed = ATOMIC_INIT(0)
static u32 simple_tx_hashrnd
static int simple_tx_hashrnd_initialized = 0
static gifconf_func_t * gifconf_list [NPROTO]
void dev_load (struct net *net, const char *name)
int dev_open (struct net_device *dev)
 dev_open - prepare an interface for use.
int dev_close (struct net_device *dev)
 dev_close - shutdown an interface.
void dev_disable_lro (struct net_device *dev)
 dev_disable_lro - disable Large Receive Offload on a device : device
 EXPORT_SYMBOL (dev_disable_lro)
int register_netdevice_notifier (struct notifier_block *nb)
 register_netdevice_notifier - register a network notifier block : notifier
int unregister_netdevice_notifier (struct notifier_block *nb)
 unregister_netdevice_notifier - unregister a network notifier block : notifier
int call_netdevice_notifiers (unsigned long val, struct net_device *dev)
 call_netdevice_notifiers - call all network notifier blocks : value passed unmodified to notifier function : net_device pointer passed unmodified to notifier function
void net_enable_timestamp (void)
void net_disable_timestamp (void)
static void net_timestamp (struct sk_buff *skb)
static void dev_queue_xmit_nit (struct sk_buff *skb, struct net_device *dev)
static void __netif_reschedule (struct Qdisc *q)
void __netif_schedule (struct Qdisc *q)
 EXPORT_SYMBOL (__netif_schedule)
void dev_kfree_skb_irq (struct sk_buff *skb)
 EXPORT_SYMBOL (dev_kfree_skb_irq)
void dev_kfree_skb_any (struct sk_buff *skb)
 EXPORT_SYMBOL (dev_kfree_skb_any)
void netif_device_detach (struct net_device *dev)
 netif_device_detach - mark device as removed : network device
 EXPORT_SYMBOL (netif_device_detach)
void netif_device_attach (struct net_device *dev)
 netif_device_attach - mark device as attached : network device
 EXPORT_SYMBOL (netif_device_attach)
static bool can_checksum_protocol (unsigned long features, __be16 protocol)
static bool dev_can_checksum (struct net_device *dev, struct sk_buff *skb)
int skb_checksum_help (struct sk_buff *skb)
struct sk_buff * skb_gso_segment (struct sk_buff *skb, int features)
 skb_gso_segment - Perform segmentation on skb.
 EXPORT_SYMBOL (skb_gso_segment)
static int illegal_highdma (struct net_device *dev, struct sk_buff *skb)
static void dev_gso_skb_destructor (struct sk_buff *skb)
static int dev_gso_segment (struct sk_buff *skb)
 dev_gso_segment - Perform emulated hardware segmentation on skb.
int dev_hard_start_xmit (struct sk_buff *skb, struct net_device *dev, struct netdev_queue *txq)
static u16 simple_tx_hash (struct net_device *dev, struct sk_buff *skb)
static struct netdev_queue * dev_pick_tx (struct net_device *dev, struct sk_buff *skb)
int dev_queue_xmit (struct sk_buff *skb)
 dev_queue_xmit - transmit a buffer : buffer to transmit
 DEFINE_PER_CPU (struct netif_rx_stats, netdev_rx_stat)
int netif_rx (struct sk_buff *skb)
 netif_rx - post buffer to the network code : buffer to post
int netif_rx_ni (struct sk_buff *skb)
 EXPORT_SYMBOL (netif_rx_ni)
static void net_tx_action (struct softirq_action *h)
static int deliver_skb (struct sk_buff *skb, struct packet_type *pt_prev, struct net_device *orig_dev)
void netif_nit_deliver (struct sk_buff *skb)
int netif_receive_skb (struct sk_buff *skb)
 netif_receive_skb - process receive buffer from network : buffer to process
static void flush_backlog (void *arg)
static int napi_gro_complete (struct sk_buff *skb)
void napi_gro_flush (struct napi_struct *napi)
 EXPORT_SYMBOL (napi_gro_flush)
int dev_gro_receive (struct napi_struct *napi, struct sk_buff *skb)
 EXPORT_SYMBOL (dev_gro_receive)
static int __napi_gro_receive (struct napi_struct *napi, struct sk_buff *skb)
int napi_gro_receive (struct napi_struct *napi, struct sk_buff *skb)
 EXPORT_SYMBOL (napi_gro_receive)
void napi_reuse_skb (struct napi_struct *napi, struct sk_buff *skb)
 EXPORT_SYMBOL (napi_reuse_skb)
struct sk_buff * napi_fraginfo_skb (struct napi_struct *napi, struct napi_gro_fraginfo *info)
 EXPORT_SYMBOL (napi_fraginfo_skb)
int napi_gro_frags (struct napi_struct *napi, struct napi_gro_fraginfo *info)
 EXPORT_SYMBOL (napi_gro_frags)
static int process_backlog (struct napi_struct *napi, int quota)
void __napi_schedule (struct napi_struct *n)
 __napi_schedule - schedule for receive
: entry to schedule
 EXPORT_SYMBOL (__napi_schedule)
void __napi_complete (struct napi_struct *n)
 EXPORT_SYMBOL (__napi_complete)
void napi_complete (struct napi_struct *n)
 EXPORT_SYMBOL (napi_complete)
void netif_napi_add (struct net_device *dev, struct napi_struct *napi, int(*poll)(struct napi_struct *, int), int weight)
 EXPORT_SYMBOL (netif_napi_add)
void netif_napi_del (struct napi_struct *napi)
 EXPORT_SYMBOL (netif_napi_del)
static void net_rx_action (struct softirq_action *h)
int register_gifconf (unsigned int family, gifconf_func_t *gifconf)
 register_gifconf - register a SIOCGIF handler : Address family : Function handler
static int dev_ifname (struct net *net, struct ifreq __user *arg)
static int dev_ifconf (struct net *net, char __user *arg)
int netdev_set_master (struct net_device *slave, struct net_device *master)
 netdev_set_master - set up master/slave pair : slave device : new master device
static void dev_change_rx_flags (struct net_device *dev, int flags)
static int __dev_set_promiscuity (struct net_device *dev, int inc)
int dev_set_promiscuity (struct net_device *dev, int inc)
 dev_set_promiscuity - update promiscuity count on a device : device : modifier
int dev_set_allmulti (struct net_device *dev, int inc)
 dev_set_allmulti - update allmulti count on a device : device : modifier
void __dev_set_rx_mode (struct net_device *dev)
void dev_set_rx_mode (struct net_device *dev)
int __dev_addr_delete (struct dev_addr_list **list, int *count, void *addr, int alen, int glbl)
int __dev_addr_add (struct dev_addr_list **list, int *count, void *addr, int alen, int glbl)
int dev_unicast_delete (struct net_device *dev, void *addr, int alen)
 dev_unicast_delete - Release secondary unicast address.
 EXPORT_SYMBOL (dev_unicast_delete)
int dev_unicast_add (struct net_device *dev, void *addr, int alen)
 dev_unicast_add - add a secondary unicast address : device : address to add : length of
 EXPORT_SYMBOL (dev_unicast_add)
int __dev_addr_sync (struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count)
void __dev_addr_unsync (struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count)
int dev_unicast_sync (struct net_device *to, struct net_device *from)
 dev_unicast_sync - Synchronize device's unicast list to another device : destination device : source device
 EXPORT_SYMBOL (dev_unicast_sync)
void dev_unicast_unsync (struct net_device *to, struct net_device *from)
 dev_unicast_unsync - Remove synchronized addresses from the destination device : destination device : source device
 EXPORT_SYMBOL (dev_unicast_unsync)
static void __dev_addr_discard (struct dev_addr_list **list)
static void dev_addr_discard (struct net_device *dev)
unsigned dev_get_flags (const struct net_device *dev)
 dev_get_flags - get flags reported to userspace : device
int dev_change_flags (struct net_device *dev, unsigned flags)
 dev_change_flags - change device settings : device : device state flags
int dev_set_mtu (struct net_device *dev, int new_mtu)
 dev_set_mtu - Change maximum transfer unit : device : new transfer unit
int dev_set_mac_address (struct net_device *dev, struct sockaddr *sa)
 dev_set_mac_address - Change Media Access Control Address : device
static int dev_ifsioc_locked (struct net *net, struct ifreq *ifr, unsigned int cmd)
static int dev_ifsioc (struct net *net, struct ifreq *ifr, unsigned int cmd)
int dev_ioctl (struct net *net, unsigned int cmd, void __user *arg)
 dev_ioctl - network device ioctl : the applicable net namespace : command to issue
static int dev_new_index (struct net *net)
 dev_new_index - allocate an ifindex : the applicable net namespace
static LIST_HEAD (net_todo_list)
static void net_set_todo (struct net_device *dev)
static void rollback_registered (struct net_device *dev)
static void __netdev_init_queue_locks_one (struct net_device *dev, struct netdev_queue *dev_queue, void *_unused)
static void netdev_init_queue_locks (struct net_device *dev)
unsigned long netdev_fix_features (unsigned long features, const char *name)
 EXPORT_SYMBOL (netdev_fix_features)
void netdev_resync_ops (struct net_device *dev)
 EXPORT_SYMBOL (netdev_resync_ops)
int register_netdevice (struct net_device *dev)
 register_netdevice - register a network device : device to register
int init_dummy_netdev (struct net_device *dev)
 init_dummy_netdev - init a dummy network device for NAPI : device to init
 EXPORT_SYMBOL_GPL (init_dummy_netdev)
int register_netdev (struct net_device *dev)
 register_netdev - register a network device : device to register
 EXPORT_SYMBOL (register_netdev)
static void netdev_wait_allrefs (struct net_device *dev)
void netdev_run_todo (void)
struct net_device_stats * dev_get_stats (struct net_device *dev)
 dev_get_stats - get network device statistics : device to get statistics from
 EXPORT_SYMBOL (dev_get_stats)
static void netdev_init_one_queue (struct net_device *dev, struct netdev_queue *queue, void *_unused)
static void netdev_init_queues (struct net_device *dev)

: device name format string

alloc_netdev_mq - allocate network device : size of private data to allocate space for

: callback to initialize device : the number of subqueues to allocate

Allocates a struct net_device with private data area for driver use and performs basic initialization. Also allocates subquue structs for each queue on the device at the end of the netdevice.

static struct
pernet_operations
__net_initdata 
netdev_net_ops
static struct
pernet_operations
__net_initdata 
default_device_ops
struct net_device * alloc_netdev_mq (int sizeof_priv, const char *name, void(*setup)(struct net_device *), unsigned int queue_count)
 EXPORT_SYMBOL (alloc_netdev_mq)
void free_netdev (struct net_device *dev)
 free_netdev - free network device : device
void synchronize_net (void)
 synchronize_net - Synchronize with packet receive processing
void unregister_netdevice (struct net_device *dev)
 unregister_netdevice - remove device from the kernel : device
void unregister_netdev (struct net_device *dev)
 unregister_netdev - remove device from the kernel : device
 EXPORT_SYMBOL (unregister_netdev)
int dev_change_net_namespace (struct net_device *dev, struct net *net, const char *pat)
 dev_change_net_namespace - move device to different nethost namespace : device : network namespace : If not NULL name pattern to try if the current device name is already taken in the destination network namespace.
static int dev_cpu_callback (struct notifier_block *nfb, unsigned long action, void *ocpu)
unsigned long netdev_increment_features (unsigned long all, unsigned long one, unsigned long mask)
 netdev_increment_features - increment feature set by one : current feature set : new feature set : mask feature set
 EXPORT_SYMBOL (netdev_increment_features)
static struct hlist_head * netdev_create_hash (void)
static int __net_init netdev_init (struct net *net)
char * netdev_drivername (const struct net_device *dev, char *buffer, int len)
 netdev_drivername - network driver for the device : network device : buffer for resulting name : size of buffer
static void __net_exit netdev_exit (struct net *net)
static void __net_exit default_device_exit (struct net *net)
static int __init net_dev_init (void)
 subsys_initcall (net_dev_init)
 EXPORT_SYMBOL (__dev_get_by_index)
 EXPORT_SYMBOL (__dev_get_by_name)
 EXPORT_SYMBOL (__dev_remove_pack)
 EXPORT_SYMBOL (dev_valid_name)
 EXPORT_SYMBOL (dev_add_pack)
 EXPORT_SYMBOL (dev_alloc_name)
 EXPORT_SYMBOL (dev_close)
 EXPORT_SYMBOL (dev_get_by_flags)
 EXPORT_SYMBOL (dev_get_by_index)
 EXPORT_SYMBOL (dev_get_by_name)
 EXPORT_SYMBOL (dev_open)
 EXPORT_SYMBOL (dev_queue_xmit)
 EXPORT_SYMBOL (dev_remove_pack)
 EXPORT_SYMBOL (dev_set_allmulti)
 EXPORT_SYMBOL (dev_set_promiscuity)
 EXPORT_SYMBOL (dev_change_flags)
 EXPORT_SYMBOL (dev_set_mtu)
 EXPORT_SYMBOL (dev_set_mac_address)
 EXPORT_SYMBOL (free_netdev)
 EXPORT_SYMBOL (netdev_boot_setup_check)
 EXPORT_SYMBOL (netdev_set_master)
 EXPORT_SYMBOL (netdev_state_change)
 EXPORT_SYMBOL (netif_receive_skb)
 EXPORT_SYMBOL (netif_rx)
 EXPORT_SYMBOL (register_gifconf)
 EXPORT_SYMBOL (register_netdevice)
 EXPORT_SYMBOL (register_netdevice_notifier)
 EXPORT_SYMBOL (skb_checksum_help)
 EXPORT_SYMBOL (synchronize_net)
 EXPORT_SYMBOL (unregister_netdevice)
 EXPORT_SYMBOL (unregister_netdevice_notifier)
 EXPORT_SYMBOL (net_enable_timestamp)
 EXPORT_SYMBOL (net_disable_timestamp)
 EXPORT_SYMBOL (dev_get_flags)
 EXPORT_PER_CPU_SYMBOL (softnet_data)

Defines

#define MAX_GRO_SKBS   8
#define GRO_MAX_HEAD   (MAX_HEADER + 128)
#define PTYPE_HASH_SIZE   (16)
#define PTYPE_HASH_MASK   (PTYPE_HASH_SIZE - 1)
#define NETDEV_HASHBITS   8
#define NETDEV_HASHENTRIES   (1 << NETDEV_HASHBITS)

Functions

static DEFINE_SPINLOCK (ptype_lock)
 DEFINE_RWLOCK (dev_base_lock)
 EXPORT_SYMBOL (dev_base_lock)
static struct hlist_head * dev_name_hash (struct net *net, const char *name)
static struct hlist_head * dev_index_hash (struct net *net, int ifindex)
static int list_netdevice (struct net_device *dev)
static void unlist_netdevice (struct net_device *dev)
static RAW_NOTIFIER_HEAD (netdev_chain)
 DEFINE_PER_CPU (struct softnet_data, softnet_data)
static void netdev_set_xmit_lockdep_class (spinlock_t *lock, unsigned short dev_type)
static void netdev_set_addr_lockdep_class (struct net_device *dev)
void dev_add_pack (struct packet_type *pt)
 dev_add_pack - add packet handler : packet type declaration
void __dev_remove_pack (struct packet_type *pt)
 __dev_remove_pack - remove packet handler : packet type declaration
void dev_remove_pack (struct packet_type *pt)
 dev_remove_pack - remove packet handler : packet type declaration
: name of the device
netdev_boot_setup_add - add new setup entry

: configured settings for the device

Adds new setup entry to the dev_boot_setup list. The function returns 0 on error and 1 on success. This is a generic routine to all netdevices.

static int netdev_boot_setup_add (char *name, struct ifmap *map)
int netdev_boot_setup_check (struct net_device *dev)
 netdev_boot_setup_check - check boot time settings : the netdevice
unsigned long netdev_boot_base (const char *prefix, int unit)
 netdev_boot_base - get address from boot time settings : prefix for network device : id for network device
int __init netdev_boot_setup (char *str)
 __setup ("netdev=", netdev_boot_setup)
: name to find
__dev_get_by_name - find a device by its name : the applicable net namespace

Find an interface by name.

Must be called under RTNL semaphore or . If the name is found a pointer to the device is returned. If the name is not found then NULL is returned. The reference counters are not incremented so the caller must be careful with locks.

struct net_device * __dev_get_by_name (struct net *net, const char *name)
: name to find
dev_get_by_name - find a device by its name : the applicable net namespace

Find an interface by name.

This can be called from any context and does its own locking. The returned handle has the usage count incremented and the caller must use dev_put() to release it when it is no longer needed. NULL is returned if no matching device is found.

struct net_device * dev_get_by_name (struct net *net, const char *name)
struct net_device * __dev_get_by_index (struct net *net, int ifindex)
 __dev_get_by_index - find a device by its ifindex : the applicable net namespace : index of device
struct net_device * dev_get_by_index (struct net *net, int ifindex)
 dev_get_by_index - find a device by its ifindex : the applicable net namespace : index of device
struct net_device * dev_getbyhwaddr (struct net *net, unsigned short type, char *ha)
 dev_getbyhwaddr - find a device by its hardware address : the applicable net namespace : media type of device : hardware address
 EXPORT_SYMBOL (dev_getbyhwaddr)
struct net_device * __dev_getfirstbyhwtype (struct net *net, unsigned short type)
 EXPORT_SYMBOL (__dev_getfirstbyhwtype)
struct net_device * dev_getfirstbyhwtype (struct net *net, unsigned short type)
 EXPORT_SYMBOL (dev_getfirstbyhwtype)
struct net_device * dev_get_by_flags (struct net *net, unsigned short if_flags, unsigned short mask)
 dev_get_by_flags - find any device with given flags : the applicable net namespace : IFF_* values : bitmask of bits in if_flags to check
: name string
dev_valid_name - check if name is okay for network device

Network device names need to be valid file names to to allow sysfs to work.

We also disallow any kind of whitespace.

int dev_valid_name (const char *name)
: name format string
__dev_alloc_name - allocate a name for a device : network namespace to allocate the device name in

: scratch buffer and result name string

Passed a format string - eg "lt%d" it will try and find a suitable id. It scans list of devices to build up a free map, then chooses the first empty slot. The caller must hold the dev_base or rtnl lock while allocating the name and adding the device in order to avoid duplicates. Limited to bits_per_byte * page size devices (ie 32K on most platforms). Returns the number of the unit assigned or a negative errno code.

static int __dev_alloc_name (struct net *net, const char *name, char *buf)
: name format string
dev_alloc_name - allocate a name for a device : device

Passed a format string - eg "lt%d" it will try and find a suitable id.

It scans list of devices to build up a free map, then chooses the first empty slot. The caller must hold the dev_base or rtnl lock while allocating the name and adding the device in order to avoid duplicates. Limited to bits_per_byte * page size devices (ie 32K on most platforms). Returns the number of the unit assigned or a negative errno code.

int dev_alloc_name (struct net_device *dev, const char *name)
int dev_change_name (struct net_device *dev, const char *newname)
 dev_change_name - change name of a device : device : name (or format string) must be at least IFNAMSIZ
int dev_set_alias (struct net_device *dev, const char *alias, size_t len)
 dev_set_alias - change ifalias of a device : device : name up to IFALIASZ : limit of bytes to copy from info
void netdev_features_change (struct net_device *dev)
 netdev_features_change - device changes features : device to cause notification
 EXPORT_SYMBOL (netdev_features_change)
void netdev_state_change (struct net_device *dev)
 netdev_state_change - device changes state : device to cause notification
void netdev_bonding_change (struct net_device *dev)
 EXPORT_SYMBOL (netdev_bonding_change)

Variables

static struct netdev_boot_setup dev_boot_setup [NETDEV_BOOT_SETUP_MAX]


Define Documentation

#define DEV_GSO_CB ( skb   )     ((struct dev_gso_cb *)(skb)->cb)

Definition at line 1623 of file dev.c.

 
#define dev_proc_init (  )     0

Definition at line 3209 of file dev.c.

#define GRO_MAX_HEAD   (MAX_HEADER + 128)

Definition at line 141 of file dev.c.

#define handle_bridge ( skb,
pt_prev,
ret,
orig_dev   )     (skb)

Definition at line 2106 of file dev.c.

#define handle_macvlan ( skb,
pt_prev,
ret,
orig_dev   )     (skb)

Definition at line 2128 of file dev.c.

#define MAX_GRO_SKBS   8

Definition at line 138 of file dev.c.

#define NETDEV_HASHBITS   8

Definition at line 201 of file dev.c.

#define NETDEV_HASHENTRIES   (1 << NETDEV_HASHBITS)

Definition at line 202 of file dev.c.

#define PTYPE_HASH_MASK   (PTYPE_HASH_SIZE - 1)

Definition at line 172 of file dev.c.

#define PTYPE_HASH_SIZE   (16)

Definition at line 171 of file dev.c.


Function Documentation

int __dev_addr_add ( struct dev_addr_list **  list,
int *  count,
void *  addr,
int  alen,
int  glbl 
)

Definition at line 3442 of file dev.c.

int __dev_addr_delete ( struct dev_addr_list **  list,
int *  count,
void *  addr,
int  alen,
int  glbl 
)

Definition at line 3416 of file dev.c.

static void __dev_addr_discard ( struct dev_addr_list **  list  )  [static]

Definition at line 3621 of file dev.c.

int __dev_addr_sync ( struct dev_addr_list **  to,
int *  to_count,
struct dev_addr_list **  from,
int *  from_count 
)

Definition at line 3526 of file dev.c.

void __dev_addr_unsync ( struct dev_addr_list **  to,
int *  to_count,
struct dev_addr_list **  from,
int *  from_count 
)

Definition at line 3553 of file dev.c.

static int __dev_alloc_name ( struct net *  net,
const char *  name,
char *  buf 
) [static]

Definition at line 798 of file dev.c.

struct net_device* __dev_get_by_index ( struct net *  net,
int  ifindex 
) [read]

__dev_get_by_index - find a device by its ifindex : the applicable net namespace : index of device

Search for an interface by index. Returns NULL if the device is not found or a pointer to the device. The device has not had its reference counter increased so the caller must be careful about locking. The caller must hold either the RTNL semaphore or .

Definition at line 633 of file dev.c.

struct net_device* __dev_get_by_name ( struct net *  net,
const char *  name 
) [read]

Definition at line 584 of file dev.c.

struct net_device* __dev_getfirstbyhwtype ( struct net *  net,
unsigned short  type 
) [read]

Definition at line 701 of file dev.c.

void __dev_remove_pack ( struct packet_type *  pt  ) 

__dev_remove_pack - remove packet handler : packet type declaration

Remove a protocol handler that was previously added to the kernel protocol handlers by dev_add_pack(). The passed &packet_type is removed from the kernel lists and can be freed or reused once this function returns.

The packet type might still be in use by receivers and must not be freed until after all the CPU's have gone through a quiescent state.

Definition at line 400 of file dev.c.

static int __dev_set_promiscuity ( struct net_device *  dev,
int  inc 
) [static]

Definition at line 3260 of file dev.c.

void __dev_set_rx_mode ( struct net_device *  dev  ) 

Definition at line 3379 of file dev.c.

void __napi_complete ( struct napi_struct *  n  ) 

Definition at line 2640 of file dev.c.

static int __napi_gro_receive ( struct napi_struct *  napi,
struct sk_buff *  skb 
) [static]

Definition at line 2488 of file dev.c.

void __napi_schedule ( struct napi_struct *  n  ) 

__napi_schedule - schedule for receive
: entry to schedule

The entry's receive function will be scheduled to run

Definition at line 2629 of file dev.c.

static void __netdev_init_queue_locks_one ( struct net_device *  dev,
struct netdev_queue *  dev_queue,
void *  _unused 
) [static]

Definition at line 4248 of file dev.c.

static void __netif_reschedule ( struct Qdisc *  q  )  [inline, static]

Definition at line 1382 of file dev.c.

void __netif_schedule ( struct Qdisc *  q  ) 

Definition at line 1395 of file dev.c.

__setup (  ) 

struct net_device* alloc_netdev_mq ( int  sizeof_priv,
const char *  name,
void(*)(struct net_device *)  setup,
unsigned int  queue_count 
) [read]

Definition at line 4712 of file dev.c.

int call_netdevice_notifiers ( unsigned long  val,
struct net_device *  dev 
)

call_netdevice_notifiers - call all network notifier blocks : value passed unmodified to notifier function : net_device pointer passed unmodified to notifier function

Call all network notifier blocks. Parameters and return value are as for raw_notifier_call_chain().

Definition at line 1309 of file dev.c.

static bool can_checksum_protocol ( unsigned long  features,
__be16  protocol 
) [static]

Definition at line 1459 of file dev.c.

static void __net_exit default_device_exit ( struct net *  net  )  [static]

Definition at line 5136 of file dev.c.

DEFINE_PER_CPU ( struct  netif_rx_stats,
netdev_rx_stat   
)

DEFINE_PER_CPU ( struct  softnet_data,
softnet_data   
)

DEFINE_RWLOCK ( dev_base_lock   ) 

static DEFINE_SPINLOCK ( ptype_lock   )  [static]

static int deliver_skb ( struct sk_buff *  skb,
struct packet_type *  pt_prev,
struct net_device *  orig_dev 
) [inline, static]

Definition at line 2067 of file dev.c.

void dev_add_pack ( struct packet_type *  pt  ) 

dev_add_pack - add packet handler : packet type declaration

Add a protocol handler to the networking stack. The passed &packet_type is linked into kernel lists and may not be freed until it has been removed from the kernel lists.

This call does not sleep therefore it can not guarantee all CPU's that are in middle of receiving packets will see the new packet type (until the next received packet).

Definition at line 373 of file dev.c.

static void dev_addr_discard ( struct net_device *  dev  )  [static]

Definition at line 3635 of file dev.c.

int dev_alloc_name ( struct net_device *  dev,
const char *  name 
)

Definition at line 862 of file dev.c.

static bool dev_can_checksum ( struct net_device *  dev,
struct sk_buff *  skb 
) [static]

Definition at line 1468 of file dev.c.

int dev_change_flags ( struct net_device *  dev,
unsigned  flags 
)

dev_change_flags - change device settings : device : device state flags

Change settings on device based state flags. The flags are in the userspace exported format.

Definition at line 3686 of file dev.c.

int dev_change_name ( struct net_device *  dev,
const char *  newname 
)

dev_change_name - change name of a device : device : name (or format string) must be at least IFNAMSIZ

Change name of a device, can pass format strings "eth%d". for wildcarding.

Definition at line 885 of file dev.c.

int dev_change_net_namespace ( struct net_device *  dev,
struct net *  net,
const char *  pat 
)

dev_change_net_namespace - move device to different nethost namespace : device : network namespace : If not NULL name pattern to try if the current device name is already taken in the destination network namespace.

This function shuts down a device interface and moves it to a new network namespace. On success 0 is returned, on a failure a netagive errno code is returned.

Callers must hold the rtnl semaphore.

Definition at line 4865 of file dev.c.

static void dev_change_rx_flags ( struct net_device *  dev,
int  flags 
) [static]

Definition at line 3252 of file dev.c.

int dev_close ( struct net_device *  dev  ) 

dev_close - shutdown an interface.

: device to shutdown

This function moves an active device into down state. A NETDEV_GOING_DOWN is sent to the netdev notifier chain. The device is then deactivated and finally a NETDEV_DOWN is sent to the notifier chain.

Definition at line 1128 of file dev.c.

static int dev_cpu_callback ( struct notifier_block *  nfb,
unsigned long  action,
void *  ocpu 
) [static]

Definition at line 4977 of file dev.c.

void dev_disable_lro ( struct net_device *  dev  ) 

dev_disable_lro - disable Large Receive Offload on a device : device

Disable Large Receive Offload (LRO) on a net device. Must be called under RTNL. This is needed if received packets may be forwarded to another interface.

Definition at line 1194 of file dev.c.

struct net_device* dev_get_by_flags ( struct net *  net,
unsigned short  if_flags,
unsigned short  mask 
) [read]

dev_get_by_flags - find any device with given flags : the applicable net namespace : IFF_* values : bitmask of bits in if_flags to check

Search for any interface with the given flags. Returns NULL if a device is not found or a pointer to the device. The device returned has had a reference added and the pointer is safe until the user calls dev_put to indicate they have finished with it.

Definition at line 741 of file dev.c.

struct net_device* dev_get_by_index ( struct net *  net,
int  ifindex 
) [read]

dev_get_by_index - find a device by its ifindex : the applicable net namespace : index of device

Search for an interface by index. Returns NULL if the device is not found or a pointer to the device. The device returned has had a reference added and the pointer is safe until the user calls dev_put to indicate they have finished with it.

Definition at line 658 of file dev.c.

struct net_device* dev_get_by_name ( struct net *  net,
const char *  name 
) [read]

Definition at line 609 of file dev.c.

unsigned dev_get_flags ( const struct net_device *  dev  ) 

dev_get_flags - get flags reported to userspace : device

Get the combination of flag bits exported through APIs to userspace.

Definition at line 3654 of file dev.c.

struct net_device_stats* dev_get_stats ( struct net_device *  dev  )  [read]

dev_get_stats - get network device statistics : device to get statistics from

Get network statistics from device. The device driver may provide its own method by setting dev->netdev_ops->get_stats; otherwise the internal statistics structure is used.

Definition at line 4676 of file dev.c.

struct net_device* dev_getbyhwaddr ( struct net *  net,
unsigned short  type,
char *  ha 
) [read]

dev_getbyhwaddr - find a device by its hardware address : the applicable net namespace : media type of device : hardware address

Search for an interface by MAC address. Returns NULL if the device is not found or a pointer to the device. The caller must hold the rtnl semaphore. The returned device has not had its ref count increased and the caller must therefore be careful about locking

BUGS: If the API was consistent this would be __dev_get_by_hwaddr

Definition at line 685 of file dev.c.

struct net_device* dev_getfirstbyhwtype ( struct net *  net,
unsigned short  type 
) [read]

Definition at line 715 of file dev.c.

int dev_gro_receive ( struct napi_struct *  napi,
struct sk_buff *  skb 
)

Definition at line 2404 of file dev.c.

static int dev_gso_segment ( struct sk_buff *  skb  )  [static]

dev_gso_segment - Perform emulated hardware segmentation on skb.

: buffer to segment

This function segments the given skb and stores the list of segments in skb->next.

Definition at line 1649 of file dev.c.

static void dev_gso_skb_destructor ( struct sk_buff *  skb  )  [static]

Definition at line 1625 of file dev.c.

int dev_hard_start_xmit ( struct sk_buff *  skb,
struct net_device *  dev,
struct netdev_queue *  txq 
)

Definition at line 1672 of file dev.c.

static int dev_ifconf ( struct net *  net,
char __user *  arg 
) [static]

Definition at line 2851 of file dev.c.

static int dev_ifname ( struct net *  net,
struct ifreq __user *  arg 
) [static]

Definition at line 2818 of file dev.c.

static int dev_ifsioc ( struct net *  net,
struct ifreq *  ifr,
unsigned int  cmd 
) [static]

Definition at line 3882 of file dev.c.

static int dev_ifsioc_locked ( struct net *  net,
struct ifreq *  ifr,
unsigned int  cmd 
) [static]

Definition at line 3815 of file dev.c.

static struct hlist_head* dev_index_hash ( struct net *  net,
int  ifindex 
) [static, read]

Definition at line 210 of file dev.c.

int dev_ioctl ( struct net *  net,
unsigned int  cmd,
void __user *  arg 
)

dev_ioctl - network device ioctl : the applicable net namespace : command to issue

  • : pointer to a struct ifreq in user space
Issue ioctl functions to devices. This is normally called by the user space syscall interfaces but can sometimes be useful for other purposes. The return value is the return from the syscall if positive or a negative errno code on error.

Definition at line 4001 of file dev.c.

void dev_kfree_skb_any ( struct sk_buff *  skb  ) 

Definition at line 1418 of file dev.c.

void dev_kfree_skb_irq ( struct sk_buff *  skb  ) 

Definition at line 1402 of file dev.c.

void dev_load ( struct net *  net,
const char *  name 
)

Definition at line 1028 of file dev.c.

static struct hlist_head* dev_name_hash ( struct net *  net,
const char *  name 
) [static, read]

Definition at line 204 of file dev.c.

static int dev_new_index ( struct net *  net  )  [static]

dev_new_index - allocate an ifindex : the applicable net namespace

Returns a suitable unique value for a new device interface number. The caller must hold the rtnl semaphore or the dev_base_lock to be sure it remains unique.

Definition at line 4175 of file dev.c.

int dev_open ( struct net_device *  dev  ) 

dev_open - prepare an interface for use.

: device to open

Takes a device from down to up state. The device's private open function is invoked and then the multicast lists are loaded. Finally the device is moved into the up state and a NETDEV_UP message is sent to the netdev notifier chain.

Calling this function on an active interface is a nop. On a failure a negative errno code is returned.

Definition at line 1052 of file dev.c.

static struct netdev_queue* dev_pick_tx ( struct net_device *  dev,
struct sk_buff *  skb 
) [static, read]

Definition at line 1770 of file dev.c.

int dev_queue_xmit ( struct sk_buff *  skb  ) 

dev_queue_xmit - transmit a buffer : buffer to transmit

Queue a buffer for transmission to a network device. The caller must have set the device and priority and built the buffer before calling this function. The function can be called from an interrupt.

A negative errno code is returned on a failure. A success does not guarantee the frame will be transmitted as it may be dropped due to congestion or traffic shaping.

----------------------------------------------------------------------------------- I notice this method can also return errors from the queue disciplines, including NET_XMIT_DROP, which is a positive value. So, errors can also be positive.

Regardless of the return value, the skb is consumed, so it is currently difficult to retry a send to this method. (You can bump the ref count before sending to hold a reference for retry if you are careful.)

When calling this method, interrupts MUST be enabled. This is because the BH enable code must have IRQs enabled so that it will not deadlock. --BLG

Definition at line 1810 of file dev.c.

static void dev_queue_xmit_nit ( struct sk_buff *  skb,
struct net_device *  dev 
) [static]

Definition at line 1340 of file dev.c.

void dev_remove_pack ( struct packet_type *  pt  ) 

dev_remove_pack - remove packet handler : packet type declaration

Remove a protocol handler that was previously added to the kernel protocol handlers by dev_add_pack(). The passed &packet_type is removed from the kernel lists and can be freed or reused once this function returns.

This call sleeps to guarantee that no CPU is looking at the packet type after return.

Definition at line 435 of file dev.c.

int dev_set_alias ( struct net_device *  dev,
const char *  alias,
size_t  len 
)

dev_set_alias - change ifalias of a device : device : name up to IFALIASZ : limit of bytes to copy from info

Set ifalias for a device,

Definition at line 960 of file dev.c.

int dev_set_allmulti ( struct net_device *  dev,
int  inc 
)

dev_set_allmulti - update allmulti count on a device : device : modifier

Add or remove reception of all multicast frames to a device. While the count in the device remains above zero the interface remains listening to all interfaces. Once it hits zero the device reverts back to normal filtering operation. A negative value is used to drop the counter when releasing a resource needing all multicasts. Return 0 if successful or a negative errno code on error.

Definition at line 3343 of file dev.c.

int dev_set_mac_address ( struct net_device *  dev,
struct sockaddr *  sa 
)

dev_set_mac_address - Change Media Access Control Address : device

See also:
: new address
Change the hardware (MAC) address of the device

Definition at line 3795 of file dev.c.

int dev_set_mtu ( struct net_device *  dev,
int  new_mtu 
)

dev_set_mtu - Change maximum transfer unit : device : new transfer unit

Change the maximum transfer size of the network device.

Definition at line 3762 of file dev.c.

int dev_set_promiscuity ( struct net_device *  dev,
int  inc 
)

dev_set_promiscuity - update promiscuity count on a device : device : modifier

Add or remove promiscuity from a device. While the count in the device remains above zero the interface remains promiscuous. Once it hits zero the device reverts back to normal filtering operation. A negative inc value is used to drop promiscuity on the device. Return 0 if successful or a negative errno code on error.

Definition at line 3317 of file dev.c.

void dev_set_rx_mode ( struct net_device *  dev  ) 

Definition at line 3409 of file dev.c.

int dev_unicast_add ( struct net_device *  dev,
void *  addr,
int  alen 
)

dev_unicast_add - add a secondary unicast address : device : address to add : length of

Add a secondary unicast address to the device or increase the reference count if it already exists.

The caller must hold the rtnl_mutex.

Definition at line 3511 of file dev.c.

int dev_unicast_delete ( struct net_device *  dev,
void *  addr,
int  alen 
)

dev_unicast_delete - Release secondary unicast address.

: device : address to delete : length of

Release reference to a secondary unicast address and remove it from the device if the reference count drops to zero.

The caller must hold the rtnl_mutex.

Definition at line 3485 of file dev.c.

int dev_unicast_sync ( struct net_device *  to,
struct net_device *  from 
)

dev_unicast_sync - Synchronize device's unicast list to another device : destination device : source device

Add newly added addresses to the destination device and release addresses that have no users left. The source device must be locked by netif_addr_lock_bh.

This function is intended to be called from the dev->set_rx_mode function of layered software devices.

Definition at line 3584 of file dev.c.

void dev_unicast_unsync ( struct net_device *  to,
struct net_device *  from 
)

dev_unicast_unsync - Remove synchronized addresses from the destination device : destination device : source device

Remove all addresses that were added to the destination device by dev_unicast_sync(). This function is intended to be called from the dev->stop function of layered software devices.

Definition at line 3607 of file dev.c.

int dev_valid_name ( const char *  name  ) 

Definition at line 766 of file dev.c.

EXPORT_PER_CPU_SYMBOL ( softnet_data   ) 

EXPORT_SYMBOL ( dev_get_flags   ) 

EXPORT_SYMBOL ( net_disable_timestamp   ) 

EXPORT_SYMBOL ( net_enable_timestamp   ) 

EXPORT_SYMBOL ( unregister_netdevice_notifier   ) 

EXPORT_SYMBOL ( unregister_netdevice   ) 

EXPORT_SYMBOL ( synchronize_net   ) 

EXPORT_SYMBOL ( skb_checksum_help   ) 

EXPORT_SYMBOL ( register_netdevice_notifier   ) 

EXPORT_SYMBOL ( register_netdevice   ) 

EXPORT_SYMBOL ( register_gifconf   ) 

EXPORT_SYMBOL ( netif_rx   ) 

EXPORT_SYMBOL ( netif_receive_skb   ) 

EXPORT_SYMBOL ( netdev_state_change   ) 

EXPORT_SYMBOL ( netdev_set_master   ) 

EXPORT_SYMBOL ( netdev_boot_setup_check   ) 

EXPORT_SYMBOL ( free_netdev   ) 

EXPORT_SYMBOL ( dev_set_mac_address   ) 

EXPORT_SYMBOL ( dev_set_mtu   ) 

EXPORT_SYMBOL ( dev_change_flags   ) 

EXPORT_SYMBOL ( dev_set_promiscuity   ) 

EXPORT_SYMBOL ( dev_set_allmulti   ) 

EXPORT_SYMBOL ( dev_remove_pack   ) 

EXPORT_SYMBOL ( dev_queue_xmit   ) 

EXPORT_SYMBOL ( dev_open   ) 

EXPORT_SYMBOL ( dev_get_by_name   ) 

EXPORT_SYMBOL ( dev_get_by_index   ) 

EXPORT_SYMBOL ( dev_get_by_flags   ) 

EXPORT_SYMBOL ( dev_close   ) 

EXPORT_SYMBOL ( dev_alloc_name   ) 

EXPORT_SYMBOL ( dev_add_pack   ) 

EXPORT_SYMBOL ( dev_valid_name   ) 

EXPORT_SYMBOL ( __dev_remove_pack   ) 

EXPORT_SYMBOL ( __dev_get_by_name   ) 

EXPORT_SYMBOL ( __dev_get_by_index   ) 

EXPORT_SYMBOL ( netdev_increment_features   ) 

EXPORT_SYMBOL ( unregister_netdev   ) 

EXPORT_SYMBOL ( alloc_netdev_mq   ) 

EXPORT_SYMBOL ( dev_get_stats   ) 

EXPORT_SYMBOL ( register_netdev   ) 

EXPORT_SYMBOL ( netdev_resync_ops   ) 

EXPORT_SYMBOL ( netdev_fix_features   ) 

EXPORT_SYMBOL ( dev_unicast_unsync   ) 

EXPORT_SYMBOL ( dev_unicast_sync   ) 

EXPORT_SYMBOL ( dev_unicast_add   ) 

EXPORT_SYMBOL ( dev_unicast_delete   ) 

EXPORT_SYMBOL ( netif_napi_del   ) 

EXPORT_SYMBOL ( netif_napi_add   ) 

EXPORT_SYMBOL ( napi_complete   ) 

EXPORT_SYMBOL ( __napi_complete   ) 

EXPORT_SYMBOL ( __napi_schedule   ) 

EXPORT_SYMBOL ( napi_gro_frags   ) 

EXPORT_SYMBOL ( napi_fraginfo_skb   ) 

EXPORT_SYMBOL ( napi_reuse_skb   ) 

EXPORT_SYMBOL ( napi_gro_receive   ) 

EXPORT_SYMBOL ( dev_gro_receive   ) 

EXPORT_SYMBOL ( napi_gro_flush   ) 

EXPORT_SYMBOL ( netif_rx_ni   ) 

EXPORT_SYMBOL ( skb_gso_segment   ) 

EXPORT_SYMBOL ( netif_device_attach   ) 

EXPORT_SYMBOL ( netif_device_detach   ) 

EXPORT_SYMBOL ( dev_kfree_skb_any   ) 

EXPORT_SYMBOL ( dev_kfree_skb_irq   ) 

EXPORT_SYMBOL ( __netif_schedule   ) 

EXPORT_SYMBOL ( dev_disable_lro   ) 

EXPORT_SYMBOL ( netdev_bonding_change   ) 

EXPORT_SYMBOL ( netdev_features_change   ) 

EXPORT_SYMBOL ( dev_getfirstbyhwtype   ) 

EXPORT_SYMBOL ( __dev_getfirstbyhwtype   ) 

EXPORT_SYMBOL ( dev_getbyhwaddr   ) 

EXPORT_SYMBOL ( dev_base_lock   ) 

EXPORT_SYMBOL_GPL ( init_dummy_netdev   ) 

static void flush_backlog ( void *  arg  )  [static]

Definition at line 2345 of file dev.c.

void free_netdev ( struct net_device *  dev  ) 

free_netdev - free network device : device

This function does the last stage of destroying an allocated device interface. The reference to the device object is released. If this is the last reference then it will be freed.

Definition at line 4773 of file dev.c.

static int illegal_highdma ( struct net_device *  dev,
struct sk_buff *  skb 
) [inline, static]

Definition at line 1603 of file dev.c.

int init_dummy_netdev ( struct net_device *  dev  ) 

init_dummy_netdev - init a dummy network device for NAPI : device to init

This takes a network device structure and initialize the minimum amount of fields so it can be used to schedule NAPI polls without registering a full blown interface. This is to be used by drivers that need to tie several hardware interfaces to a single NAPI poll scheduler due to HW limitations.

Definition at line 4487 of file dev.c.

static LIST_HEAD ( net_todo_list   )  [static]

static int list_netdevice ( struct net_device *  dev  )  [static]

Definition at line 216 of file dev.c.

void napi_complete ( struct napi_struct *  n  ) 

Definition at line 2651 of file dev.c.

struct sk_buff* napi_fraginfo_skb ( struct napi_struct *  napi,
struct napi_gro_fraginfo *  info 
) [read]

Definition at line 2527 of file dev.c.

static int napi_gro_complete ( struct sk_buff *  skb  )  [static]

Definition at line 2358 of file dev.c.

void napi_gro_flush ( struct napi_struct *  napi  ) 

Definition at line 2390 of file dev.c.

int napi_gro_frags ( struct napi_struct *  napi,
struct napi_gro_fraginfo *  info 
)

Definition at line 2567 of file dev.c.

int napi_gro_receive ( struct napi_struct *  napi,
struct sk_buff *  skb 
)

Definition at line 2500 of file dev.c.

void napi_reuse_skb ( struct napi_struct *  napi,
struct sk_buff *  skb 
)

Definition at line 2518 of file dev.c.

static int __init net_dev_init ( void   )  [static]

Definition at line 5187 of file dev.c.

void net_disable_timestamp ( void   ) 

Definition at line 1322 of file dev.c.

void net_enable_timestamp ( void   ) 

Definition at line 1317 of file dev.c.

static void net_rx_action ( struct softirq_action *  h  )  [static]

Definition at line 2705 of file dev.c.

static void net_set_todo ( struct net_device *  dev  )  [static]

Definition at line 4189 of file dev.c.

static void net_timestamp ( struct sk_buff *  skb  )  [inline, static]

Definition at line 1327 of file dev.c.

static void net_tx_action ( struct softirq_action *  h  )  [static]

Definition at line 2011 of file dev.c.

void netdev_bonding_change ( struct net_device *  dev  ) 

Definition at line 1012 of file dev.c.

unsigned long netdev_boot_base ( const char *  prefix,
int  unit 
)

netdev_boot_base - get address from boot time settings : prefix for network device : id for network device

Check boot time settings for the base address of device. The found settings are set for the device to be used later in the device probing. Returns 0 if no settings found.

Definition at line 516 of file dev.c.

int __init netdev_boot_setup ( char *  str  ) 

Definition at line 540 of file dev.c.

static int netdev_boot_setup_add ( char *  name,
struct ifmap *  map 
) [static]

Definition at line 460 of file dev.c.

int netdev_boot_setup_check ( struct net_device *  dev  ) 

netdev_boot_setup_check - check boot time settings : the netdevice

Check boot time settings for the device. The found settings are set for the device to be used later in the device probing. Returns 0 if no settings found, 1 if they are.

Definition at line 487 of file dev.c.

static struct hlist_head* netdev_create_hash ( void   )  [static, read]

Definition at line 5063 of file dev.c.

char* netdev_drivername ( const struct net_device *  dev,
char *  buffer,
int  len 
)

netdev_drivername - network driver for the device : network device : buffer for resulting name : size of buffer

Determine network driver for device.

Definition at line 5105 of file dev.c.

static void __net_exit netdev_exit ( struct net *  net  )  [static]

Definition at line 5125 of file dev.c.

void netdev_features_change ( struct net_device *  dev  ) 

netdev_features_change - device changes features : device to cause notification

Called to indicate a device has changed features.

Definition at line 990 of file dev.c.

unsigned long netdev_fix_features ( unsigned long  features,
const char *  name 
)

Definition at line 4263 of file dev.c.

unsigned long netdev_increment_features ( unsigned long  all,
unsigned long  one,
unsigned long  mask 
)

netdev_increment_features - increment feature set by one : current feature set : new feature set : mask feature set

Computes a new feature set after adding a device with feature set to the master device with current feature set . Will not enable anything that is off in . Returns the new feature set.

Definition at line 5032 of file dev.c.

static int __net_init netdev_init ( struct net *  net  )  [static]

Definition at line 5077 of file dev.c.

static void netdev_init_one_queue ( struct net_device *  dev,
struct netdev_queue *  queue,
void *  _unused 
) [static]

Definition at line 4687 of file dev.c.

static void netdev_init_queue_locks ( struct net_device *  dev  )  [static]

Definition at line 4257 of file dev.c.

static void netdev_init_queues ( struct net_device *  dev  )  [static]

Definition at line 4694 of file dev.c.

void netdev_resync_ops ( struct net_device *  dev  ) 

Definition at line 4307 of file dev.c.

void netdev_run_todo ( void   ) 

Definition at line 4627 of file dev.c.

static void netdev_set_addr_lockdep_class ( struct net_device *  dev  )  [inline, static]

Definition at line 333 of file dev.c.

int netdev_set_master ( struct net_device *  slave,
struct net_device *  master 
)

netdev_set_master - set up master/slave pair : slave device : new master device

Changes the master device of the slave. Pass NULL to break the bonding. The caller must hold the RTNL semaphore. On a failure a negative errno code is returned. On success the reference counts are adjusted, RTM_NEWLINK is sent to the routing socket and the function returns zero.

Definition at line 3224 of file dev.c.

static void netdev_set_xmit_lockdep_class ( spinlock_t *  lock,
unsigned short  dev_type 
) [inline, static]

Definition at line 329 of file dev.c.

void netdev_state_change ( struct net_device *  dev  ) 

netdev_state_change - device changes state : device to cause notification

Called to indicate a device has changed state. This function calls the notifier chains for netdev_chain and sends a NEWLINK message to the routing socket.

Definition at line 1004 of file dev.c.

static void netdev_wait_allrefs ( struct net_device *  dev  )  [static]

Definition at line 4563 of file dev.c.

void netif_device_attach ( struct net_device *  dev  ) 

netif_device_attach - mark device as attached : network device

Mark device as attached from system and restart if needed.

Definition at line 1449 of file dev.c.

void netif_device_detach ( struct net_device *  dev  ) 

netif_device_detach - mark device as removed : network device

Mark device as removed from system and therefore no longer available.

Definition at line 1434 of file dev.c.

void netif_napi_add ( struct net_device *  dev,
struct napi_struct *  napi,
int(*)(struct napi_struct *, int)  poll,
int  weight 
)

Definition at line 2669 of file dev.c.

void netif_napi_del ( struct napi_struct *  napi  ) 

Definition at line 2687 of file dev.c.

void netif_nit_deliver ( struct sk_buff *  skb  ) 

Definition at line 2207 of file dev.c.

int netif_receive_skb ( struct sk_buff *  skb  ) 

netif_receive_skb - process receive buffer from network : buffer to process

netif_receive_skb() is the main receive data processing function. It always succeeds. The buffer may be dropped during processing for congestion control or by the protocol layers.

This function may only be called from softirq context and interrupts should be enabled.

Return values (usually ignored): NET_RX_SUCCESS: no congestion NET_RX_DROP: packet was dropped

Definition at line 2241 of file dev.c.

int netif_rx ( struct sk_buff *  skb  ) 

netif_rx - post buffer to the network code : buffer to post

This function receives a packet from a device driver and queues it for the upper (protocol) levels to process. It always succeeds. The buffer may be dropped during processing for congestion control or by the protocol layers.

return values: NET_RX_SUCCESS (no congestion) NET_RX_DROP (packet was dropped)

Definition at line 1951 of file dev.c.

int netif_rx_ni ( struct sk_buff *  skb  ) 

Definition at line 1996 of file dev.c.

static int process_backlog ( struct napi_struct *  napi,
int  quota 
) [static]

Definition at line 2595 of file dev.c.

static RAW_NOTIFIER_HEAD ( netdev_chain   )  [static]

int register_gifconf ( unsigned int  family,
gifconf_func_t *  gifconf 
)

register_gifconf - register a SIOCGIF handler : Address family : Function handler

Register protocol dependent address dumping routines. The handler that is passed must not be freed or reused until it has been replaced by another handler.

Definition at line 2798 of file dev.c.

int register_netdev ( struct net_device *  dev  ) 

register_netdev - register a network device : device to register

Take a completed network device structure and add it to the kernel interfaces. A NETDEV_REGISTER message is sent to the netdev notifier chain. 0 is returned on success. A negative errno code is returned on a failure to set up the device, or if the name is a duplicate.

This is a wrapper around register_netdevice that takes the rtnl semaphore and expands the device name if you passed a format string to alloc_netdev.

Definition at line 4529 of file dev.c.

int register_netdevice ( struct net_device *  dev  ) 

register_netdevice - register a network device : device to register

Take a completed network device structure and add it to the kernel interfaces. A NETDEV_REGISTER message is sent to the netdev notifier chain. 0 is returned on success. A negative errno code is returned on a failure to set up the device, or if the name is a duplicate.

Callers must hold the rtnl semaphore. You may want register_netdev() instead of this.

BUGS: The locking appears insufficient to guarantee two parallel registers will not get the same name.

Definition at line 4353 of file dev.c.

int register_netdevice_notifier ( struct notifier_block *  nb  ) 

register_netdevice_notifier - register a network notifier block : notifier

Register a notifier to be called when network device events occur. The notifier passed is linked into the kernel structures and must not be reused until it has been unregistered. A negative errno code is returned on a failure.

When registered all registration and up events are replayed to the new notifier to allow device to have a race free view of the network device list.

Definition at line 1230 of file dev.c.

static void rollback_registered ( struct net_device *  dev  )  [static]

Definition at line 4194 of file dev.c.

static u16 simple_tx_hash ( struct net_device *  dev,
struct sk_buff *  skb 
) [static]

Definition at line 1719 of file dev.c.

int skb_checksum_help ( struct sk_buff *  skb  ) 

Definition at line 1487 of file dev.c.

struct sk_buff* skb_gso_segment ( struct sk_buff *  skb,
int  features 
) [read]

skb_gso_segment - Perform segmentation on skb.

: buffer to segment : features for the output path (see dev->features)

This function segments the given skb and returns a list of segments.

It may return NULL if the skb requires no segmentation. This is only possible when GSO is used for verifying header integrity.

Definition at line 1531 of file dev.c.

subsys_initcall ( net_dev_init   ) 

void synchronize_net ( void   ) 

synchronize_net - Synchronize with packet receive processing

Wait for packets currently being received to be done. Does not block later packets from starting.

Definition at line 4803 of file dev.c.

static void unlist_netdevice ( struct net_device *  dev  )  [static]

Definition at line 231 of file dev.c.

void unregister_netdev ( struct net_device *  dev  ) 

unregister_netdev - remove device from the kernel : device

This function shuts down a device interface and removes it from the kernel tables.

This is just a wrapper for unregister_netdevice that takes the rtnl semaphore. In general you want to use this and not unregister_netdevice.

Definition at line 4842 of file dev.c.

void unregister_netdevice ( struct net_device *  dev  ) 

unregister_netdevice - remove device from the kernel : device

This function shuts down a device interface and removes it from the kernel tables.

Callers must hold the rtnl semaphore. You may want unregister_netdev() instead of this.

Definition at line 4822 of file dev.c.

int unregister_netdevice_notifier ( struct notifier_block *  nb  ) 

unregister_netdevice_notifier - unregister a network notifier block : notifier

Unregister a notifier previously registered by register_netdevice_notifier(). The notifier is unlinked into the kernel structures and may then be reused. A negative errno code is returned on a failure.

Definition at line 1290 of file dev.c.


Variable Documentation

int weight_p __read_mostly = 1000 [static, read]

Definition at line 175 of file dev.c.

struct pernet_operations __net_initdata default_device_ops [static]

Initial value:

 {
        .exit = default_device_exit,
}

Definition at line 5172 of file dev.c.

int dev_boot_phase = 1 [static]

Definition at line 1209 of file dev.c.

struct netdev_boot_setup dev_boot_setup[NETDEV_BOOT_SETUP_MAX] [static]

Definition at line 449 of file dev.c.

gifconf_func_t* gifconf_list[NPROTO] [static]

Definition at line 2787 of file dev.c.

struct pernet_operations __net_initdata netdev_net_ops [static]

Initial value:

 {
        .init = netdev_init,
        .exit = netdev_exit,
}

Definition at line 5131 of file dev.c.

atomic_t netstamp_needed = ATOMIC_INIT(0) [static]

Definition at line 1315 of file dev.c.

u32 simple_tx_hashrnd [static]

Definition at line 1716 of file dev.c.

Definition at line 1717 of file dev.c.


Generated on Wed Apr 11 06:39:15 2012 for DDE - The L4 Device Driver Environment by  doxygen 1.5.6