Commit 4f7b9140 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville

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: default avatarLuis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 8fc68580
...@@ -652,8 +652,6 @@ ath_regd_init_wiphy(struct ath_regulatory *reg, ...@@ -652,8 +652,6 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
} }
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;
......
...@@ -96,6 +96,10 @@ struct regulatory_request { ...@@ -96,6 +96,10 @@ struct regulatory_request {
* initiator is %REGDOM_SET_BY_CORE). Drivers that use * initiator is %REGDOM_SET_BY_CORE). Drivers that use
* wiphy_apply_custom_regulatory() should have this flag set * wiphy_apply_custom_regulatory() should have this flag set
* or the regulatory core will set it for the wiphy. * or the regulatory core will set it for the wiphy.
* If you use regulatory_hint() *after* using
* wiphy_apply_custom_regulatory() the wireless core will
* clear the REGULATORY_CUSTOM_REG for your wiphy as it would be
* implied that the device somehow gained knowledge of its region.
* @REGULATORY_STRICT_REG: tells us that the wiphy for this device * @REGULATORY_STRICT_REG: tells us that the wiphy for this device
* has regulatory domain that it wishes to be considered as the * has regulatory domain that it wishes to be considered as the
* superset for regulatory rules. After this device gets its regulatory * superset for regulatory rules. After this device gets its regulatory
......
...@@ -1853,6 +1853,8 @@ int regulatory_hint(struct wiphy *wiphy, const char *alpha2) ...@@ -1853,6 +1853,8 @@ int regulatory_hint(struct wiphy *wiphy, const char *alpha2)
if (WARN_ON(!alpha2 || !wiphy)) if (WARN_ON(!alpha2 || !wiphy))
return -EINVAL; return -EINVAL;
wiphy->regulatory_flags &= ~REGULATORY_CUSTOM_REG;
request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL); request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL);
if (!request) if (!request)
return -ENOMEM; return -ENOMEM;
......
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