Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[pandora-kernel.git] / drivers / net / bonding / bond_sysfs.c
index 88fcb25..b60835f 100644 (file)
@@ -804,6 +804,7 @@ static ssize_t bonding_store_lacp(struct device *d,
 
        if ((new_value == 1) || (new_value == 0)) {
                bond->params.lacp_fast = new_value;
+               bond_3ad_update_lacp_rate(bond);
                pr_info("%s: Setting LACP rate to %s (%d).\n",
                        bond->dev->name, bond_lacp_tbl[new_value].modename,
                        new_value);
@@ -818,6 +819,38 @@ out:
 static DEVICE_ATTR(lacp_rate, S_IRUGO | S_IWUSR,
                   bonding_show_lacp, bonding_store_lacp);
 
+static ssize_t bonding_show_min_links(struct device *d,
+                                     struct device_attribute *attr,
+                                     char *buf)
+{
+       struct bonding *bond = to_bond(d);
+
+       return sprintf(buf, "%d\n", bond->params.min_links);
+}
+
+static ssize_t bonding_store_min_links(struct device *d,
+                                      struct device_attribute *attr,
+                                      const char *buf, size_t count)
+{
+       struct bonding *bond = to_bond(d);
+       int ret;
+       unsigned int new_value;
+
+       ret = kstrtouint(buf, 0, &new_value);
+       if (ret < 0) {
+               pr_err("%s: Ignoring invalid min links value %s.\n",
+                      bond->dev->name, buf);
+               return ret;
+       }
+
+       pr_info("%s: Setting min links value to %u\n",
+               bond->dev->name, new_value);
+       bond->params.min_links = new_value;
+       return count;
+}
+static DEVICE_ATTR(min_links, S_IRUGO | S_IWUSR,
+                  bonding_show_min_links, bonding_store_min_links);
+
 static ssize_t bonding_show_ad_select(struct device *d,
                                      struct device_attribute *attr,
                                      char *buf)
@@ -1600,6 +1633,7 @@ static struct attribute *per_bond_attrs[] = {
        &dev_attr_queue_id.attr,
        &dev_attr_all_slaves_active.attr,
        &dev_attr_resend_igmp.attr,
+       &dev_attr_min_links.attr,
        NULL,
 };