aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bonding/bond_sysfs.c')
-rw-r--r--drivers/net/bonding/bond_sysfs.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 1f028579e53b..7a61e9a14386 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -951,6 +951,45 @@ out:
951static DEVICE_ATTR(lacp_rate, S_IRUGO | S_IWUSR, bonding_show_lacp, bonding_store_lacp); 951static DEVICE_ATTR(lacp_rate, S_IRUGO | S_IWUSR, bonding_show_lacp, bonding_store_lacp);
952 952
953/* 953/*
954 * Show and set the number of grat ARP to send after a failover event.
955 */
956static ssize_t bonding_show_n_grat_arp(struct device *d,
957 struct device_attribute *attr,
958 char *buf)
959{
960 struct bonding *bond = to_bond(d);
961
962 return sprintf(buf, "%d\n", bond->params.num_grat_arp);
963}
964
965static ssize_t bonding_store_n_grat_arp(struct device *d,
966 struct device_attribute *attr,
967 const char *buf, size_t count)
968{
969 int new_value, ret = count;
970 struct bonding *bond = to_bond(d);
971
972 if (sscanf(buf, "%d", &new_value) != 1) {
973 printk(KERN_ERR DRV_NAME
974 ": %s: no num_grat_arp value specified.\n",
975 bond->dev->name);
976 ret = -EINVAL;
977 goto out;
978 }
979 if (new_value < 0 || new_value > 255) {
980 printk(KERN_ERR DRV_NAME
981 ": %s: Invalid num_grat_arp value %d not in range 0-255; rejected.\n",
982 bond->dev->name, new_value);
983 ret = -EINVAL;
984 goto out;
985 } else {
986 bond->params.num_grat_arp = new_value;
987 }
988out:
989 return ret;
990}
991static DEVICE_ATTR(num_grat_arp, S_IRUGO | S_IWUSR, bonding_show_n_grat_arp, bonding_store_n_grat_arp);
992/*
954 * Show and set the MII monitor interval. There are two tricky bits 993 * Show and set the MII monitor interval. There are two tricky bits
955 * here. First, if MII monitoring is activated, then we must disable 994 * here. First, if MII monitoring is activated, then we must disable
956 * ARP monitoring. Second, if the timer isn't running, we must 995 * ARP monitoring. Second, if the timer isn't running, we must
@@ -1387,6 +1426,7 @@ static struct attribute *per_bond_attrs[] = {
1387 &dev_attr_updelay.attr, 1426 &dev_attr_updelay.attr,
1388 &dev_attr_lacp_rate.attr, 1427 &dev_attr_lacp_rate.attr,
1389 &dev_attr_xmit_hash_policy.attr, 1428 &dev_attr_xmit_hash_policy.attr,
1429 &dev_attr_num_grat_arp.attr,
1390 &dev_attr_miimon.attr, 1430 &dev_attr_miimon.attr,
1391 &dev_attr_primary.attr, 1431 &dev_attr_primary.attr,
1392 &dev_attr_use_carrier.attr, 1432 &dev_attr_use_carrier.attr,