mac80211: refresh patches
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / ath / 406-ath_relax_default_regd.patch
1 --- a/drivers/net/wireless/ath/regd.c
2 +++ b/drivers/net/wireless/ath/regd.c
3 @@ -115,6 +115,16 @@ static const struct ieee80211_regdomain
4 )
5 };
6
7 +static u16 ath_regd_get_eepromRD(struct ath_regulatory *reg)
8 +{
9 + return reg->current_rd & ~WORLDWIDE_ROAMING_FLAG;
10 +}
11 +
12 +static bool is_default_regd(struct ath_regulatory *reg)
13 +{
14 + return ath_regd_get_eepromRD(reg) == CTRY_DEFAULT;
15 +}
16 +
17 static bool dynamic_country_user_possible(struct ath_regulatory *reg)
18 {
19 if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
20 @@ -123,6 +133,9 @@ static bool dynamic_country_user_possibl
21 if (IS_ENABLED(CPTCFG_ATH_REG_DYNAMIC_USER_CERT_TESTING))
22 return true;
23
24 + if (is_default_regd(reg))
25 + return true;
26 +
27 switch (reg->country_code) {
28 case CTRY_UNITED_STATES:
29 case CTRY_JAPAN1:
30 @@ -208,11 +221,6 @@ static inline bool is_wwr_sku(u16 regd)
31 (regd == WORLD));
32 }
33
34 -static u16 ath_regd_get_eepromRD(struct ath_regulatory *reg)
35 -{
36 - return reg->current_rd & ~WORLDWIDE_ROAMING_FLAG;
37 -}
38 -
39 bool ath_is_world_regd(struct ath_regulatory *reg)
40 {
41 return is_wwr_sku(ath_regd_get_eepromRD(reg));
42 @@ -658,6 +666,9 @@ ath_regd_init_wiphy(struct ath_regulator
43 if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
44 return 0;
45
46 + if (is_default_regd(reg))
47 + return 0;
48 +
49 wiphy->regulatory_flags |= REGULATORY_STRICT_REG |
50 REGULATORY_CUSTOM_REG;
51