aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>2013-12-14 14:09:05 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-01-13 14:46:58 -0500
commit8fc685803a8d7b42a5f69dcad7f7cef6f8b60edf (patch)
tree8a3d11eff63d15e14a18c100459a08680b5349a3
parentf13352519ee8c4b22b87fc1a47743d1f53ea193e (diff)
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: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/regd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index 9e154732afaa..56c3d05c6224 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -632,7 +632,8 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
632 const struct ieee80211_regdomain *regd; 632 const struct ieee80211_regdomain *regd;
633 633
634 wiphy->reg_notifier = reg_notifier; 634 wiphy->reg_notifier = reg_notifier;
635 wiphy->regulatory_flags |= REGULATORY_STRICT_REG; 635 wiphy->regulatory_flags |= REGULATORY_STRICT_REG |
636 REGULATORY_CUSTOM_REG;
636 637
637 if (ath_is_world_regd(reg)) { 638 if (ath_is_world_regd(reg)) {
638 /* 639 /*
@@ -640,8 +641,7 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
640 * saved on the wiphy orig_* parameters 641 * saved on the wiphy orig_* parameters
641 */ 642 */
642 regd = ath_world_regdomain(reg); 643 regd = ath_world_regdomain(reg);
643 wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG | 644 wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_FOLLOW_POWER;
644 REGULATORY_COUNTRY_IE_FOLLOW_POWER;
645 } else { 645 } else {
646 /* 646 /*
647 * This gets applied in the case of the absence of CRDA, 647 * This gets applied in the case of the absence of CRDA,
@@ -650,7 +650,10 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
650 */ 650 */
651 regd = ath_default_world_regdomain(); 651 regd = ath_default_world_regdomain();
652 } 652 }
653
653 wiphy_apply_custom_regulatory(wiphy, regd); 654 wiphy_apply_custom_regulatory(wiphy, regd);
655 if (!ath_is_world_regd(reg))
656 wiphy->regulatory_flags &= ~REGULATORY_CUSTOM_REG;
654 ath_reg_apply_radar_flags(wiphy); 657 ath_reg_apply_radar_flags(wiphy);
655 ath_reg_apply_world_flags(wiphy, NL80211_REGDOM_SET_BY_DRIVER, reg); 658 ath_reg_apply_world_flags(wiphy, NL80211_REGDOM_SET_BY_DRIVER, reg);
656 return 0; 659 return 0;