diff options
Diffstat (limited to 'drivers/net/bonding/bond_sysfs.c')
-rw-r--r-- | drivers/net/bonding/bond_sysfs.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index e400d7dfdfc8..8788e3e33852 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -983,6 +983,47 @@ out: | |||
983 | return ret; | 983 | return ret; |
984 | } | 984 | } |
985 | static DEVICE_ATTR(num_grat_arp, S_IRUGO | S_IWUSR, bonding_show_n_grat_arp, bonding_store_n_grat_arp); | 985 | static DEVICE_ATTR(num_grat_arp, S_IRUGO | S_IWUSR, bonding_show_n_grat_arp, bonding_store_n_grat_arp); |
986 | |||
987 | /* | ||
988 | * Show and set the number of unsolicted NA's to send after a failover event. | ||
989 | */ | ||
990 | static ssize_t bonding_show_n_unsol_na(struct device *d, | ||
991 | struct device_attribute *attr, | ||
992 | char *buf) | ||
993 | { | ||
994 | struct bonding *bond = to_bond(d); | ||
995 | |||
996 | return sprintf(buf, "%d\n", bond->params.num_unsol_na); | ||
997 | } | ||
998 | |||
999 | static ssize_t bonding_store_n_unsol_na(struct device *d, | ||
1000 | struct device_attribute *attr, | ||
1001 | const char *buf, size_t count) | ||
1002 | { | ||
1003 | int new_value, ret = count; | ||
1004 | struct bonding *bond = to_bond(d); | ||
1005 | |||
1006 | if (sscanf(buf, "%d", &new_value) != 1) { | ||
1007 | printk(KERN_ERR DRV_NAME | ||
1008 | ": %s: no num_unsol_na value specified.\n", | ||
1009 | bond->dev->name); | ||
1010 | ret = -EINVAL; | ||
1011 | goto out; | ||
1012 | } | ||
1013 | if (new_value < 0 || new_value > 255) { | ||
1014 | printk(KERN_ERR DRV_NAME | ||
1015 | ": %s: Invalid num_unsol_na value %d not in range 0-255; rejected.\n", | ||
1016 | bond->dev->name, new_value); | ||
1017 | ret = -EINVAL; | ||
1018 | goto out; | ||
1019 | } else { | ||
1020 | bond->params.num_unsol_na = new_value; | ||
1021 | } | ||
1022 | out: | ||
1023 | return ret; | ||
1024 | } | ||
1025 | static DEVICE_ATTR(num_unsol_na, S_IRUGO | S_IWUSR, bonding_show_n_unsol_na, bonding_store_n_unsol_na); | ||
1026 | |||
986 | /* | 1027 | /* |
987 | * Show and set the MII monitor interval. There are two tricky bits | 1028 | * Show and set the MII monitor interval. There are two tricky bits |
988 | * here. First, if MII monitoring is activated, then we must disable | 1029 | * here. First, if MII monitoring is activated, then we must disable |
@@ -1420,6 +1461,7 @@ static struct attribute *per_bond_attrs[] = { | |||
1420 | &dev_attr_lacp_rate.attr, | 1461 | &dev_attr_lacp_rate.attr, |
1421 | &dev_attr_xmit_hash_policy.attr, | 1462 | &dev_attr_xmit_hash_policy.attr, |
1422 | &dev_attr_num_grat_arp.attr, | 1463 | &dev_attr_num_grat_arp.attr, |
1464 | &dev_attr_num_unsol_na.attr, | ||
1423 | &dev_attr_miimon.attr, | 1465 | &dev_attr_miimon.attr, |
1424 | &dev_attr_primary.attr, | 1466 | &dev_attr_primary.attr, |
1425 | &dev_attr_use_carrier.attr, | 1467 | &dev_attr_use_carrier.attr, |