Commit b6ccba4c authored by Veaceslav Falico's avatar Veaceslav Falico Committed by David S. Miller

net: add a possibility to get private from netdev_adjacent->list

It will be useful to get first/last element.

CC: "David S. Miller" <davem@davemloft.net>
CC: Eric Dumazet <edumazet@google.com>
CC: Jiri Pirko <jiri@resnulli.us>
CC: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: default avatarVeaceslav Falico <vfalico@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 70039aa7
...@@ -2850,6 +2850,7 @@ extern void *netdev_lower_get_next_private_rcu(struct net_device *dev, ...@@ -2850,6 +2850,7 @@ extern void *netdev_lower_get_next_private_rcu(struct net_device *dev,
priv; \ priv; \
priv = netdev_lower_get_next_private_rcu(dev, &(iter))) priv = netdev_lower_get_next_private_rcu(dev, &(iter)))
extern void *netdev_adjacent_get_private(struct list_head *adj_list);
extern struct net_device *netdev_master_upper_dev_get(struct net_device *dev); extern struct net_device *netdev_master_upper_dev_get(struct net_device *dev);
extern struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev); extern struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev);
extern int netdev_upper_dev_link(struct net_device *dev, extern int netdev_upper_dev_link(struct net_device *dev,
......
...@@ -4466,6 +4466,16 @@ struct net_device *netdev_master_upper_dev_get(struct net_device *dev) ...@@ -4466,6 +4466,16 @@ struct net_device *netdev_master_upper_dev_get(struct net_device *dev)
} }
EXPORT_SYMBOL(netdev_master_upper_dev_get); EXPORT_SYMBOL(netdev_master_upper_dev_get);
void *netdev_adjacent_get_private(struct list_head *adj_list)
{
struct netdev_adjacent *adj;
adj = list_entry(adj_list, struct netdev_adjacent, list);
return adj->private;
}
EXPORT_SYMBOL(netdev_adjacent_get_private);
/** /**
* netdev_all_upper_get_next_dev_rcu - Get the next dev from upper list * netdev_all_upper_get_next_dev_rcu - Get the next dev from upper list
* @dev: device * @dev: device
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment