From ad4556a11030787e14084c53e76acdcb829a8be7 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 8 Jun 2005 14:55:42 -0700 Subject: [PATCH] --- yaml --- r: 1919 b: refs/heads/master c: 699a411451a32cc111410f44f172b265f6d679c8 h: refs/heads/master i: 1917: 1c91a50971c3bf8994b5c12324f82443a965b48c 1915: 8f7995cb629ae947b36a914ac90e7b371588d8c7 1911: 3176cf67df774d7468de2618d69237a3dd17ff16 1903: 1830a351121a56c38e719eb4d083d64544025e2a 1887: 5d935dddfcd873a78869e9add2d12d1cce325118 1855: feda4af2a32963835582ea4e9490286ce6aafda2 1791: 2d308cfa23ba972d80b5f43fd314fa8c2da39603 v: v3 --- [refs] | 2 +- trunk/net/core/net-sysfs.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 0450409454b5..4c321cc12e2d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8181b8c1f3a69fe5abcc51cb732eb512ccd1566a +refs/heads/master: 699a411451a32cc111410f44f172b265f6d679c8 diff --git a/trunk/net/core/net-sysfs.c b/trunk/net/core/net-sysfs.c index 910eb4c05a47..e2137f3e489d 100644 --- a/trunk/net/core/net-sysfs.c +++ b/trunk/net/core/net-sysfs.c @@ -185,6 +185,22 @@ static ssize_t store_tx_queue_len(struct class_device *dev, const char *buf, siz static CLASS_DEVICE_ATTR(tx_queue_len, S_IRUGO | S_IWUSR, show_tx_queue_len, store_tx_queue_len); +NETDEVICE_SHOW(weight, fmt_dec); + +static int change_weight(struct net_device *net, unsigned long new_weight) +{ + net->weight = new_weight; + return 0; +} + +static ssize_t store_weight(struct class_device *dev, const char *buf, size_t len) +{ + return netdev_store(dev, buf, len, change_weight); +} + +static CLASS_DEVICE_ATTR(weight, S_IRUGO | S_IWUSR, show_weight, + store_weight); + static struct class_device_attribute *net_class_attributes[] = { &class_device_attr_ifindex, @@ -194,6 +210,7 @@ static struct class_device_attribute *net_class_attributes[] = { &class_device_attr_features, &class_device_attr_mtu, &class_device_attr_flags, + &class_device_attr_weight, &class_device_attr_type, &class_device_attr_address, &class_device_attr_broadcast,