aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/netdevice.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 8858422c5c5d..c7d707452228 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1447,7 +1447,7 @@ static inline struct net_device *next_net_device_rcu(struct net_device *dev)
1447 struct net *net; 1447 struct net *net;
1448 1448
1449 net = dev_net(dev); 1449 net = dev_net(dev);
1450 lh = rcu_dereference(dev->dev_list.next); 1450 lh = rcu_dereference(list_next_rcu(&dev->dev_list));
1451 return lh == &net->dev_base_head ? NULL : net_device_entry(lh); 1451 return lh == &net->dev_base_head ? NULL : net_device_entry(lh);
1452} 1452}
1453 1453
@@ -1457,6 +1457,13 @@ static inline struct net_device *first_net_device(struct net *net)
1457 net_device_entry(net->dev_base_head.next); 1457 net_device_entry(net->dev_base_head.next);
1458} 1458}
1459 1459
1460static inline struct net_device *first_net_device_rcu(struct net *net)
1461{
1462 struct list_head *lh = rcu_dereference(list_next_rcu(&net->dev_base_head));
1463
1464 return lh == &net->dev_base_head ? NULL : net_device_entry(lh);
1465}
1466
1460extern int netdev_boot_setup_check(struct net_device *dev); 1467extern int netdev_boot_setup_check(struct net_device *dev);
1461extern unsigned long netdev_boot_base(const char *prefix, int unit); 1468extern unsigned long netdev_boot_base(const char *prefix, int unit);
1462extern struct net_device *dev_getbyhwaddr_rcu(struct net *net, unsigned short type, 1469extern struct net_device *dev_getbyhwaddr_rcu(struct net *net, unsigned short type,