aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorVlad Dogaru <ddvlad@rosedu.org>2011-01-13 18:38:30 -0500
committerDavid S. Miller <davem@davemloft.net>2011-01-20 02:31:09 -0500
commitcbda10fa97d72c7a1923be4426171aa90e8c6dab (patch)
tree113206ef603189e9f91f075e154cbdc8e1ac3f40 /include/linux/netdevice.h
parent441c793a56502638d45d5da2195056d686147370 (diff)
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 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index d971346b0340..68a4627b74f5 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -75,6 +75,9 @@ struct wireless_dev;
75#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ 75#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */
76#define NET_RX_DROP 1 /* packet dropped */ 76#define NET_RX_DROP 1 /* packet dropped */
77 77
78/* Initial net device group. All devices belong to group 0 by default. */
79#define INIT_NETDEV_GROUP 0
80
78/* 81/*
79 * Transmit return codes: transmit return codes originate from three different 82 * Transmit return codes: transmit return codes originate from three different
80 * namespaces: 83 * namespaces:
@@ -1153,6 +1156,9 @@ struct net_device {
1153 1156
1154 /* phy device may attach itself for hardware timestamping */ 1157 /* phy device may attach itself for hardware timestamping */
1155 struct phy_device *phydev; 1158 struct phy_device *phydev;
1159
1160 /* group the device belongs to */
1161 int group;
1156}; 1162};
1157#define to_net_dev(d) container_of(d, struct net_device, dev) 1163#define to_net_dev(d) container_of(d, struct net_device, dev)
1158 1164
@@ -1844,6 +1850,7 @@ extern int dev_set_alias(struct net_device *, const char *, size_t);
1844extern int dev_change_net_namespace(struct net_device *, 1850extern int dev_change_net_namespace(struct net_device *,
1845 struct net *, const char *); 1851 struct net *, const char *);
1846extern int dev_set_mtu(struct net_device *, int); 1852extern int dev_set_mtu(struct net_device *, int);
1853extern void dev_set_group(struct net_device *, int);
1847extern int dev_set_mac_address(struct net_device *, 1854extern int dev_set_mac_address(struct net_device *,
1848 struct sockaddr *); 1855 struct sockaddr *);
1849extern int dev_hard_start_xmit(struct sk_buff *skb, 1856extern int dev_hard_start_xmit(struct sk_buff *skb,