Commit f629d208d27a22f495b7734eede585b5d207e912

Authored by Joe Perches
1 parent 7965bd4d71

[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>

Showing 6 changed files with 248 additions and 266 deletions Side-by-side Diff

include/linux/etherdevice.h
... ... @@ -28,27 +28,24 @@
28 28 #include <asm/unaligned.h>
29 29  
30 30 #ifdef __KERNEL__
31   -extern __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev);
  31 +__be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev);
32 32 extern const struct header_ops eth_header_ops;
33 33  
34   -extern int eth_header(struct sk_buff *skb, struct net_device *dev,
35   - unsigned short type,
36   - const void *daddr, const void *saddr, unsigned len);
37   -extern int eth_rebuild_header(struct sk_buff *skb);
38   -extern int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr);
39   -extern int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, __be16 type);
40   -extern void eth_header_cache_update(struct hh_cache *hh,
41   - const struct net_device *dev,
42   - const unsigned char *haddr);
43   -extern int eth_prepare_mac_addr_change(struct net_device *dev, void *p);
44   -extern void eth_commit_mac_addr_change(struct net_device *dev, void *p);
45   -extern int eth_mac_addr(struct net_device *dev, void *p);
46   -extern int eth_change_mtu(struct net_device *dev, int new_mtu);
47   -extern int eth_validate_addr(struct net_device *dev);
  34 +int eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type,
  35 + const void *daddr, const void *saddr, unsigned len);
  36 +int eth_rebuild_header(struct sk_buff *skb);
  37 +int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr);
  38 +int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh,
  39 + __be16 type);
  40 +void eth_header_cache_update(struct hh_cache *hh, const struct net_device *dev,
  41 + const unsigned char *haddr);
  42 +int eth_prepare_mac_addr_change(struct net_device *dev, void *p);
  43 +void eth_commit_mac_addr_change(struct net_device *dev, void *p);
  44 +int eth_mac_addr(struct net_device *dev, void *p);
  45 +int eth_change_mtu(struct net_device *dev, int new_mtu);
  46 +int eth_validate_addr(struct net_device *dev);
48 47  
49   -
50   -
51   -extern struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
  48 +struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
52 49 unsigned int rxqs);
53 50 #define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1)
54 51 #define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count)
include/linux/fcdevice.h
... ... @@ -27,7 +27,7 @@
27 27 #include <linux/if_fc.h>
28 28  
29 29 #ifdef __KERNEL__
30   -extern struct net_device *alloc_fcdev(int sizeof_priv);
  30 +struct net_device *alloc_fcdev(int sizeof_priv);
31 31 #endif
32 32  
33 33 #endif /* _LINUX_FCDEVICE_H */
include/linux/fddidevice.h
... ... @@ -25,10 +25,9 @@
25 25 #include <linux/if_fddi.h>
26 26  
27 27 #ifdef __KERNEL__
28   -extern __be16 fddi_type_trans(struct sk_buff *skb,
29   - struct net_device *dev);
30   -extern int fddi_change_mtu(struct net_device *dev, int new_mtu);
31   -extern struct net_device *alloc_fddidev(int sizeof_priv);
  28 +__be16 fddi_type_trans(struct sk_buff *skb, struct net_device *dev);
  29 +int fddi_change_mtu(struct net_device *dev, int new_mtu);
  30 +struct net_device *alloc_fddidev(int sizeof_priv);
32 31 #endif
33 32  
34 33 #endif /* _LINUX_FDDIDEVICE_H */
include/linux/hippidevice.h
... ... @@ -31,11 +31,11 @@
31 31 __u32 ifield;
32 32 };
33 33  
34   -extern __be16 hippi_type_trans(struct sk_buff *skb, struct net_device *dev);
35   -extern int hippi_change_mtu(struct net_device *dev, int new_mtu);
36   -extern int hippi_mac_addr(struct net_device *dev, void *p);
37   -extern int hippi_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p);
38   -extern struct net_device *alloc_hippi_dev(int sizeof_priv);
  34 +__be16 hippi_type_trans(struct sk_buff *skb, struct net_device *dev);
  35 +int hippi_change_mtu(struct net_device *dev, int new_mtu);
  36 +int hippi_mac_addr(struct net_device *dev, void *p);
  37 +int hippi_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p);
  38 +struct net_device *alloc_hippi_dev(int sizeof_priv);
39 39 #endif
40 40  
41 41 #endif /* _LINUX_HIPPIDEVICE_H */
include/linux/inetdevice.h
... ... @@ -147,25 +147,27 @@
147 147 unsigned long ifa_tstamp; /* updated timestamp */
148 148 };
149 149  
150   -extern int register_inetaddr_notifier(struct notifier_block *nb);
151   -extern int unregister_inetaddr_notifier(struct notifier_block *nb);
  150 +int register_inetaddr_notifier(struct notifier_block *nb);
  151 +int unregister_inetaddr_notifier(struct notifier_block *nb);
152 152  
153   -extern void inet_netconf_notify_devconf(struct net *net, int type, int ifindex,
154   - struct ipv4_devconf *devconf);
  153 +void inet_netconf_notify_devconf(struct net *net, int type, int ifindex,
  154 + struct ipv4_devconf *devconf);
155 155  
156   -extern struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref);
  156 +struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref);
157 157 static inline struct net_device *ip_dev_find(struct net *net, __be32 addr)
158 158 {
159 159 return __ip_dev_find(net, addr, true);
160 160 }
161 161  
162   -extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b);
163   -extern int devinet_ioctl(struct net *net, unsigned int cmd, void __user *);
164   -extern void devinet_init(void);
165   -extern struct in_device *inetdev_by_index(struct net *, int);
166   -extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope);
167   -extern __be32 inet_confirm_addr(struct in_device *in_dev, __be32 dst, __be32 local, int scope);
168   -extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, __be32 mask);
  162 +int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b);
  163 +int devinet_ioctl(struct net *net, unsigned int cmd, void __user *);
  164 +void devinet_init(void);
  165 +struct in_device *inetdev_by_index(struct net *, int);
  166 +__be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope);
  167 +__be32 inet_confirm_addr(struct in_device *in_dev, __be32 dst, __be32 local,
  168 + int scope);
  169 +struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix,
  170 + __be32 mask);
169 171  
170 172 static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa)
171 173 {
... ... @@ -218,7 +220,7 @@
218 220 return rtnl_dereference(dev->ip_ptr);
219 221 }
220 222  
221   -extern void in_dev_finish_destroy(struct in_device *idev);
  223 +void in_dev_finish_destroy(struct in_device *idev);
222 224  
223 225 static inline void in_dev_put(struct in_device *idev)
224 226 {
include/linux/netdevice.h
... ... @@ -60,8 +60,8 @@
60 60 #define SET_ETHTOOL_OPS(netdev,ops) \
61 61 ( (netdev)->ethtool_ops = (ops) )
62 62  
63   -extern void netdev_set_default_ethtool_ops(struct net_device *dev,
64   - const struct ethtool_ops *ops);
  63 +void netdev_set_default_ethtool_ops(struct net_device *dev,
  64 + const struct ethtool_ops *ops);
65 65  
66 66 /* hardware address assignment types */
67 67 #define NET_ADDR_PERM 0 /* address is permanent (default) */
... ... @@ -298,7 +298,7 @@
298 298 };
299 299 #define NETDEV_BOOT_SETUP_MAX 8
300 300  
301   -extern int __init netdev_boot_setup(char *str);
  301 +int __init netdev_boot_setup(char *str);
302 302  
303 303 /*
304 304 * Structure for NAPI scheduling similar to tasklet but with weighting
... ... @@ -394,7 +394,7 @@
394 394 typedef enum rx_handler_result rx_handler_result_t;
395 395 typedef rx_handler_result_t rx_handler_func_t(struct sk_buff **pskb);
396 396  
397   -extern void __napi_schedule(struct napi_struct *n);
  397 +void __napi_schedule(struct napi_struct *n);
398 398  
399 399 static inline bool napi_disable_pending(struct napi_struct *n)
400 400 {
... ... @@ -445,8 +445,8 @@
445 445 *
446 446 * Mark NAPI processing as complete.
447 447 */
448   -extern void __napi_complete(struct napi_struct *n);
449   -extern void napi_complete(struct napi_struct *n);
  448 +void __napi_complete(struct napi_struct *n);
  449 +void napi_complete(struct napi_struct *n);
450 450  
451 451 /**
452 452 * napi_by_id - lookup a NAPI by napi_id
... ... @@ -455,7 +455,7 @@
455 455 * lookup @napi_id in napi_hash table
456 456 * must be called under rcu_read_lock()
457 457 */
458   -extern struct napi_struct *napi_by_id(unsigned int napi_id);
  458 +struct napi_struct *napi_by_id(unsigned int napi_id);
459 459  
460 460 /**
461 461 * napi_hash_add - add a NAPI to global hashtable
... ... @@ -463,7 +463,7 @@
463 463 *
464 464 * generate a new napi_id and store a @napi under it in napi_hash
465 465 */
466   -extern void napi_hash_add(struct napi_struct *napi);
  466 +void napi_hash_add(struct napi_struct *napi);
467 467  
468 468 /**
469 469 * napi_hash_del - remove a NAPI from global table
... ... @@ -472,7 +472,7 @@
472 472 * Warning: caller must observe rcu grace period
473 473 * before freeing memory containing @napi
474 474 */
475   -extern void napi_hash_del(struct napi_struct *napi);
  475 +void napi_hash_del(struct napi_struct *napi);
476 476  
477 477 /**
478 478 * napi_disable - prevent NAPI from scheduling
... ... @@ -664,8 +664,8 @@
664 664 extern struct rps_sock_flow_table __rcu *rps_sock_flow_table;
665 665  
666 666 #ifdef CONFIG_RFS_ACCEL
667   -extern bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index,
668   - u32 flow_id, u16 filter_id);
  667 +bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id,
  668 + u16 filter_id);
669 669 #endif
670 670  
671 671 /* This structure contains an instance of an RX queue. */
... ... @@ -1497,9 +1497,9 @@
1497 1497 f(dev, &dev->_tx[i], arg);
1498 1498 }
1499 1499  
1500   -extern struct netdev_queue *netdev_pick_tx(struct net_device *dev,
1501   - struct sk_buff *skb);
1502   -extern u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb);
  1500 +struct netdev_queue *netdev_pick_tx(struct net_device *dev,
  1501 + struct sk_buff *skb);
  1502 +u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb);
1503 1503  
1504 1504 /*
1505 1505 * Net namespace inlines
... ... @@ -1683,8 +1683,8 @@
1683 1683 #define NETDEV_CHANGEUPPER 0x0015
1684 1684 #define NETDEV_RESEND_IGMP 0x0016
1685 1685  
1686   -extern int register_netdevice_notifier(struct notifier_block *nb);
1687   -extern int unregister_netdevice_notifier(struct notifier_block *nb);
  1686 +int register_netdevice_notifier(struct notifier_block *nb);
  1687 +int unregister_netdevice_notifier(struct notifier_block *nb);
1688 1688  
1689 1689 struct netdev_notifier_info {
1690 1690 struct net_device *dev;
... ... @@ -1707,9 +1707,9 @@
1707 1707 return info->dev;
1708 1708 }
1709 1709  
1710   -extern int call_netdevice_notifiers_info(unsigned long val, struct net_device *dev,
1711   - struct netdev_notifier_info *info);
1712   -extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
  1710 +int call_netdevice_notifiers_info(unsigned long val, struct net_device *dev,
  1711 + struct netdev_notifier_info *info);
  1712 +int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
1713 1713  
1714 1714  
1715 1715 extern rwlock_t dev_base_lock; /* Device list lock */
1716 1716  
1717 1717  
1718 1718  
1719 1719  
1720 1720  
... ... @@ -1764,54 +1764,52 @@
1764 1764 return lh == &net->dev_base_head ? NULL : net_device_entry(lh);
1765 1765 }
1766 1766  
1767   -extern int netdev_boot_setup_check(struct net_device *dev);
1768   -extern unsigned long netdev_boot_base(const char *prefix, int unit);
1769   -extern struct net_device *dev_getbyhwaddr_rcu(struct net *net, unsigned short type,
1770   - const char *hwaddr);
1771   -extern struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type);
1772   -extern struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short type);
1773   -extern void dev_add_pack(struct packet_type *pt);
1774   -extern void dev_remove_pack(struct packet_type *pt);
1775   -extern void __dev_remove_pack(struct packet_type *pt);
1776   -extern void dev_add_offload(struct packet_offload *po);
1777   -extern void dev_remove_offload(struct packet_offload *po);
1778   -extern void __dev_remove_offload(struct packet_offload *po);
  1767 +int netdev_boot_setup_check(struct net_device *dev);
  1768 +unsigned long netdev_boot_base(const char *prefix, int unit);
  1769 +struct net_device *dev_getbyhwaddr_rcu(struct net *net, unsigned short type,
  1770 + const char *hwaddr);
  1771 +struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type);
  1772 +struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short type);
  1773 +void dev_add_pack(struct packet_type *pt);
  1774 +void dev_remove_pack(struct packet_type *pt);
  1775 +void __dev_remove_pack(struct packet_type *pt);
  1776 +void dev_add_offload(struct packet_offload *po);
  1777 +void dev_remove_offload(struct packet_offload *po);
  1778 +void __dev_remove_offload(struct packet_offload *po);
1779 1779  
1780   -extern struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags,
1781   - unsigned short mask);
1782   -extern struct net_device *dev_get_by_name(struct net *net, const char *name);
1783   -extern struct net_device *dev_get_by_name_rcu(struct net *net, const char *name);
1784   -extern struct net_device *__dev_get_by_name(struct net *net, const char *name);
1785   -extern int dev_alloc_name(struct net_device *dev, const char *name);
1786   -extern int dev_open(struct net_device *dev);
1787   -extern int dev_close(struct net_device *dev);
1788   -extern void dev_disable_lro(struct net_device *dev);
1789   -extern int dev_loopback_xmit(struct sk_buff *newskb);
1790   -extern int dev_queue_xmit(struct sk_buff *skb);
1791   -extern int register_netdevice(struct net_device *dev);
1792   -extern void unregister_netdevice_queue(struct net_device *dev,
1793   - struct list_head *head);
1794   -extern void unregister_netdevice_many(struct list_head *head);
  1780 +struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags,
  1781 + unsigned short mask);
  1782 +struct net_device *dev_get_by_name(struct net *net, const char *name);
  1783 +struct net_device *dev_get_by_name_rcu(struct net *net, const char *name);
  1784 +struct net_device *__dev_get_by_name(struct net *net, const char *name);
  1785 +int dev_alloc_name(struct net_device *dev, const char *name);
  1786 +int dev_open(struct net_device *dev);
  1787 +int dev_close(struct net_device *dev);
  1788 +void dev_disable_lro(struct net_device *dev);
  1789 +int dev_loopback_xmit(struct sk_buff *newskb);
  1790 +int dev_queue_xmit(struct sk_buff *skb);
  1791 +int register_netdevice(struct net_device *dev);
  1792 +void unregister_netdevice_queue(struct net_device *dev, struct list_head *head);
  1793 +void unregister_netdevice_many(struct list_head *head);
1795 1794 static inline void unregister_netdevice(struct net_device *dev)
1796 1795 {
1797 1796 unregister_netdevice_queue(dev, NULL);
1798 1797 }
1799 1798  
1800   -extern int netdev_refcnt_read(const struct net_device *dev);
1801   -extern void free_netdev(struct net_device *dev);
1802   -extern void synchronize_net(void);
1803   -extern int init_dummy_netdev(struct net_device *dev);
  1799 +int netdev_refcnt_read(const struct net_device *dev);
  1800 +void free_netdev(struct net_device *dev);
  1801 +void synchronize_net(void);
  1802 +int init_dummy_netdev(struct net_device *dev);
1804 1803  
1805   -extern struct net_device *dev_get_by_index(struct net *net, int ifindex);
1806   -extern struct net_device *__dev_get_by_index(struct net *net, int ifindex);
1807   -extern struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex);
1808   -extern int netdev_get_name(struct net *net, char *name, int ifindex);
1809   -extern int dev_restart(struct net_device *dev);
  1804 +struct net_device *dev_get_by_index(struct net *net, int ifindex);
  1805 +struct net_device *__dev_get_by_index(struct net *net, int ifindex);
  1806 +struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex);
  1807 +int netdev_get_name(struct net *net, char *name, int ifindex);
  1808 +int dev_restart(struct net_device *dev);
1810 1809 #ifdef CONFIG_NETPOLL_TRAP
1811   -extern int netpoll_trap(void);
  1810 +int netpoll_trap(void);
1812 1811 #endif
1813   -extern int skb_gro_receive(struct sk_buff **head,
1814   - struct sk_buff *skb);
  1812 +int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb);
1815 1813  
1816 1814 static inline unsigned int skb_gro_offset(const struct sk_buff *skb)
1817 1815 {
... ... @@ -1883,7 +1881,7 @@
1883 1881 }
1884 1882  
1885 1883 typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len);
1886   -extern int register_gifconf(unsigned int family, gifconf_func_t * gifconf);
  1884 +int register_gifconf(unsigned int family, gifconf_func_t *gifconf);
1887 1885 static inline int unregister_gifconf(unsigned int family)
1888 1886 {
1889 1887 return register_gifconf(family, NULL);
... ... @@ -1954,7 +1952,7 @@
1954 1952  
1955 1953 DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data);
1956 1954  
1957   -extern void __netif_schedule(struct Qdisc *q);
  1955 +void __netif_schedule(struct Qdisc *q);
1958 1956  
1959 1957 static inline void netif_schedule_queue(struct netdev_queue *txq)
1960 1958 {
... ... @@ -2274,8 +2272,8 @@
2274 2272 }
2275 2273  
2276 2274 #ifdef CONFIG_XPS
2277   -extern int netif_set_xps_queue(struct net_device *dev, struct cpumask *mask,
2278   - u16 index);
  2275 +int netif_set_xps_queue(struct net_device *dev, struct cpumask *mask,
  2276 + u16 index);
2279 2277 #else
2280 2278 static inline int netif_set_xps_queue(struct net_device *dev,
2281 2279 struct cpumask *mask,
2282 2280  
... ... @@ -2306,12 +2304,10 @@
2306 2304 return dev->num_tx_queues > 1;
2307 2305 }
2308 2306  
2309   -extern int netif_set_real_num_tx_queues(struct net_device *dev,
2310   - unsigned int txq);
  2307 +int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq);
2311 2308  
2312 2309 #ifdef CONFIG_RPS
2313   -extern int netif_set_real_num_rx_queues(struct net_device *dev,
2314   - unsigned int rxq);
  2310 +int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq);
2315 2311 #else
2316 2312 static inline int netif_set_real_num_rx_queues(struct net_device *dev,
2317 2313 unsigned int rxq)
2318 2314  
2319 2315  
2320 2316  
... ... @@ -2338,28 +2334,27 @@
2338 2334 }
2339 2335  
2340 2336 #define DEFAULT_MAX_NUM_RSS_QUEUES (8)
2341   -extern int netif_get_num_default_rss_queues(void);
  2337 +int netif_get_num_default_rss_queues(void);
2342 2338  
2343 2339 /* Use this variant when it is known for sure that it
2344 2340 * is executing from hardware interrupt context or with hardware interrupts
2345 2341 * disabled.
2346 2342 */
2347   -extern void dev_kfree_skb_irq(struct sk_buff *skb);
  2343 +void dev_kfree_skb_irq(struct sk_buff *skb);
2348 2344  
2349 2345 /* Use this variant in places where it could be invoked
2350 2346 * from either hardware interrupt or other context, with hardware interrupts
2351 2347 * either disabled or enabled.
2352 2348 */
2353   -extern void dev_kfree_skb_any(struct sk_buff *skb);
  2349 +void dev_kfree_skb_any(struct sk_buff *skb);
2354 2350  
2355   -extern int netif_rx(struct sk_buff *skb);
2356   -extern int netif_rx_ni(struct sk_buff *skb);
2357   -extern int netif_receive_skb(struct sk_buff *skb);
2358   -extern gro_result_t napi_gro_receive(struct napi_struct *napi,
2359   - struct sk_buff *skb);
2360   -extern void napi_gro_flush(struct napi_struct *napi, bool flush_old);
2361   -extern struct sk_buff * napi_get_frags(struct napi_struct *napi);
2362   -extern gro_result_t napi_gro_frags(struct napi_struct *napi);
  2351 +int netif_rx(struct sk_buff *skb);
  2352 +int netif_rx_ni(struct sk_buff *skb);
  2353 +int netif_receive_skb(struct sk_buff *skb);
  2354 +gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb);
  2355 +void napi_gro_flush(struct napi_struct *napi, bool flush_old);
  2356 +struct sk_buff *napi_get_frags(struct napi_struct *napi);
  2357 +gro_result_t napi_gro_frags(struct napi_struct *napi);
2363 2358  
2364 2359 static inline void napi_free_frags(struct napi_struct *napi)
2365 2360 {
2366 2361  
2367 2362  
... ... @@ -2367,40 +2362,35 @@
2367 2362 napi->skb = NULL;
2368 2363 }
2369 2364  
2370   -extern int netdev_rx_handler_register(struct net_device *dev,
2371   - rx_handler_func_t *rx_handler,
2372   - void *rx_handler_data);
2373   -extern void netdev_rx_handler_unregister(struct net_device *dev);
  2365 +int netdev_rx_handler_register(struct net_device *dev,
  2366 + rx_handler_func_t *rx_handler,
  2367 + void *rx_handler_data);
  2368 +void netdev_rx_handler_unregister(struct net_device *dev);
2374 2369  
2375   -extern bool dev_valid_name(const char *name);
2376   -extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *);
2377   -extern int dev_ethtool(struct net *net, struct ifreq *);
2378   -extern unsigned int dev_get_flags(const struct net_device *);
2379   -extern int __dev_change_flags(struct net_device *, unsigned int flags);
2380   -extern int dev_change_flags(struct net_device *, unsigned int);
2381   -extern void __dev_notify_flags(struct net_device *, unsigned int old_flags);
2382   -extern int dev_change_name(struct net_device *, const char *);
2383   -extern int dev_set_alias(struct net_device *, const char *, size_t);
2384   -extern int dev_change_net_namespace(struct net_device *,
2385   - struct net *, const char *);
2386   -extern int dev_set_mtu(struct net_device *, int);
2387   -extern void dev_set_group(struct net_device *, int);
2388   -extern int dev_set_mac_address(struct net_device *,
2389   - struct sockaddr *);
2390   -extern int dev_change_carrier(struct net_device *,
2391   - bool new_carrier);
2392   -extern int dev_get_phys_port_id(struct net_device *dev,
2393   - struct netdev_phys_port_id *ppid);
2394   -extern int dev_hard_start_xmit(struct sk_buff *skb,
2395   - struct net_device *dev,
2396   - struct netdev_queue *txq);
2397   -extern int dev_forward_skb(struct net_device *dev,
2398   - struct sk_buff *skb);
  2370 +bool dev_valid_name(const char *name);
  2371 +int dev_ioctl(struct net *net, unsigned int cmd, void __user *);
  2372 +int dev_ethtool(struct net *net, struct ifreq *);
  2373 +unsigned int dev_get_flags(const struct net_device *);
  2374 +int __dev_change_flags(struct net_device *, unsigned int flags);
  2375 +int dev_change_flags(struct net_device *, unsigned int);
  2376 +void __dev_notify_flags(struct net_device *, unsigned int old_flags);
  2377 +int dev_change_name(struct net_device *, const char *);
  2378 +int dev_set_alias(struct net_device *, const char *, size_t);
  2379 +int dev_change_net_namespace(struct net_device *, struct net *, const char *);
  2380 +int dev_set_mtu(struct net_device *, int);
  2381 +void dev_set_group(struct net_device *, int);
  2382 +int dev_set_mac_address(struct net_device *, struct sockaddr *);
  2383 +int dev_change_carrier(struct net_device *, bool new_carrier);
  2384 +int dev_get_phys_port_id(struct net_device *dev,
  2385 + struct netdev_phys_port_id *ppid);
  2386 +int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
  2387 + struct netdev_queue *txq);
  2388 +int dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
2399 2389  
2400 2390 extern int netdev_budget;
2401 2391  
2402 2392 /* Called by rtnetlink.c:rtnl_unlock() */
2403   -extern void netdev_run_todo(void);
  2393 +void netdev_run_todo(void);
2404 2394  
2405 2395 /**
2406 2396 * dev_put - release reference to device
... ... @@ -2433,9 +2423,9 @@
2433 2423 * kind of lower layer not just hardware media.
2434 2424 */
2435 2425  
2436   -extern void linkwatch_init_dev(struct net_device *dev);
2437   -extern void linkwatch_fire_event(struct net_device *dev);
2438   -extern void linkwatch_forget_dev(struct net_device *dev);
  2426 +void linkwatch_init_dev(struct net_device *dev);
  2427 +void linkwatch_fire_event(struct net_device *dev);
  2428 +void linkwatch_forget_dev(struct net_device *dev);
2439 2429  
2440 2430 /**
2441 2431 * netif_carrier_ok - test if carrier present
2442 2432  
2443 2433  
2444 2434  
... ... @@ -2448,13 +2438,13 @@
2448 2438 return !test_bit(__LINK_STATE_NOCARRIER, &dev->state);
2449 2439 }
2450 2440  
2451   -extern unsigned long dev_trans_start(struct net_device *dev);
  2441 +unsigned long dev_trans_start(struct net_device *dev);
2452 2442  
2453   -extern void __netdev_watchdog_up(struct net_device *dev);
  2443 +void __netdev_watchdog_up(struct net_device *dev);
2454 2444  
2455   -extern void netif_carrier_on(struct net_device *dev);
  2445 +void netif_carrier_on(struct net_device *dev);
2456 2446  
2457   -extern void netif_carrier_off(struct net_device *dev);
  2447 +void netif_carrier_off(struct net_device *dev);
2458 2448  
2459 2449 /**
2460 2450 * netif_dormant_on - mark device as dormant.
2461 2451  
... ... @@ -2522,9 +2512,9 @@
2522 2512 return test_bit(__LINK_STATE_PRESENT, &dev->state);
2523 2513 }
2524 2514  
2525   -extern void netif_device_detach(struct net_device *dev);
  2515 +void netif_device_detach(struct net_device *dev);
2526 2516  
2527   -extern void netif_device_attach(struct net_device *dev);
  2517 +void netif_device_attach(struct net_device *dev);
2528 2518  
2529 2519 /*
2530 2520 * Network interface message level settings
2531 2521  
2532 2522  
2533 2523  
2534 2524  
2535 2525  
2536 2526  
2537 2527  
2538 2528  
2539 2529  
... ... @@ -2733,98 +2723,93 @@
2733 2723  
2734 2724 /* These functions live elsewhere (drivers/net/net_init.c, but related) */
2735 2725  
2736   -extern void ether_setup(struct net_device *dev);
  2726 +void ether_setup(struct net_device *dev);
2737 2727  
2738 2728 /* Support for loadable net-drivers */
2739   -extern struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
2740   - void (*setup)(struct net_device *),
2741   - unsigned int txqs, unsigned int rxqs);
  2729 +struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
  2730 + void (*setup)(struct net_device *),
  2731 + unsigned int txqs, unsigned int rxqs);
2742 2732 #define alloc_netdev(sizeof_priv, name, setup) \
2743 2733 alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1)
2744 2734  
2745 2735 #define alloc_netdev_mq(sizeof_priv, name, setup, count) \
2746 2736 alloc_netdev_mqs(sizeof_priv, name, setup, count, count)
2747 2737  
2748   -extern int register_netdev(struct net_device *dev);
2749   -extern void unregister_netdev(struct net_device *dev);
  2738 +int register_netdev(struct net_device *dev);
  2739 +void unregister_netdev(struct net_device *dev);
2750 2740  
2751 2741 /* General hardware address lists handling functions */
2752   -extern int __hw_addr_add_multiple(struct netdev_hw_addr_list *to_list,
2753   - struct netdev_hw_addr_list *from_list,
2754   - int addr_len, unsigned char addr_type);
2755   -extern void __hw_addr_del_multiple(struct netdev_hw_addr_list *to_list,
2756   - struct netdev_hw_addr_list *from_list,
2757   - int addr_len, unsigned char addr_type);
2758   -extern int __hw_addr_sync(struct netdev_hw_addr_list *to_list,
2759   - struct netdev_hw_addr_list *from_list,
2760   - int addr_len);
2761   -extern void __hw_addr_unsync(struct netdev_hw_addr_list *to_list,
2762   - struct netdev_hw_addr_list *from_list,
2763   - int addr_len);
2764   -extern void __hw_addr_flush(struct netdev_hw_addr_list *list);
2765   -extern void __hw_addr_init(struct netdev_hw_addr_list *list);
  2742 +int __hw_addr_add_multiple(struct netdev_hw_addr_list *to_list,
  2743 + struct netdev_hw_addr_list *from_list,
  2744 + int addr_len, unsigned char addr_type);
  2745 +void __hw_addr_del_multiple(struct netdev_hw_addr_list *to_list,
  2746 + struct netdev_hw_addr_list *from_list,
  2747 + int addr_len, unsigned char addr_type);
  2748 +int __hw_addr_sync(struct netdev_hw_addr_list *to_list,
  2749 + struct netdev_hw_addr_list *from_list, int addr_len);
  2750 +void __hw_addr_unsync(struct netdev_hw_addr_list *to_list,
  2751 + struct netdev_hw_addr_list *from_list, int addr_len);
  2752 +void __hw_addr_flush(struct netdev_hw_addr_list *list);
  2753 +void __hw_addr_init(struct netdev_hw_addr_list *list);
2766 2754  
2767 2755 /* Functions used for device addresses handling */
2768   -extern int dev_addr_add(struct net_device *dev, const unsigned char *addr,
2769   - unsigned char addr_type);
2770   -extern int dev_addr_del(struct net_device *dev, const unsigned char *addr,
2771   - unsigned char addr_type);
2772   -extern int dev_addr_add_multiple(struct net_device *to_dev,
2773   - struct net_device *from_dev,
2774   - unsigned char addr_type);
2775   -extern int dev_addr_del_multiple(struct net_device *to_dev,
2776   - struct net_device *from_dev,
2777   - unsigned char addr_type);
2778   -extern void dev_addr_flush(struct net_device *dev);
2779   -extern int dev_addr_init(struct net_device *dev);
  2756 +int dev_addr_add(struct net_device *dev, const unsigned char *addr,
  2757 + unsigned char addr_type);
  2758 +int dev_addr_del(struct net_device *dev, const unsigned char *addr,
  2759 + unsigned char addr_type);
  2760 +int dev_addr_add_multiple(struct net_device *to_dev,
  2761 + struct net_device *from_dev, unsigned char addr_type);
  2762 +int dev_addr_del_multiple(struct net_device *to_dev,
  2763 + struct net_device *from_dev, unsigned char addr_type);
  2764 +void dev_addr_flush(struct net_device *dev);
  2765 +int dev_addr_init(struct net_device *dev);
2780 2766  
2781 2767 /* Functions used for unicast addresses handling */
2782   -extern int dev_uc_add(struct net_device *dev, const unsigned char *addr);
2783   -extern int dev_uc_add_excl(struct net_device *dev, const unsigned char *addr);
2784   -extern int dev_uc_del(struct net_device *dev, const unsigned char *addr);
2785   -extern int dev_uc_sync(struct net_device *to, struct net_device *from);
2786   -extern int dev_uc_sync_multiple(struct net_device *to, struct net_device *from);
2787   -extern void dev_uc_unsync(struct net_device *to, struct net_device *from);
2788   -extern void dev_uc_flush(struct net_device *dev);
2789   -extern void dev_uc_init(struct net_device *dev);
  2768 +int dev_uc_add(struct net_device *dev, const unsigned char *addr);
  2769 +int dev_uc_add_excl(struct net_device *dev, const unsigned char *addr);
  2770 +int dev_uc_del(struct net_device *dev, const unsigned char *addr);
  2771 +int dev_uc_sync(struct net_device *to, struct net_device *from);
  2772 +int dev_uc_sync_multiple(struct net_device *to, struct net_device *from);
  2773 +void dev_uc_unsync(struct net_device *to, struct net_device *from);
  2774 +void dev_uc_flush(struct net_device *dev);
  2775 +void dev_uc_init(struct net_device *dev);
2790 2776  
2791 2777 /* Functions used for multicast addresses handling */
2792   -extern int dev_mc_add(struct net_device *dev, const unsigned char *addr);
2793   -extern int dev_mc_add_global(struct net_device *dev, const unsigned char *addr);
2794   -extern int dev_mc_add_excl(struct net_device *dev, const unsigned char *addr);
2795   -extern int dev_mc_del(struct net_device *dev, const unsigned char *addr);
2796   -extern int dev_mc_del_global(struct net_device *dev, const unsigned char *addr);
2797   -extern int dev_mc_sync(struct net_device *to, struct net_device *from);
2798   -extern int dev_mc_sync_multiple(struct net_device *to, struct net_device *from);
2799   -extern void dev_mc_unsync(struct net_device *to, struct net_device *from);
2800   -extern void dev_mc_flush(struct net_device *dev);
2801   -extern void dev_mc_init(struct net_device *dev);
  2778 +int dev_mc_add(struct net_device *dev, const unsigned char *addr);
  2779 +int dev_mc_add_global(struct net_device *dev, const unsigned char *addr);
  2780 +int dev_mc_add_excl(struct net_device *dev, const unsigned char *addr);
  2781 +int dev_mc_del(struct net_device *dev, const unsigned char *addr);
  2782 +int dev_mc_del_global(struct net_device *dev, const unsigned char *addr);
  2783 +int dev_mc_sync(struct net_device *to, struct net_device *from);
  2784 +int dev_mc_sync_multiple(struct net_device *to, struct net_device *from);
  2785 +void dev_mc_unsync(struct net_device *to, struct net_device *from);
  2786 +void dev_mc_flush(struct net_device *dev);
  2787 +void dev_mc_init(struct net_device *dev);
2802 2788  
2803 2789 /* Functions used for secondary unicast and multicast support */
2804   -extern void dev_set_rx_mode(struct net_device *dev);
2805   -extern void __dev_set_rx_mode(struct net_device *dev);
2806   -extern int dev_set_promiscuity(struct net_device *dev, int inc);
2807   -extern int dev_set_allmulti(struct net_device *dev, int inc);
2808   -extern void netdev_state_change(struct net_device *dev);
2809   -extern void netdev_notify_peers(struct net_device *dev);
2810   -extern void netdev_features_change(struct net_device *dev);
  2790 +void dev_set_rx_mode(struct net_device *dev);
  2791 +void __dev_set_rx_mode(struct net_device *dev);
  2792 +int dev_set_promiscuity(struct net_device *dev, int inc);
  2793 +int dev_set_allmulti(struct net_device *dev, int inc);
  2794 +void netdev_state_change(struct net_device *dev);
  2795 +void netdev_notify_peers(struct net_device *dev);
  2796 +void netdev_features_change(struct net_device *dev);
2811 2797 /* Load a device via the kmod */
2812   -extern void dev_load(struct net *net, const char *name);
2813   -extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
2814   - struct rtnl_link_stats64 *storage);
2815   -extern void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64,
2816   - const struct net_device_stats *netdev_stats);
  2798 +void dev_load(struct net *net, const char *name);
  2799 +struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
  2800 + struct rtnl_link_stats64 *storage);
  2801 +void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64,
  2802 + const struct net_device_stats *netdev_stats);
2817 2803  
2818 2804 extern int netdev_max_backlog;
2819 2805 extern int netdev_tstamp_prequeue;
2820 2806 extern int weight_p;
2821 2807 extern int bpf_jit_enable;
2822 2808  
2823   -extern bool netdev_has_upper_dev(struct net_device *dev,
2824   - struct net_device *upper_dev);
2825   -extern bool netdev_has_any_upper_dev(struct net_device *dev);
2826   -extern struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev,
2827   - struct list_head **iter);
  2809 +bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev);
  2810 +bool netdev_has_any_upper_dev(struct net_device *dev);
  2811 +struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev,
  2812 + struct list_head **iter);
2828 2813  
2829 2814 /* iterate through upper list, must be called under RCU read lock */
2830 2815 #define netdev_for_each_all_upper_dev_rcu(dev, updev, iter) \
... ... @@ -2833,10 +2818,10 @@
2833 2818 updev; \
2834 2819 updev = netdev_all_upper_get_next_dev_rcu(dev, &(iter)))
2835 2820  
2836   -extern void *netdev_lower_get_next_private(struct net_device *dev,
2837   - struct list_head **iter);
2838   -extern void *netdev_lower_get_next_private_rcu(struct net_device *dev,
2839   - struct list_head **iter);
  2821 +void *netdev_lower_get_next_private(struct net_device *dev,
  2822 + struct list_head **iter);
  2823 +void *netdev_lower_get_next_private_rcu(struct net_device *dev,
  2824 + struct list_head **iter);
2840 2825  
2841 2826 #define netdev_for_each_lower_private(dev, priv, iter) \
2842 2827 for (iter = (dev)->adj_list.lower.next, \
2843 2828  
... ... @@ -2850,27 +2835,26 @@
2850 2835 priv; \
2851 2836 priv = netdev_lower_get_next_private_rcu(dev, &(iter)))
2852 2837  
2853   -extern void *netdev_adjacent_get_private(struct list_head *adj_list);
2854   -extern struct net_device *netdev_master_upper_dev_get(struct net_device *dev);
2855   -extern struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev);
2856   -extern int netdev_upper_dev_link(struct net_device *dev,
  2838 +void *netdev_adjacent_get_private(struct list_head *adj_list);
  2839 +struct net_device *netdev_master_upper_dev_get(struct net_device *dev);
  2840 +struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev);
  2841 +int netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev);
  2842 +int netdev_master_upper_dev_link(struct net_device *dev,
2857 2843 struct net_device *upper_dev);
2858   -extern int netdev_master_upper_dev_link(struct net_device *dev,
2859   - struct net_device *upper_dev);
2860   -extern int netdev_master_upper_dev_link_private(struct net_device *dev,
2861   - struct net_device *upper_dev,
2862   - void *private);
2863   -extern void netdev_upper_dev_unlink(struct net_device *dev,
2864   - struct net_device *upper_dev);
2865   -extern void *netdev_lower_dev_get_private_rcu(struct net_device *dev,
2866   - struct net_device *lower_dev);
2867   -extern void *netdev_lower_dev_get_private(struct net_device *dev,
2868   - struct net_device *lower_dev);
2869   -extern int skb_checksum_help(struct sk_buff *skb);
2870   -extern struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
2871   - netdev_features_t features, bool tx_path);
2872   -extern struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb,
2873   - netdev_features_t features);
  2844 +int netdev_master_upper_dev_link_private(struct net_device *dev,
  2845 + struct net_device *upper_dev,
  2846 + void *private);
  2847 +void netdev_upper_dev_unlink(struct net_device *dev,
  2848 + struct net_device *upper_dev);
  2849 +void *netdev_lower_dev_get_private_rcu(struct net_device *dev,
  2850 + struct net_device *lower_dev);
  2851 +void *netdev_lower_dev_get_private(struct net_device *dev,
  2852 + struct net_device *lower_dev);
  2853 +int skb_checksum_help(struct sk_buff *skb);
  2854 +struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
  2855 + netdev_features_t features, bool tx_path);
  2856 +struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb,
  2857 + netdev_features_t features);
2874 2858  
2875 2859 static inline
2876 2860 struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features)
2877 2861  
2878 2862  
2879 2863  
2880 2864  
2881 2865  
... ... @@ -2892,30 +2876,30 @@
2892 2876 }
2893 2877  
2894 2878 #ifdef CONFIG_BUG
2895   -extern void netdev_rx_csum_fault(struct net_device *dev);
  2879 +void netdev_rx_csum_fault(struct net_device *dev);
2896 2880 #else
2897 2881 static inline void netdev_rx_csum_fault(struct net_device *dev)
2898 2882 {
2899 2883 }
2900 2884 #endif
2901 2885 /* rx skb timestamps */
2902   -extern void net_enable_timestamp(void);
2903   -extern void net_disable_timestamp(void);
  2886 +void net_enable_timestamp(void);
  2887 +void net_disable_timestamp(void);
2904 2888  
2905 2889 #ifdef CONFIG_PROC_FS
2906   -extern int __init dev_proc_init(void);
  2890 +int __init dev_proc_init(void);
2907 2891 #else
2908 2892 #define dev_proc_init() 0
2909 2893 #endif
2910 2894  
2911   -extern int netdev_class_create_file(struct class_attribute *class_attr);
2912   -extern void netdev_class_remove_file(struct class_attribute *class_attr);
  2895 +int netdev_class_create_file(struct class_attribute *class_attr);
  2896 +void netdev_class_remove_file(struct class_attribute *class_attr);
2913 2897  
2914 2898 extern struct kobj_ns_type_operations net_ns_type_operations;
2915 2899  
2916   -extern const char *netdev_drivername(const struct net_device *dev);
  2900 +const char *netdev_drivername(const struct net_device *dev);
2917 2901  
2918   -extern void linkwatch_run_queue(void);
  2902 +void linkwatch_run_queue(void);
2919 2903  
2920 2904 static inline netdev_features_t netdev_get_wanted_features(
2921 2905 struct net_device *dev)
2922 2906  
2923 2907  
2924 2908  
2925 2909  
2926 2910  
2927 2911  
2928 2912  
... ... @@ -3007,22 +2991,22 @@
3007 2991 return dev->name;
3008 2992 }
3009 2993  
3010   -extern __printf(3, 4)
  2994 +__printf(3, 4)
3011 2995 int netdev_printk(const char *level, const struct net_device *dev,
3012 2996 const char *format, ...);
3013   -extern __printf(2, 3)
  2997 +__printf(2, 3)
3014 2998 int netdev_emerg(const struct net_device *dev, const char *format, ...);
3015   -extern __printf(2, 3)
  2999 +__printf(2, 3)
3016 3000 int netdev_alert(const struct net_device *dev, const char *format, ...);
3017   -extern __printf(2, 3)
  3001 +__printf(2, 3)
3018 3002 int netdev_crit(const struct net_device *dev, const char *format, ...);
3019   -extern __printf(2, 3)
  3003 +__printf(2, 3)
3020 3004 int netdev_err(const struct net_device *dev, const char *format, ...);
3021   -extern __printf(2, 3)
  3005 +__printf(2, 3)
3022 3006 int netdev_warn(const struct net_device *dev, const char *format, ...);
3023   -extern __printf(2, 3)
  3007 +__printf(2, 3)
3024 3008 int netdev_notice(const struct net_device *dev, const char *format, ...);
3025   -extern __printf(2, 3)
  3009 +__printf(2, 3)
3026 3010 int netdev_info(const struct net_device *dev, const char *format, ...);
3027 3011  
3028 3012 #define MODULE_ALIAS_NETDEV(device) \