aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_rate.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-10-28 09:17:44 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-11-11 00:59:23 -0500
commitac71c691e6a5ce991fe221d3bdb0c972f617aa37 (patch)
treea3641b416579fbb8368e04e1a88f68e0da8dfe39 /net/mac80211/ieee80211_rate.c
parent8a8f1c0437a77cce29c1cb6089f01f22a6d9ca6e (diff)
mac80211: make simple rate control algorithm built-in
Too frequently people do not have module autoloading enabled or fail to install the rate control module correctly, hence their hardware probing fails due to no rate control algorithm being available. This makes the 'simple' algorithm built into the mac80211 module unless EMBEDDED is enabled in which case it can be disabled (eg. if the wanted driver requires another rate control algorithm.) Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ieee80211_rate.c')
-rw-r--r--net/mac80211/ieee80211_rate.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/net/mac80211/ieee80211_rate.c b/net/mac80211/ieee80211_rate.c
index 93abb8fff141..e4bd8481554d 100644
--- a/net/mac80211/ieee80211_rate.c
+++ b/net/mac80211/ieee80211_rate.c
@@ -25,6 +25,9 @@ int ieee80211_rate_control_register(struct rate_control_ops *ops)
25{ 25{
26 struct rate_control_alg *alg; 26 struct rate_control_alg *alg;
27 27
28 if (!ops->name)
29 return -EINVAL;
30
28 alg = kzalloc(sizeof(*alg), GFP_KERNEL); 31 alg = kzalloc(sizeof(*alg), GFP_KERNEL);
29 if (alg == NULL) { 32 if (alg == NULL) {
30 return -ENOMEM; 33 return -ENOMEM;
@@ -61,9 +64,12 @@ ieee80211_try_rate_control_ops_get(const char *name)
61 struct rate_control_alg *alg; 64 struct rate_control_alg *alg;
62 struct rate_control_ops *ops = NULL; 65 struct rate_control_ops *ops = NULL;
63 66
67 if (!name)
68 return NULL;
69
64 mutex_lock(&rate_ctrl_mutex); 70 mutex_lock(&rate_ctrl_mutex);
65 list_for_each_entry(alg, &rate_ctrl_algs, list) { 71 list_for_each_entry(alg, &rate_ctrl_algs, list) {
66 if (!name || !strcmp(alg->ops->name, name)) 72 if (!strcmp(alg->ops->name, name))
67 if (try_module_get(alg->ops->module)) { 73 if (try_module_get(alg->ops->module)) {
68 ops = alg->ops; 74 ops = alg->ops;
69 break; 75 break;
@@ -80,9 +86,12 @@ ieee80211_rate_control_ops_get(const char *name)
80{ 86{
81 struct rate_control_ops *ops; 87 struct rate_control_ops *ops;
82 88
89 if (!name)
90 name = "simple";
91
83 ops = ieee80211_try_rate_control_ops_get(name); 92 ops = ieee80211_try_rate_control_ops_get(name);
84 if (!ops) { 93 if (!ops) {
85 request_module("rc80211_%s", name ? name : "default"); 94 request_module("rc80211_%s", name);
86 ops = ieee80211_try_rate_control_ops_get(name); 95 ops = ieee80211_try_rate_control_ops_get(name);
87 } 96 }
88 return ops; 97 return ops;