Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 1919
b: refs/heads/master
c: 699a411
h: refs/heads/master
i:
  1917: 1c91a50
  1915: 8f7995c
  1911: 3176cf6
  1903: 1830a35
  1887: 5d935dd
  1855: feda4af
  1791: 2d308cf
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Jun 8, 2005
1 parent 47558bf commit ad4556a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8181b8c1f3a69fe5abcc51cb732eb512ccd1566a
refs/heads/master: 699a411451a32cc111410f44f172b265f6d679c8
17 changes: 17 additions & 0 deletions trunk/net/core/net-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit ad4556a

Please sign in to comment.