Linux Kernel
3.7.1
|
#include <linux/pm_qos.h>
#include <linux/timer.h>
#include <linux/bug.h>
#include <linux/delay.h>
#include <linux/atomic.h>
#include <asm/cache.h>
#include <asm/byteorder.h>
#include <linux/percpu.h>
#include <linux/rculist.h>
#include <linux/dmaengine.h>
#include <linux/workqueue.h>
#include <linux/dynamic_queue_limits.h>
#include <linux/ethtool.h>
#include <net/net_namespace.h>
#include <net/dsa.h>
#include <net/netprio_cgroup.h>
#include <linux/netdev_features.h>
#include <linux/neighbour.h>
#include <uapi/linux/netdevice.h>
#include <linux/cache.h>
#include <linux/skbuff.h>
#include <linux/notifier.h>
Go to the source code of this file.
Data Structures | |
struct | net_device_stats |
struct | netdev_hw_addr |
struct | netdev_hw_addr_list |
struct | hh_cache |
struct | header_ops |
struct | netdev_boot_setup |
struct | napi_struct |
struct | netdev_queue |
struct | netdev_tc_txq |
struct | net_device_ops |
struct | net_device |
struct | napi_gro_cb |
struct | packet_type |
struct | softnet_data |
Typedefs | |
typedef enum netdev_tx | netdev_tx_t |
typedef enum gro_result | gro_result_t |
typedef enum rx_handler_result | rx_handler_result_t |
typedef rx_handler_result_t | rx_handler_func_t (struct sk_buff **pskb) |
typedef int | gifconf_func_t (struct net_device *dev, char __user *bufptr, int len) |
#define alloc_netdev | ( | sizeof_priv, | |
name, | |||
setup | |||
) | alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1) |
Definition at line 2518 of file netdevice.h.
#define alloc_netdev_mq | ( | sizeof_priv, | |
name, | |||
setup, | |||
count | |||
) | alloc_netdev_mqs(sizeof_priv, name, setup, count, count) |
Definition at line 2521 of file netdevice.h.
#define DEFAULT_MAX_NUM_RSS_QUEUES (8) |
Definition at line 2114 of file netdevice.h.
#define for_each_dev_addr | ( | dev, | |
ha | |||
) | list_for_each_entry_rcu(ha, &dev->dev_addrs.list, list) |
Definition at line 2507 of file netdevice.h.
Definition at line 1552 of file netdevice.h.
#define for_each_netdev_continue | ( | net, | |
d | |||
) | list_for_each_entry_continue(d, &(net)->dev_base_head, dev_list) |
Definition at line 1560 of file netdevice.h.
#define for_each_netdev_continue_rcu | ( | net, | |
d | |||
) | list_for_each_entry_continue_rcu(d, &(net)->dev_base_head, dev_list) |
Definition at line 1562 of file netdevice.h.
Definition at line 1556 of file netdevice.h.
#define for_each_netdev_reverse | ( | net, | |
d | |||
) | list_for_each_entry_reverse(d, &(net)->dev_base_head, dev_list) |
Definition at line 1554 of file netdevice.h.
#define for_each_netdev_safe | ( | net, | |
d, | |||
n | |||
) | list_for_each_entry_safe(d, n, &(net)->dev_base_head, dev_list) |
Definition at line 1558 of file netdevice.h.
#define GSO_MAX_SEGS 65535 |
Definition at line 1276 of file netdevice.h.
#define GSO_MAX_SIZE 65536 |
Definition at line 1274 of file netdevice.h.
Definition at line 2449 of file netdevice.h.
#define HARD_TX_UNLOCK | ( | dev, | |
txq | |||
) |
Definition at line 2455 of file netdevice.h.
#define HH_DATA_ALIGN | ( | __len | ) | (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1)) |
Definition at line 243 of file netdevice.h.
#define HH_DATA_MOD 16 |
Definition at line 240 of file netdevice.h.
#define HH_DATA_OFF | ( | __len | ) | (HH_DATA_MOD - (((__len - 1) & (HH_DATA_MOD - 1)) + 1)) |
Definition at line 241 of file netdevice.h.
#define LL_MAX_HEADER 32 |
Definition at line 145 of file netdevice.h.
#define LL_RESERVED_SPACE | ( | dev | ) | ((((dev)->hard_header_len+(dev)->needed_headroom)&~(HH_DATA_MOD - 1)) + HH_DATA_MOD) |
Definition at line 256 of file netdevice.h.
#define LL_RESERVED_SPACE_EXTRA | ( | dev, | |
extra | |||
) | ((((dev)->hard_header_len+(dev)->needed_headroom+(extra))&~(HH_DATA_MOD - 1)) + HH_DATA_MOD) |
Definition at line 258 of file netdevice.h.
#define MAX_HEADER LL_MAX_HEADER |
Definition at line 150 of file netdevice.h.
#define MODULE_ALIAS_NETDEV | ( | device | ) | MODULE_ALIAS("netdev-" device) |
Definition at line 2721 of file netdevice.h.
#define NAPI_GRO_CB | ( | skb | ) | ((struct napi_gro_cb *)(skb)->cb) |
Definition at line 1496 of file netdevice.h.
#define NAPI_GRO_FREE 1 |
Definition at line 1483 of file netdevice.h.
#define NAPI_GRO_FREE_STOLEN_HEAD 2 |
Definition at line 1484 of file netdevice.h.
Definition at line 488 of file netdevice.h.
Definition at line 64 of file netdevice.h.
Definition at line 65 of file netdevice.h.
Definition at line 66 of file netdevice.h.
#define net_device_entry | ( | lh | ) | list_entry(lh, struct net_device, dev_list) |
Definition at line 1564 of file netdevice.h.
#define NET_RX_DROP 1 /* packet dropped */ |
Definition at line 70 of file netdevice.h.
#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ |
Definition at line 69 of file netdevice.h.
#define NET_XMIT_CN 0x02 /* congestion notification */ |
Definition at line 92 of file netdevice.h.
#define NET_XMIT_DROP 0x01 /* skb dropped */ |
Definition at line 91 of file netdevice.h.
#define net_xmit_errno | ( | e | ) | ((e) != NET_XMIT_CN ? -ENOBUFS : 0) |
Definition at line 100 of file netdevice.h.
#define net_xmit_eval | ( | e | ) | ((e) == NET_XMIT_CN ? 0 : (e)) |
Definition at line 99 of file netdevice.h.
#define NET_XMIT_MASK 0x0f /* qdisc flags in net/sch_generic.h */ |
Definition at line 94 of file netdevice.h.
#define NET_XMIT_POLICED 0x03 /* skb is shot by police */ |
Definition at line 93 of file netdevice.h.
#define NET_XMIT_SUCCESS 0x00 |
Definition at line 90 of file netdevice.h.
#define NETDEV_ALIGN 32 |
Definition at line 1306 of file netdevice.h.
#define NETDEV_BONDING_FAILOVER 0x000C |
Definition at line 1534 of file netdevice.h.
#define NETDEV_BOOT_SETUP_MAX 8 |
Definition at line 295 of file netdevice.h.
#define NETDEV_CHANGE 0x0004 /* Notify device state change */ |
Definition at line 1526 of file netdevice.h.
#define NETDEV_CHANGEADDR 0x0008 |
Definition at line 1530 of file netdevice.h.
#define NETDEV_CHANGEMTU 0x0007 |
Definition at line 1529 of file netdevice.h.
#define NETDEV_CHANGENAME 0x000A |
Definition at line 1532 of file netdevice.h.
#define netdev_dbg | ( | __dev, | |
format, | |||
args... | |||
) |
Definition at line 2733 of file netdevice.h.
#define NETDEV_DOWN 0x0002 |
Definition at line 1524 of file netdevice.h.
#define NETDEV_FEAT_CHANGE 0x000B |
Definition at line 1533 of file netdevice.h.
#define netdev_for_each_mc_addr | ( | ha, | |
dev | |||
) | netdev_hw_addr_list_for_each(ha, &(dev)->mc) |
Definition at line 231 of file netdevice.h.
#define netdev_for_each_uc_addr | ( | ha, | |
dev | |||
) | netdev_hw_addr_list_for_each(ha, &(dev)->uc) |
Definition at line 226 of file netdevice.h.
#define NETDEV_GOING_DOWN 0x0009 |
Definition at line 1531 of file netdevice.h.
Definition at line 219 of file netdevice.h.
#define netdev_hw_addr_list_empty | ( | l | ) | (netdev_hw_addr_list_count(l) == 0) |
Definition at line 220 of file netdevice.h.
#define netdev_hw_addr_list_for_each | ( | ha, | |
l | |||
) | list_for_each_entry(ha, &(l)->list, list) |
Definition at line 221 of file netdevice.h.
#define NETDEV_HW_ADDR_T_LAN 1 |
Definition at line 203 of file netdevice.h.
#define NETDEV_HW_ADDR_T_MULTICAST 5 |
Definition at line 207 of file netdevice.h.
#define NETDEV_HW_ADDR_T_SAN 2 |
Definition at line 204 of file netdevice.h.
#define NETDEV_HW_ADDR_T_SLAVE 3 |
Definition at line 205 of file netdevice.h.
#define NETDEV_HW_ADDR_T_UNICAST 4 |
Definition at line 206 of file netdevice.h.
#define NETDEV_JOIN 0x0014 |
Definition at line 1542 of file netdevice.h.
#define netdev_mc_count | ( | dev | ) | netdev_hw_addr_list_count(&(dev)->mc) |
Definition at line 229 of file netdevice.h.
#define netdev_mc_empty | ( | dev | ) | netdev_hw_addr_list_empty(&(dev)->mc) |
Definition at line 230 of file netdevice.h.
#define NETDEV_NOTIFY_PEERS 0x0013 |
Definition at line 1541 of file netdevice.h.
#define NETDEV_POST_INIT 0x0010 |
Definition at line 1538 of file netdevice.h.
#define NETDEV_POST_TYPE_CHANGE 0x000F |
Definition at line 1537 of file netdevice.h.
#define NETDEV_PRE_TYPE_CHANGE 0x000E |
Definition at line 1536 of file netdevice.h.
#define NETDEV_PRE_UP 0x000D |
Definition at line 1535 of file netdevice.h.
#define NETDEV_REBOOT |
Definition at line 1525 of file netdevice.h.
#define NETDEV_REGISTER 0x0005 |
Definition at line 1527 of file netdevice.h.
#define NETDEV_RELEASE 0x0012 |
Definition at line 1540 of file netdevice.h.
#define NETDEV_TX_MASK 0xf0 |
Definition at line 103 of file netdevice.h.
#define netdev_uc_count | ( | dev | ) | netdev_hw_addr_list_count(&(dev)->uc) |
Definition at line 224 of file netdevice.h.
#define netdev_uc_empty | ( | dev | ) | netdev_hw_addr_list_empty(&(dev)->uc) |
Definition at line 225 of file netdevice.h.
#define NETDEV_UNREGISTER 0x0006 |
Definition at line 1528 of file netdevice.h.
#define NETDEV_UNREGISTER_FINAL 0x0011 |
Definition at line 1539 of file netdevice.h.
#define NETDEV_UP 0x0001 /* For now you can't veto a device up/down */ |
Definition at line 1523 of file netdevice.h.
Definition at line 2745 of file netdevice.h.
#define netdev_WARN | ( | dev, | |
format, | |||
args... | |||
) | WARN(1, "netdevice: %s\n" format, netdev_name(dev), ##args); |
Definition at line 2758 of file netdevice.h.
#define netif_alert | ( | priv, | |
type, | |||
dev, | |||
fmt, | |||
args... | |||
) | netif_level(alert, priv, type, dev, fmt, ##args) |
Definition at line 2777 of file netdevice.h.
#define netif_crit | ( | priv, | |
type, | |||
dev, | |||
fmt, | |||
args... | |||
) | netif_level(crit, priv, type, dev, fmt, ##args) |
Definition at line 2779 of file netdevice.h.
Definition at line 2800 of file netdevice.h.
#define netif_emerg | ( | priv, | |
type, | |||
dev, | |||
fmt, | |||
args... | |||
) | netif_level(emerg, priv, type, dev, fmt, ##args) |
Definition at line 2775 of file netdevice.h.
Definition at line 2781 of file netdevice.h.
#define netif_info | ( | priv, | |
type, | |||
dev, | |||
fmt, | |||
args... | |||
) | netif_level(info, priv, type, dev, fmt, ##args) |
Definition at line 2787 of file netdevice.h.
#define netif_msg_drv | ( | p | ) | ((p)->msg_enable & NETIF_MSG_DRV) |
Definition at line 2327 of file netdevice.h.
#define netif_msg_hw | ( | p | ) | ((p)->msg_enable & NETIF_MSG_HW) |
Definition at line 2340 of file netdevice.h.
#define netif_msg_ifdown | ( | p | ) | ((p)->msg_enable & NETIF_MSG_IFDOWN) |
Definition at line 2331 of file netdevice.h.
#define netif_msg_ifup | ( | p | ) | ((p)->msg_enable & NETIF_MSG_IFUP) |
Definition at line 2332 of file netdevice.h.
#define netif_msg_intr | ( | p | ) | ((p)->msg_enable & NETIF_MSG_INTR) |
Definition at line 2336 of file netdevice.h.
#define netif_msg_link | ( | p | ) | ((p)->msg_enable & NETIF_MSG_LINK) |
Definition at line 2329 of file netdevice.h.
#define netif_msg_pktdata | ( | p | ) | ((p)->msg_enable & NETIF_MSG_PKTDATA) |
Definition at line 2339 of file netdevice.h.
#define netif_msg_probe | ( | p | ) | ((p)->msg_enable & NETIF_MSG_PROBE) |
Definition at line 2328 of file netdevice.h.
#define netif_msg_rx_err | ( | p | ) | ((p)->msg_enable & NETIF_MSG_RX_ERR) |
Definition at line 2333 of file netdevice.h.
#define netif_msg_rx_status | ( | p | ) | ((p)->msg_enable & NETIF_MSG_RX_STATUS) |
Definition at line 2338 of file netdevice.h.
#define netif_msg_timer | ( | p | ) | ((p)->msg_enable & NETIF_MSG_TIMER) |
Definition at line 2330 of file netdevice.h.
#define netif_msg_tx_done | ( | p | ) | ((p)->msg_enable & NETIF_MSG_TX_DONE) |
Definition at line 2337 of file netdevice.h.
#define netif_msg_tx_err | ( | p | ) | ((p)->msg_enable & NETIF_MSG_TX_ERR) |
Definition at line 2334 of file netdevice.h.
#define netif_msg_tx_queued | ( | p | ) | ((p)->msg_enable & NETIF_MSG_TX_QUEUED) |
Definition at line 2335 of file netdevice.h.
#define netif_msg_wol | ( | p | ) | ((p)->msg_enable & NETIF_MSG_WOL) |
Definition at line 2341 of file netdevice.h.
#define netif_notice | ( | priv, | |
type, | |||
dev, | |||
fmt, | |||
args... | |||
) | netif_level(notice, priv, type, dev, fmt, ##args) |
Definition at line 2785 of file netdevice.h.
Definition at line 2811 of file netdevice.h.
#define netif_warn | ( | priv, | |
type, | |||
dev, | |||
fmt, | |||
args... | |||
) | netif_level(warn, priv, type, dev, fmt, ##args) |
Definition at line 2783 of file netdevice.h.
#define QUEUE_STATE_ANY_XOFF |
Definition at line 495 of file netdevice.h.
#define QUEUE_STATE_ANY_XOFF_OR_FROZEN |
Definition at line 497 of file netdevice.h.
#define SET_ETHTOOL_OPS | ( | netdev, | |
ops | |||
) | ( (netdev)->ethtool_ops = (ops) ) |
Definition at line 60 of file netdevice.h.
#define SET_NETDEV_DEV | ( | net, | |
pdev | |||
) | ((net)->dev.parent = (pdev)) |
Definition at line 1433 of file netdevice.h.
Definition at line 1439 of file netdevice.h.
#define TC_BITMASK 15 |
Definition at line 675 of file netdevice.h.
#define TC_MAX_QUEUE 16 |
Definition at line 674 of file netdevice.h.
#define to_net_dev | ( | d | ) | container_of(d, struct net_device, dev) |
Definition at line 1304 of file netdevice.h.
Definition at line 1714 of file netdevice.h.
typedef enum gro_result gro_result_t |
Definition at line 338 of file netdevice.h.
typedef enum netdev_tx netdev_tx_t |
Definition at line 111 of file netdevice.h.
typedef rx_handler_result_t rx_handler_func_t(struct sk_buff **pskb) |
Definition at line 388 of file netdevice.h.
typedef enum rx_handler_result rx_handler_result_t |
Definition at line 387 of file netdevice.h.
anonymous enum |
Definition at line 325 of file netdevice.h.
anonymous enum |
Definition at line 2309 of file netdevice.h.
enum gro_result |
Definition at line 331 of file netdevice.h.
enum netdev_queue_state_t |
Definition at line 491 of file netdevice.h.
enum netdev_state_t |
__LINK_STATE_START | |
__LINK_STATE_PRESENT | |
__LINK_STATE_NOCARRIER | |
__LINK_STATE_LINKWATCH_PENDING | |
__LINK_STATE_DORMANT |
Definition at line 278 of file netdevice.h.
enum netdev_tx |
Definition at line 105 of file netdevice.h.
enum rx_handler_result |
Definition at line 381 of file netdevice.h.
int __dev_change_flags | ( | struct net_device * | , |
unsigned int | flags | ||
) |
|
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 .
|
read |
void __dev_notify_flags | ( | struct net_device * | , |
unsigned int | old_flags | ||
) |
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.
void __dev_set_rx_mode | ( | struct net_device * | dev | ) |
int __hw_addr_add_multiple | ( | struct netdev_hw_addr_list * | to_list, |
struct netdev_hw_addr_list * | from_list, | ||
int | addr_len, | ||
unsigned char | addr_type | ||
) |
Definition at line 115 of file dev_addr_lists.c.
void __hw_addr_del_multiple | ( | struct netdev_hw_addr_list * | to_list, |
struct netdev_hw_addr_list * | from_list, | ||
int | addr_len, | ||
unsigned char | addr_type | ||
) |
Definition at line 142 of file dev_addr_lists.c.
void __hw_addr_flush | ( | struct netdev_hw_addr_list * | list | ) |
Definition at line 198 of file dev_addr_lists.c.
void __hw_addr_init | ( | struct netdev_hw_addr_list * | list | ) |
Definition at line 210 of file dev_addr_lists.c.
int __hw_addr_sync | ( | struct netdev_hw_addr_list * | to_list, |
struct netdev_hw_addr_list * | from_list, | ||
int | addr_len | ||
) |
Definition at line 156 of file dev_addr_lists.c.
void __hw_addr_unsync | ( | struct netdev_hw_addr_list * | to_list, |
struct netdev_hw_addr_list * | from_list, | ||
int | addr_len | ||
) |
Definition at line 180 of file dev_addr_lists.c.
void __napi_complete | ( | struct napi_struct * | n | ) |
void __napi_schedule | ( | struct napi_struct * | n | ) |
int __netdev_update_features | ( | struct net_device * | dev | ) |
void __netdev_watchdog_up | ( | struct net_device * | dev | ) |
Definition at line 269 of file sch_generic.c.
__printf | ( | 3 | , |
4 | |||
) | const |
struct net_device const char __printf | ( | 2 | , |
3 | |||
) | const |
|
read |
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().
DECLARE_PER_CPU_ALIGNED | ( | struct softnet_data | , |
softnet_data | |||
) |
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).
int dev_addr_add_multiple | ( | struct net_device * | to_dev, |
struct net_device * | from_dev, | ||
unsigned char | addr_type | ||
) |
dev_addr_add_multiple - Add device addresses from another device : device to which addresses will be added : device from which addresses will be added : address type - 0 means type will be used from from_dev
Add device addresses of the one device to another.
The caller must hold the rtnl_mutex.
Definition at line 344 of file dev_addr_lists.c.
int dev_addr_del_multiple | ( | struct net_device * | to_dev, |
struct net_device * | from_dev, | ||
unsigned char | addr_type | ||
) |
dev_addr_del_multiple - Delete device addresses by another device : device where the addresses will be deleted : device supplying the addresses to be deleted : address type - 0 means type will be used from from_dev
Deletes addresses in to device by the list of addresses in from device.
The caller must hold the rtnl_mutex.
Definition at line 372 of file dev_addr_lists.c.
void dev_addr_flush | ( | struct net_device * | dev | ) |
dev_addr_flush - Flush device address list : device
Flush device address list and reset ->dev_addr.
The caller must hold the rtnl_mutex.
Definition at line 229 of file dev_addr_lists.c.
int dev_addr_init | ( | struct net_device * | dev | ) |
dev_addr_init - Init device address list : device
Init device address list and create the first element, used by ->dev_addr.
The caller must hold the rtnl_mutex.
Definition at line 247 of file dev_addr_lists.c.
int dev_alloc_name | ( | struct net_device * | dev, |
const char * | name | ||
) |
int dev_change_flags | ( | struct net_device * | dev, |
unsigned int | flags | ||
) |
int dev_change_name | ( | struct net_device * | dev, |
const char * | newname | ||
) |
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.
int dev_close | ( | struct net_device * | dev | ) |
void dev_disable_lro | ( | struct net_device * | dev | ) |
int dev_forward_skb | ( | struct net_device * | dev, |
struct sk_buff * | skb | ||
) |
dev_forward_skb - loopback an skb to another netif
: destination network device : buffer to forward
return values: NET_RX_SUCCESS (no congestion) NET_RX_DROP (packet was dropped, but freed)
dev_forward_skb can be used for injecting an skb from the start_xmit function of one device into the receive queue of another device.
The receiving device may be in another namespace, so we have to clear all information in the skb that could impact namespace isolation.
|
read |
dev_get_by_flags_rcu - 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. Must be called inside rcu_read_lock(), and result refcount is unchanged.
|
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.
|
read |
dev_get_by_index_rcu - 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 RCU lock.
unsigned int dev_get_flags | ( | const struct net_device * | dev | ) |
|
read |
dev_get_stats - get network device statistics : device to get statistics from : place to store stats
Get network statistics from device. Return . The device driver may provide its own method by setting dev->netdev_ops->get_stats64 or dev->netdev_ops->get_stats; otherwise the internal statistics structure is used.
|
read |
dev_getbyhwaddr_rcu - 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 RCU or RTNL. The returned device has not had its ref count increased and the caller must therefore be careful about locking
|
read |
gro_result_t dev_gro_receive | ( | struct napi_struct * | napi, |
struct sk_buff * | skb | ||
) |
int dev_hard_start_xmit | ( | struct sk_buff * | skb, |
struct net_device * | dev, | ||
struct netdev_queue * | txq | ||
) |
dev_ioctl - network device ioctl : the applicable net namespace : command to issue
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.
int dev_mc_add | ( | struct net_device * | dev, |
const unsigned char * | addr | ||
) |
dev_mc_add - Add a multicast address : device : address to add
Add a multicast address to the device or increase the reference count if it already exists.
Definition at line 593 of file dev_addr_lists.c.
int dev_mc_add_excl | ( | struct net_device * | dev, |
const unsigned char * | addr | ||
) |
dev_mc_add_excl - Add a global secondary multicast address : device : address to add
Definition at line 549 of file dev_addr_lists.c.
int dev_mc_add_global | ( | struct net_device * | dev, |
const unsigned char * | addr | ||
) |
dev_mc_add_global - Add a global multicast address : device : address to add
Add a global multicast address to the device.
Definition at line 606 of file dev_addr_lists.c.
int dev_mc_del | ( | struct net_device * | dev, |
const unsigned char * | addr | ||
) |
dev_mc_del - Delete a multicast address. : device : address to delete
Release reference to a multicast address and remove it from the device if the reference count drops to zero.
Definition at line 634 of file dev_addr_lists.c.
int dev_mc_del_global | ( | struct net_device * | dev, |
const unsigned char * | addr | ||
) |
dev_mc_del_global - Delete a global multicast address. : device : address to delete
Release reference to a multicast address and remove it from the device if the reference count drops to zero.
Definition at line 648 of file dev_addr_lists.c.
void dev_mc_flush | ( | struct net_device * | dev | ) |
dev_mc_flush - Flush multicast addresses : device
Flush multicast addresses.
Definition at line 711 of file dev_addr_lists.c.
void dev_mc_init | ( | struct net_device * | dev | ) |
dev_mc_flush - Init multicast address list : device
Init multicast address list.
Definition at line 725 of file dev_addr_lists.c.
int dev_mc_sync | ( | struct net_device * | to, |
struct net_device * | from | ||
) |
dev_mc_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 ndo_set_rx_mode function of layered software devices.
Definition at line 666 of file dev_addr_lists.c.
void dev_mc_unsync | ( | struct net_device * | to, |
struct net_device * | from | ||
) |
dev_mc_unsync - Remove synchronized addresses from the destination device : destination device : source device
Remove all addresses that were added to the destination device by dev_mc_sync(). This function is intended to be called from the dev->stop function of layered software devices.
Definition at line 691 of file dev_addr_lists.c.
Definition at line 798 of file dev_addr_lists.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.
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.
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
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.
int dev_restart | ( | struct net_device * | dev | ) |
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.
void dev_set_group | ( | struct net_device * | dev, |
int | new_group | ||
) |
int dev_set_mac_address | ( | struct net_device * | dev, |
struct sockaddr * | sa | ||
) |
int dev_set_mtu | ( | struct net_device * | dev, |
int | new_mtu | ||
) |
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.
void dev_set_rx_mode | ( | struct net_device * | dev | ) |
unsigned long dev_trans_start | ( | struct net_device * | dev | ) |
Definition at line 208 of file sch_generic.c.
int dev_uc_add | ( | struct net_device * | dev, |
const unsigned char * | addr | ||
) |
dev_uc_add - Add a secondary unicast address : device : address to add
Add a secondary unicast address to the device or increase the reference count if it already exists.
Definition at line 427 of file dev_addr_lists.c.
int dev_uc_add_excl | ( | struct net_device * | dev, |
const unsigned char * | addr | ||
) |
dev_uc_add_excl - Add a global secondary unicast address : device : address to add
Definition at line 396 of file dev_addr_lists.c.
int dev_uc_del | ( | struct net_device * | dev, |
const unsigned char * | addr | ||
) |
dev_uc_del - Release secondary unicast address. : device : address to delete
Release reference to a secondary unicast address and remove it from the device if the reference count drops to zero.
Definition at line 449 of file dev_addr_lists.c.
void dev_uc_flush | ( | struct net_device * | dev | ) |
dev_uc_flush - Flush unicast addresses : device
Flush unicast addresses.
Definition at line 520 of file dev_addr_lists.c.
void dev_uc_init | ( | struct net_device * | dev | ) |
dev_uc_flush - Init unicast address list : device
Init unicast address list.
Definition at line 534 of file dev_addr_lists.c.
int dev_uc_sync | ( | struct net_device * | to, |
struct net_device * | from | ||
) |
dev_uc_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 475 of file dev_addr_lists.c.
void dev_uc_unsync | ( | struct net_device * | to, |
struct net_device * | from | ||
) |
dev_uc_unsync - Remove synchronized addresses from the destination device : destination device : source device
Remove all addresses that were added to the destination device by dev_uc_sync(). This function is intended to be called from the dev->stop function of layered software devices.
Definition at line 500 of file dev_addr_lists.c.
void ether_setup | ( | struct net_device * | dev | ) |
void free_netdev | ( | struct net_device * | dev | ) |
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.
void linkwatch_fire_event | ( | struct net_device * | dev | ) |
Definition at line 239 of file link_watch.c.
void linkwatch_forget_dev | ( | struct net_device * | dev | ) |
Definition at line 208 of file link_watch.c.
void linkwatch_init_dev | ( | struct net_device * | dev | ) |
Definition at line 79 of file link_watch.c.
Definition at line 225 of file link_watch.c.
void napi_complete | ( | struct napi_struct * | n | ) |
gro_result_t napi_frags_finish | ( | struct napi_struct * | napi, |
struct sk_buff * | skb, | ||
gro_result_t | ret | ||
) |
|
read |
void napi_gro_flush | ( | struct napi_struct * | napi, |
bool | flush_old | ||
) |
gro_result_t napi_gro_frags | ( | struct napi_struct * | napi | ) |
gro_result_t napi_gro_receive | ( | struct napi_struct * | napi, |
struct sk_buff * | skb | ||
) |
gro_result_t napi_skb_finish | ( | gro_result_t | ret, |
struct sk_buff * | skb | ||
) |
int netdev_boot_setup_check | ( | struct net_device * | dev | ) |
void netdev_change_features | ( | struct net_device * | dev | ) |
netdev_change_features - recalculate device features : the device to check
Recalculate dev->features set and send notifications even if they have not changed. Should be called instead of netdev_update_features() if also dev->vlan_features might have changed to allow the changes to be propagated to stacked VLAN devices.
int netdev_class_create_file | ( | struct class_attribute * | class_attr | ) |
Definition at line 1447 of file net-sysfs.c.
void netdev_class_remove_file | ( | struct class_attribute * | class_attr | ) |
Definition at line 1453 of file net-sysfs.c.
const char* netdev_drivername | ( | const struct net_device * | dev | ) |
void netdev_features_change | ( | struct net_device * | dev | ) |
netdev_features_t netdev_increment_features | ( | netdev_features_t | all, |
netdev_features_t | one, | ||
netdev_features_t | 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.
void netdev_notify_peers | ( | struct net_device * | dev | ) |
netdev_notify_peers - notify network peers about existence of @dev @dev: network device
Generate traffic such that interested network peers are aware of , such as by generating a gratuitous ARP. This may be used when a device wants to inform the rest of the network about some sort of reconfiguration such as a failover event or virtual machine migration.
|
read |
void netdev_resync_ops | ( | struct net_device * | dev | ) |
int netdev_rx_handler_register | ( | struct net_device * | dev, |
rx_handler_func_t * | rx_handler, | ||
void * | rx_handler_data | ||
) |
netdev_rx_handler_register - register receive handler : device to register a handler for : receive handler to register : data pointer that is used by rx handler
Register a receive hander for a device. This handler will then be called from __netif_receive_skb. A negative errno code is returned on a failure.
The caller must hold the rtnl_mutex.
For a general description of rx_handler, see enum rx_handler_result.
void netdev_rx_handler_unregister | ( | struct net_device * | dev | ) |
int netdev_set_bond_master | ( | struct net_device * | slave, |
struct net_device * | master | ||
) |
netdev_set_bond_master - set up bonding 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 RTM_NEWLINK is sent to the routing socket and the function returns zero.
int netdev_set_master | ( | struct net_device * | slave, |
struct net_device * | master | ||
) |
netdev_set_master - set up master pointer : 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 and the function returns zero.
void netdev_state_change | ( | struct net_device * | dev | ) |
void netdev_stats_to_stats64 | ( | struct rtnl_link_stats64 * | stats64, |
const struct net_device_stats * | netdev_stats | ||
) |
void netdev_update_features | ( | struct net_device * | dev | ) |
void netif_carrier_off | ( | struct net_device * | dev | ) |
netif_carrier_off - clear carrier : network device
Device has detected loss of carrier.
Definition at line 317 of file sch_generic.c.
void netif_carrier_on | ( | struct net_device * | dev | ) |
netif_carrier_on - set carrier : network device
Device has detected that carrier.
Definition at line 299 of file sch_generic.c.
void netif_device_attach | ( | struct net_device * | dev | ) |
void netif_device_detach | ( | struct net_device * | dev | ) |
void netif_napi_add | ( | struct net_device * | dev, |
struct napi_struct * | napi, | ||
int(*)(struct napi_struct *, int) | poll, | ||
int | weight | ||
) |
netif_napi_add - initialize a napi context : network device : napi context : polling function : default weight
netif_napi_add() must be used to initialize a napi context prior to calling any of the other napi related functions.
void netif_napi_del | ( | struct napi_struct * | napi | ) |
netif_napi_del - remove a napi context : napi context
netif_napi_del() removes a napi context from the network device napi list
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
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)
int netif_set_real_num_tx_queues | ( | struct net_device * | dev, |
unsigned int | txq | ||
) |
netdev_features_t netif_skb_features | ( | struct sk_buff * | skb | ) |
void netif_stacked_transfer_operstate | ( | const struct net_device * | rootdev, |
struct net_device * | dev | ||
) |
netif_stacked_transfer_operstate - transfer operstate : the root or lower level device to transfer state from : the device to transfer operstate to
Transfer operational state from root to device. This is normally called when a stacking relationship exists between the root device and the device(a leaf device).
int register_gifconf | ( | unsigned int | family, |
gifconf_func_t * | gifconf | ||
) |
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.
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.
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.
|
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.
void unregister_netdev | ( | struct net_device * | dev | ) |
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.
After unregistering unregister and down device events are synthesized for all devices on the device list to the removed notifier to remove the need for special case cleanup code.
void unregister_netdevice_queue | ( | struct net_device * | dev, |
struct list_head * | head | ||
) |
unregister_netdevice_queue - remove device from the kernel : device : list
This function shuts down a device interface and removes it from the kernel tables. If head not NULL, device is queued to be unregistered later.
Callers must hold the rtnl semaphore. You may want unregister_netdev() instead of this.
struct netdev_queue ____cacheline_aligned_in_smp |
int bpf_jit_enable |
struct net_device* dev |
Definition at line 2704 of file netdevice.h.
rwlock_t dev_base_lock |
struct net_device const char const char const char const char const char const char const char const char* format |
Definition at line 2704 of file netdevice.h.
struct pernet_operations __net_initdata loopback_net_ops |
Definition at line 214 of file loopback.c.
struct kobj_ns_type_operations net_ns_type_operations |
Definition at line 1325 of file net-sysfs.c.
int netdev_budget |
int netdev_max_backlog |
int netdev_tstamp_prequeue |
int weight_p |