summaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2013-09-26 17:48:15 -0400
committerJoe Perches <joe@perches.com>2013-09-26 18:06:58 -0400
commitf629d208d27a22f495b7734eede585b5d207e912 (patch)
tree1fd20f80eb03de507641f4069b39a07df3d57000 /include/linux/netdevice.h
parent7965bd4d71ef7cf1db00afb9e406ddfc13443c13 (diff)
[networking]device.h: Remove extern from function prototypes
There are a mix of function prototypes with and without extern in the kernel sources. Standardize on not using extern for function prototypes. Function prototypes don't need to be written with extern. extern is assumed by the compiler. Its use is as unnecessary as using auto to declare automatic/local variables in a block. Signed-off-by: Joe Perches <joe@perches.com>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h432
1 files changed, 208 insertions, 224 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index b4cfb63f264e..5f01af3927ca 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
@@ -664,8 +664,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; 664extern struct rps_sock_flow_table __rcu *rps_sock_flow_table;
665 665
666#ifdef CONFIG_RFS_ACCEL 666#ifdef CONFIG_RFS_ACCEL
667extern bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, 667bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id,
668 u32 flow_id, u16 filter_id); 668 u16 filter_id);
669#endif 669#endif
670 670
671/* This structure contains an instance of an RX queue. */ 671/* This structure contains an instance of an RX queue. */
@@ -1497,9 +1497,9 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev,
1497 f(dev, &dev->_tx[i], arg); 1497 f(dev, &dev->_tx[i], arg);
1498} 1498}
1499 1499
1500extern struct netdev_queue *netdev_pick_tx(struct net_device *dev, 1500struct netdev_queue *netdev_pick_tx(struct net_device *dev,
1501 struct sk_buff *skb); 1501 struct sk_buff *skb);
1502extern u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb); 1502u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb);
1503 1503
1504/* 1504/*
1505 * Net namespace inlines 1505 * Net namespace inlines
@@ -1683,8 +1683,8 @@ struct packet_offload {
1683#define NETDEV_CHANGEUPPER 0x0015 1683#define NETDEV_CHANGEUPPER 0x0015
1684#define NETDEV_RESEND_IGMP 0x0016 1684#define NETDEV_RESEND_IGMP 0x0016
1685 1685
1686extern int register_netdevice_notifier(struct notifier_block *nb); 1686int register_netdevice_notifier(struct notifier_block *nb);
1687extern int unregister_netdevice_notifier(struct notifier_block *nb); 1687int unregister_netdevice_notifier(struct notifier_block *nb);
1688 1688
1689struct netdev_notifier_info { 1689struct netdev_notifier_info {
1690 struct net_device *dev; 1690 struct net_device *dev;
@@ -1707,9 +1707,9 @@ netdev_notifier_info_to_dev(const struct netdev_notifier_info *info)
1707 return info->dev; 1707 return info->dev;
1708} 1708}
1709 1709
1710extern int call_netdevice_notifiers_info(unsigned long val, struct net_device *dev, 1710int call_netdevice_notifiers_info(unsigned long val, struct net_device *dev,
1711 struct netdev_notifier_info *info); 1711 struct netdev_notifier_info *info);
1712extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); 1712int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
1713 1713
1714 1714
1715extern rwlock_t dev_base_lock; /* Device list lock */ 1715extern rwlock_t dev_base_lock; /* Device list lock */
@@ -1764,54 +1764,52 @@ static inline struct net_device *first_net_device_rcu(struct net *net)
1764 return lh == &net->dev_base_head ? NULL : net_device_entry(lh); 1764 return lh == &net->dev_base_head ? NULL : net_device_entry(lh);
1765} 1765}
1766 1766
1767extern int netdev_boot_setup_check(struct net_device *dev); 1767int netdev_boot_setup_check(struct net_device *dev);
1768extern unsigned long netdev_boot_base(const char *prefix, int unit); 1768unsigned long netdev_boot_base(const char *prefix, int unit);
1769extern struct net_device *dev_getbyhwaddr_rcu(struct net *net, unsigned short type, 1769struct net_device *dev_getbyhwaddr_rcu(struct net *net, unsigned short type,
1770 const char *hwaddr); 1770 const char *hwaddr);
1771extern struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type); 1771struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type);
1772extern struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short type); 1772struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short type);
1773extern void dev_add_pack(struct packet_type *pt); 1773void dev_add_pack(struct packet_type *pt);
1774extern void dev_remove_pack(struct packet_type *pt); 1774void dev_remove_pack(struct packet_type *pt);
1775extern void __dev_remove_pack(struct packet_type *pt); 1775void __dev_remove_pack(struct packet_type *pt);
1776extern void dev_add_offload(struct packet_offload *po); 1776void dev_add_offload(struct packet_offload *po);
1777extern void dev_remove_offload(struct packet_offload *po); 1777void dev_remove_offload(struct packet_offload *po);
1778extern void __dev_remove_offload(struct packet_offload *po); 1778void __dev_remove_offload(struct packet_offload *po);
1779 1779
1780extern struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags, 1780struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags,
1781 unsigned short mask); 1781 unsigned short mask);
1782extern struct net_device *dev_get_by_name(struct net *net, const char *name); 1782struct net_device *dev_get_by_name(struct net *net, const char *name);
1783extern struct net_device *dev_get_by_name_rcu(struct net *net, const char *name); 1783struct net_device *dev_get_by_name_rcu(struct net *net, const char *name);
1784extern struct net_device *__dev_get_by_name(struct net *net, const char *name); 1784struct net_device *__dev_get_by_name(struct net *net, const char *name);
1785extern int dev_alloc_name(struct net_device *dev, const char *name); 1785int dev_alloc_name(struct net_device *dev, const char *name);
1786extern int dev_open(struct net_device *dev); 1786int dev_open(struct net_device *dev);
1787extern int dev_close(struct net_device *dev); 1787int dev_close(struct net_device *dev);
1788extern void dev_disable_lro(struct net_device *dev); 1788void dev_disable_lro(struct net_device *dev);
1789extern int dev_loopback_xmit(struct sk_buff *newskb); 1789int dev_loopback_xmit(struct sk_buff *newskb);
1790extern int dev_queue_xmit(struct sk_buff *skb); 1790int dev_queue_xmit(struct sk_buff *skb);
1791extern int register_netdevice(struct net_device *dev); 1791int register_netdevice(struct net_device *dev);
1792extern void unregister_netdevice_queue(struct net_device *dev, 1792void unregister_netdevice_queue(struct net_device *dev, struct list_head *head);
1793 struct list_head *head); 1793void unregister_netdevice_many(struct list_head *head);
1794extern void unregister_netdevice_many(struct list_head *head);
1795static inline void unregister_netdevice(struct net_device *dev) 1794static inline void unregister_netdevice(struct net_device *dev)
1796{ 1795{
1797 unregister_netdevice_queue(dev, NULL); 1796 unregister_netdevice_queue(dev, NULL);
1798} 1797}
1799 1798
1800extern int netdev_refcnt_read(const struct net_device *dev); 1799int netdev_refcnt_read(const struct net_device *dev);
1801extern void free_netdev(struct net_device *dev); 1800void free_netdev(struct net_device *dev);
1802extern void synchronize_net(void); 1801void synchronize_net(void);
1803extern int init_dummy_netdev(struct net_device *dev); 1802int init_dummy_netdev(struct net_device *dev);
1804 1803
1805extern struct net_device *dev_get_by_index(struct net *net, int ifindex); 1804struct net_device *dev_get_by_index(struct net *net, int ifindex);
1806extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); 1805struct net_device *__dev_get_by_index(struct net *net, int ifindex);
1807extern struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); 1806struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex);
1808extern int netdev_get_name(struct net *net, char *name, int ifindex); 1807int netdev_get_name(struct net *net, char *name, int ifindex);
1809extern int dev_restart(struct net_device *dev); 1808int dev_restart(struct net_device *dev);
1810#ifdef CONFIG_NETPOLL_TRAP 1809#ifdef CONFIG_NETPOLL_TRAP
1811extern int netpoll_trap(void); 1810int netpoll_trap(void);
1812#endif 1811#endif
1813extern int skb_gro_receive(struct sk_buff **head, 1812int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb);
1814 struct sk_buff *skb);
1815 1813
1816static inline unsigned int skb_gro_offset(const struct sk_buff *skb) 1814static inline unsigned int skb_gro_offset(const struct sk_buff *skb)
1817{ 1815{
@@ -1883,7 +1881,7 @@ static inline int dev_parse_header(const struct sk_buff *skb,
1883} 1881}
1884 1882
1885typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len); 1883typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len);
1886extern int register_gifconf(unsigned int family, gifconf_func_t * gifconf); 1884int register_gifconf(unsigned int family, gifconf_func_t *gifconf);
1887static inline int unregister_gifconf(unsigned int family) 1885static inline int unregister_gifconf(unsigned int family)
1888{ 1886{
1889 return register_gifconf(family, NULL); 1887 return register_gifconf(family, NULL);
@@ -1954,7 +1952,7 @@ static inline void input_queue_tail_incr_save(struct softnet_data *sd,
1954 1952
1955DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data); 1953DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data);
1956 1954
1957extern void __netif_schedule(struct Qdisc *q); 1955void __netif_schedule(struct Qdisc *q);
1958 1956
1959static inline void netif_schedule_queue(struct netdev_queue *txq) 1957static inline void netif_schedule_queue(struct netdev_queue *txq)
1960{ 1958{
@@ -2274,8 +2272,8 @@ static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index)
2274} 2272}
2275 2273
2276#ifdef CONFIG_XPS 2274#ifdef CONFIG_XPS
2277extern int netif_set_xps_queue(struct net_device *dev, struct cpumask *mask, 2275int netif_set_xps_queue(struct net_device *dev, struct cpumask *mask,
2278 u16 index); 2276 u16 index);
2279#else 2277#else
2280static inline int netif_set_xps_queue(struct net_device *dev, 2278static inline int netif_set_xps_queue(struct net_device *dev,
2281 struct cpumask *mask, 2279 struct cpumask *mask,
@@ -2306,12 +2304,10 @@ static inline bool netif_is_multiqueue(const struct net_device *dev)
2306 return dev->num_tx_queues > 1; 2304 return dev->num_tx_queues > 1;
2307} 2305}
2308 2306
2309extern int netif_set_real_num_tx_queues(struct net_device *dev, 2307int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq);
2310 unsigned int txq);
2311 2308
2312#ifdef CONFIG_RPS 2309#ifdef CONFIG_RPS
2313extern int netif_set_real_num_rx_queues(struct net_device *dev, 2310int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq);
2314 unsigned int rxq);
2315#else 2311#else
2316static inline int netif_set_real_num_rx_queues(struct net_device *dev, 2312static inline int netif_set_real_num_rx_queues(struct net_device *dev,
2317 unsigned int rxq) 2313 unsigned int rxq)
@@ -2338,28 +2334,27 @@ static inline int netif_copy_real_num_queues(struct net_device *to_dev,
2338} 2334}
2339 2335
2340#define DEFAULT_MAX_NUM_RSS_QUEUES (8) 2336#define DEFAULT_MAX_NUM_RSS_QUEUES (8)
2341extern int netif_get_num_default_rss_queues(void); 2337int netif_get_num_default_rss_queues(void);
2342 2338
2343/* Use this variant when it is known for sure that it 2339/* Use this variant when it is known for sure that it
2344 * is executing from hardware interrupt context or with hardware interrupts 2340 * is executing from hardware interrupt context or with hardware interrupts
2345 * disabled. 2341 * disabled.
2346 */ 2342 */
2347extern void dev_kfree_skb_irq(struct sk_buff *skb); 2343void dev_kfree_skb_irq(struct sk_buff *skb);
2348 2344
2349/* Use this variant in places where it could be invoked 2345/* Use this variant in places where it could be invoked
2350 * from either hardware interrupt or other context, with hardware interrupts 2346 * from either hardware interrupt or other context, with hardware interrupts
2351 * either disabled or enabled. 2347 * either disabled or enabled.
2352 */ 2348 */
2353extern void dev_kfree_skb_any(struct sk_buff *skb); 2349void dev_kfree_skb_any(struct sk_buff *skb);
2354 2350
2355extern int netif_rx(struct sk_buff *skb); 2351int netif_rx(struct sk_buff *skb);
2356extern int netif_rx_ni(struct sk_buff *skb); 2352int netif_rx_ni(struct sk_buff *skb);
2357extern int netif_receive_skb(struct sk_buff *skb); 2353int netif_receive_skb(struct sk_buff *skb);
2358extern gro_result_t napi_gro_receive(struct napi_struct *napi, 2354gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb);
2359 struct sk_buff *skb); 2355void napi_gro_flush(struct napi_struct *napi, bool flush_old);
2360extern void napi_gro_flush(struct napi_struct *napi, bool flush_old); 2356struct sk_buff *napi_get_frags(struct napi_struct *napi);
2361extern struct sk_buff * napi_get_frags(struct napi_struct *napi); 2357gro_result_t napi_gro_frags(struct napi_struct *napi);
2362extern gro_result_t napi_gro_frags(struct napi_struct *napi);
2363 2358
2364static inline void napi_free_frags(struct napi_struct *napi) 2359static inline void napi_free_frags(struct napi_struct *napi)
2365{ 2360{
@@ -2367,40 +2362,35 @@ static inline void napi_free_frags(struct napi_struct *napi)
2367 napi->skb = NULL; 2362 napi->skb = NULL;
2368} 2363}
2369 2364
2370extern int netdev_rx_handler_register(struct net_device *dev, 2365int netdev_rx_handler_register(struct net_device *dev,
2371 rx_handler_func_t *rx_handler, 2366 rx_handler_func_t *rx_handler,
2372 void *rx_handler_data); 2367 void *rx_handler_data);
2373extern void netdev_rx_handler_unregister(struct net_device *dev); 2368void netdev_rx_handler_unregister(struct net_device *dev);
2374 2369
2375extern bool dev_valid_name(const char *name); 2370bool dev_valid_name(const char *name);
2376extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); 2371int dev_ioctl(struct net *net, unsigned int cmd, void __user *);
2377extern int dev_ethtool(struct net *net, struct ifreq *); 2372int dev_ethtool(struct net *net, struct ifreq *);
2378extern unsigned int dev_get_flags(const struct net_device *); 2373unsigned int dev_get_flags(const struct net_device *);
2379extern int __dev_change_flags(struct net_device *, unsigned int flags); 2374int __dev_change_flags(struct net_device *, unsigned int flags);
2380extern int dev_change_flags(struct net_device *, unsigned int); 2375int dev_change_flags(struct net_device *, unsigned int);
2381extern void __dev_notify_flags(struct net_device *, unsigned int old_flags); 2376void __dev_notify_flags(struct net_device *, unsigned int old_flags);
2382extern int dev_change_name(struct net_device *, const char *); 2377int dev_change_name(struct net_device *, const char *);
2383extern int dev_set_alias(struct net_device *, const char *, size_t); 2378int dev_set_alias(struct net_device *, const char *, size_t);
2384extern int dev_change_net_namespace(struct net_device *, 2379int dev_change_net_namespace(struct net_device *, struct net *, const char *);
2385 struct net *, const char *); 2380int dev_set_mtu(struct net_device *, int);
2386extern int dev_set_mtu(struct net_device *, int); 2381void dev_set_group(struct net_device *, int);
2387extern void dev_set_group(struct net_device *, int); 2382int dev_set_mac_address(struct net_device *, struct sockaddr *);
2388extern int dev_set_mac_address(struct net_device *, 2383int dev_change_carrier(struct net_device *, bool new_carrier);
2389 struct sockaddr *); 2384int dev_get_phys_port_id(struct net_device *dev,
2390extern int dev_change_carrier(struct net_device *, 2385 struct netdev_phys_port_id *ppid);
2391 bool new_carrier); 2386int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
2392extern int dev_get_phys_port_id(struct net_device *dev, 2387 struct netdev_queue *txq);
2393 struct netdev_phys_port_id *ppid); 2388int dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
2394extern int dev_hard_start_xmit(struct sk_buff *skb,
2395 struct net_device *dev,
2396 struct netdev_queue *txq);
2397extern int dev_forward_skb(struct net_device *dev,
2398 struct sk_buff *skb);
2399 2389
2400extern int netdev_budget; 2390extern int netdev_budget;
2401 2391
2402/* Called by rtnetlink.c:rtnl_unlock() */ 2392/* Called by rtnetlink.c:rtnl_unlock() */
2403extern void netdev_run_todo(void); 2393void netdev_run_todo(void);
2404 2394
2405/** 2395/**
2406 * dev_put - release reference to device 2396 * dev_put - release reference to device
@@ -2433,9 +2423,9 @@ static inline void dev_hold(struct net_device *dev)
2433 * kind of lower layer not just hardware media. 2423 * kind of lower layer not just hardware media.
2434 */ 2424 */
2435 2425
2436extern void linkwatch_init_dev(struct net_device *dev); 2426void linkwatch_init_dev(struct net_device *dev);
2437extern void linkwatch_fire_event(struct net_device *dev); 2427void linkwatch_fire_event(struct net_device *dev);
2438extern void linkwatch_forget_dev(struct net_device *dev); 2428void linkwatch_forget_dev(struct net_device *dev);
2439 2429
2440/** 2430/**
2441 * netif_carrier_ok - test if carrier present 2431 * netif_carrier_ok - test if carrier present
@@ -2448,13 +2438,13 @@ static inline bool netif_carrier_ok(const struct net_device *dev)
2448 return !test_bit(__LINK_STATE_NOCARRIER, &dev->state); 2438 return !test_bit(__LINK_STATE_NOCARRIER, &dev->state);
2449} 2439}
2450 2440
2451extern unsigned long dev_trans_start(struct net_device *dev); 2441unsigned long dev_trans_start(struct net_device *dev);
2452 2442
2453extern void __netdev_watchdog_up(struct net_device *dev); 2443void __netdev_watchdog_up(struct net_device *dev);
2454 2444
2455extern void netif_carrier_on(struct net_device *dev); 2445void netif_carrier_on(struct net_device *dev);
2456 2446
2457extern void netif_carrier_off(struct net_device *dev); 2447void netif_carrier_off(struct net_device *dev);
2458 2448
2459/** 2449/**
2460 * netif_dormant_on - mark device as dormant. 2450 * netif_dormant_on - mark device as dormant.
@@ -2522,9 +2512,9 @@ static inline bool netif_device_present(struct net_device *dev)
2522 return test_bit(__LINK_STATE_PRESENT, &dev->state); 2512 return test_bit(__LINK_STATE_PRESENT, &dev->state);
2523} 2513}
2524 2514
2525extern void netif_device_detach(struct net_device *dev); 2515void netif_device_detach(struct net_device *dev);
2526 2516
2527extern void netif_device_attach(struct net_device *dev); 2517void netif_device_attach(struct net_device *dev);
2528 2518
2529/* 2519/*
2530 * Network interface message level settings 2520 * Network interface message level settings
@@ -2733,98 +2723,93 @@ static inline void netif_addr_unlock_bh(struct net_device *dev)
2733 2723
2734/* These functions live elsewhere (drivers/net/net_init.c, but related) */ 2724/* These functions live elsewhere (drivers/net/net_init.c, but related) */
2735 2725
2736extern void ether_setup(struct net_device *dev); 2726void ether_setup(struct net_device *dev);
2737 2727
2738/* Support for loadable net-drivers */ 2728/* Support for loadable net-drivers */
2739extern struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, 2729struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
2740 void (*setup)(struct net_device *), 2730 void (*setup)(struct net_device *),
2741 unsigned int txqs, unsigned int rxqs); 2731 unsigned int txqs, unsigned int rxqs);
2742#define alloc_netdev(sizeof_priv, name, setup) \ 2732#define alloc_netdev(sizeof_priv, name, setup) \
2743 alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1) 2733 alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1)
2744 2734
2745#define alloc_netdev_mq(sizeof_priv, name, setup, count) \ 2735#define alloc_netdev_mq(sizeof_priv, name, setup, count) \
2746 alloc_netdev_mqs(sizeof_priv, name, setup, count, count) 2736 alloc_netdev_mqs(sizeof_priv, name, setup, count, count)
2747 2737
2748extern int register_netdev(struct net_device *dev); 2738int register_netdev(struct net_device *dev);
2749extern void unregister_netdev(struct net_device *dev); 2739void unregister_netdev(struct net_device *dev);
2750 2740
2751/* General hardware address lists handling functions */ 2741/* General hardware address lists handling functions */
2752extern int __hw_addr_add_multiple(struct netdev_hw_addr_list *to_list, 2742int __hw_addr_add_multiple(struct netdev_hw_addr_list *to_list,
2753 struct netdev_hw_addr_list *from_list, 2743 struct netdev_hw_addr_list *from_list,
2754 int addr_len, unsigned char addr_type); 2744 int addr_len, unsigned char addr_type);
2755extern void __hw_addr_del_multiple(struct netdev_hw_addr_list *to_list, 2745void __hw_addr_del_multiple(struct netdev_hw_addr_list *to_list,
2756 struct netdev_hw_addr_list *from_list, 2746 struct netdev_hw_addr_list *from_list,
2757 int addr_len, unsigned char addr_type); 2747 int addr_len, unsigned char addr_type);
2758extern int __hw_addr_sync(struct netdev_hw_addr_list *to_list, 2748int __hw_addr_sync(struct netdev_hw_addr_list *to_list,
2759 struct netdev_hw_addr_list *from_list, 2749 struct netdev_hw_addr_list *from_list, int addr_len);
2760 int addr_len); 2750void __hw_addr_unsync(struct netdev_hw_addr_list *to_list,
2761extern void __hw_addr_unsync(struct netdev_hw_addr_list *to_list, 2751 struct netdev_hw_addr_list *from_list, int addr_len);
2762 struct netdev_hw_addr_list *from_list, 2752void __hw_addr_flush(struct netdev_hw_addr_list *list);
2763 int addr_len); 2753void __hw_addr_init(struct netdev_hw_addr_list *list);
2764extern void __hw_addr_flush(struct netdev_hw_addr_list *list);
2765extern void __hw_addr_init(struct netdev_hw_addr_list *list);
2766 2754
2767/* Functions used for device addresses handling */ 2755/* Functions used for device addresses handling */
2768extern int dev_addr_add(struct net_device *dev, const unsigned char *addr, 2756int dev_addr_add(struct net_device *dev, const unsigned char *addr,
2769 unsigned char addr_type); 2757 unsigned char addr_type);
2770extern int dev_addr_del(struct net_device *dev, const unsigned char *addr, 2758int dev_addr_del(struct net_device *dev, const unsigned char *addr,
2771 unsigned char addr_type); 2759 unsigned char addr_type);
2772extern int dev_addr_add_multiple(struct net_device *to_dev, 2760int dev_addr_add_multiple(struct net_device *to_dev,
2773 struct net_device *from_dev, 2761 struct net_device *from_dev, unsigned char addr_type);
2774 unsigned char addr_type); 2762int dev_addr_del_multiple(struct net_device *to_dev,
2775extern int dev_addr_del_multiple(struct net_device *to_dev, 2763 struct net_device *from_dev, unsigned char addr_type);
2776 struct net_device *from_dev, 2764void dev_addr_flush(struct net_device *dev);
2777 unsigned char addr_type); 2765int dev_addr_init(struct net_device *dev);
2778extern void dev_addr_flush(struct net_device *dev);
2779extern int dev_addr_init(struct net_device *dev);
2780 2766
2781/* Functions used for unicast addresses handling */ 2767/* Functions used for unicast addresses handling */
2782extern int dev_uc_add(struct net_device *dev, const unsigned char *addr); 2768int dev_uc_add(struct net_device *dev, const unsigned char *addr);
2783extern int dev_uc_add_excl(struct net_device *dev, const unsigned char *addr); 2769int dev_uc_add_excl(struct net_device *dev, const unsigned char *addr);
2784extern int dev_uc_del(struct net_device *dev, const unsigned char *addr); 2770int dev_uc_del(struct net_device *dev, const unsigned char *addr);
2785extern int dev_uc_sync(struct net_device *to, struct net_device *from); 2771int dev_uc_sync(struct net_device *to, struct net_device *from);
2786extern int dev_uc_sync_multiple(struct net_device *to, struct net_device *from); 2772int dev_uc_sync_multiple(struct net_device *to, struct net_device *from);
2787extern void dev_uc_unsync(struct net_device *to, struct net_device *from); 2773void dev_uc_unsync(struct net_device *to, struct net_device *from);
2788extern void dev_uc_flush(struct net_device *dev); 2774void dev_uc_flush(struct net_device *dev);
2789extern void dev_uc_init(struct net_device *dev); 2775void dev_uc_init(struct net_device *dev);
2790 2776
2791/* Functions used for multicast addresses handling */ 2777/* Functions used for multicast addresses handling */
2792extern int dev_mc_add(struct net_device *dev, const unsigned char *addr); 2778int dev_mc_add(struct net_device *dev, const unsigned char *addr);
2793extern int dev_mc_add_global(struct net_device *dev, const unsigned char *addr); 2779int dev_mc_add_global(struct net_device *dev, const unsigned char *addr);
2794extern int dev_mc_add_excl(struct net_device *dev, const unsigned char *addr); 2780int dev_mc_add_excl(struct net_device *dev, const unsigned char *addr);
2795extern int dev_mc_del(struct net_device *dev, const unsigned char *addr); 2781int dev_mc_del(struct net_device *dev, const unsigned char *addr);
2796extern int dev_mc_del_global(struct net_device *dev, const unsigned char *addr); 2782int dev_mc_del_global(struct net_device *dev, const unsigned char *addr);
2797extern int dev_mc_sync(struct net_device *to, struct net_device *from); 2783int dev_mc_sync(struct net_device *to, struct net_device *from);
2798extern int dev_mc_sync_multiple(struct net_device *to, struct net_device *from); 2784int dev_mc_sync_multiple(struct net_device *to, struct net_device *from);
2799extern void dev_mc_unsync(struct net_device *to, struct net_device *from); 2785void dev_mc_unsync(struct net_device *to, struct net_device *from);
2800extern void dev_mc_flush(struct net_device *dev); 2786void dev_mc_flush(struct net_device *dev);
2801extern void dev_mc_init(struct net_device *dev); 2787void dev_mc_init(struct net_device *dev);
2802 2788
2803/* Functions used for secondary unicast and multicast support */ 2789/* Functions used for secondary unicast and multicast support */
2804extern void dev_set_rx_mode(struct net_device *dev); 2790void dev_set_rx_mode(struct net_device *dev);
2805extern void __dev_set_rx_mode(struct net_device *dev); 2791void __dev_set_rx_mode(struct net_device *dev);
2806extern int dev_set_promiscuity(struct net_device *dev, int inc); 2792int dev_set_promiscuity(struct net_device *dev, int inc);
2807extern int dev_set_allmulti(struct net_device *dev, int inc); 2793int dev_set_allmulti(struct net_device *dev, int inc);
2808extern void netdev_state_change(struct net_device *dev); 2794void netdev_state_change(struct net_device *dev);
2809extern void netdev_notify_peers(struct net_device *dev); 2795void netdev_notify_peers(struct net_device *dev);
2810extern void netdev_features_change(struct net_device *dev); 2796void netdev_features_change(struct net_device *dev);
2811/* Load a device via the kmod */ 2797/* Load a device via the kmod */
2812extern void dev_load(struct net *net, const char *name); 2798void dev_load(struct net *net, const char *name);
2813extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, 2799struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
2814 struct rtnl_link_stats64 *storage); 2800 struct rtnl_link_stats64 *storage);
2815extern void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64, 2801void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64,
2816 const struct net_device_stats *netdev_stats); 2802 const struct net_device_stats *netdev_stats);
2817 2803
2818extern int netdev_max_backlog; 2804extern int netdev_max_backlog;
2819extern int netdev_tstamp_prequeue; 2805extern int netdev_tstamp_prequeue;
2820extern int weight_p; 2806extern int weight_p;
2821extern int bpf_jit_enable; 2807extern int bpf_jit_enable;
2822 2808
2823extern bool netdev_has_upper_dev(struct net_device *dev, 2809bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev);
2824 struct net_device *upper_dev); 2810bool netdev_has_any_upper_dev(struct net_device *dev);
2825extern bool netdev_has_any_upper_dev(struct net_device *dev); 2811struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev,
2826extern struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev, 2812 struct list_head **iter);
2827 struct list_head **iter);
2828 2813
2829/* iterate through upper list, must be called under RCU read lock */ 2814/* iterate through upper list, must be called under RCU read lock */
2830#define netdev_for_each_all_upper_dev_rcu(dev, updev, iter) \ 2815#define netdev_for_each_all_upper_dev_rcu(dev, updev, iter) \
@@ -2833,10 +2818,10 @@ extern struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *d
2833 updev; \ 2818 updev; \
2834 updev = netdev_all_upper_get_next_dev_rcu(dev, &(iter))) 2819 updev = netdev_all_upper_get_next_dev_rcu(dev, &(iter)))
2835 2820
2836extern void *netdev_lower_get_next_private(struct net_device *dev, 2821void *netdev_lower_get_next_private(struct net_device *dev,
2837 struct list_head **iter); 2822 struct list_head **iter);
2838extern void *netdev_lower_get_next_private_rcu(struct net_device *dev, 2823void *netdev_lower_get_next_private_rcu(struct net_device *dev,
2839 struct list_head **iter); 2824 struct list_head **iter);
2840 2825
2841#define netdev_for_each_lower_private(dev, priv, iter) \ 2826#define netdev_for_each_lower_private(dev, priv, iter) \
2842 for (iter = (dev)->adj_list.lower.next, \ 2827 for (iter = (dev)->adj_list.lower.next, \
@@ -2850,27 +2835,26 @@ extern void *netdev_lower_get_next_private_rcu(struct net_device *dev,
2850 priv; \ 2835 priv; \
2851 priv = netdev_lower_get_next_private_rcu(dev, &(iter))) 2836 priv = netdev_lower_get_next_private_rcu(dev, &(iter)))
2852 2837
2853extern void *netdev_adjacent_get_private(struct list_head *adj_list); 2838void *netdev_adjacent_get_private(struct list_head *adj_list);
2854extern struct net_device *netdev_master_upper_dev_get(struct net_device *dev); 2839struct net_device *netdev_master_upper_dev_get(struct net_device *dev);
2855extern struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev); 2840struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev);
2856extern int netdev_upper_dev_link(struct net_device *dev, 2841int netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev);
2842int netdev_master_upper_dev_link(struct net_device *dev,
2857 struct net_device *upper_dev); 2843 struct net_device *upper_dev);
2858extern int netdev_master_upper_dev_link(struct net_device *dev, 2844int netdev_master_upper_dev_link_private(struct net_device *dev,
2859 struct net_device *upper_dev); 2845 struct net_device *upper_dev,
2860extern int netdev_master_upper_dev_link_private(struct net_device *dev, 2846 void *private);
2861 struct net_device *upper_dev, 2847void netdev_upper_dev_unlink(struct net_device *dev,
2862 void *private); 2848 struct net_device *upper_dev);
2863extern void netdev_upper_dev_unlink(struct net_device *dev, 2849void *netdev_lower_dev_get_private_rcu(struct net_device *dev,
2864 struct net_device *upper_dev); 2850 struct net_device *lower_dev);
2865extern void *netdev_lower_dev_get_private_rcu(struct net_device *dev, 2851void *netdev_lower_dev_get_private(struct net_device *dev,
2866 struct net_device *lower_dev); 2852 struct net_device *lower_dev);
2867extern void *netdev_lower_dev_get_private(struct net_device *dev, 2853int skb_checksum_help(struct sk_buff *skb);
2868 struct net_device *lower_dev); 2854struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
2869extern int skb_checksum_help(struct sk_buff *skb); 2855 netdev_features_t features, bool tx_path);
2870extern struct sk_buff *__skb_gso_segment(struct sk_buff *skb, 2856struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb,
2871 netdev_features_t features, bool tx_path); 2857 netdev_features_t features);
2872extern struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb,
2873 netdev_features_t features);
2874 2858
2875static inline 2859static inline
2876struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features) 2860struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features)
@@ -2892,30 +2876,30 @@ static inline bool can_checksum_protocol(netdev_features_t features,
2892} 2876}
2893 2877
2894#ifdef CONFIG_BUG 2878#ifdef CONFIG_BUG
2895extern void netdev_rx_csum_fault(struct net_device *dev); 2879void netdev_rx_csum_fault(struct net_device *dev);
2896#else 2880#else
2897static inline void netdev_rx_csum_fault(struct net_device *dev) 2881static inline void netdev_rx_csum_fault(struct net_device *dev)
2898{ 2882{
2899} 2883}
2900#endif 2884#endif
2901/* rx skb timestamps */ 2885/* rx skb timestamps */
2902extern void net_enable_timestamp(void); 2886void net_enable_timestamp(void);
2903extern void net_disable_timestamp(void); 2887void net_disable_timestamp(void);
2904 2888
2905#ifdef CONFIG_PROC_FS 2889#ifdef CONFIG_PROC_FS
2906extern int __init dev_proc_init(void); 2890int __init dev_proc_init(void);
2907#else 2891#else
2908#define dev_proc_init() 0 2892#define dev_proc_init() 0
2909#endif 2893#endif
2910 2894
2911extern int netdev_class_create_file(struct class_attribute *class_attr); 2895int netdev_class_create_file(struct class_attribute *class_attr);
2912extern void netdev_class_remove_file(struct class_attribute *class_attr); 2896void netdev_class_remove_file(struct class_attribute *class_attr);
2913 2897
2914extern struct kobj_ns_type_operations net_ns_type_operations; 2898extern struct kobj_ns_type_operations net_ns_type_operations;
2915 2899
2916extern const char *netdev_drivername(const struct net_device *dev); 2900const char *netdev_drivername(const struct net_device *dev);
2917 2901
2918extern void linkwatch_run_queue(void); 2902void linkwatch_run_queue(void);
2919 2903
2920static inline netdev_features_t netdev_get_wanted_features( 2904static inline netdev_features_t netdev_get_wanted_features(
2921 struct net_device *dev) 2905 struct net_device *dev)
@@ -3007,22 +2991,22 @@ static inline const char *netdev_name(const struct net_device *dev)
3007 return dev->name; 2991 return dev->name;
3008} 2992}
3009 2993
3010extern __printf(3, 4) 2994__printf(3, 4)
3011int netdev_printk(const char *level, const struct net_device *dev, 2995int netdev_printk(const char *level, const struct net_device *dev,
3012 const char *format, ...); 2996 const char *format, ...);
3013extern __printf(2, 3) 2997__printf(2, 3)
3014int netdev_emerg(const struct net_device *dev, const char *format, ...); 2998int netdev_emerg(const struct net_device *dev, const char *format, ...);
3015extern __printf(2, 3) 2999__printf(2, 3)
3016int netdev_alert(const struct net_device *dev, const char *format, ...); 3000int netdev_alert(const struct net_device *dev, const char *format, ...);
3017extern __printf(2, 3) 3001__printf(2, 3)
3018int netdev_crit(const struct net_device *dev, const char *format, ...); 3002int netdev_crit(const struct net_device *dev, const char *format, ...);
3019extern __printf(2, 3) 3003__printf(2, 3)
3020int netdev_err(const struct net_device *dev, const char *format, ...); 3004int netdev_err(const struct net_device *dev, const char *format, ...);
3021extern __printf(2, 3) 3005__printf(2, 3)
3022int netdev_warn(const struct net_device *dev, const char *format, ...); 3006int netdev_warn(const struct net_device *dev, const char *format, ...);
3023extern __printf(2, 3) 3007__printf(2, 3)
3024int netdev_notice(const struct net_device *dev, const char *format, ...); 3008int netdev_notice(const struct net_device *dev, const char *format, ...);
3025extern __printf(2, 3) 3009__printf(2, 3)
3026int netdev_info(const struct net_device *dev, const char *format, ...); 3010int netdev_info(const struct net_device *dev, const char *format, ...);
3027 3011
3028#define MODULE_ALIAS_NETDEV(device) \ 3012#define MODULE_ALIAS_NETDEV(device) \