From 81a5f1411613474eef79cce4c062de3333ed96dc Mon Sep 17 00:00:00 2001 From: Vlad Dogaru Date: Mon, 24 Jan 2011 03:37:29 +0000 Subject: [PATCH] --- yaml --- r: 236691 b: refs/heads/master c: a512b92b3af4b03fc6834617a042dc85fbd4e34e h: refs/heads/master i: 236689: 7da0cc0b647fef0cb4bf2b4234567ac1f40bb558 236687: b92cf871027062f9d26b384013dd41fb06cc4b54 v: v3 --- [refs] | 2 +- trunk/net/core/net-sysfs.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index aaae7838c682..580ba080b3ac 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 84c49d8c3e4abefb0a41a77b25aa37ebe8d6b743 +refs/heads/master: a512b92b3af4b03fc6834617a042dc85fbd4e34e diff --git a/trunk/net/core/net-sysfs.c b/trunk/net/core/net-sysfs.c index 81367ccf3306..2e4a393dfc3b 100644 --- a/trunk/net/core/net-sysfs.c +++ b/trunk/net/core/net-sysfs.c @@ -295,6 +295,20 @@ static ssize_t show_ifalias(struct device *dev, return ret; } +NETDEVICE_SHOW(group, fmt_dec); + +static int change_group(struct net_device *net, unsigned long new_group) +{ + dev_set_group(net, (int) new_group); + return 0; +} + +static ssize_t store_group(struct device *dev, struct device_attribute *attr, + const char *buf, size_t len) +{ + return netdev_store(dev, attr, buf, len, change_group); +} + static struct device_attribute net_class_attributes[] = { __ATTR(addr_assign_type, S_IRUGO, show_addr_assign_type, NULL), __ATTR(addr_len, S_IRUGO, show_addr_len, NULL), @@ -316,6 +330,7 @@ static struct device_attribute net_class_attributes[] = { __ATTR(flags, S_IRUGO | S_IWUSR, show_flags, store_flags), __ATTR(tx_queue_len, S_IRUGO | S_IWUSR, show_tx_queue_len, store_tx_queue_len), + __ATTR(group, S_IRUGO | S_IWUSR, show_group, store_group), {} };