summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>2013-12-14 14:09:06 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-01-13 14:46:58 -0500
commit4f7b91404cd5da3657a82b00394f4f5dfbff13d6 (patch)
treed111dd2ecec10bddc417f77b3f75203fd064acb0
parent8fc685803a8d7b42a5f69dcad7f7cef6f8b60edf (diff)
cfg80211: make regulatory_hint() remove REGULATORY_CUSTOM_REG
The REGULATORY_CUSTOM_REG can be used during early init with the goal of overriding the wiphy's default regulatory settings in case the alpha2 of the device is not known. In the case that the alpha2 becomes known lets avoid having drivers having to clear the REGULATORY_CUSTOM_REG flag by doing it for them when regulatory_hint() is used. Cc: 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.c2
-rw-r--r--include/net/regulatory.h4
-rw-r--r--net/wireless/reg.c2
3 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index 56c3d05c6224..e5e905910db4 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -652,8 +652,6 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
652 } 652 }
653 653
654 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;
657 ath_reg_apply_radar_flags(wiphy); 655 ath_reg_apply_radar_flags(wiphy);
658 ath_reg_apply_world_flags(wiphy, NL80211_REGDOM_SET_BY_DRIVER, reg); 656 ath_reg_apply_world_flags(wiphy, NL80211_REGDOM_SET_BY_DRIVER, reg);
659 return 0; 657 return 0;
diff --git a/include/net/regulatory.h b/include/net/regulatory.h
index c96a0b86f342..b07cdc9fa454 100644
--- a/include/net/regulatory.h
+++ b/include/net/regulatory.h
@@ -96,6 +96,10 @@ struct regulatory_request {
96 * initiator is %REGDOM_SET_BY_CORE). Drivers that use 96 * initiator is %REGDOM_SET_BY_CORE). Drivers that use
97 * wiphy_apply_custom_regulatory() should have this flag set 97 * wiphy_apply_custom_regulatory() should have this flag set
98 * or the regulatory core will set it for the wiphy. 98 * or the regulatory core will set it for the wiphy.
99 * If you use regulatory_hint() *after* using
100 * wiphy_apply_custom_regulatory() the wireless core will
101 * clear the REGULATORY_CUSTOM_REG for your wiphy as it would be
102 * implied that the device somehow gained knowledge of its region.
99 * @REGULATORY_STRICT_REG: tells us that the wiphy for this device 103 * @REGULATORY_STRICT_REG: tells us that the wiphy for this device
100 * has regulatory domain that it wishes to be considered as the 104 * has regulatory domain that it wishes to be considered as the
101 * superset for regulatory rules. After this device gets its regulatory 105 * superset for regulatory rules. After this device gets its regulatory
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 7d20d844ca60..9b897fca7487 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1853,6 +1853,8 @@ int regulatory_hint(struct wiphy *wiphy, const char *alpha2)
1853 if (WARN_ON(!alpha2 || !wiphy)) 1853 if (WARN_ON(!alpha2 || !wiphy))
1854 return -EINVAL; 1854 return -EINVAL;
1855 1855
1856 wiphy->regulatory_flags &= ~REGULATORY_CUSTOM_REG;
1857
1856 request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL); 1858 request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL);
1857 if (!request) 1859 if (!request)
1858 return -ENOMEM; 1860 return -ENOMEM;