--- features_rw/net/core/net-sysfs.c 2005-03-26 05:28:36.000000000 +0200 +++ linux/net/core/net-sysfs.c 2005-05-23 11:57:33.000000000 +0300 @@ -91,7 +91,6 @@ static CLASS_DEVICE_ATTR(field, S_IRUGO, NETDEVICE_ATTR(addr_len, fmt_dec); NETDEVICE_ATTR(iflink, fmt_dec); NETDEVICE_ATTR(ifindex, fmt_dec); -NETDEVICE_ATTR(features, fmt_hex); NETDEVICE_ATTR(type, fmt_dec); /* use same locking rules as GIFHWADDR ioctl's */ @@ -184,6 +183,28 @@ static ssize_t store_tx_queue_len(struct static CLASS_DEVICE_ATTR(tx_queue_len, S_IRUGO | S_IWUSR, show_tx_queue_len, store_tx_queue_len); +NETDEVICE_SHOW(features, fmt_hex); + +static int change_features(struct net_device *net, unsigned long new_features) +{ + int old_features = net->features; + + net->features = new_features; + + if (old_features != net->features) + netdev_features_change(net); + + return 0; +} + +static ssize_t store_features(struct class_device *dev, const char *buf, size_t len) +{ + return netdev_store(dev, buf, len, change_features); +} + +static CLASS_DEVICE_ATTR(features, S_IRUGO | S_IWUSR, show_features, + store_features); + static struct class_device_attribute *net_class_attributes[] = { &class_device_attr_ifindex,