aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/reg.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-07-14 20:23:15 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-24 15:05:19 -0400
commitae9e4b0d1a43fd66da43918491834f9e5c1b6cca (patch)
tree805654d3402c7e306f8cc9b306eb316562cebc2b /net/wireless/reg.c
parent64839170be296e6348fbaf83fd103711978669b9 (diff)
cfg80211: treat ieee80211_regdom hints as user hints
We were treating ieee80211_regdom module parameter hints as core hints, this means we were not letting the user help compliance further when using the module parameter. It also meant that users with a device with a custom regulatory domain set (wiphy->custom_regulatory) using this module parameter were being stuck to the original default core static regualtory domain. We fix this by using the static cfg80211_regdomain alpha2 as the core hint and treating the module parameter separately. All iwlwifi and ath5k/ath9k/ar9170 devices which world roam set the wiphy->custom_regulatory. This change allows users using this module parameter to have it trated as a a proper user hint and not have it ignored. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r--net/wireless/reg.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 2b4a6c66f5ae..fb40428a5946 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -113,11 +113,7 @@ static const struct ieee80211_regdomain world_regdom = {
113static const struct ieee80211_regdomain *cfg80211_world_regdom = 113static const struct ieee80211_regdomain *cfg80211_world_regdom =
114 &world_regdom; 114 &world_regdom;
115 115
116#ifdef CONFIG_WIRELESS_OLD_REGULATORY
117static char *ieee80211_regdom = "US";
118#else
119static char *ieee80211_regdom = "00"; 116static char *ieee80211_regdom = "00";
120#endif
121 117
122module_param(ieee80211_regdom, charp, 0444); 118module_param(ieee80211_regdom, charp, 0444);
123MODULE_PARM_DESC(ieee80211_regdom, "IEEE 802.11 regulatory domain code"); 119MODULE_PARM_DESC(ieee80211_regdom, "IEEE 802.11 regulatory domain code");
@@ -2287,22 +2283,12 @@ int regulatory_init(void)
2287 2283
2288 printk(KERN_INFO "cfg80211: Using static regulatory domain info\n"); 2284 printk(KERN_INFO "cfg80211: Using static regulatory domain info\n");
2289 print_regdomain_info(cfg80211_regdomain); 2285 print_regdomain_info(cfg80211_regdomain);
2290 /*
2291 * The old code still requests for a new regdomain and if
2292 * you have CRDA you get it updated, otherwise you get
2293 * stuck with the static values. Since "EU" is not a valid
2294 * ISO / IEC 3166 alpha2 code we can't expect userpace to
2295 * give us a regulatory domain for it. We need last_request
2296 * iniitalized though so lets just send a request which we
2297 * know will be ignored... this crap will be removed once
2298 * OLD_REG dies.
2299 */
2300 err = regulatory_hint_core(ieee80211_regdom);
2301#else 2286#else
2302 cfg80211_regdomain = cfg80211_world_regdom; 2287 cfg80211_regdomain = cfg80211_world_regdom;
2303 2288
2304 err = regulatory_hint_core(ieee80211_regdom);
2305#endif 2289#endif
2290 /* We always try to get an update for the static regdomain */
2291 err = regulatory_hint_core(cfg80211_regdomain->alpha2);
2306 if (err) { 2292 if (err) {
2307 if (err == -ENOMEM) 2293 if (err == -ENOMEM)
2308 return err; 2294 return err;
@@ -2321,6 +2307,13 @@ int regulatory_init(void)
2321#endif 2307#endif
2322 } 2308 }
2323 2309
2310 /*
2311 * Finally, if the user set the module parameter treat it
2312 * as a user hint.
2313 */
2314 if (!is_world_regdom(ieee80211_regdom))
2315 regulatory_hint_user(ieee80211_regdom);
2316
2324 return 0; 2317 return 0;
2325} 2318}
2326 2319