Commit f3253339 authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller

bonding: options handling cleanup

Make local functions static (ie. only used in bond_options.c)
Make bond options parsing tables constant.
Signed-off-by: default avatarStephen Hemminger <stephen@networkplumber.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fca28094
...@@ -3950,7 +3950,8 @@ static void bond_uninit(struct net_device *bond_dev) ...@@ -3950,7 +3950,8 @@ static void bond_uninit(struct net_device *bond_dev)
static int bond_check_params(struct bond_params *params) static int bond_check_params(struct bond_params *params)
{ {
int arp_validate_value, fail_over_mac_value, primary_reselect_value, i; int arp_validate_value, fail_over_mac_value, primary_reselect_value, i;
struct bond_opt_value newval, *valptr; struct bond_opt_value newval;
const struct bond_opt_value *valptr;
int arp_all_targets_value; int arp_all_targets_value;
/* /*
......
This diff is collapsed.
...@@ -81,8 +81,8 @@ struct bonding; ...@@ -81,8 +81,8 @@ struct bonding;
struct bond_option { struct bond_option {
int id; int id;
char *name; const char *name;
char *desc; const char *desc;
u32 flags; u32 flags;
/* unsuppmodes is used to denote modes in which the option isn't /* unsuppmodes is used to denote modes in which the option isn't
...@@ -92,7 +92,7 @@ struct bond_option { ...@@ -92,7 +92,7 @@ struct bond_option {
/* supported values which this option can have, can be a subset of /* supported values which this option can have, can be a subset of
* BOND_OPTVAL_RANGE's value range * BOND_OPTVAL_RANGE's value range
*/ */
struct bond_opt_value *values; const struct bond_opt_value *values;
int (*set)(struct bonding *bond, struct bond_opt_value *val); int (*set)(struct bonding *bond, struct bond_opt_value *val);
}; };
...@@ -100,10 +100,10 @@ struct bond_option { ...@@ -100,10 +100,10 @@ struct bond_option {
int __bond_opt_set(struct bonding *bond, unsigned int option, int __bond_opt_set(struct bonding *bond, unsigned int option,
struct bond_opt_value *val); struct bond_opt_value *val);
int bond_opt_tryset_rtnl(struct bonding *bond, unsigned int option, char *buf); int bond_opt_tryset_rtnl(struct bonding *bond, unsigned int option, char *buf);
struct bond_opt_value *bond_opt_parse(const struct bond_option *opt, const struct bond_opt_value *bond_opt_parse(const struct bond_option *opt,
struct bond_opt_value *val); struct bond_opt_value *val);
struct bond_option *bond_opt_get(unsigned int option); const struct bond_option *bond_opt_get(unsigned int option);
struct bond_opt_value *bond_opt_get_val(unsigned int option, u64 val); const struct bond_opt_value *bond_opt_get_val(unsigned int option, u64 val);
/* This helper is used to initialize a bond_opt_value structure for parameter /* This helper is used to initialize a bond_opt_value structure for parameter
* passing. There should be either a valid string or value, but not both. * passing. There should be either a valid string or value, but not both.
...@@ -122,49 +122,6 @@ static inline void __bond_opt_init(struct bond_opt_value *optval, ...@@ -122,49 +122,6 @@ static inline void __bond_opt_init(struct bond_opt_value *optval,
#define bond_opt_initval(optval, value) __bond_opt_init(optval, NULL, value) #define bond_opt_initval(optval, value) __bond_opt_init(optval, NULL, value)
#define bond_opt_initstr(optval, str) __bond_opt_init(optval, str, ULLONG_MAX) #define bond_opt_initstr(optval, str) __bond_opt_init(optval, str, ULLONG_MAX)
int bond_option_mode_set(struct bonding *bond, struct bond_opt_value *newval);
int bond_option_pps_set(struct bonding *bond, struct bond_opt_value *newval);
int bond_option_xmit_hash_policy_set(struct bonding *bond,
struct bond_opt_value *newval);
int bond_option_arp_validate_set(struct bonding *bond,
struct bond_opt_value *newval);
int bond_option_arp_all_targets_set(struct bonding *bond,
struct bond_opt_value *newval);
int bond_option_fail_over_mac_set(struct bonding *bond,
struct bond_opt_value *newval);
int bond_option_arp_interval_set(struct bonding *bond,
struct bond_opt_value *newval);
int bond_option_arp_ip_targets_set(struct bonding *bond,
struct bond_opt_value *newval);
void bond_option_arp_ip_targets_clear(struct bonding *bond); void bond_option_arp_ip_targets_clear(struct bonding *bond);
int bond_option_downdelay_set(struct bonding *bond,
struct bond_opt_value *newval);
int bond_option_updelay_set(struct bonding *bond,
struct bond_opt_value *newval);
int bond_option_lacp_rate_set(struct bonding *bond,
struct bond_opt_value *newval);
int bond_option_min_links_set(struct bonding *bond,
struct bond_opt_value *newval);
int bond_option_ad_select_set(struct bonding *bond,
struct bond_opt_value *newval);
int bond_option_num_peer_notif_set(struct bonding *bond,
struct bond_opt_value *newval);
int bond_option_miimon_set(struct bonding *bond, struct bond_opt_value *newval);
int bond_option_primary_set(struct bonding *bond,
struct bond_opt_value *newval);
int bond_option_primary_reselect_set(struct bonding *bond,
struct bond_opt_value *newval);
int bond_option_use_carrier_set(struct bonding *bond,
struct bond_opt_value *newval);
int bond_option_active_slave_set(struct bonding *bond,
struct bond_opt_value *newval);
int bond_option_queue_id_set(struct bonding *bond,
struct bond_opt_value *newval);
int bond_option_all_slaves_active_set(struct bonding *bond,
struct bond_opt_value *newval);
int bond_option_resend_igmp_set(struct bonding *bond,
struct bond_opt_value *newval);
int bond_option_lp_interval_set(struct bonding *bond,
struct bond_opt_value *newval);
int bond_option_slaves_set(struct bonding *bond, struct bond_opt_value *newval);
#endif /* _BOND_OPTIONS_H */ #endif /* _BOND_OPTIONS_H */
...@@ -220,7 +220,7 @@ static ssize_t bonding_show_mode(struct device *d, ...@@ -220,7 +220,7 @@ static ssize_t bonding_show_mode(struct device *d,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct bonding *bond = to_bond(d); struct bonding *bond = to_bond(d);
struct bond_opt_value *val; const struct bond_opt_value *val;
val = bond_opt_get_val(BOND_OPT_MODE, bond->params.mode); val = bond_opt_get_val(BOND_OPT_MODE, bond->params.mode);
...@@ -251,7 +251,7 @@ static ssize_t bonding_show_xmit_hash(struct device *d, ...@@ -251,7 +251,7 @@ static ssize_t bonding_show_xmit_hash(struct device *d,
char *buf) char *buf)
{ {
struct bonding *bond = to_bond(d); struct bonding *bond = to_bond(d);
struct bond_opt_value *val; const struct bond_opt_value *val;
val = bond_opt_get_val(BOND_OPT_XMIT_HASH, bond->params.xmit_policy); val = bond_opt_get_val(BOND_OPT_XMIT_HASH, bond->params.xmit_policy);
...@@ -282,7 +282,7 @@ static ssize_t bonding_show_arp_validate(struct device *d, ...@@ -282,7 +282,7 @@ static ssize_t bonding_show_arp_validate(struct device *d,
char *buf) char *buf)
{ {
struct bonding *bond = to_bond(d); struct bonding *bond = to_bond(d);
struct bond_opt_value *val; const struct bond_opt_value *val;
val = bond_opt_get_val(BOND_OPT_ARP_VALIDATE, val = bond_opt_get_val(BOND_OPT_ARP_VALIDATE,
bond->params.arp_validate); bond->params.arp_validate);
...@@ -314,7 +314,7 @@ static ssize_t bonding_show_arp_all_targets(struct device *d, ...@@ -314,7 +314,7 @@ static ssize_t bonding_show_arp_all_targets(struct device *d,
char *buf) char *buf)
{ {
struct bonding *bond = to_bond(d); struct bonding *bond = to_bond(d);
struct bond_opt_value *val; const struct bond_opt_value *val;
val = bond_opt_get_val(BOND_OPT_ARP_ALL_TARGETS, val = bond_opt_get_val(BOND_OPT_ARP_ALL_TARGETS,
bond->params.arp_all_targets); bond->params.arp_all_targets);
...@@ -348,7 +348,7 @@ static ssize_t bonding_show_fail_over_mac(struct device *d, ...@@ -348,7 +348,7 @@ static ssize_t bonding_show_fail_over_mac(struct device *d,
char *buf) char *buf)
{ {
struct bonding *bond = to_bond(d); struct bonding *bond = to_bond(d);
struct bond_opt_value *val; const struct bond_opt_value *val;
val = bond_opt_get_val(BOND_OPT_FAIL_OVER_MAC, val = bond_opt_get_val(BOND_OPT_FAIL_OVER_MAC,
bond->params.fail_over_mac); bond->params.fail_over_mac);
...@@ -505,7 +505,7 @@ static ssize_t bonding_show_lacp(struct device *d, ...@@ -505,7 +505,7 @@ static ssize_t bonding_show_lacp(struct device *d,
char *buf) char *buf)
{ {
struct bonding *bond = to_bond(d); struct bonding *bond = to_bond(d);
struct bond_opt_value *val; const struct bond_opt_value *val;
val = bond_opt_get_val(BOND_OPT_LACP_RATE, bond->params.lacp_fast); val = bond_opt_get_val(BOND_OPT_LACP_RATE, bond->params.lacp_fast);
...@@ -558,7 +558,7 @@ static ssize_t bonding_show_ad_select(struct device *d, ...@@ -558,7 +558,7 @@ static ssize_t bonding_show_ad_select(struct device *d,
char *buf) char *buf)
{ {
struct bonding *bond = to_bond(d); struct bonding *bond = to_bond(d);
struct bond_opt_value *val; const struct bond_opt_value *val;
val = bond_opt_get_val(BOND_OPT_AD_SELECT, bond->params.ad_select); val = bond_opt_get_val(BOND_OPT_AD_SELECT, bond->params.ad_select);
...@@ -686,7 +686,7 @@ static ssize_t bonding_show_primary_reselect(struct device *d, ...@@ -686,7 +686,7 @@ static ssize_t bonding_show_primary_reselect(struct device *d,
char *buf) char *buf)
{ {
struct bonding *bond = to_bond(d); struct bonding *bond = to_bond(d);
struct bond_opt_value *val; const struct bond_opt_value *val;
val = bond_opt_get_val(BOND_OPT_PRIMARY_RESELECT, val = bond_opt_get_val(BOND_OPT_PRIMARY_RESELECT,
bond->params.primary_reselect); bond->params.primary_reselect);
......
...@@ -507,8 +507,6 @@ void bond_setup(struct net_device *bond_dev); ...@@ -507,8 +507,6 @@ void bond_setup(struct net_device *bond_dev);
unsigned int bond_get_num_tx_queues(void); unsigned int bond_get_num_tx_queues(void);
int bond_netlink_init(void); int bond_netlink_init(void);
void bond_netlink_fini(void); void bond_netlink_fini(void);
int bond_option_arp_ip_target_add(struct bonding *bond, __be32 target);
int bond_option_arp_ip_target_rem(struct bonding *bond, __be32 target);
struct net_device *bond_option_active_slave_get_rcu(struct bonding *bond); struct net_device *bond_option_active_slave_get_rcu(struct bonding *bond);
struct net_device *bond_option_active_slave_get(struct bonding *bond); struct net_device *bond_option_active_slave_get(struct bonding *bond);
const char *bond_slave_link_status(s8 link); const char *bond_slave_link_status(s8 link);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment