cfg80211: enable regulatory hints for strict custom settings
PATCH 1/2 cfg80211: enable regulatory hints for strict custom settings
If we have a wiphy with an ISO3166-alpha2 regulatory domain programmed with the strict flag set we wait until the wiphy gets its wiphy->regd programmed before allowing regulatory domains hints other than country IE hints from processing on the wiphy. The existing check however discards the possibility of custom regulatory domains having also used the strict flag and these will not have the wiphy->regd set. Custom strict regulatory domains never set the wiphy->regd though as such currently all regulatory hints other than country IE hints are being ignored on these wiphys.
All custom strict regulatory domains set the wiphy with the WIPHY_FLAG_CUSTOM_REGULATORY and use wiphy_apply_custom_regulatory(). Enhance the check for the strict ISO3166-alpha2 regulatory domain case by exempting the WIPHY_FLAG_CUSTOM_REGULATORY case. This will enable other regulatory hints to be processed now for these strict custom regulatory domains.
--- net/wireless/reg.c | 1 + 1 file changed, 1 insertion(+)
net/wireless/reg.c +1 -0
@@ -992,6 +992,7 @@ static bool ignore_reg_update(struct wiphy *wiphy,*/ if (wiphy->flags &WIPHY_FLAG_STRICT_REGULATORY && !wiphy->regd && initiator !=NL80211_REGDOM_SET_BY_COUNTRY_IE && + !(wiphy->flags &WIPHY_FLAG_CUSTOM_REGULATORY ) && !is_world_regdom (lr->alpha2)) {REG_DBG_PRINT ("Ignoring regulatory request set by %s " "since the driver requires its own regulatory "
Signature · 1 line
1.8.4.rc3
PATCH 2/2 cfg80211: simplfy strict custom alpha2 regdomain check
This makes it easier to read.
--- net/wireless/reg.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
net/wireless/reg.c +8 -2
@@ -964,6 +964,13 @@ static bool reg_dev_ignore_cell_hint(struct wiphy *wiphy) }#endif +static bool wiphy_strict_alpha2_regd (struct wiphy *wiphy) +{ +if (wiphy->flags &WIPHY_FLAG_STRICT_REGULATORY && + !(wiphy->flags &WIPHY_FLAG_CUSTOM_REGULATORY )) +return true; +return false; +}static bool ignore_reg_update (struct wiphy *wiphy,enum nl80211_reg_initiator initiator)
@@ -990,9 +997,8 @@ static bool ignore_reg_update(struct wiphy *wiphy,* wiphy->regd will be set once the device has its own * desired regulatory domain set */ -if (wiphy->flags &WIPHY_FLAG_STRICT_REGULATORY && !wiphy->regd && +if (wiphy_strict_alpha2_regd (wiphy) && !wiphy->regd && initiator !=NL80211_REGDOM_SET_BY_COUNTRY_IE && - !(wiphy->flags &WIPHY_FLAG_CUSTOM_REGULATORY ) && !is_world_regdom (lr->alpha2)) {REG_DBG_PRINT ("Ignoring regulatory request set by %s " "since the driver requires its own regulatory "
Signature · 1 line
1.8.4.rc3
Johannes Berg
maintainerAPplied both, but there were issues (fuzz) - please check.
Also, fixed your typo in the subject :)
johannes