mac80211: update to wireless-testing 2016-10-08
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 406-ath_relax_default_regd.patch
1 --- a/drivers/net/wireless/ath/regd.c
2 +++ b/drivers/net/wireless/ath/regd.c
3 @@ -114,11 +114,24 @@ 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_REG_DYNAMIC_USER_CERT_TESTING))
20 return true;
21
22 + if (is_default_regd(reg))
23 + return true;
24 +
25 switch (reg->country_code) {
26 case CTRY_UNITED_STATES:
27 case CTRY_JAPAN1:
28 @@ -202,11 +215,6 @@ static inline bool is_wwr_sku(u16 regd)
29 (regd == WORLD));
30 }
31
32 -static u16 ath_regd_get_eepromRD(struct ath_regulatory *reg)
33 -{
34 - return reg->current_rd & ~WORLDWIDE_ROAMING_FLAG;
35 -}
36 -
37 bool ath_is_world_regd(struct ath_regulatory *reg)
38 {
39 return is_wwr_sku(ath_regd_get_eepromRD(reg));
40 @@ -650,6 +658,9 @@ ath_regd_init_wiphy(struct ath_regulator
41 return 0;
42 #endif
43
44 + if (is_default_regd(reg))
45 + return 0;
46 +
47 wiphy->regulatory_flags |= REGULATORY_STRICT_REG |
48 REGULATORY_CUSTOM_REG;
49