Commit 8fc68580 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville

ath: fix warning on usage of REGULATORY_CUSTOM_REG

ath wants to first apply the custom regd and only later
will it revert to not using it if an alpha2 regulatory
domain is found. Since the wireless core now enforces
usage of the REGULATORY_CUSTOM_REG strictly when
wiphy_apply_custom_regulatory() is used this makes
ath adhere to the expected behaviour but also updates
the wiphy after its done with the custom usage.

This fixes this warning:

[    5.488733] ath: phy0: ASPM enabled: 0x43
[    5.488735] ath: EEPROM regdomain: 0x0
[    5.488736] ath: EEPROM indicates default country code should be used
[    5.488736] ath: doing EEPROM country->regdmn map search
[    5.488737] ath: country maps to regdmn code: 0x3a
[    5.488737] ath: Country alpha2 being used: US
[    5.488738] ath: Regpair used: 0x3a
[    5.488738] ------------[ cut here ]------------
[    5.488745] WARNING: CPU: 0 PID: 161 at
	/home/sujith/dev/wireless-testing/net/wireless/reg.c:1361
	wiphy_apply_custom_regulatory+0x17a/0x1b0 [cfg80211]()
[    5.488746] wiphy should have REGULATORY_CUSTOM_REG

The wireless core can *later* lift this flag for us for when
using the regulatory_hint() to make this fix more generic.
Reported-by: default avatarSujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent f1335251
...@@ -632,7 +632,8 @@ ath_regd_init_wiphy(struct ath_regulatory *reg, ...@@ -632,7 +632,8 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
const struct ieee80211_regdomain *regd; const struct ieee80211_regdomain *regd;
wiphy->reg_notifier = reg_notifier; wiphy->reg_notifier = reg_notifier;
wiphy->regulatory_flags |= REGULATORY_STRICT_REG; wiphy->regulatory_flags |= REGULATORY_STRICT_REG |
REGULATORY_CUSTOM_REG;
if (ath_is_world_regd(reg)) { if (ath_is_world_regd(reg)) {
/* /*
...@@ -640,8 +641,7 @@ ath_regd_init_wiphy(struct ath_regulatory *reg, ...@@ -640,8 +641,7 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
* saved on the wiphy orig_* parameters * saved on the wiphy orig_* parameters
*/ */
regd = ath_world_regdomain(reg); regd = ath_world_regdomain(reg);
wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG | wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_FOLLOW_POWER;
REGULATORY_COUNTRY_IE_FOLLOW_POWER;
} else { } else {
/* /*
* This gets applied in the case of the absence of CRDA, * This gets applied in the case of the absence of CRDA,
...@@ -650,7 +650,10 @@ ath_regd_init_wiphy(struct ath_regulatory *reg, ...@@ -650,7 +650,10 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
*/ */
regd = ath_default_world_regdomain(); regd = ath_default_world_regdomain();
} }
wiphy_apply_custom_regulatory(wiphy, regd); wiphy_apply_custom_regulatory(wiphy, regd);
if (!ath_is_world_regd(reg))
wiphy->regulatory_flags &= ~REGULATORY_CUSTOM_REG;
ath_reg_apply_radar_flags(wiphy); ath_reg_apply_radar_flags(wiphy);
ath_reg_apply_world_flags(wiphy, NL80211_REGDOM_SET_BY_DRIVER, reg); ath_reg_apply_world_flags(wiphy, NL80211_REGDOM_SET_BY_DRIVER, reg);
return 0; return 0;
......
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