diff options
-rw-r--r-- | include/linux/netdevice.h | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 407658c64fb6..625240ce27f1 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -41,7 +41,8 @@ | |||
41 | #include <linux/dmaengine.h> | 41 | #include <linux/dmaengine.h> |
42 | #include <linux/workqueue.h> | 42 | #include <linux/workqueue.h> |
43 | 43 | ||
44 | struct net; | 44 | #include <net/net_namespace.h> |
45 | |||
45 | struct vlan_group; | 46 | struct vlan_group; |
46 | struct ethtool_ops; | 47 | struct ethtool_ops; |
47 | struct netpoll_info; | 48 | struct netpoll_info; |
@@ -753,23 +754,21 @@ extern rwlock_t dev_base_lock; /* Device list lock */ | |||
753 | list_for_each_entry_continue(d, &(net)->dev_base_head, dev_list) | 754 | list_for_each_entry_continue(d, &(net)->dev_base_head, dev_list) |
754 | #define net_device_entry(lh) list_entry(lh, struct net_device, dev_list) | 755 | #define net_device_entry(lh) list_entry(lh, struct net_device, dev_list) |
755 | 756 | ||
756 | #define next_net_device(d) \ | 757 | static inline struct net_device *next_net_device(struct net_device *dev) |
757 | ({ \ | 758 | { |
758 | struct net_device *dev = d; \ | 759 | struct list_head *lh; |
759 | struct list_head *lh; \ | 760 | struct net *net; |
760 | struct net *net; \ | 761 | |
761 | \ | 762 | net = dev->nd_net; |
762 | net = dev->nd_net; \ | 763 | lh = dev->dev_list.next; |
763 | lh = dev->dev_list.next; \ | 764 | return lh == &net->dev_base_head ? NULL : net_device_entry(lh); |
764 | lh == &net->dev_base_head ? NULL : net_device_entry(lh); \ | 765 | } |
765 | }) | 766 | |
766 | 767 | static inline struct net_device *first_net_device(struct net *net) | |
767 | #define first_net_device(N) \ | 768 | { |
768 | ({ \ | 769 | return list_empty(&net->dev_base_head) ? NULL : |
769 | struct net *NET = (N); \ | 770 | net_device_entry(net->dev_base_head.next); |
770 | list_empty(&NET->dev_base_head) ? NULL : \ | 771 | } |
771 | net_device_entry(NET->dev_base_head.next); \ | ||
772 | }) | ||
773 | 772 | ||
774 | extern int netdev_boot_setup_check(struct net_device *dev); | 773 | extern int netdev_boot_setup_check(struct net_device *dev); |
775 | extern unsigned long netdev_boot_base(const char *prefix, int unit); | 774 | extern unsigned long netdev_boot_base(const char *prefix, int unit); |