diff options
author | Nikolay Aleksandrov <nikolay@redhat.com> | 2014-01-22 17:53:29 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-23 03:38:43 +0400 |
commit | 9e5f5eebe765b340af0318dba261e5de0f2aaf32 (patch) | |
tree | 1a2e1854202ee94bd52f7c83dcdde91f41297e7b /drivers/net/bonding/bond_main.c | |
parent | 633ddc9e9bafd168861dee1000b2c6ff725e85c5 (diff) | |
download | linux-9e5f5eebe765b340af0318dba261e5de0f2aaf32.tar.xz |
bonding: convert ad_select to use the new option API
This patch adds the necessary changes so ad_select would use
the new bonding option API.
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index f3bfcafc96a4..8f3f9f046f1c 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -214,13 +214,6 @@ const struct bond_parm_tbl pri_reselect_tbl[] = { { NULL, -1}, }; -struct bond_parm_tbl ad_select_tbl[] = { -{ "stable", BOND_AD_STABLE}, -{ "bandwidth", BOND_AD_BANDWIDTH}, -{ "count", BOND_AD_COUNT}, -{ NULL, -1}, -}; - /*-------------------------- Forward declarations ---------------------------*/ static int bond_init(struct net_device *bond_dev); @@ -4032,16 +4025,16 @@ static int bond_check_params(struct bond_params *params) } if (ad_select) { - params->ad_select = bond_parse_parm(ad_select, ad_select_tbl); - if (params->ad_select == -1) { - pr_err("Error: Invalid ad_select \"%s\"\n", - ad_select == NULL ? "NULL" : ad_select); + bond_opt_initstr(&newval, lacp_rate); + valptr = bond_opt_parse(bond_opt_get(BOND_OPT_AD_SELECT), + &newval); + if (!valptr) { + pr_err("Error: Invalid ad_select \"%s\"\n", ad_select); return -EINVAL; } - - if (bond_mode != BOND_MODE_8023AD) { + params->ad_select = valptr->value; + if (bond_mode != BOND_MODE_8023AD) pr_warning("ad_select param only affects 802.3ad mode\n"); - } } else { params->ad_select = BOND_AD_STABLE; } |