1 --- a/drivers/net/wireless/ath/regd.c
2 +++ b/drivers/net/wireless/ath/regd.c
4 #include "regd_common.h"
6 static int __ath_regd_init(struct ath_regulatory *reg);
7 +static struct reg_dmn_pair_mapping *ath_get_regpair(int regdmn);
10 * This is a set of common rules used by our world regulatory domains.
11 @@ -116,6 +117,9 @@ static const struct ieee80211_regdomain
13 static bool dynamic_country_user_possible(struct ath_regulatory *reg)
15 + if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
18 if (IS_ENABLED(CPTCFG_ATH_REG_DYNAMIC_USER_CERT_TESTING))
21 @@ -188,6 +192,8 @@ static bool dynamic_country_user_possibl
23 static bool ath_reg_dyn_country_user_allow(struct ath_regulatory *reg)
25 + if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
27 if (!IS_ENABLED(CPTCFG_ATH_REG_DYNAMIC_USER_REG_HINTS))
29 if (!dynamic_country_user_possible(reg))
30 @@ -345,6 +351,9 @@ ath_reg_apply_beaconing_flags(struct wip
31 struct ieee80211_channel *ch;
34 + if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
37 for (band = 0; band < NUM_NL80211_BANDS; band++) {
38 if (!wiphy->bands[band])
40 @@ -379,6 +388,9 @@ ath_reg_apply_ir_flags(struct wiphy *wip
42 struct ieee80211_supported_band *sband;
44 + if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
47 sband = wiphy->bands[NL80211_BAND_2GHZ];
50 @@ -408,6 +420,9 @@ static void ath_reg_apply_radar_flags(st
51 struct ieee80211_channel *ch;
54 + if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
57 if (!wiphy->bands[NL80211_BAND_5GHZ])
60 @@ -640,6 +655,10 @@ ath_regd_init_wiphy(struct ath_regulator
61 const struct ieee80211_regdomain *regd;
63 wiphy->reg_notifier = reg_notifier;
65 + if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
68 wiphy->regulatory_flags |= REGULATORY_STRICT_REG |
69 REGULATORY_CUSTOM_REG;
71 --- a/drivers/net/wireless/ath/Kconfig
72 +++ b/drivers/net/wireless/ath/Kconfig
73 @@ -24,6 +24,9 @@ config WLAN_VENDOR_ATH
78 + bool "Do not enforce EEPROM regulatory restrictions"
81 bool "Atheros wireless debugging"
85 @@ -83,6 +83,7 @@ ADM8211=
91 ATH_REG_DYNAMIC_USER_REG_HINTS=
92 ATH_REG_DYNAMIC_USER_CERT_TESTING=