Commit ae9e4b0d authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville
Browse files

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: default avatarLuis R. Rodriguez <>
Acked-by: default avatarJohannes Berg <>
Signed-off-by: default avatarJohn W. Linville <>
parent 64839170
......@@ -113,11 +113,7 @@ static const struct ieee80211_regdomain world_regdom = {
static const struct ieee80211_regdomain *cfg80211_world_regdom =
static char *ieee80211_regdom = "US";
static char *ieee80211_regdom = "00";
module_param(ieee80211_regdom, charp, 0444);
MODULE_PARM_DESC(ieee80211_regdom, "IEEE 802.11 regulatory domain code");
......@@ -2287,22 +2283,12 @@ int regulatory_init(void)
printk(KERN_INFO "cfg80211: Using static regulatory domain info\n");
* The old code still requests for a new regdomain and if
* you have CRDA you get it updated, otherwise you get
* stuck with the static values. Since "EU" is not a valid
* ISO / IEC 3166 alpha2 code we can't expect userpace to
* give us a regulatory domain for it. We need last_request
* iniitalized though so lets just send a request which we
* know will be ignored... this crap will be removed once
* OLD_REG dies.
err = regulatory_hint_core(ieee80211_regdom);
cfg80211_regdomain = cfg80211_world_regdom;
err = regulatory_hint_core(ieee80211_regdom);
/* We always try to get an update for the static regdomain */
err = regulatory_hint_core(cfg80211_regdomain->alpha2);
if (err) {
if (err == -ENOMEM)
return err;
......@@ -2321,6 +2307,13 @@ int regulatory_init(void)
* Finally, if the user set the module parameter treat it
* as a user hint.
if (!is_world_regdom(ieee80211_regdom))
return 0;
Supports Markdown
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