diff options
author | Jiri Pirko <jiri@resnulli.us> | 2013-01-03 22:48:49 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-04 13:31:49 -0800 |
commit | 9ff162a8b96c96238773972e26288a366e403b0c (patch) | |
tree | ae74065e46364c807a1996e5268aec349d9d86d4 /include/linux/netdevice.h | |
parent | 04e406dcc54cfd84d333ea673fa986fb5a1840e7 (diff) |
net: introduce upper device lists
This lists are supposed to serve for storing pointers to all upper devices.
Eventually it will replace dev->master pointer which is used for
bonding, bridge, team but it cannot be used for vlan, macvlan where
there might be multiple upper present. In case the upper link is
replacement for dev->master, it is marked with "master" flag.
New upper device list resolves this limitation. Also, the information
stored in lists is used for preventing looping setups like
"bond->somethingelse->samebond"
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index c5031a45e18..e324601f48e 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1174,6 +1174,8 @@ struct net_device { * which this device is member of. */ + struct list_head upper_dev_list; /* List of upper devices */ + /* Interface address info used in eth_type_trans() */ unsigned char *dev_addr; /* hw address, (before bcast because most packets are @@ -2636,6 +2638,18 @@ extern int netdev_max_backlog; extern int netdev_tstamp_prequeue; extern int weight_p; extern int bpf_jit_enable; + +extern bool netdev_has_upper_dev(struct net_device *dev, + struct net_device *upper_dev); +extern bool netdev_has_any_upper_dev(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 int netdev_upper_dev_link(struct net_device *dev, + struct net_device *upper_dev); +extern int netdev_master_upper_dev_link(struct net_device *dev, + struct net_device *upper_dev); +extern void netdev_upper_dev_unlink(struct net_device *dev, + struct net_device *upper_dev); extern int netdev_set_master(struct net_device *dev, struct net_device *master); extern int netdev_set_bond_master(struct net_device *dev, struct net_device *master); |