aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/netdevice.h35
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
44struct net; 44#include <net/net_namespace.h>
45
45struct vlan_group; 46struct vlan_group;
46struct ethtool_ops; 47struct ethtool_ops;
47struct netpoll_info; 48struct 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) \ 757static 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 767static 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
774extern int netdev_boot_setup_check(struct net_device *dev); 773extern int netdev_boot_setup_check(struct net_device *dev);
775extern unsigned long netdev_boot_base(const char *prefix, int unit); 774extern unsigned long netdev_boot_base(const char *prefix, int unit);