]> git.pld-linux.org Git - packages/kernel.git/blame - ath-regd.patch
DMA_PERNUMA_CMA replaced by DMA_NUMA_CMA
[packages/kernel.git] / ath-regd.patch
CommitLineData
51c86cd6
JP
1--- a/drivers/net/wireless/ath/regd.c
2+++ b/drivers/net/wireless/ath/regd.c
3@@ -24,6 +24,7 @@
4 #include "regd_common.h"
5
6 static int __ath_regd_init(struct ath_regulatory *reg);
7+static struct reg_dmn_pair_mapping *ath_get_regpair(int regdmn);
8
9 /*
10 * This is a set of common rules used by our world regulatory domains.
11@@ -116,6 +117,9 @@ static const struct ieee80211_regdomain
12
13 static bool dynamic_country_user_possible(struct ath_regulatory *reg)
14 {
15+ if (IS_ENABLED(CONFIG_ATH_USER_REGD))
16+ return true;
17+
18 if (IS_ENABLED(CONFIG_ATH_REG_DYNAMIC_USER_CERT_TESTING))
19 return true;
20
21@@ -188,6 +192,8 @@ static bool dynamic_country_user_possibl
22
23 static bool ath_reg_dyn_country_user_allow(struct ath_regulatory *reg)
24 {
25+ if (IS_ENABLED(CONFIG_ATH_USER_REGD))
26+ return true;
27 if (!IS_ENABLED(CONFIG_ATH_REG_DYNAMIC_USER_REG_HINTS))
28 return false;
29 if (!dynamic_country_user_possible(reg))
30@@ -345,6 +351,9 @@ ath_reg_apply_beaconing_flags(struct wip
31 struct ieee80211_channel *ch;
32 unsigned int i;
33
34+ if (IS_ENABLED(CONFIG_ATH_USER_REGD))
35+ return;
36+
37 for (band = 0; band < NUM_NL80211_BANDS; band++) {
38 if (!wiphy->bands[band])
39 continue;
40@@ -379,6 +388,9 @@ ath_reg_apply_ir_flags(struct wiphy *wip
41 {
42 struct ieee80211_supported_band *sband;
43
44+ if (IS_ENABLED(CONFIG_ATH_USER_REGD))
45+ return;
46+
47 sband = wiphy->bands[NL80211_BAND_2GHZ];
48 if (!sband)
49 return;
50@@ -408,6 +420,9 @@ static void ath_reg_apply_radar_flags(st
51 struct ieee80211_channel *ch;
52 unsigned int i;
53
54+ if (IS_ENABLED(CONFIG_ATH_USER_REGD))
55+ return;
56+
57 if (!wiphy->bands[NL80211_BAND_5GHZ])
58 return;
59
60@@ -640,6 +655,10 @@ ath_regd_init_wiphy(struct ath_regulator
61 const struct ieee80211_regdomain *regd;
62
63 wiphy->reg_notifier = reg_notifier;
64+
65+ if (IS_ENABLED(CONFIG_ATH_USER_REGD))
66+ return 0;
67+
68 wiphy->regulatory_flags |= REGULATORY_STRICT_REG |
69 REGULATORY_CUSTOM_REG;
70
71--- a/drivers/net/wireless/ath/Kconfig
72+++ b/drivers/net/wireless/ath/Kconfig
73@@ -24,6 +24,9 @@ config WLAN_VENDOR_ATH
74
75 if WLAN_VENDOR_ATH
76
77+config ATH_USER_REGD
78+ bool "Do not enforce EEPROM regulatory restrictions"
79+
80 config ATH_DEBUG
81 bool "Atheros wireless debugging"
82 help
83--- a/drivers/net/wireless/ath/regd.c
84+++ b/drivers/net/wireless/ath/regd.c
85@@ -44,7 +44,8 @@ static struct reg_dmn_pair_mapping *ath_
86 NL80211_RRF_NO_OFDM)
87
88 /* We allow IBSS on these on a case by case basis by regulatory domain */
89-#define ATH_5GHZ_5150_5350 REG_RULE(5150-10, 5350+10, 80, 0, 30,\
90+#define ATH_5GHZ_5150_5350 REG_RULE(5150-10, 5240+10, 80, 0, 30, 0),\
91+ REG_RULE(5260-10, 5350+10, 80, 0, 30,\
92 NL80211_RRF_NO_IR)
93 #define ATH_5GHZ_5470_5850 REG_RULE(5470-10, 5850+10, 80, 0, 30,\
94 NL80211_RRF_NO_IR)
95@@ -62,57 +63,56 @@ static struct reg_dmn_pair_mapping *ath_
96 #define ATH_5GHZ_NO_MIDBAND ATH_5GHZ_5150_5350, \
97 ATH_5GHZ_5725_5850
98
99+#define REGD_RULES(...) \
100+ .reg_rules = { __VA_ARGS__ }, \
101+ .n_reg_rules = ARRAY_SIZE(((struct ieee80211_reg_rule[]) { __VA_ARGS__ }))
102+
103 /* Can be used for:
104 * 0x60, 0x61, 0x62 */
105 static const struct ieee80211_regdomain ath_world_regdom_60_61_62 = {
106- .n_reg_rules = 5,
107 .alpha2 = "99",
108- .reg_rules = {
109+ REGD_RULES(
110 ATH_2GHZ_ALL,
111 ATH_5GHZ_ALL,
112- }
113+ )
114 };
115
116 /* Can be used by 0x63 and 0x65 */
117 static const struct ieee80211_regdomain ath_world_regdom_63_65 = {
118- .n_reg_rules = 4,
119 .alpha2 = "99",
120- .reg_rules = {
121+ REGD_RULES(
122 ATH_2GHZ_CH01_11,
123 ATH_2GHZ_CH12_13,
124 ATH_5GHZ_NO_MIDBAND,
125- }
126+ )
127 };
128
129 /* Can be used by 0x64 only */
130 static const struct ieee80211_regdomain ath_world_regdom_64 = {
131- .n_reg_rules = 3,
132 .alpha2 = "99",
133- .reg_rules = {
134+ REGD_RULES(
135 ATH_2GHZ_CH01_11,
136 ATH_5GHZ_NO_MIDBAND,
137- }
138+ )
139 };
140
141 /* Can be used by 0x66 and 0x69 */
142 static const struct ieee80211_regdomain ath_world_regdom_66_69 = {
143- .n_reg_rules = 3,
144 .alpha2 = "99",
145- .reg_rules = {
146+ REGD_RULES(
147 ATH_2GHZ_CH01_11,
148 ATH_5GHZ_ALL,
149- }
150+ )
151 };
152
153 /* Can be used by 0x67, 0x68, 0x6A and 0x6C */
154 static const struct ieee80211_regdomain ath_world_regdom_67_68_6A_6C = {
155- .n_reg_rules = 4,
156 .alpha2 = "99",
157- .reg_rules = {
158+ REGD_RULES(
159 ATH_2GHZ_CH01_11,
160 ATH_2GHZ_CH12_13,
161 ATH_5GHZ_ALL,
162- }
163+ )
164 };
165
166 static bool dynamic_country_user_possible(struct ath_regulatory *reg)
167--- a/net/wireless/reg.c
168+++ b/net/wireless/reg.c
169@@ -3370,6 +3370,8 @@ void regulatory_hint_country_ie(struct w
170 enum environment_cap env = ENVIRON_ANY;
171 struct regulatory_request *request = NULL, *lr;
172
173+ return;
174+
175 /* IE len must be evenly divisible by 2 */
176 if (country_ie_len & 0x01)
177 return;
178@@ -3621,6 +3623,7 @@ static bool is_wiphy_all_set_reg_flag(en
179
180 void regulatory_hint_disconnect(void)
181 {
182+ return;
183 /* Restore of regulatory settings is not required when wiphy(s)
184 * ignore IE from connected access point but clearance of beacon hints
185 * is required when wiphy(s) supports beacon hints.
186--- a/drivers/net/wireless/ath/regd_common.h
187+++ b/drivers/net/wireless/ath/regd_common.h
188@@ -32,6 +32,7 @@ enum EnumRd {
189 FCC2_WORLD = 0x21,
190 FCC2_ETSIC = 0x22,
191 FCC6_WORLD = 0x23,
192+ FCC3_FCCA_2 = 0x2A,
193 FRANCE_RES = 0x31,
194 FCC3_FCCA = 0x3A,
195 FCC3_WORLD = 0x3B,
196@@ -173,6 +174,7 @@ static struct reg_dmn_pair_mapping regDo
197 {FCC2_WORLD, CTL_FCC, CTL_ETSI},
198 {FCC2_ETSIC, CTL_FCC, CTL_ETSI},
199 {FCC3_FCCA, CTL_FCC, CTL_FCC},
200+ {FCC3_FCCA_2, CTL_FCC, CTL_FCC},
201 {FCC3_WORLD, CTL_FCC, CTL_ETSI},
202 {FCC3_ETSIC, CTL_FCC, CTL_ETSI},
203 {FCC4_FCCA, CTL_FCC, CTL_FCC},
204@@ -486,6 +488,7 @@ static struct country_code_to_enum_rd al
205 {CTRY_UAE, NULL1_WORLD, "AE"},
206 {CTRY_UNITED_KINGDOM, ETSI1_WORLD, "GB"},
207 {CTRY_UNITED_STATES, FCC3_FCCA, "US"},
208+ {CTRY_UNITED_STATES, FCC3_FCCA_2, "US"},
209 {CTRY_UNITED_STATES2, FCC3_FCCA, "US"},
210 {CTRY_UNITED_STATES3, FCC3_FCCA, "US"},
211 /* This "PS" is for US public safety actually... to support this we
212--- a/drivers/net/wireless/ath/regd.c
213+++ b/drivers/net/wireless/ath/regd.c
214@@ -115,6 +115,16 @@ static const struct ieee80211_regdomain
215 )
216 };
217
218+static u16 ath_regd_get_eepromRD(struct ath_regulatory *reg)
219+{
220+ return reg->current_rd & ~WORLDWIDE_ROAMING_FLAG;
221+}
222+
223+static bool is_default_regd(struct ath_regulatory *reg)
224+{
225+ return ath_regd_get_eepromRD(reg) == CTRY_DEFAULT;
226+}
227+
228 static bool dynamic_country_user_possible(struct ath_regulatory *reg)
229 {
230 if (IS_ENABLED(CONFIG_ATH_USER_REGD))
231@@ -123,6 +133,9 @@ static bool dynamic_country_user_possibl
232 if (IS_ENABLED(CONFIG_ATH_REG_DYNAMIC_USER_CERT_TESTING))
233 return true;
234
235+ if (is_default_regd(reg))
236+ return true;
237+
238 switch (reg->country_code) {
239 case CTRY_UNITED_STATES:
240 case CTRY_JAPAN1:
241@@ -208,11 +221,6 @@ static inline bool is_wwr_sku(u16 regd)
242 (regd == WORLD));
243 }
244
245-static u16 ath_regd_get_eepromRD(struct ath_regulatory *reg)
246-{
247- return reg->current_rd & ~WORLDWIDE_ROAMING_FLAG;
248-}
249-
250 bool ath_is_world_regd(struct ath_regulatory *reg)
251 {
252 return is_wwr_sku(ath_regd_get_eepromRD(reg));
253@@ -659,6 +667,9 @@ ath_regd_init_wiphy(struct ath_regulator
254 if (IS_ENABLED(CONFIG_ATH_USER_REGD))
255 return 0;
256
257+ if (is_default_regd(reg))
258+ return 0;
259+
260 wiphy->regulatory_flags |= REGULATORY_STRICT_REG |
261 REGULATORY_CUSTOM_REG;
262
3fadef83
JP
263--- linux-6.3/drivers/net/wireless/ath/ath9k/init.c.orig 2023-04-23 21:02:52.000000000 +0200
264+++ linux-6.3/drivers/net/wireless/ath/ath9k/init.c 2023-05-28 12:29:58.335041933 +0200
265@@ -1108,7 +1108,7 @@
266 }
267
268 /* Handle world regulatory */
269- if (!ath_is_world_regd(reg)) {
270+ if (!IS_ENABLED(CONFIG_ATH_USER_REGD) && !ath_is_world_regd(reg)) {
271 error = regulatory_hint(hw->wiphy, reg->alpha2);
272 if (error)
273 goto debug_cleanup;
274--- linux-6.3/drivers/net/wireless/ath/ath10k/mac.c.orig 2023-04-23 21:02:52.000000000 +0200
275+++ linux-6.3/drivers/net/wireless/ath/ath10k/mac.c 2023-05-28 12:29:12.823062813 +0200
276@@ -10278,7 +10278,7 @@
277 ar->hw->wiphy->software_iftypes |= BIT(NL80211_IFTYPE_AP_VLAN);
278 }
279
280- if (!ath_is_world_regd(&ar->ath_common.reg_world_copy) &&
281+ if (!IS_ENABLED(CONFIG_ATH_USER_REGD) && !ath_is_world_regd(&ar->ath_common.reg_world_copy) &&
282 !ath_is_world_regd(&ar->ath_common.regulatory)) {
283 ret = regulatory_hint(ar->hw->wiphy,
284 ar->ath_common.regulatory.alpha2);
This page took 0.239586 seconds and 4 git commands to generate.