aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h525
1 files changed, 297 insertions, 228 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 041b42a305f6..7f0ed423a360 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -60,8 +60,8 @@ struct wireless_dev;
60#define SET_ETHTOOL_OPS(netdev,ops) \ 60#define SET_ETHTOOL_OPS(netdev,ops) \
61 ( (netdev)->ethtool_ops = (ops) ) 61 ( (netdev)->ethtool_ops = (ops) )
62 62
63extern void netdev_set_default_ethtool_ops(struct net_device *dev, 63void netdev_set_default_ethtool_ops(struct net_device *dev,
64 const struct ethtool_ops *ops); 64 const struct ethtool_ops *ops);
65 65
66/* hardware address assignment types */ 66/* hardware address assignment types */
67#define NET_ADDR_PERM 0 /* address is permanent (default) */ 67#define NET_ADDR_PERM 0 /* address is permanent (default) */
@@ -298,7 +298,7 @@ struct netdev_boot_setup {
298}; 298};
299#define NETDEV_BOOT_SETUP_MAX 8 299#define NETDEV_BOOT_SETUP_MAX 8
300 300
301extern int __init netdev_boot_setup(char *str); 301int __init netdev_boot_setup(char *str);
302 302
303/* 303/*
304 * Structure for NAPI scheduling similar to tasklet but with weighting 304 * Structure for NAPI scheduling similar to tasklet but with weighting
@@ -394,7 +394,7 @@ enum rx_handler_result {
394typedef enum rx_handler_result rx_handler_result_t; 394typedef enum rx_handler_result rx_handler_result_t;
395typedef rx_handler_result_t rx_handler_func_t(struct sk_buff **pskb); 395typedef rx_handler_result_t rx_handler_func_t(struct sk_buff **pskb);
396 396
397extern void __napi_schedule(struct napi_struct *n); 397void __napi_schedule(struct napi_struct *n);
398 398
399static inline bool napi_disable_pending(struct napi_struct *n) 399static inline bool napi_disable_pending(struct napi_struct *n)
400{ 400{
@@ -445,8 +445,8 @@ static inline bool napi_reschedule(struct napi_struct *napi)
445 * 445 *
446 * Mark NAPI processing as complete. 446 * Mark NAPI processing as complete.
447 */ 447 */
448extern void __napi_complete(struct napi_struct *n); 448void __napi_complete(struct napi_struct *n);
449extern void napi_complete(struct napi_struct *n); 449void napi_complete(struct napi_struct *n);
450 450
451/** 451/**
452 * napi_by_id - lookup a NAPI by napi_id 452 * napi_by_id - lookup a NAPI by napi_id
@@ -455,7 +455,7 @@ extern void napi_complete(struct napi_struct *n);
455 * lookup @napi_id in napi_hash table 455 * lookup @napi_id in napi_hash table
456 * must be called under rcu_read_lock() 456 * must be called under rcu_read_lock()
457 */ 457 */
458extern struct napi_struct *napi_by_id(unsigned int napi_id); 458struct napi_struct *napi_by_id(unsigned int napi_id);
459 459
460/** 460/**
461 * napi_hash_add - add a NAPI to global hashtable 461 * napi_hash_add - add a NAPI to global hashtable
@@ -463,7 +463,7 @@ extern struct napi_struct *napi_by_id(unsigned int napi_id);
463 * 463 *
464 * generate a new napi_id and store a @napi under it in napi_hash 464 * generate a new napi_id and store a @napi under it in napi_hash
465 */ 465 */
466extern void napi_hash_add(struct napi_struct *napi); 466void napi_hash_add(struct napi_struct *napi);
467 467
468/** 468/**
469 * napi_hash_del - remove a NAPI from global table 469 * napi_hash_del - remove a NAPI from global table
@@ -472,7 +472,7 @@ extern void napi_hash_add(struct napi_struct *napi);
472 * Warning: caller must observe rcu grace period 472 * Warning: caller must observe rcu grace period
473 * before freeing memory containing @napi 473 * before freeing memory containing @napi
474 */ 474 */
475extern void napi_hash_del(struct napi_struct *napi); 475void napi_hash_del(struct napi_struct *napi);
476 476
477/** 477/**
478 * napi_disable - prevent NAPI from scheduling 478 * napi_disable - prevent NAPI from scheduling
@@ -483,6 +483,7 @@ extern void napi_hash_del(struct napi_struct *napi);
483 */ 483 */
484static inline void napi_disable(struct napi_struct *n) 484static inline void napi_disable(struct napi_struct *n)
485{ 485{
486 might_sleep();
486 set_bit(NAPI_STATE_DISABLE, &n->state); 487 set_bit(NAPI_STATE_DISABLE, &n->state);
487 while (test_and_set_bit(NAPI_STATE_SCHED, &n->state)) 488 while (test_and_set_bit(NAPI_STATE_SCHED, &n->state))
488 msleep(1); 489 msleep(1);
@@ -664,8 +665,8 @@ static inline void rps_reset_sock_flow(struct rps_sock_flow_table *table,
664extern struct rps_sock_flow_table __rcu *rps_sock_flow_table; 665extern struct rps_sock_flow_table __rcu *rps_sock_flow_table;
665 666
666#ifdef CONFIG_RFS_ACCEL 667#ifdef CONFIG_RFS_ACCEL
667extern bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, 668bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id,
668 u32 flow_id, u16 filter_id); 669 u16 filter_id);
669#endif 670#endif
670 671
671/* This structure contains an instance of an RX queue. */ 672/* This structure contains an instance of an RX queue. */
@@ -950,17 +951,36 @@ struct netdev_phys_port_id {
950 * multiple net devices on single physical port. 951 * multiple net devices on single physical port.
951 * 952 *
952 * void (*ndo_add_vxlan_port)(struct net_device *dev, 953 * void (*ndo_add_vxlan_port)(struct net_device *dev,
953 * sa_family_t sa_family, __u16 port); 954 * sa_family_t sa_family, __be16 port);
954 * Called by vxlan to notiy a driver about the UDP port and socket 955 * Called by vxlan to notiy a driver about the UDP port and socket
955 * address family that vxlan is listnening to. It is called only when 956 * address family that vxlan is listnening to. It is called only when
956 * a new port starts listening. The operation is protected by the 957 * a new port starts listening. The operation is protected by the
957 * vxlan_net->sock_lock. 958 * vxlan_net->sock_lock.
958 * 959 *
959 * void (*ndo_del_vxlan_port)(struct net_device *dev, 960 * void (*ndo_del_vxlan_port)(struct net_device *dev,
960 * sa_family_t sa_family, __u16 port); 961 * sa_family_t sa_family, __be16 port);
961 * Called by vxlan to notify the driver about a UDP port and socket 962 * Called by vxlan to notify the driver about a UDP port and socket
962 * address family that vxlan is not listening to anymore. The operation 963 * address family that vxlan is not listening to anymore. The operation
963 * is protected by the vxlan_net->sock_lock. 964 * is protected by the vxlan_net->sock_lock.
965 *
966 * void* (*ndo_dfwd_add_station)(struct net_device *pdev,
967 * struct net_device *dev)
968 * Called by upper layer devices to accelerate switching or other
969 * station functionality into hardware. 'pdev is the lowerdev
970 * to use for the offload and 'dev' is the net device that will
971 * back the offload. Returns a pointer to the private structure
972 * the upper layer will maintain.
973 * void (*ndo_dfwd_del_station)(struct net_device *pdev, void *priv)
974 * Called by upper layer device to delete the station created
975 * by 'ndo_dfwd_add_station'. 'pdev' is the net device backing
976 * the station and priv is the structure returned by the add
977 * operation.
978 * netdev_tx_t (*ndo_dfwd_start_xmit)(struct sk_buff *skb,
979 * struct net_device *dev,
980 * void *priv);
981 * Callback to use for xmit over the accelerated station. This
982 * is used in place of ndo_start_xmit on accelerated net
983 * devices.
964 */ 984 */
965struct net_device_ops { 985struct net_device_ops {
966 int (*ndo_init)(struct net_device *dev); 986 int (*ndo_init)(struct net_device *dev);
@@ -1093,10 +1113,19 @@ struct net_device_ops {
1093 struct netdev_phys_port_id *ppid); 1113 struct netdev_phys_port_id *ppid);
1094 void (*ndo_add_vxlan_port)(struct net_device *dev, 1114 void (*ndo_add_vxlan_port)(struct net_device *dev,
1095 sa_family_t sa_family, 1115 sa_family_t sa_family,
1096 __u16 port); 1116 __be16 port);
1097 void (*ndo_del_vxlan_port)(struct net_device *dev, 1117 void (*ndo_del_vxlan_port)(struct net_device *dev,
1098 sa_family_t sa_family, 1118 sa_family_t sa_family,
1099 __u16 port); 1119 __be16 port);
1120
1121 void* (*ndo_dfwd_add_station)(struct net_device *pdev,
1122 struct net_device *dev);
1123 void (*ndo_dfwd_del_station)(struct net_device *pdev,
1124 void *priv);
1125
1126 netdev_tx_t (*ndo_dfwd_start_xmit) (struct sk_buff *skb,
1127 struct net_device *dev,
1128 void *priv);
1100}; 1129};
1101 1130
1102/* 1131/*
@@ -1131,7 +1160,7 @@ struct net_device {
1131 unsigned long mem_end; /* shared mem end */ 1160 unsigned long mem_end; /* shared mem end */
1132 unsigned long mem_start; /* shared mem start */ 1161 unsigned long mem_start; /* shared mem start */
1133 unsigned long base_addr; /* device I/O address */ 1162 unsigned long base_addr; /* device I/O address */
1134 unsigned int irq; /* device IRQ number */ 1163 int irq; /* device IRQ number */
1135 1164
1136 /* 1165 /*
1137 * Some hardware also needs these fields, but they are not 1166 * Some hardware also needs these fields, but they are not
@@ -1143,8 +1172,19 @@ struct net_device {
1143 struct list_head dev_list; 1172 struct list_head dev_list;
1144 struct list_head napi_list; 1173 struct list_head napi_list;
1145 struct list_head unreg_list; 1174 struct list_head unreg_list;
1146 struct list_head upper_dev_list; /* List of upper devices */ 1175 struct list_head close_list;
1147 struct list_head lower_dev_list; 1176
1177 /* directly linked devices, like slaves for bonding */
1178 struct {
1179 struct list_head upper;
1180 struct list_head lower;
1181 } adj_list;
1182
1183 /* all linked devices, *including* neighbours */
1184 struct {
1185 struct list_head upper;
1186 struct list_head lower;
1187 } all_adj_list;
1148 1188
1149 1189
1150 /* currently active device features */ 1190 /* currently active device features */
@@ -1183,6 +1223,7 @@ struct net_device {
1183 /* Management operations */ 1223 /* Management operations */
1184 const struct net_device_ops *netdev_ops; 1224 const struct net_device_ops *netdev_ops;
1185 const struct ethtool_ops *ethtool_ops; 1225 const struct ethtool_ops *ethtool_ops;
1226 const struct forwarding_accel_ops *fwd_ops;
1186 1227
1187 /* Hardware header description */ 1228 /* Hardware header description */
1188 const struct header_ops *header_ops; 1229 const struct header_ops *header_ops;
@@ -1487,9 +1528,9 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev,
1487 f(dev, &dev->_tx[i], arg); 1528 f(dev, &dev->_tx[i], arg);
1488} 1529}
1489 1530
1490extern struct netdev_queue *netdev_pick_tx(struct net_device *dev, 1531struct netdev_queue *netdev_pick_tx(struct net_device *dev,
1491 struct sk_buff *skb); 1532 struct sk_buff *skb);
1492extern u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb); 1533u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb);
1493 1534
1494/* 1535/*
1495 * Net namespace inlines 1536 * Net namespace inlines
@@ -1546,7 +1587,7 @@ static inline void *netdev_priv(const struct net_device *dev)
1546#define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev)) 1587#define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev))
1547 1588
1548/* Set the sysfs device type for the network logical device to allow 1589/* Set the sysfs device type for the network logical device to allow
1549 * fin grained indentification of different network device types. For 1590 * fine-grained identification of different network device types. For
1550 * example Ethernet, Wirelss LAN, Bluetooth, WiMAX etc. 1591 * example Ethernet, Wirelss LAN, Bluetooth, WiMAX etc.
1551 */ 1592 */
1552#define SET_NETDEV_DEVTYPE(net, devtype) ((net)->dev.type = (devtype)) 1593#define SET_NETDEV_DEVTYPE(net, devtype) ((net)->dev.type = (devtype))
@@ -1673,8 +1714,8 @@ struct packet_offload {
1673#define NETDEV_CHANGEUPPER 0x0015 1714#define NETDEV_CHANGEUPPER 0x0015
1674#define NETDEV_RESEND_IGMP 0x0016 1715#define NETDEV_RESEND_IGMP 0x0016
1675 1716
1676extern int register_netdevice_notifier(struct notifier_block *nb); 1717int register_netdevice_notifier(struct notifier_block *nb);
1677extern int unregister_netdevice_notifier(struct notifier_block *nb); 1718int unregister_netdevice_notifier(struct notifier_block *nb);
1678 1719
1679struct netdev_notifier_info { 1720struct netdev_notifier_info {
1680 struct net_device *dev; 1721 struct net_device *dev;
@@ -1697,9 +1738,9 @@ netdev_notifier_info_to_dev(const struct netdev_notifier_info *info)
1697 return info->dev; 1738 return info->dev;
1698} 1739}
1699 1740
1700extern int call_netdevice_notifiers_info(unsigned long val, struct net_device *dev, 1741int call_netdevice_notifiers_info(unsigned long val, struct net_device *dev,
1701 struct netdev_notifier_info *info); 1742 struct netdev_notifier_info *info);
1702extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); 1743int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
1703 1744
1704 1745
1705extern rwlock_t dev_base_lock; /* Device list lock */ 1746extern rwlock_t dev_base_lock; /* Device list lock */
@@ -1754,54 +1795,53 @@ static inline struct net_device *first_net_device_rcu(struct net *net)
1754 return lh == &net->dev_base_head ? NULL : net_device_entry(lh); 1795 return lh == &net->dev_base_head ? NULL : net_device_entry(lh);
1755} 1796}
1756 1797
1757extern int netdev_boot_setup_check(struct net_device *dev); 1798int netdev_boot_setup_check(struct net_device *dev);
1758extern unsigned long netdev_boot_base(const char *prefix, int unit); 1799unsigned long netdev_boot_base(const char *prefix, int unit);
1759extern struct net_device *dev_getbyhwaddr_rcu(struct net *net, unsigned short type, 1800struct net_device *dev_getbyhwaddr_rcu(struct net *net, unsigned short type,
1760 const char *hwaddr); 1801 const char *hwaddr);
1761extern struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type); 1802struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type);
1762extern struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short type); 1803struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short type);
1763extern void dev_add_pack(struct packet_type *pt); 1804void dev_add_pack(struct packet_type *pt);
1764extern void dev_remove_pack(struct packet_type *pt); 1805void dev_remove_pack(struct packet_type *pt);
1765extern void __dev_remove_pack(struct packet_type *pt); 1806void __dev_remove_pack(struct packet_type *pt);
1766extern void dev_add_offload(struct packet_offload *po); 1807void dev_add_offload(struct packet_offload *po);
1767extern void dev_remove_offload(struct packet_offload *po); 1808void dev_remove_offload(struct packet_offload *po);
1768extern void __dev_remove_offload(struct packet_offload *po); 1809void __dev_remove_offload(struct packet_offload *po);
1769 1810
1770extern struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags, 1811struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags,
1771 unsigned short mask); 1812 unsigned short mask);
1772extern struct net_device *dev_get_by_name(struct net *net, const char *name); 1813struct net_device *dev_get_by_name(struct net *net, const char *name);
1773extern struct net_device *dev_get_by_name_rcu(struct net *net, const char *name); 1814struct net_device *dev_get_by_name_rcu(struct net *net, const char *name);
1774extern struct net_device *__dev_get_by_name(struct net *net, const char *name); 1815struct net_device *__dev_get_by_name(struct net *net, const char *name);
1775extern int dev_alloc_name(struct net_device *dev, const char *name); 1816int dev_alloc_name(struct net_device *dev, const char *name);
1776extern int dev_open(struct net_device *dev); 1817int dev_open(struct net_device *dev);
1777extern int dev_close(struct net_device *dev); 1818int dev_close(struct net_device *dev);
1778extern void dev_disable_lro(struct net_device *dev); 1819void dev_disable_lro(struct net_device *dev);
1779extern int dev_loopback_xmit(struct sk_buff *newskb); 1820int dev_loopback_xmit(struct sk_buff *newskb);
1780extern int dev_queue_xmit(struct sk_buff *skb); 1821int dev_queue_xmit(struct sk_buff *skb);
1781extern int register_netdevice(struct net_device *dev); 1822int register_netdevice(struct net_device *dev);
1782extern void unregister_netdevice_queue(struct net_device *dev, 1823void unregister_netdevice_queue(struct net_device *dev, struct list_head *head);
1783 struct list_head *head); 1824void unregister_netdevice_many(struct list_head *head);
1784extern void unregister_netdevice_many(struct list_head *head);
1785static inline void unregister_netdevice(struct net_device *dev) 1825static inline void unregister_netdevice(struct net_device *dev)
1786{ 1826{
1787 unregister_netdevice_queue(dev, NULL); 1827 unregister_netdevice_queue(dev, NULL);
1788} 1828}
1789 1829
1790extern int netdev_refcnt_read(const struct net_device *dev); 1830int netdev_refcnt_read(const struct net_device *dev);
1791extern void free_netdev(struct net_device *dev); 1831void free_netdev(struct net_device *dev);
1792extern void synchronize_net(void); 1832void netdev_freemem(struct net_device *dev);
1793extern int init_dummy_netdev(struct net_device *dev); 1833void synchronize_net(void);
1834int init_dummy_netdev(struct net_device *dev);
1794 1835
1795extern struct net_device *dev_get_by_index(struct net *net, int ifindex); 1836struct net_device *dev_get_by_index(struct net *net, int ifindex);
1796extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); 1837struct net_device *__dev_get_by_index(struct net *net, int ifindex);
1797extern struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); 1838struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex);
1798extern int netdev_get_name(struct net *net, char *name, int ifindex); 1839int netdev_get_name(struct net *net, char *name, int ifindex);
1799extern int dev_restart(struct net_device *dev); 1840int dev_restart(struct net_device *dev);
1800#ifdef CONFIG_NETPOLL_TRAP 1841#ifdef CONFIG_NETPOLL_TRAP
1801extern int netpoll_trap(void); 1842int netpoll_trap(void);
1802#endif 1843#endif
1803extern int skb_gro_receive(struct sk_buff **head, 1844int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb);
1804 struct sk_buff *skb);
1805 1845
1806static inline unsigned int skb_gro_offset(const struct sk_buff *skb) 1846static inline unsigned int skb_gro_offset(const struct sk_buff *skb)
1807{ 1847{
@@ -1873,7 +1913,7 @@ static inline int dev_parse_header(const struct sk_buff *skb,
1873} 1913}
1874 1914
1875typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len); 1915typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len);
1876extern int register_gifconf(unsigned int family, gifconf_func_t * gifconf); 1916int register_gifconf(unsigned int family, gifconf_func_t *gifconf);
1877static inline int unregister_gifconf(unsigned int family) 1917static inline int unregister_gifconf(unsigned int family)
1878{ 1918{
1879 return register_gifconf(family, NULL); 1919 return register_gifconf(family, NULL);
@@ -1944,7 +1984,7 @@ static inline void input_queue_tail_incr_save(struct softnet_data *sd,
1944 1984
1945DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data); 1985DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data);
1946 1986
1947extern void __netif_schedule(struct Qdisc *q); 1987void __netif_schedule(struct Qdisc *q);
1948 1988
1949static inline void netif_schedule_queue(struct netdev_queue *txq) 1989static inline void netif_schedule_queue(struct netdev_queue *txq)
1950{ 1990{
@@ -2264,11 +2304,11 @@ static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index)
2264} 2304}
2265 2305
2266#ifdef CONFIG_XPS 2306#ifdef CONFIG_XPS
2267extern int netif_set_xps_queue(struct net_device *dev, struct cpumask *mask, 2307int netif_set_xps_queue(struct net_device *dev, const struct cpumask *mask,
2268 u16 index); 2308 u16 index);
2269#else 2309#else
2270static inline int netif_set_xps_queue(struct net_device *dev, 2310static inline int netif_set_xps_queue(struct net_device *dev,
2271 struct cpumask *mask, 2311 const struct cpumask *mask,
2272 u16 index) 2312 u16 index)
2273{ 2313{
2274 return 0; 2314 return 0;
@@ -2296,12 +2336,10 @@ static inline bool netif_is_multiqueue(const struct net_device *dev)
2296 return dev->num_tx_queues > 1; 2336 return dev->num_tx_queues > 1;
2297} 2337}
2298 2338
2299extern int netif_set_real_num_tx_queues(struct net_device *dev, 2339int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq);
2300 unsigned int txq);
2301 2340
2302#ifdef CONFIG_RPS 2341#ifdef CONFIG_RPS
2303extern int netif_set_real_num_rx_queues(struct net_device *dev, 2342int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq);
2304 unsigned int rxq);
2305#else 2343#else
2306static inline int netif_set_real_num_rx_queues(struct net_device *dev, 2344static inline int netif_set_real_num_rx_queues(struct net_device *dev,
2307 unsigned int rxq) 2345 unsigned int rxq)
@@ -2328,28 +2366,27 @@ static inline int netif_copy_real_num_queues(struct net_device *to_dev,
2328} 2366}
2329 2367
2330#define DEFAULT_MAX_NUM_RSS_QUEUES (8) 2368#define DEFAULT_MAX_NUM_RSS_QUEUES (8)
2331extern int netif_get_num_default_rss_queues(void); 2369int netif_get_num_default_rss_queues(void);
2332 2370
2333/* Use this variant when it is known for sure that it 2371/* Use this variant when it is known for sure that it
2334 * is executing from hardware interrupt context or with hardware interrupts 2372 * is executing from hardware interrupt context or with hardware interrupts
2335 * disabled. 2373 * disabled.
2336 */ 2374 */
2337extern void dev_kfree_skb_irq(struct sk_buff *skb); 2375void dev_kfree_skb_irq(struct sk_buff *skb);
2338 2376
2339/* Use this variant in places where it could be invoked 2377/* Use this variant in places where it could be invoked
2340 * from either hardware interrupt or other context, with hardware interrupts 2378 * from either hardware interrupt or other context, with hardware interrupts
2341 * either disabled or enabled. 2379 * either disabled or enabled.
2342 */ 2380 */
2343extern void dev_kfree_skb_any(struct sk_buff *skb); 2381void dev_kfree_skb_any(struct sk_buff *skb);
2344 2382
2345extern int netif_rx(struct sk_buff *skb); 2383int netif_rx(struct sk_buff *skb);
2346extern int netif_rx_ni(struct sk_buff *skb); 2384int netif_rx_ni(struct sk_buff *skb);
2347extern int netif_receive_skb(struct sk_buff *skb); 2385int netif_receive_skb(struct sk_buff *skb);
2348extern gro_result_t napi_gro_receive(struct napi_struct *napi, 2386gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb);
2349 struct sk_buff *skb); 2387void napi_gro_flush(struct napi_struct *napi, bool flush_old);
2350extern void napi_gro_flush(struct napi_struct *napi, bool flush_old); 2388struct sk_buff *napi_get_frags(struct napi_struct *napi);
2351extern struct sk_buff * napi_get_frags(struct napi_struct *napi); 2389gro_result_t napi_gro_frags(struct napi_struct *napi);
2352extern gro_result_t napi_gro_frags(struct napi_struct *napi);
2353 2390
2354static inline void napi_free_frags(struct napi_struct *napi) 2391static inline void napi_free_frags(struct napi_struct *napi)
2355{ 2392{
@@ -2357,40 +2394,36 @@ static inline void napi_free_frags(struct napi_struct *napi)
2357 napi->skb = NULL; 2394 napi->skb = NULL;
2358} 2395}
2359 2396
2360extern int netdev_rx_handler_register(struct net_device *dev, 2397int netdev_rx_handler_register(struct net_device *dev,
2361 rx_handler_func_t *rx_handler, 2398 rx_handler_func_t *rx_handler,
2362 void *rx_handler_data); 2399 void *rx_handler_data);
2363extern void netdev_rx_handler_unregister(struct net_device *dev); 2400void netdev_rx_handler_unregister(struct net_device *dev);
2364 2401
2365extern bool dev_valid_name(const char *name); 2402bool dev_valid_name(const char *name);
2366extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); 2403int dev_ioctl(struct net *net, unsigned int cmd, void __user *);
2367extern int dev_ethtool(struct net *net, struct ifreq *); 2404int dev_ethtool(struct net *net, struct ifreq *);
2368extern unsigned int dev_get_flags(const struct net_device *); 2405unsigned int dev_get_flags(const struct net_device *);
2369extern int __dev_change_flags(struct net_device *, unsigned int flags); 2406int __dev_change_flags(struct net_device *, unsigned int flags);
2370extern int dev_change_flags(struct net_device *, unsigned int); 2407int dev_change_flags(struct net_device *, unsigned int);
2371extern void __dev_notify_flags(struct net_device *, unsigned int old_flags); 2408void __dev_notify_flags(struct net_device *, unsigned int old_flags,
2372extern int dev_change_name(struct net_device *, const char *); 2409 unsigned int gchanges);
2373extern int dev_set_alias(struct net_device *, const char *, size_t); 2410int dev_change_name(struct net_device *, const char *);
2374extern int dev_change_net_namespace(struct net_device *, 2411int dev_set_alias(struct net_device *, const char *, size_t);
2375 struct net *, const char *); 2412int dev_change_net_namespace(struct net_device *, struct net *, const char *);
2376extern int dev_set_mtu(struct net_device *, int); 2413int dev_set_mtu(struct net_device *, int);
2377extern void dev_set_group(struct net_device *, int); 2414void dev_set_group(struct net_device *, int);
2378extern int dev_set_mac_address(struct net_device *, 2415int dev_set_mac_address(struct net_device *, struct sockaddr *);
2379 struct sockaddr *); 2416int dev_change_carrier(struct net_device *, bool new_carrier);
2380extern int dev_change_carrier(struct net_device *, 2417int dev_get_phys_port_id(struct net_device *dev,
2381 bool new_carrier); 2418 struct netdev_phys_port_id *ppid);
2382extern int dev_get_phys_port_id(struct net_device *dev, 2419int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
2383 struct netdev_phys_port_id *ppid); 2420 struct netdev_queue *txq, void *accel_priv);
2384extern int dev_hard_start_xmit(struct sk_buff *skb, 2421int dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
2385 struct net_device *dev,
2386 struct netdev_queue *txq);
2387extern int dev_forward_skb(struct net_device *dev,
2388 struct sk_buff *skb);
2389 2422
2390extern int netdev_budget; 2423extern int netdev_budget;
2391 2424
2392/* Called by rtnetlink.c:rtnl_unlock() */ 2425/* Called by rtnetlink.c:rtnl_unlock() */
2393extern void netdev_run_todo(void); 2426void netdev_run_todo(void);
2394 2427
2395/** 2428/**
2396 * dev_put - release reference to device 2429 * dev_put - release reference to device
@@ -2423,9 +2456,9 @@ static inline void dev_hold(struct net_device *dev)
2423 * kind of lower layer not just hardware media. 2456 * kind of lower layer not just hardware media.
2424 */ 2457 */
2425 2458
2426extern void linkwatch_init_dev(struct net_device *dev); 2459void linkwatch_init_dev(struct net_device *dev);
2427extern void linkwatch_fire_event(struct net_device *dev); 2460void linkwatch_fire_event(struct net_device *dev);
2428extern void linkwatch_forget_dev(struct net_device *dev); 2461void linkwatch_forget_dev(struct net_device *dev);
2429 2462
2430/** 2463/**
2431 * netif_carrier_ok - test if carrier present 2464 * netif_carrier_ok - test if carrier present
@@ -2438,13 +2471,13 @@ static inline bool netif_carrier_ok(const struct net_device *dev)
2438 return !test_bit(__LINK_STATE_NOCARRIER, &dev->state); 2471 return !test_bit(__LINK_STATE_NOCARRIER, &dev->state);
2439} 2472}
2440 2473
2441extern unsigned long dev_trans_start(struct net_device *dev); 2474unsigned long dev_trans_start(struct net_device *dev);
2442 2475
2443extern void __netdev_watchdog_up(struct net_device *dev); 2476void __netdev_watchdog_up(struct net_device *dev);
2444 2477
2445extern void netif_carrier_on(struct net_device *dev); 2478void netif_carrier_on(struct net_device *dev);
2446 2479
2447extern void netif_carrier_off(struct net_device *dev); 2480void netif_carrier_off(struct net_device *dev);
2448 2481
2449/** 2482/**
2450 * netif_dormant_on - mark device as dormant. 2483 * netif_dormant_on - mark device as dormant.
@@ -2512,9 +2545,9 @@ static inline bool netif_device_present(struct net_device *dev)
2512 return test_bit(__LINK_STATE_PRESENT, &dev->state); 2545 return test_bit(__LINK_STATE_PRESENT, &dev->state);
2513} 2546}
2514 2547
2515extern void netif_device_detach(struct net_device *dev); 2548void netif_device_detach(struct net_device *dev);
2516 2549
2517extern void netif_device_attach(struct net_device *dev); 2550void netif_device_attach(struct net_device *dev);
2518 2551
2519/* 2552/*
2520 * Network interface message level settings 2553 * Network interface message level settings
@@ -2723,119 +2756,138 @@ static inline void netif_addr_unlock_bh(struct net_device *dev)
2723 2756
2724/* These functions live elsewhere (drivers/net/net_init.c, but related) */ 2757/* These functions live elsewhere (drivers/net/net_init.c, but related) */
2725 2758
2726extern void ether_setup(struct net_device *dev); 2759void ether_setup(struct net_device *dev);
2727 2760
2728/* Support for loadable net-drivers */ 2761/* Support for loadable net-drivers */
2729extern struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, 2762struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
2730 void (*setup)(struct net_device *), 2763 void (*setup)(struct net_device *),
2731 unsigned int txqs, unsigned int rxqs); 2764 unsigned int txqs, unsigned int rxqs);
2732#define alloc_netdev(sizeof_priv, name, setup) \ 2765#define alloc_netdev(sizeof_priv, name, setup) \
2733 alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1) 2766 alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1)
2734 2767
2735#define alloc_netdev_mq(sizeof_priv, name, setup, count) \ 2768#define alloc_netdev_mq(sizeof_priv, name, setup, count) \
2736 alloc_netdev_mqs(sizeof_priv, name, setup, count, count) 2769 alloc_netdev_mqs(sizeof_priv, name, setup, count, count)
2737 2770
2738extern int register_netdev(struct net_device *dev); 2771int register_netdev(struct net_device *dev);
2739extern void unregister_netdev(struct net_device *dev); 2772void unregister_netdev(struct net_device *dev);
2740 2773
2741/* General hardware address lists handling functions */ 2774/* General hardware address lists handling functions */
2742extern int __hw_addr_add_multiple(struct netdev_hw_addr_list *to_list, 2775int __hw_addr_add_multiple(struct netdev_hw_addr_list *to_list,
2743 struct netdev_hw_addr_list *from_list, 2776 struct netdev_hw_addr_list *from_list,
2744 int addr_len, unsigned char addr_type); 2777 int addr_len, unsigned char addr_type);
2745extern void __hw_addr_del_multiple(struct netdev_hw_addr_list *to_list, 2778void __hw_addr_del_multiple(struct netdev_hw_addr_list *to_list,
2746 struct netdev_hw_addr_list *from_list, 2779 struct netdev_hw_addr_list *from_list,
2747 int addr_len, unsigned char addr_type); 2780 int addr_len, unsigned char addr_type);
2748extern int __hw_addr_sync(struct netdev_hw_addr_list *to_list, 2781int __hw_addr_sync(struct netdev_hw_addr_list *to_list,
2749 struct netdev_hw_addr_list *from_list, 2782 struct netdev_hw_addr_list *from_list, int addr_len);
2750 int addr_len); 2783void __hw_addr_unsync(struct netdev_hw_addr_list *to_list,
2751extern void __hw_addr_unsync(struct netdev_hw_addr_list *to_list, 2784 struct netdev_hw_addr_list *from_list, int addr_len);
2752 struct netdev_hw_addr_list *from_list, 2785void __hw_addr_flush(struct netdev_hw_addr_list *list);
2753 int addr_len); 2786void __hw_addr_init(struct netdev_hw_addr_list *list);
2754extern void __hw_addr_flush(struct netdev_hw_addr_list *list);
2755extern void __hw_addr_init(struct netdev_hw_addr_list *list);
2756 2787
2757/* Functions used for device addresses handling */ 2788/* Functions used for device addresses handling */
2758extern int dev_addr_add(struct net_device *dev, const unsigned char *addr, 2789int dev_addr_add(struct net_device *dev, const unsigned char *addr,
2759 unsigned char addr_type); 2790 unsigned char addr_type);
2760extern int dev_addr_del(struct net_device *dev, const unsigned char *addr, 2791int dev_addr_del(struct net_device *dev, const unsigned char *addr,
2761 unsigned char addr_type); 2792 unsigned char addr_type);
2762extern int dev_addr_add_multiple(struct net_device *to_dev, 2793int dev_addr_add_multiple(struct net_device *to_dev,
2763 struct net_device *from_dev, 2794 struct net_device *from_dev, unsigned char addr_type);
2764 unsigned char addr_type); 2795int dev_addr_del_multiple(struct net_device *to_dev,
2765extern int dev_addr_del_multiple(struct net_device *to_dev, 2796 struct net_device *from_dev, unsigned char addr_type);
2766 struct net_device *from_dev, 2797void dev_addr_flush(struct net_device *dev);
2767 unsigned char addr_type); 2798int dev_addr_init(struct net_device *dev);
2768extern void dev_addr_flush(struct net_device *dev);
2769extern int dev_addr_init(struct net_device *dev);
2770 2799
2771/* Functions used for unicast addresses handling */ 2800/* Functions used for unicast addresses handling */
2772extern int dev_uc_add(struct net_device *dev, const unsigned char *addr); 2801int dev_uc_add(struct net_device *dev, const unsigned char *addr);
2773extern int dev_uc_add_excl(struct net_device *dev, const unsigned char *addr); 2802int dev_uc_add_excl(struct net_device *dev, const unsigned char *addr);
2774extern int dev_uc_del(struct net_device *dev, const unsigned char *addr); 2803int dev_uc_del(struct net_device *dev, const unsigned char *addr);
2775extern int dev_uc_sync(struct net_device *to, struct net_device *from); 2804int dev_uc_sync(struct net_device *to, struct net_device *from);
2776extern int dev_uc_sync_multiple(struct net_device *to, struct net_device *from); 2805int dev_uc_sync_multiple(struct net_device *to, struct net_device *from);
2777extern void dev_uc_unsync(struct net_device *to, struct net_device *from); 2806void dev_uc_unsync(struct net_device *to, struct net_device *from);
2778extern void dev_uc_flush(struct net_device *dev); 2807void dev_uc_flush(struct net_device *dev);
2779extern void dev_uc_init(struct net_device *dev); 2808void dev_uc_init(struct net_device *dev);
2780 2809
2781/* Functions used for multicast addresses handling */ 2810/* Functions used for multicast addresses handling */
2782extern int dev_mc_add(struct net_device *dev, const unsigned char *addr); 2811int dev_mc_add(struct net_device *dev, const unsigned char *addr);
2783extern int dev_mc_add_global(struct net_device *dev, const unsigned char *addr); 2812int dev_mc_add_global(struct net_device *dev, const unsigned char *addr);
2784extern int dev_mc_add_excl(struct net_device *dev, const unsigned char *addr); 2813int dev_mc_add_excl(struct net_device *dev, const unsigned char *addr);
2785extern int dev_mc_del(struct net_device *dev, const unsigned char *addr); 2814int dev_mc_del(struct net_device *dev, const unsigned char *addr);
2786extern int dev_mc_del_global(struct net_device *dev, const unsigned char *addr); 2815int dev_mc_del_global(struct net_device *dev, const unsigned char *addr);
2787extern int dev_mc_sync(struct net_device *to, struct net_device *from); 2816int dev_mc_sync(struct net_device *to, struct net_device *from);
2788extern int dev_mc_sync_multiple(struct net_device *to, struct net_device *from); 2817int dev_mc_sync_multiple(struct net_device *to, struct net_device *from);
2789extern void dev_mc_unsync(struct net_device *to, struct net_device *from); 2818void dev_mc_unsync(struct net_device *to, struct net_device *from);
2790extern void dev_mc_flush(struct net_device *dev); 2819void dev_mc_flush(struct net_device *dev);
2791extern void dev_mc_init(struct net_device *dev); 2820void dev_mc_init(struct net_device *dev);
2792 2821
2793/* Functions used for secondary unicast and multicast support */ 2822/* Functions used for secondary unicast and multicast support */
2794extern void dev_set_rx_mode(struct net_device *dev); 2823void dev_set_rx_mode(struct net_device *dev);
2795extern void __dev_set_rx_mode(struct net_device *dev); 2824void __dev_set_rx_mode(struct net_device *dev);
2796extern int dev_set_promiscuity(struct net_device *dev, int inc); 2825int dev_set_promiscuity(struct net_device *dev, int inc);
2797extern int dev_set_allmulti(struct net_device *dev, int inc); 2826int dev_set_allmulti(struct net_device *dev, int inc);
2798extern void netdev_state_change(struct net_device *dev); 2827void netdev_state_change(struct net_device *dev);
2799extern void netdev_notify_peers(struct net_device *dev); 2828void netdev_notify_peers(struct net_device *dev);
2800extern void netdev_features_change(struct net_device *dev); 2829void netdev_features_change(struct net_device *dev);
2801/* Load a device via the kmod */ 2830/* Load a device via the kmod */
2802extern void dev_load(struct net *net, const char *name); 2831void dev_load(struct net *net, const char *name);
2803extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, 2832struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
2804 struct rtnl_link_stats64 *storage); 2833 struct rtnl_link_stats64 *storage);
2805extern void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64, 2834void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64,
2806 const struct net_device_stats *netdev_stats); 2835 const struct net_device_stats *netdev_stats);
2807 2836
2808extern int netdev_max_backlog; 2837extern int netdev_max_backlog;
2809extern int netdev_tstamp_prequeue; 2838extern int netdev_tstamp_prequeue;
2810extern int weight_p; 2839extern int weight_p;
2811extern int bpf_jit_enable; 2840extern int bpf_jit_enable;
2812 2841
2813extern bool netdev_has_upper_dev(struct net_device *dev, 2842bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev);
2814 struct net_device *upper_dev); 2843bool netdev_has_any_upper_dev(struct net_device *dev);
2815extern bool netdev_has_any_upper_dev(struct net_device *dev); 2844struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev,
2816extern struct net_device *netdev_upper_get_next_dev_rcu(struct net_device *dev, 2845 struct list_head **iter);
2817 struct list_head **iter);
2818 2846
2819/* iterate through upper list, must be called under RCU read lock */ 2847/* iterate through upper list, must be called under RCU read lock */
2820#define netdev_for_each_upper_dev_rcu(dev, upper, iter) \ 2848#define netdev_for_each_all_upper_dev_rcu(dev, updev, iter) \
2821 for (iter = &(dev)->upper_dev_list, \ 2849 for (iter = &(dev)->all_adj_list.upper, \
2822 upper = netdev_upper_get_next_dev_rcu(dev, &(iter)); \ 2850 updev = netdev_all_upper_get_next_dev_rcu(dev, &(iter)); \
2823 upper; \ 2851 updev; \
2824 upper = netdev_upper_get_next_dev_rcu(dev, &(iter))) 2852 updev = netdev_all_upper_get_next_dev_rcu(dev, &(iter)))
2825 2853
2826extern struct net_device *netdev_master_upper_dev_get(struct net_device *dev); 2854void *netdev_lower_get_next_private(struct net_device *dev,
2827extern struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev); 2855 struct list_head **iter);
2828extern int netdev_upper_dev_link(struct net_device *dev, 2856void *netdev_lower_get_next_private_rcu(struct net_device *dev,
2857 struct list_head **iter);
2858
2859#define netdev_for_each_lower_private(dev, priv, iter) \
2860 for (iter = (dev)->adj_list.lower.next, \
2861 priv = netdev_lower_get_next_private(dev, &(iter)); \
2862 priv; \
2863 priv = netdev_lower_get_next_private(dev, &(iter)))
2864
2865#define netdev_for_each_lower_private_rcu(dev, priv, iter) \
2866 for (iter = &(dev)->adj_list.lower, \
2867 priv = netdev_lower_get_next_private_rcu(dev, &(iter)); \
2868 priv; \
2869 priv = netdev_lower_get_next_private_rcu(dev, &(iter)))
2870
2871void *netdev_adjacent_get_private(struct list_head *adj_list);
2872struct net_device *netdev_master_upper_dev_get(struct net_device *dev);
2873struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev);
2874int netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev);
2875int netdev_master_upper_dev_link(struct net_device *dev,
2829 struct net_device *upper_dev); 2876 struct net_device *upper_dev);
2830extern int netdev_master_upper_dev_link(struct net_device *dev, 2877int netdev_master_upper_dev_link_private(struct net_device *dev,
2831 struct net_device *upper_dev); 2878 struct net_device *upper_dev,
2832extern void netdev_upper_dev_unlink(struct net_device *dev, 2879 void *private);
2833 struct net_device *upper_dev); 2880void netdev_upper_dev_unlink(struct net_device *dev,
2834extern int skb_checksum_help(struct sk_buff *skb); 2881 struct net_device *upper_dev);
2835extern struct sk_buff *__skb_gso_segment(struct sk_buff *skb, 2882void *netdev_lower_dev_get_private_rcu(struct net_device *dev,
2836 netdev_features_t features, bool tx_path); 2883 struct net_device *lower_dev);
2837extern struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb, 2884void *netdev_lower_dev_get_private(struct net_device *dev,
2838 netdev_features_t features); 2885 struct net_device *lower_dev);
2886int skb_checksum_help(struct sk_buff *skb);
2887struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
2888 netdev_features_t features, bool tx_path);
2889struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb,
2890 netdev_features_t features);
2839 2891
2840static inline 2892static inline
2841struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features) 2893struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features)
@@ -2857,30 +2909,42 @@ static inline bool can_checksum_protocol(netdev_features_t features,
2857} 2909}
2858 2910
2859#ifdef CONFIG_BUG 2911#ifdef CONFIG_BUG
2860extern void netdev_rx_csum_fault(struct net_device *dev); 2912void netdev_rx_csum_fault(struct net_device *dev);
2861#else 2913#else
2862static inline void netdev_rx_csum_fault(struct net_device *dev) 2914static inline void netdev_rx_csum_fault(struct net_device *dev)
2863{ 2915{
2864} 2916}
2865#endif 2917#endif
2866/* rx skb timestamps */ 2918/* rx skb timestamps */
2867extern void net_enable_timestamp(void); 2919void net_enable_timestamp(void);
2868extern void net_disable_timestamp(void); 2920void net_disable_timestamp(void);
2869 2921
2870#ifdef CONFIG_PROC_FS 2922#ifdef CONFIG_PROC_FS
2871extern int __init dev_proc_init(void); 2923int __init dev_proc_init(void);
2872#else 2924#else
2873#define dev_proc_init() 0 2925#define dev_proc_init() 0
2874#endif 2926#endif
2875 2927
2876extern int netdev_class_create_file(struct class_attribute *class_attr); 2928int netdev_class_create_file_ns(struct class_attribute *class_attr,
2877extern void netdev_class_remove_file(struct class_attribute *class_attr); 2929 const void *ns);
2930void netdev_class_remove_file_ns(struct class_attribute *class_attr,
2931 const void *ns);
2932
2933static inline int netdev_class_create_file(struct class_attribute *class_attr)
2934{
2935 return netdev_class_create_file_ns(class_attr, NULL);
2936}
2937
2938static inline void netdev_class_remove_file(struct class_attribute *class_attr)
2939{
2940 netdev_class_remove_file_ns(class_attr, NULL);
2941}
2878 2942
2879extern struct kobj_ns_type_operations net_ns_type_operations; 2943extern struct kobj_ns_type_operations net_ns_type_operations;
2880 2944
2881extern const char *netdev_drivername(const struct net_device *dev); 2945const char *netdev_drivername(const struct net_device *dev);
2882 2946
2883extern void linkwatch_run_queue(void); 2947void linkwatch_run_queue(void);
2884 2948
2885static inline netdev_features_t netdev_get_wanted_features( 2949static inline netdev_features_t netdev_get_wanted_features(
2886 struct net_device *dev) 2950 struct net_device *dev)
@@ -2944,6 +3008,11 @@ static inline void netif_set_gso_max_size(struct net_device *dev,
2944 dev->gso_max_size = size; 3008 dev->gso_max_size = size;
2945} 3009}
2946 3010
3011static inline bool netif_is_macvlan(struct net_device *dev)
3012{
3013 return dev->priv_flags & IFF_MACVLAN;
3014}
3015
2947static inline bool netif_is_bond_master(struct net_device *dev) 3016static inline bool netif_is_bond_master(struct net_device *dev)
2948{ 3017{
2949 return dev->flags & IFF_MASTER && dev->priv_flags & IFF_BONDING; 3018 return dev->flags & IFF_MASTER && dev->priv_flags & IFF_BONDING;
@@ -2972,22 +3041,22 @@ static inline const char *netdev_name(const struct net_device *dev)
2972 return dev->name; 3041 return dev->name;
2973} 3042}
2974 3043
2975extern __printf(3, 4) 3044__printf(3, 4)
2976int netdev_printk(const char *level, const struct net_device *dev, 3045int netdev_printk(const char *level, const struct net_device *dev,
2977 const char *format, ...); 3046 const char *format, ...);
2978extern __printf(2, 3) 3047__printf(2, 3)
2979int netdev_emerg(const struct net_device *dev, const char *format, ...); 3048int netdev_emerg(const struct net_device *dev, const char *format, ...);
2980extern __printf(2, 3) 3049__printf(2, 3)
2981int netdev_alert(const struct net_device *dev, const char *format, ...); 3050int netdev_alert(const struct net_device *dev, const char *format, ...);
2982extern __printf(2, 3) 3051__printf(2, 3)
2983int netdev_crit(const struct net_device *dev, const char *format, ...); 3052int netdev_crit(const struct net_device *dev, const char *format, ...);
2984extern __printf(2, 3) 3053__printf(2, 3)
2985int netdev_err(const struct net_device *dev, const char *format, ...); 3054int netdev_err(const struct net_device *dev, const char *format, ...);
2986extern __printf(2, 3) 3055__printf(2, 3)
2987int netdev_warn(const struct net_device *dev, const char *format, ...); 3056int netdev_warn(const struct net_device *dev, const char *format, ...);
2988extern __printf(2, 3) 3057__printf(2, 3)
2989int netdev_notice(const struct net_device *dev, const char *format, ...); 3058int netdev_notice(const struct net_device *dev, const char *format, ...);
2990extern __printf(2, 3) 3059__printf(2, 3)
2991int netdev_info(const struct net_device *dev, const char *format, ...); 3060int netdev_info(const struct net_device *dev, const char *format, ...);
2992 3061
2993#define MODULE_ALIAS_NETDEV(device) \ 3062#define MODULE_ALIAS_NETDEV(device) \
@@ -3028,7 +3097,7 @@ do { \
3028 * file/line information and a backtrace. 3097 * file/line information and a backtrace.
3029 */ 3098 */
3030#define netdev_WARN(dev, format, args...) \ 3099#define netdev_WARN(dev, format, args...) \
3031 WARN(1, "netdevice: %s\n" format, netdev_name(dev), ##args); 3100 WARN(1, "netdevice: %s\n" format, netdev_name(dev), ##args)
3032 3101
3033/* netif printk helpers, similar to netdev_printk */ 3102/* netif printk helpers, similar to netdev_printk */
3034 3103