diff options
Diffstat (limited to 'net/mac80211/ieee80211_rate.c')
-rw-r--r-- | net/mac80211/ieee80211_rate.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/net/mac80211/ieee80211_rate.c b/net/mac80211/ieee80211_rate.c index e495b0998b4d..65fc9ad615e9 100644 --- a/net/mac80211/ieee80211_rate.c +++ b/net/mac80211/ieee80211_rate.c | |||
@@ -21,6 +21,11 @@ struct rate_control_alg { | |||
21 | static LIST_HEAD(rate_ctrl_algs); | 21 | static LIST_HEAD(rate_ctrl_algs); |
22 | static DEFINE_MUTEX(rate_ctrl_mutex); | 22 | static DEFINE_MUTEX(rate_ctrl_mutex); |
23 | 23 | ||
24 | static char *ieee80211_default_rc_algo = CONFIG_MAC80211_RC_DEFAULT; | ||
25 | module_param(ieee80211_default_rc_algo, charp, 0644); | ||
26 | MODULE_PARM_DESC(ieee80211_default_rc_algo, | ||
27 | "Default rate control algorithm for mac80211 to use"); | ||
28 | |||
24 | int ieee80211_rate_control_register(struct rate_control_ops *ops) | 29 | int ieee80211_rate_control_register(struct rate_control_ops *ops) |
25 | { | 30 | { |
26 | struct rate_control_alg *alg; | 31 | struct rate_control_alg *alg; |
@@ -89,21 +94,27 @@ ieee80211_try_rate_control_ops_get(const char *name) | |||
89 | return ops; | 94 | return ops; |
90 | } | 95 | } |
91 | 96 | ||
92 | /* Get the rate control algorithm. If `name' is NULL, get the first | 97 | /* Get the rate control algorithm. */ |
93 | * available algorithm. */ | ||
94 | static struct rate_control_ops * | 98 | static struct rate_control_ops * |
95 | ieee80211_rate_control_ops_get(const char *name) | 99 | ieee80211_rate_control_ops_get(const char *name) |
96 | { | 100 | { |
97 | struct rate_control_ops *ops; | 101 | struct rate_control_ops *ops; |
102 | const char *alg_name; | ||
98 | 103 | ||
99 | if (!name) | 104 | if (!name) |
100 | name = "simple"; | 105 | alg_name = ieee80211_default_rc_algo; |
106 | else | ||
107 | alg_name = name; | ||
101 | 108 | ||
102 | ops = ieee80211_try_rate_control_ops_get(name); | 109 | ops = ieee80211_try_rate_control_ops_get(alg_name); |
103 | if (!ops) { | 110 | if (!ops) { |
104 | request_module("rc80211_%s", name); | 111 | request_module("rc80211_%s", alg_name); |
105 | ops = ieee80211_try_rate_control_ops_get(name); | 112 | ops = ieee80211_try_rate_control_ops_get(alg_name); |
106 | } | 113 | } |
114 | if (!ops && name) | ||
115 | /* try default if specific alg requested but not found */ | ||
116 | ops = ieee80211_try_rate_control_ops_get(ieee80211_default_rc_algo); | ||
117 | |||
107 | return ops; | 118 | return ops; |
108 | } | 119 | } |
109 | 120 | ||
@@ -244,3 +255,4 @@ void rate_control_deinitialize(struct ieee80211_local *local) | |||
244 | local->rate_ctrl = NULL; | 255 | local->rate_ctrl = NULL; |
245 | rate_control_put(ref); | 256 | rate_control_put(ref); |
246 | } | 257 | } |
258 | |||