diff options
author | Vlad Dogaru | 2011-01-14 00:38:30 +0100 |
---|---|---|
committer | David S. Miller | 2011-01-20 08:31:09 +0100 |
commit | cbda10fa97d72c7a1923be4426171aa90e8c6dab (patch) | |
tree | 113206ef603189e9f91f075e154cbdc8e1ac3f40 /net/core/dev.c | |
parent | net: cleanup unused macros in net directory (diff) | |
download | kernel-qcow2-linux-cbda10fa97d72c7a1923be4426171aa90e8c6dab.tar.gz kernel-qcow2-linux-cbda10fa97d72c7a1923be4426171aa90e8c6dab.tar.xz kernel-qcow2-linux-cbda10fa97d72c7a1923be4426171aa90e8c6dab.zip |
net_device: add support for network device groups
Net devices can now be grouped, enabling simpler manipulation from
userspace. This patch adds a group field to the net_device structure, as
well as rtnetlink support to query and modify it.
Signed-off-by: Vlad Dogaru <ddvlad@rosedu.org>
Acked-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 7741507429f4..2b85d4ae981f 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -4572,6 +4572,17 @@ int dev_set_mtu(struct net_device *dev, int new_mtu) EXPORT_SYMBOL(dev_set_mtu); /** + * dev_set_group - Change group this device belongs to + * @dev: device + * @new_group: group this device should belong to + */ +void dev_set_group(struct net_device *dev, int new_group) +{ + dev->group = new_group; +} +EXPORT_SYMBOL(dev_set_group); + +/** * dev_set_mac_address - Change Media Access Control Address * @dev: device * @sa: new address @@ -5678,6 +5689,7 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, dev->priv_flags = IFF_XMIT_DST_RELEASE; setup(dev); strcpy(dev->name, name); + dev->group = INIT_NETDEV_GROUP; return dev; free_pcpu: |