xref: /wlan-dirver/qca-wifi-host-cmn/umac/regulatory/dispatcher/inc/reg_services_public_struct.h (revision 45a38684b07295822dc8eba39e293408f203eec8)
1 /*
2  * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19  /**
20  * DOC: reg_services_public_struct.h
21  * This file contains regulatory data structures
22  */
23 
24 #ifndef __REG_SERVICES_PUBLIC_STRUCT_H_
25 #define __REG_SERVICES_PUBLIC_STRUCT_H_
26 
27 #define REG_SBS_SEPARATION_THRESHOLD 100
28 
29 #ifdef CONFIG_BAND_6GHZ
30 #define REG_MAX_CHANNELS_PER_OPERATING_CLASS  70
31 #else
32 #define REG_MAX_CHANNELS_PER_OPERATING_CLASS  25
33 #endif
34 
35 #define REG_MAX_SUPP_OPER_CLASSES 32
36 #define REG_MAX_CHAN_CHANGE_CBKS 30
37 #define REG_INVALID_TXPOWER 255
38 #define MAX_STA_VDEV_CNT 4
39 #define INVALID_VDEV_ID 0xFF
40 #define INVALID_CHANNEL_NUM 0x0
41 #define CH_AVOID_MAX_RANGE   4
42 #define REG_ALPHA2_LEN 2
43 #define MAX_REG_RULES 10
44 
45 #define REGULATORY_CHAN_DISABLED     BIT(0)
46 #define REGULATORY_CHAN_NO_IR        BIT(1)
47 #define REGULATORY_CHAN_RADAR        BIT(3)
48 #define REGULATORY_CHAN_NO_OFDM      BIT(6)
49 #define REGULATORY_CHAN_INDOOR_ONLY  BIT(9)
50 #define REGULATORY_CHAN_AFC          BIT(13)
51 
52 #define REGULATORY_CHAN_NO_HT40      BIT(4)
53 #define REGULATORY_CHAN_NO_80MHZ     BIT(7)
54 #define REGULATORY_CHAN_NO_160MHZ    BIT(8)
55 #define REGULATORY_CHAN_NO_20MHZ     BIT(11)
56 #define REGULATORY_CHAN_NO_10MHZ     BIT(12)
57 #define REGULATORY_CHAN_INVALID      BIT(14)
58 
59 #define REGULATORY_PHYMODE_NO11A     BIT(0)
60 #define REGULATORY_PHYMODE_NO11B     BIT(1)
61 #define REGULATORY_PHYMODE_NO11G     BIT(2)
62 #define REGULATORY_CHAN_NO11N        BIT(3)
63 #define REGULATORY_PHYMODE_NO11AC    BIT(4)
64 #define REGULATORY_PHYMODE_NO11AX    BIT(5)
65 
66 #define BW_5_MHZ      5
67 #define BW_10_MHZ     10
68 #define BW_20_MHZ     20
69 #define BW_25_MHZ     25
70 #define BW_40_MHZ     40
71 #define BW_80_MHZ     80
72 #define BW_160_MHZ    160
73 #define BW_40_MHZ     40
74 
75 /**
76  * enum dfs_reg - DFS region
77  * @DFS_UNINIT_REGION: un-initialized region
78  * @DFS_FCC_REGION: FCC region
79  * @DFS_ETSI_REGION: ETSI region
80  * @DFS_MKK_REGION: MKK region
81  * @DFS_CN_REGION: China region
82  * @DFS_KR_REGION: Korea region
83  * @DFS_MKK_REGION: MKKN region
84  * that supports updated W53 RADAR pattern
85  * detection.
86  * @DFS_UNDEF_REGION: Undefined region
87  */
88 
89 enum dfs_reg {
90 	DFS_UNINIT_REGION = 0,
91 	DFS_FCC_REGION = 1,
92 	DFS_ETSI_REGION = 2,
93 	DFS_MKK_REGION = 3,
94 	DFS_CN_REGION = 4,
95 	DFS_KR_REGION = 5,
96 	DFS_MKKN_REGION = 6,
97 	DFS_UNDEF_REGION = 0xFFFF,
98 };
99 
100 /** enum op_class_table_num
101  * OP_CLASS_US- Class corresponds to US
102  * OP_CLASS_EU- Class corresponds to EU
103  * OP_CLASS_JAPAN- Class corresponds to JAPAN
104  * OP_CLASS_GLOBAL- Class corresponds to GLOBAL
105  * OP_CLASS_CHINA- Class corresponds to CHINA
106  */
107 enum op_class_table_num {
108 	OP_CLASS_US = 1,
109 	OP_CLASS_EU,
110 	OP_CLASS_JAPAN,
111 	OP_CLASS_GLOBAL,
112 	OP_CLASS_CHINA
113 };
114 
115 /**
116  * enum channel_enum - channel enumeration
117  * @CHAN_ENUM_2412: channel with freq 2412
118  * @CHAN_ENUM_2417: channel with freq 2417
119  * @CHAN_ENUM_2422: channel with freq 2422
120  * @CHAN_ENUM_2427: channel with freq 2427
121  * @CHAN_ENUM_2432: channel with freq 2432
122  * @CHAN_ENUM_2437: channel with freq 2437
123  * @CHAN_ENUM_2442: channel with freq 2442
124  * @CHAN_ENUM_2447: channel with freq 2447
125  * @CHAN_ENUM_2452: channel with freq 2452
126  * @CHAN_ENUM_2457: channel with freq 2457
127  * @CHAN_ENUM_2462: channel with freq 2462
128  * @CHAN_ENUM_2467: channel with freq 2467
129  * @CHAN_ENUM_2472: channel with freq 2472
130  * @CHAN_ENUM_2484: channel with freq 2484
131  * @CHAN_ENUM_4912: channel with freq 4912
132  * @CHAN_ENUM_4915: channel with freq 4915
133  * @CHAN_ENUM_4917: channel with freq 4917
134  * @CHAN_ENUM_4920: channel with freq 4920
135  * @CHAN_ENUM_4922: channel with freq 4922
136  * @CHAN_ENUM_4925: channel with freq 4925
137  * @CHAN_ENUM_4927: channel with freq 4927
138  * @CHAN_ENUM_4932: channel with freq 4932
139  * @CHAN_ENUM_4935: channel with freq 4935
140  * @CHAN_ENUM_4937: channel with freq 4937
141  * @CHAN_ENUM_4940: channel with freq 4940
142  * @CHAN_ENUM_4942: channel with freq 4942
143  * @CHAN_ENUM_4945: channel with freq 4945
144  * @CHAN_ENUM_4947: channel with freq 4947
145  * @CHAN_ENUM_4950: channel with freq 4950
146  * @CHAN_ENUM_4952: channel with freq 4952
147  * @CHAN_ENUM_4955: channel with freq 4955
148  * @CHAN_ENUM_4957: channel with freq 4957
149  * @CHAN_ENUM_4960: channel with freq 4960
150  * @CHAN_ENUM_4962: channel with freq 4962
151  * @CHAN_ENUM_4965: channel with freq 4965
152  * @CHAN_ENUM_4967: channel with freq 4967
153  * @CHAN_ENUM_4970: channel with freq 4970
154  * @CHAN_ENUM_4972: channel with freq 4972
155  * @CHAN_ENUM_4975: channel with freq 4975
156  * @CHAN_ENUM_4977: channel with freq 4977
157  * @CHAN_ENUM_4980: channel with freq 4980
158  * @CHAN_ENUM_4982: channel with freq 4982
159  * @CHAN_ENUM_4985: channel with freq 4985
160  * @CHAN_ENUM_4987: channel with freq 4987
161  * @CHAN_ENUM_5032: channel with freq 5032
162  * @CHAN_ENUM_5035: channel with freq 5035
163  * @CHAN_ENUM_5037: channel with freq 5037
164  * @CHAN_ENUM_5040: channel with freq 5040
165  * @CHAN_ENUM_5042: channel with freq 5042
166  * @CHAN_ENUM_5045: channel with freq 5045
167  * @CHAN_ENUM_5047: channel with freq 5047
168  * @CHAN_ENUM_5052: channel with freq 5052
169  * @CHAN_ENUM_5055: channel with freq 5055
170  * @CHAN_ENUM_5057: channel with freq 5057
171  * @CHAN_ENUM_5060: channel with freq 5060
172  * @CHAN_ENUM_5080: channel with freq 5080
173  * @CHAN_ENUM_5180: channel with freq 5180
174  * @CHAN_ENUM_5200: channel with freq 5200
175  * @CHAN_ENUM_5220: channel with freq 5220
176  * @CHAN_ENUM_5240: channel with freq 5240
177  * @CHAN_ENUM_5260: channel with freq 5260
178  * @CHAN_ENUM_5280: channel with freq 5280
179  * @CHAN_ENUM_5300: channel with freq 5300
180  * @CHAN_ENUM_5320: channel with freq 5320
181  * @CHAN_ENUM_5500: channel with freq 5500
182  * @CHAN_ENUM_5520: channel with freq 5520
183  * @CHAN_ENUM_5540: channel with freq 5540
184  * @CHAN_ENUM_5560: channel with freq 5560
185  * @CHAN_ENUM_5580: channel with freq 5580
186  * @CHAN_ENUM_5600: channel with freq 5600
187  * @CHAN_ENUM_5620: channel with freq 5620
188  * @CHAN_ENUM_5640: channel with freq 5640
189  * @CHAN_ENUM_5660: channel with freq 5660
190  * @CHAN_ENUM_5680: channel with freq 5680
191  * @CHAN_ENUM_5700: channel with freq 5700
192  * @CHAN_ENUM_5720: channel with freq 5720
193  * @CHAN_ENUM_5745: channel with freq 5745
194  * @CHAN_ENUM_5765: channel with freq 5765
195  * @CHAN_ENUM_5785: channel with freq 5785
196  * @CHAN_ENUM_5805: channel with freq 5805
197  * @CHAN_ENUM_5825: channel with freq 5825
198  * @CHAN_ENUM_5845: channel with freq 5845
199  * @CHAN_ENUM_5850: channel with freq 5850
200  * @CHAN_ENUM_5855: channel with freq 5855
201  * @CHAN_ENUM_5860: channel with freq 5860
202  * @CHAN_ENUM_5865: channel with freq 5865
203  * @CHAN_ENUM_5870: channel with freq 5870
204  * @CHAN_ENUM_5875: channel with freq 5875
205  * @CHAN_ENUM_5880: channel with freq 5880
206  * @CHAN_ENUM_5885: channel with freq 5885
207  * @CHAN_ENUM_5890: channel with freq 5890
208  * @CHAN_ENUM_5895: channel with freq 5895
209  * @CHAN_ENUM_5900: channel with freq 5900
210  * @CHAN_ENUM_5905: channel with freq 5905
211  * @CHAN_ENUM_5910: channel with freq 5910
212  * @CHAN_ENUM_5915: channel with freq 5915
213  * @CHAN_ENUM_5920: channel with freq 5920
214  * @CHAN_ENUM_5935: channel with freq 5935
215  * @CHAN_ENUM_5955: channel with freq 5955
216  * @CHAN_ENUM_5975: channel with freq 5975
217  * @CHAN_ENUM_5995: channel with freq 5995
218  * @CHAN_ENUM_6015: channel with freq 6015
219  * @CHAN_ENUM_6035: channel with freq 6035
220  * @CHAN_ENUM_6055: channel with freq 6055
221  * @CHAN_ENUM_6075: channel with freq 6075
222  * @CHAN_ENUM_6095: channel with freq 6095
223  * @CHAN_ENUM_6115: channel with freq 6115
224  * @CHAN_ENUM_6135: channel with freq 6135
225  * @CHAN_ENUM_6155: channel with freq 6155
226  * @CHAN_ENUM_6175: channel with freq 6175
227  * @CHAN_ENUM_6195: channel with freq 6195
228  * @CHAN_ENUM_6215: channel with freq 6215
229  * @CHAN_ENUM_6235: channel with freq 6235
230  * @CHAN_ENUM_6255: channel with freq 6255
231  * @CHAN_ENUM_6275: channel with freq 6275
232  * @CHAN_ENUM_6295: channel with freq 6295
233  * @CHAN_ENUM_6315: channel with freq 6315
234  * @CHAN_ENUM_6335: channel with freq 6335
235  * @CHAN_ENUM_6355: channel with freq 6355
236  * @CHAN_ENUM_6375: channel with freq 6375
237  * @CHAN_ENUM_6395: channel with freq 6395
238  * @CHAN_ENUM_6415: channel with freq 6415
239  * @CHAN_ENUM_6435: channel with freq 6435
240  * @CHAN_ENUM_6455: channel with freq 6455
241  * @CHAN_ENUM_6475: channel with freq 6475
242  * @CHAN_ENUM_6495: channel with freq 6495
243  * @CHAN_ENUM_6515: channel with freq 6515
244  * @CHAN_ENUM_6535: channel with freq 6535
245  * @CHAN_ENUM_6555: channel with freq 6555
246  * @CHAN_ENUM_6575: channel with freq 6575
247  * @CHAN_ENUM_6595: channel with freq 6595
248  * @CHAN_ENUM_6615: channel with freq 6615
249  * @CHAN_ENUM_6635: channel with freq 6635
250  * @CHAN_ENUM_6655: channel with freq 6655
251  * @CHAN_ENUM_6675: channel with freq 6675
252  * @CHAN_ENUM_6695: channel with freq 6695
253  * @CHAN_ENUM_6715: channel with freq 6715
254  * @CHAN_ENUM_6735: channel with freq 6735
255  * @CHAN_ENUM_6755: channel with freq 6755
256  * @CHAN_ENUM_6775: channel with freq 6775
257  * @CHAN_ENUM_6795: channel with freq 6795
258  * @CHAN_ENUM_6815: channel with freq 6815
259  * @CHAN_ENUM_6835: channel with freq 6835
260  * @CHAN_ENUM_6855: channel with freq 6855
261  * @CHAN_ENUM_6875: channel with freq 6875
262  * @CHAN_ENUM_6895: channel with freq 6895
263  * @CHAN_ENUM_6915: channel with freq 6915
264  * @CHAN_ENUM_6935: channel with freq 6935
265  * @CHAN_ENUM_6955: channel with freq 6955
266  * @CHAN_ENUM_6975: channel with freq 6975
267  * @CHAN_ENUM_6995: channel with freq 6995
268  * @CHAN_ENUM_7015: channel with freq 7015
269  * @CHAN_ENUM_7035: channel with freq 7035
270  * @CHAN_ENUM_7055: channel with freq 7055
271  * @CHAN_ENUM_7075: channel with freq 7075
272  * @CHAN_ENUM_7095: channel with freq 7095
273  * @CHAN_ENUM_7115: channel with freq 7115
274  */
275 enum channel_enum {
276 	CHAN_ENUM_2412,
277 	CHAN_ENUM_2417,
278 	CHAN_ENUM_2422,
279 	CHAN_ENUM_2427,
280 	CHAN_ENUM_2432,
281 	CHAN_ENUM_2437,
282 	CHAN_ENUM_2442,
283 	CHAN_ENUM_2447,
284 	CHAN_ENUM_2452,
285 	CHAN_ENUM_2457,
286 	CHAN_ENUM_2462,
287 	CHAN_ENUM_2467,
288 	CHAN_ENUM_2472,
289 	CHAN_ENUM_2484,
290 
291 	CHAN_ENUM_4912,
292 	CHAN_ENUM_4915,
293 	CHAN_ENUM_4917,
294 	CHAN_ENUM_4920,
295 	CHAN_ENUM_4922,
296 	CHAN_ENUM_4925,
297 	CHAN_ENUM_4927,
298 	CHAN_ENUM_4932,
299 	CHAN_ENUM_4935,
300 	CHAN_ENUM_4937,
301 	CHAN_ENUM_4940,
302 	CHAN_ENUM_4942,
303 	CHAN_ENUM_4945,
304 	CHAN_ENUM_4947,
305 	CHAN_ENUM_4950,
306 	CHAN_ENUM_4952,
307 	CHAN_ENUM_4955,
308 	CHAN_ENUM_4957,
309 	CHAN_ENUM_4960,
310 	CHAN_ENUM_4962,
311 	CHAN_ENUM_4965,
312 	CHAN_ENUM_4967,
313 	CHAN_ENUM_4970,
314 	CHAN_ENUM_4972,
315 	CHAN_ENUM_4975,
316 	CHAN_ENUM_4977,
317 	CHAN_ENUM_4980,
318 	CHAN_ENUM_4982,
319 	CHAN_ENUM_4985,
320 	CHAN_ENUM_4987,
321 	CHAN_ENUM_5032,
322 	CHAN_ENUM_5035,
323 	CHAN_ENUM_5037,
324 	CHAN_ENUM_5040,
325 	CHAN_ENUM_5042,
326 	CHAN_ENUM_5045,
327 	CHAN_ENUM_5047,
328 	CHAN_ENUM_5052,
329 	CHAN_ENUM_5055,
330 	CHAN_ENUM_5057,
331 	CHAN_ENUM_5060,
332 	CHAN_ENUM_5080,
333 
334 	CHAN_ENUM_5180,
335 	CHAN_ENUM_5200,
336 	CHAN_ENUM_5220,
337 	CHAN_ENUM_5240,
338 	CHAN_ENUM_5260,
339 	CHAN_ENUM_5280,
340 	CHAN_ENUM_5300,
341 	CHAN_ENUM_5320,
342 	CHAN_ENUM_5500,
343 	CHAN_ENUM_5520,
344 	CHAN_ENUM_5540,
345 	CHAN_ENUM_5560,
346 	CHAN_ENUM_5580,
347 	CHAN_ENUM_5600,
348 	CHAN_ENUM_5620,
349 	CHAN_ENUM_5640,
350 	CHAN_ENUM_5660,
351 	CHAN_ENUM_5680,
352 	CHAN_ENUM_5700,
353 	CHAN_ENUM_5720,
354 	CHAN_ENUM_5745,
355 	CHAN_ENUM_5765,
356 	CHAN_ENUM_5785,
357 	CHAN_ENUM_5805,
358 	CHAN_ENUM_5825,
359 	CHAN_ENUM_5845,
360 #ifdef WLAN_FEATURE_DSRC
361 	CHAN_ENUM_5850,
362 	CHAN_ENUM_5855,
363 	CHAN_ENUM_5860,
364 #endif
365 	CHAN_ENUM_5865,
366 #ifdef WLAN_FEATURE_DSRC
367 	CHAN_ENUM_5870,
368 	CHAN_ENUM_5875,
369 	CHAN_ENUM_5880,
370 #endif
371 	CHAN_ENUM_5885,
372 #ifdef WLAN_FEATURE_DSRC
373 	CHAN_ENUM_5890,
374 	CHAN_ENUM_5895,
375 	CHAN_ENUM_5900,
376 	CHAN_ENUM_5905,
377 	CHAN_ENUM_5910,
378 	CHAN_ENUM_5915,
379 	CHAN_ENUM_5920,
380 #endif /* WLAN_FEATURE_DSRC */
381 #ifdef CONFIG_BAND_6GHZ
382 	CHAN_ENUM_5935,
383 	CHAN_ENUM_5955,
384 	CHAN_ENUM_5975,
385 	CHAN_ENUM_5995,
386 	CHAN_ENUM_6015,
387 	CHAN_ENUM_6035,
388 	CHAN_ENUM_6055,
389 	CHAN_ENUM_6075,
390 	CHAN_ENUM_6095,
391 	CHAN_ENUM_6115,
392 	CHAN_ENUM_6135,
393 	CHAN_ENUM_6155,
394 	CHAN_ENUM_6175,
395 	CHAN_ENUM_6195,
396 	CHAN_ENUM_6215,
397 	CHAN_ENUM_6235,
398 	CHAN_ENUM_6255,
399 	CHAN_ENUM_6275,
400 	CHAN_ENUM_6295,
401 	CHAN_ENUM_6315,
402 	CHAN_ENUM_6335,
403 	CHAN_ENUM_6355,
404 	CHAN_ENUM_6375,
405 	CHAN_ENUM_6395,
406 	CHAN_ENUM_6415,
407 	CHAN_ENUM_6435,
408 	CHAN_ENUM_6455,
409 	CHAN_ENUM_6475,
410 	CHAN_ENUM_6495,
411 	CHAN_ENUM_6515,
412 	CHAN_ENUM_6535,
413 	CHAN_ENUM_6555,
414 	CHAN_ENUM_6575,
415 	CHAN_ENUM_6595,
416 	CHAN_ENUM_6615,
417 	CHAN_ENUM_6635,
418 	CHAN_ENUM_6655,
419 	CHAN_ENUM_6675,
420 	CHAN_ENUM_6695,
421 	CHAN_ENUM_6715,
422 	CHAN_ENUM_6735,
423 	CHAN_ENUM_6755,
424 	CHAN_ENUM_6775,
425 	CHAN_ENUM_6795,
426 	CHAN_ENUM_6815,
427 	CHAN_ENUM_6835,
428 	CHAN_ENUM_6855,
429 	CHAN_ENUM_6875,
430 	CHAN_ENUM_6895,
431 	CHAN_ENUM_6915,
432 	CHAN_ENUM_6935,
433 	CHAN_ENUM_6955,
434 	CHAN_ENUM_6975,
435 	CHAN_ENUM_6995,
436 	CHAN_ENUM_7015,
437 	CHAN_ENUM_7035,
438 	CHAN_ENUM_7055,
439 	CHAN_ENUM_7075,
440 	CHAN_ENUM_7095,
441 	CHAN_ENUM_7115,
442 #endif /* CONFIG_BAND_6GHZ */
443 
444 	NUM_CHANNELS,
445 
446 	MIN_CHANNEL = CHAN_ENUM_2412,
447 	MAX_CHANNEL = (NUM_CHANNELS - 1),
448 
449 	MIN_24GHZ_CHANNEL = CHAN_ENUM_2412,
450 	MAX_24GHZ_CHANNEL = CHAN_ENUM_2484,
451 	NUM_24GHZ_CHANNELS = (MAX_24GHZ_CHANNEL - MIN_24GHZ_CHANNEL + 1),
452 
453 	MIN_49GHZ_CHANNEL = CHAN_ENUM_4912,
454 	MAX_49GHZ_CHANNEL = CHAN_ENUM_5080,
455 	NUM_49GHZ_CHANNELS = (MAX_49GHZ_CHANNEL - MIN_49GHZ_CHANNEL + 1),
456 
457 	MIN_5GHZ_CHANNEL = CHAN_ENUM_5180,
458 	MAX_5GHZ_CHANNEL = CHAN_ENUM_5885,
459 	NUM_5GHZ_CHANNELS = (MAX_5GHZ_CHANNEL - MIN_5GHZ_CHANNEL + 1),
460 
461 #ifdef WLAN_FEATURE_DSRC
462 	MIN_5GHZ_CHANNEL = CHAN_ENUM_5180,
463 	MAX_5GHZ_CHANNEL = CHAN_ENUM_5920,
464 	NUM_5GHZ_CHANNELS = (MAX_5GHZ_CHANNEL - MIN_5GHZ_CHANNEL + 1),
465 
466 	MIN_DSRC_CHANNEL = CHAN_ENUM_5850,
467 	MAX_DSRC_CHANNEL = CHAN_ENUM_5920,
468 	NUM_DSRC_CHANNELS = (MAX_DSRC_CHANNEL - MIN_DSRC_CHANNEL + 1),
469 #endif
470 
471 	MIN_5DOT9_CHANNEL = CHAN_ENUM_5845,
472 	MAX_5DOT9_CHANNEL = CHAN_ENUM_5885,
473 	NUM_5DOT9_CHANNELS = (MAX_5DOT9_CHANNEL - MIN_5DOT9_CHANNEL + 1),
474 
475 	INVALID_CHANNEL = 0xBAD,
476 
477 #ifdef DISABLE_UNII_SHARED_BANDS
478 	MIN_UNII_1_BAND_CHANNEL = CHAN_ENUM_5180,
479 	MAX_UNII_1_BAND_CHANNEL = CHAN_ENUM_5240,
480 	NUM_UNII_1_BAND_CHANNELS = (MAX_UNII_1_BAND_CHANNEL -
481 				    MIN_UNII_1_BAND_CHANNEL + 1),
482 
483 	MIN_UNII_2A_BAND_CHANNEL = CHAN_ENUM_5260,
484 	MAX_UNII_2A_BAND_CHANNEL = CHAN_ENUM_5320,
485 	NUM_UNII_2A_BAND_CHANNELS = (MAX_UNII_2A_BAND_CHANNEL -
486 				     MIN_UNII_2A_BAND_CHANNEL + 1),
487 #endif
488 
489 #ifdef CONFIG_BAND_6GHZ
490 	MIN_6GHZ_CHANNEL = CHAN_ENUM_5935,
491 	MAX_6GHZ_CHANNEL = CHAN_ENUM_7115,
492 	NUM_6GHZ_CHANNELS = (MAX_6GHZ_CHANNEL - MIN_6GHZ_CHANNEL + 1),
493 	MIN_6GHZ_NON_ORPHAN_CHANNEL = CHAN_ENUM_5955,
494 #else
495 	MIN_6GHZ_CHANNEL = INVALID_CHANNEL,
496 	MAX_6GHZ_CHANNEL = INVALID_CHANNEL,
497 	NUM_6GHZ_CHANNELS = 0,
498 	MIN_6GHZ_NON_ORPHAN_CHANNEL = INVALID_CHANNEL,
499 #endif /* CONFIG_BAND_6GHZ */
500 };
501 
502 /**
503  * enum channel_state - channel state
504  * @CHANNEL_STATE_DISABLE: disabled state
505  * @CHANNEL_STATE_PASSIVE: passive state
506  * @CHANNEL_STATE_DFS: dfs state
507  * @CHANNEL_STATE_ENABLE: enabled state
508  * @CHANNEL_STATE_INVALID: invalid state
509  */
510 enum channel_state {
511 	CHANNEL_STATE_DISABLE,
512 	CHANNEL_STATE_PASSIVE,
513 	CHANNEL_STATE_DFS,
514 	CHANNEL_STATE_ENABLE,
515 	CHANNEL_STATE_INVALID,
516 };
517 
518 /**
519  * enum reg_domain: reg domain
520  * @REGDOMAIN_FCC: FCC domain
521  * @REGDOMAIN_ETSI: ETSI domain
522  * @REGDOMAIN_JAPAN: JAPAN domain
523  * @REGDOMAIN_WORLD: WORLD domain
524  * @REGDOMAIN_COUNT: Max domain
525  */
526 typedef enum {
527 	REGDOMAIN_FCC,
528 	REGDOMAIN_ETSI,
529 	REGDOMAIN_JAPAN,
530 	REGDOMAIN_WORLD,
531 	REGDOMAIN_COUNT
532 } v_REGDOMAIN_t;
533 
534 /**
535  * enum ctl_value - CTL value
536  * @CTL_FCC: CTL FCC
537  * @CTL_MKK: CTL MKK
538  * @CTL_ETSI: CTL ETSI
539  * @CTL_KOR: CTL KOR
540  * @CTL_CHN: CTL CHINA
541  * @CTL_USER_DEF: CTL USER_DEF
542  * @CTL_NONE: CTL NONE
543  */
544 enum ctl_value {
545 	CTL_FCC = 0x10,
546 	CTL_ETSI = 0x30,
547 	CTL_MKK = 0x40,
548 	CTL_KOR = 0x50,
549 	CTL_CHN = 0x60,
550 	CTL_USER_DEF = 0x70,
551 	CTL_NONE = 0xff
552 };
553 
554 /**
555  * struct ch_params
556  * @ch_width: channel width
557  * @sec_ch_offset: secondary channel offset
558  * @center_freq_seg0: channel number for segment 0
559  * @center_freq_seg1: channel number segment 1
560  * @mhz_freq_seg0: Center frequency for segment 0
561  * @mhz_freq_seg1: Center frequency for segment 1
562  */
563 struct ch_params {
564 	enum phy_ch_width ch_width;
565 	uint8_t sec_ch_offset;
566 	uint8_t center_freq_seg0;
567 	uint8_t center_freq_seg1;
568 	qdf_freq_t mhz_freq_seg0;
569 	qdf_freq_t mhz_freq_seg1;
570 };
571 
572 /**
573  * struct channel_power
574  * @center_freq: Channel Center Frequency
575  * @chan_num: channel number
576  * @tx_power: TX power
577  */
578 struct channel_power {
579 	qdf_freq_t center_freq;
580 	uint8_t chan_num;
581 	uint32_t tx_power;
582 };
583 
584 /**
585  * enum offset_t: channel offset
586  * @BW20: 20 mhz channel
587  * @BW40_LOW_PRIMARY: lower channel in 40 mhz
588  * @BW40_HIGH_PRIMARY: higher channel in 40 mhz
589  * @BW80: 80 mhz channel
590  * @BWALL: unknown bandwidth
591  */
592 enum offset_t {
593 	BW20 = 0,
594 	BW40_LOW_PRIMARY = 1,
595 	BW40_HIGH_PRIMARY = 3,
596 	BW80,
597 	BWALL,
598 	BW_INVALID = 0xFF
599 };
600 
601 /**
602  * enum behav_limit - behavior limit
603  * @BEHAV_NONE: none
604  * @BEHAV_BW40_LOW_PRIMARY: BW40 low primary
605  * @BEHAV_BW40_HIGH_PRIMARY: BW40 high primary
606  * @BEHAV_BW80_PLUS: BW 80 plus
607  * @BEHAV_INVALID: invalid behavior
608  */
609 enum behav_limit {
610 	BEHAV_NONE,
611 	BEHAV_BW40_LOW_PRIMARY,
612 	BEHAV_BW40_HIGH_PRIMARY,
613 	BEHAV_BW80_PLUS,
614 	BEHAV_INVALID = 0xFF
615 };
616 
617 /**
618  * struct reg_dmn_op_class_map_t: operating class
619  * @op_class: operating class number
620  * @chan_spacing: channel spacing
621  * @offset: offset
622  * @behav_limit: OR of bitmaps of enum behav_limit
623  * @start_freq: starting frequency
624  * @channels: channel set
625  */
626 struct reg_dmn_op_class_map_t {
627 	uint8_t op_class;
628 	uint8_t chan_spacing;
629 	enum offset_t offset;
630 	uint16_t behav_limit;
631 	qdf_freq_t start_freq;
632 	uint8_t channels[REG_MAX_CHANNELS_PER_OPERATING_CLASS];
633 };
634 
635 /**
636  * struct regdmn_ap_cap_opclass_t: AP Cap operation class table
637  * @op_class: operating class number
638  * @ch_width: channel width in MHz
639  * @start_freq: Starting Frequency in MHz
640  * @behav_limit: OR of bitmaps of enum behav_limit
641  * @max_tx_pwr_dbm: Maximum tx power in dbm
642  * @num_supported_chan: Number of supported channels
643  * @num_non_supported_chan: Number of non-supported channels
644  * @sup_chan_list: Array of supported channel numbers
645  * @non_sup_chan_list: Array of non supported channel numbers
646  */
647 struct regdmn_ap_cap_opclass_t {
648 	uint8_t op_class;
649 	uint8_t ch_width;
650 	qdf_freq_t start_freq;
651 	uint16_t behav_limit;
652 	uint8_t max_tx_pwr_dbm;
653 	uint8_t num_supported_chan;
654 	uint8_t num_non_supported_chan;
655 	uint8_t sup_chan_list[REG_MAX_CHANNELS_PER_OPERATING_CLASS];
656 	uint8_t non_sup_chan_list[REG_MAX_CHANNELS_PER_OPERATING_CLASS];
657 };
658 
659 /**
660  * struct reg_dmn_supp_op_classes: operating classes
661  * @num_classes: number of classes
662  * @classes: classes
663  */
664 struct reg_dmn_supp_op_classes {
665 	uint8_t num_classes;
666 	uint8_t classes[REG_MAX_SUPP_OPER_CLASSES];
667 };
668 
669 /**
670  * struct reg_start_11d_scan_req: start 11d scan request
671  * @vdev_id: vdev id
672  * @scan_period_msec: scan duration in milli-seconds
673  * @start_interval_msec: offset duration to start the scan in milli-seconds
674  */
675 struct reg_start_11d_scan_req {
676 	uint8_t vdev_id;
677 	uint32_t scan_period_msec;
678 	uint32_t start_interval_msec;
679 };
680 
681 /**
682  * struct reg_11d_scan_msg: 11d scan message structure
683  * @psoc: pointer to psoc object
684  * @enable_11d_supp: enable 11d scan or disable 11d scan
685  */
686 struct reg_11d_scan_msg {
687 	struct wlan_objmgr_psoc *psoc;
688 	bool enable_11d_supp;
689 };
690 /**
691  * struct reg_stop_11d_scan_req: stop 11d scan request
692  * @vdev_id: vdev id
693  */
694 struct reg_stop_11d_scan_req {
695 	uint8_t vdev_id;
696 };
697 
698 /**
699  * struct reg_11d_new_country: regulatory 11d new coutry code
700  * @alpha2: new 11d alpha2
701  */
702 struct reg_11d_new_country {
703 	uint8_t alpha2[REG_ALPHA2_LEN + 1];
704 };
705 
706 /**
707  * enum country_src: country source
708  * @SOURCE_QUERY: source query
709  * @SOURCE_CORE: source regulatory core
710  * @SOURCE_DRIVER: source driver
711  * @SOURCE_USERSPACE: source userspace
712  * @SOURCE_11D: source 11D
713  */
714 enum country_src {
715 	SOURCE_UNKNOWN,
716 	SOURCE_QUERY,
717 	SOURCE_CORE,
718 	SOURCE_DRIVER,
719 	SOURCE_USERSPACE,
720 	SOURCE_11D
721 };
722 
723 /**
724  * struct regulatory_channel
725  * @center_freq: center frequency
726  * @chan_num: channel number
727  * @state: channel state
728  * @chan_flags: channel flags
729  * @tx_power: TX powers
730  * @min_bw: min bandwidth
731  * @max_bw: max bandwidth
732  * @nol_chan: whether channel is nol
733  * @nol_history: Set NOL-History when STA vap detects RADAR.
734  */
735 struct regulatory_channel {
736 	qdf_freq_t center_freq;
737 	uint8_t chan_num;
738 	enum channel_state state;
739 	uint32_t chan_flags;
740 	uint32_t tx_power;
741 	uint16_t min_bw;
742 	uint16_t max_bw;
743 	uint8_t ant_gain;
744 	bool nol_chan;
745 	bool nol_history;
746 };
747 
748 /**
749  * struct regulatory: regulatory information
750  * @reg_domain: regulatory domain pair
751  * @eeprom_rd_ext: eeprom value
752  * @country_code: current country in integer
753  * @alpha2: current alpha2
754  * @def_country: default country alpha2
755  * @def_region: DFS region
756  * @ctl_2g: 2G CTL value
757  * @ctl_5g: 5G CTL value
758  * @reg_pair: pointer to regulatory pair
759  * @cc_src: country code src
760  * @reg_flags: kernel regulatory flags
761  */
762 struct regulatory {
763 	uint32_t reg_domain;
764 	uint32_t eeprom_rd_ext;
765 	uint16_t country_code;
766 	uint8_t alpha2[REG_ALPHA2_LEN + 1];
767 	uint8_t ctl_2g;
768 	uint8_t ctl_5g;
769 	const void *regpair;
770 	enum country_src cc_src;
771 	uint32_t reg_flags;
772 };
773 
774 /**
775  * struct chan_map
776  * @center_freq: center freq in mhz
777  * @chan_num: channel number
778  * @min_bw: min bw
779  * @max_bw: max bw
780  */
781 struct chan_map {
782 	qdf_freq_t center_freq;
783 	uint8_t chan_num;
784 	uint16_t min_bw;
785 	uint16_t max_bw;
786 };
787 
788 /**
789  * struct bonded_channel
790  * @start_ch: start channel
791  * @end_ch: end channel
792  */
793 struct bonded_channel {
794 	uint8_t start_ch;
795 	uint8_t end_ch;
796 };
797 
798 /**
799  * struct bonded_channel_freq
800  * @start_freq: start channel frequency
801  * @end_freq: end channel frequency
802  */
803 struct bonded_channel_freq {
804 	uint16_t start_freq;
805 	uint16_t end_freq;
806 };
807 
808 struct set_country {
809 	uint8_t country[REG_ALPHA2_LEN + 1];
810 	uint8_t pdev_id;
811 };
812 /**
813  * enum ht_sec_ch_offset
814  * @NO_SEC_CH: no secondary
815  * @LOW_PRIMARY_CH: low primary
816  * @HIGH_PRIMARY_CH: high primary
817  */
818 enum ht_sec_ch_offset {
819 	NO_SEC_CH = 0,
820 	LOW_PRIMARY_CH = 1,
821 	HIGH_PRIMARY_CH = 3,
822 };
823 
824 enum cc_setting_code {
825 	REG_SET_CC_STATUS_PASS = 0,
826 	REG_CURRENT_ALPHA2_NOT_FOUND = 1,
827 	REG_INIT_ALPHA2_NOT_FOUND = 2,
828 	REG_SET_CC_CHANGE_NOT_ALLOWED = 3,
829 	REG_SET_CC_STATUS_NO_MEMORY = 4,
830 	REG_SET_CC_STATUS_FAIL = 5,
831 };
832 
833 /**
834  * struct cur_reg_rule
835  * @start_freq: start frequency
836  * @end_freq: end frequency
837  * @max_bw: maximum bandwidth
838  * @reg_power: regulatory power
839  * @ant_gain: antenna gain
840  * @flags: regulatory flags
841  */
842 struct cur_reg_rule {
843 	uint16_t start_freq;
844 	uint16_t end_freq;
845 	uint16_t max_bw;
846 	uint8_t reg_power;
847 	uint8_t ant_gain;
848 	uint16_t flags;
849 };
850 
851 /**
852  * struct cur_regulatory_info
853  * @psoc: psoc ptr
854  * @status_code: status value
855  * @num_phy: number of phy
856  * @phy_id: phy id
857  * @reg_dmn_pair: reg domain pair
858  * @ctry_code: country code
859  * @alpha2: country alpha2
860  * @offload_enabled: offload enabled
861  * @dfs_reg: dfs region
862  * @phybitmap: phy bit map
863  * @min_bw_2g: minimum 2G bw
864  * @max_bw_2g: maximum 2G bw
865  * @min_bw_5g: minimum 5G bw
866  * @max_bw_5g: maximum 5G bw
867  * @num_2g_reg_rules: number 2G reg rules
868  * @num_5g_reg_rules: number 5G  and 6G reg rules
869  * @reg_rules_2g_ptr: ptr to 2G reg rules
870  * @reg_rules_5g_ptr: ptr to 5G reg rules
871  */
872 struct cur_regulatory_info {
873 	struct wlan_objmgr_psoc *psoc;
874 	enum cc_setting_code status_code;
875 	uint8_t num_phy;
876 	uint8_t phy_id;
877 	uint16_t reg_dmn_pair;
878 	uint16_t ctry_code;
879 	uint8_t alpha2[REG_ALPHA2_LEN + 1];
880 	bool offload_enabled;
881 	enum dfs_reg dfs_region;
882 	uint32_t phybitmap;
883 	uint32_t min_bw_2g;
884 	uint32_t max_bw_2g;
885 	uint32_t min_bw_5g;
886 	uint32_t max_bw_5g;
887 	uint32_t num_2g_reg_rules;
888 	uint32_t num_5g_reg_rules;
889 	struct cur_reg_rule *reg_rules_2g_ptr;
890 	struct cur_reg_rule *reg_rules_5g_ptr;
891 };
892 
893 /**
894  * struct reg_rule_info
895  * @alpha2: alpha2 of reg rules
896  * @dfs_region: dfs region
897  * @num_of_reg_rules: number of reg rules
898  * @reg_rules: regulatory rules array
899  */
900 struct reg_rule_info {
901 	uint8_t alpha2[REG_ALPHA2_LEN + 1];
902 	enum dfs_reg dfs_region;
903 	uint8_t num_of_reg_rules;
904 	struct cur_reg_rule reg_rules[MAX_REG_RULES];
905 };
906 
907 /**
908  * enum reg_reg_wifi_band
909  * @REG_BAND_2G: 2G band
910  * @REG_BAND_5G: 5G band
911  * @REG_BAND_6G: 6G band
912  * @REG_BAND_UNKNOWN: Unsupported band
913  */
914 enum reg_wifi_band {
915 	REG_BAND_2G,
916 	REG_BAND_5G,
917 	REG_BAND_6G,
918 	REG_BAND_UNKNOWN
919 };
920 
921 #ifdef DISABLE_UNII_SHARED_BANDS
922 /**
923  * enum reg_unii_band
924  * @REG_UNII_BAND_1: Disable UNII-1 band channels
925  * @REG_UNII_BAND_2A: Disable UNII-2A band channels
926  */
927 enum reg_unii_band {
928 	REG_UNII_BAND_1 = 0x0,
929 	REG_UNII_BAND_2A = 0x1,
930 };
931 #endif
932 
933 #define REG_BAND_MASK_ALL (BIT(REG_BAND_2G) | BIT(REG_BAND_5G) \
934 			  | BIT(REG_BAND_6G))
935 
936 /* Avoid the use of band_info as it does not support 6GHz band. Use
937  * reg_wifi_band, as it supports the 6GHz band
938  */
939 /**
940  * enum band_info
941  * @BAND_ALL:all bands
942  * @BAND_2G: 2G band
943  * @BAND_5G: 5G band
944  * @BAND_UNKNOWN: Unsupported band
945  */
946 enum band_info {
947 	BAND_ALL,
948 	BAND_2G,
949 	BAND_5G,
950 	BAND_UNKNOWN
951 };
952 
953 /**
954  * enum restart_beaconing_on_ch_avoid_rule: control the beaconing entity to
955  * move away from active LTE channels
956  * @CH_AVOID_RULE_DO_NOT_RESTART: Do not move from active LTE
957  *                              channels
958  * @CH_AVOID_RULE_RESTART: Move from active LTE channels
959  * @CH_AVOID_RULE_RESTART_24G_ONLY: move from 2.4G active LTE
960  *                                channels only
961  */
962 enum restart_beaconing_on_ch_avoid_rule {
963 	CH_AVOID_RULE_DO_NOT_RESTART,
964 	CH_AVOID_RULE_RESTART,
965 	CH_AVOID_RULE_RESTART_24G_ONLY,
966 };
967 
968 /**
969  * struct reg_config_vars
970  * @enable_11d_support: enable 11d support
971  * @scan_11d_interval: 11d scan interval in ms
972  * @userspace_ctry_priority: user priority
973  * @band_capability: band capability
974  * @dfs_disable: dfs disabled
975  * @indoor_channel_support: indoor channel support
976  * @force_ssc_disable_indoor_channel: Disable indoor channel on sap start
977  * @restart_beaconing: control the beaconing entity to move
978  * away from active LTE channels
979  * @enable_srd_chan_in_master_mode: SRD channel support in master mode
980  * @enable_11d_in_world_mode: enable 11d in world mode
981  * @enable_5dot9_ghz_chan_in_master_mode: 5.9 GHz channel support in
982  * master mode
983  * @retain_nol_across_regdmn_update: Retain the NOL list across the regdomain.
984  */
985 struct reg_config_vars {
986 	uint32_t enable_11d_support;
987 	uint32_t scan_11d_interval;
988 	uint32_t userspace_ctry_priority;
989 	uint32_t band_capability;
990 	uint32_t dfs_enabled;
991 	uint32_t indoor_chan_enabled;
992 	uint32_t force_ssc_disable_indoor_channel;
993 	enum restart_beaconing_on_ch_avoid_rule restart_beaconing;
994 	bool enable_srd_chan_in_master_mode;
995 	bool enable_11d_in_world_mode;
996 	bool enable_5dot9_ghz_chan_in_master_mode;
997 	bool retain_nol_across_regdmn_update;
998 };
999 
1000 /**
1001  * struct reg_freq_range
1002  * @low_freq: low frequency
1003  * @high_freq: high frequency
1004  */
1005 struct reg_freq_range {
1006 	uint32_t low_freq;
1007 	uint32_t high_freq;
1008 };
1009 
1010 /**
1011  * struct reg_sched_payload
1012  * @psoc: psoc ptr
1013  * @pdev: pdev ptr
1014  */
1015 struct reg_sched_payload {
1016 	struct wlan_objmgr_psoc *psoc;
1017 	struct wlan_objmgr_pdev *pdev;
1018 };
1019 
1020 /**
1021  * enum direction
1022  * @NORTHBOUND: northbound
1023  * @SOUTHBOUND: southbound
1024  */
1025 enum direction {
1026 	NORTHBOUND,
1027 	SOUTHBOUND,
1028 };
1029 
1030 /**
1031  * struct mas_chan_params
1032  * @dfs_region: dfs region
1033  * @phybitmap: phybitmap
1034  * @mas_chan_list: master chan list
1035  * @default_country: default country
1036  * @current_country: current country
1037  * @def_region_domain: default reg domain
1038  * @def_country_code: default country code
1039  * @reg_dmn_pair: reg domain pair
1040  * @ctry_code: country code
1041  * @reg_rules: regulatory rules
1042  */
1043 struct mas_chan_params {
1044 	enum dfs_reg dfs_region;
1045 	uint32_t phybitmap;
1046 	struct regulatory_channel mas_chan_list[NUM_CHANNELS];
1047 	char default_country[REG_ALPHA2_LEN + 1];
1048 	char current_country[REG_ALPHA2_LEN + 1];
1049 	uint16_t def_region_domain;
1050 	uint16_t def_country_code;
1051 	uint16_t reg_dmn_pair;
1052 	uint16_t ctry_code;
1053 	struct reg_rule_info reg_rules;
1054 };
1055 
1056 /**
1057  * enum cc_regdmn_flag: Regdomain flags
1058  * @INVALID:       Invalid flag
1059  * @CC_IS_SET:     Country code is set
1060  * @REGDMN_IS_SET: Regdomain ID is set
1061  * @ALPHA_IS_SET:  Country ISO is set
1062  */
1063 enum cc_regdmn_flag {
1064 	INVALID_CC,
1065 	CC_IS_SET,
1066 	REGDMN_IS_SET,
1067 	ALPHA_IS_SET,
1068 };
1069 
1070 /**
1071  * struct cc_regdmn_s: User country code or regdomain
1072  * @country_code: Country code
1073  * @regdmn_id:    Regdomain pair ID
1074  * @alpha:        Country ISO
1075  * @flags:        Regdomain flags
1076  */
1077 struct cc_regdmn_s {
1078 	union {
1079 		uint16_t country_code;
1080 		uint16_t regdmn_id;
1081 		uint8_t alpha[REG_ALPHA2_LEN + 1];
1082 	} cc;
1083 	uint8_t flags;
1084 };
1085 
1086 /**
1087  * struct cur_regdmn_info: Current regulatory info
1088  * @regdmn_pair_id: Current regdomain pair ID
1089  * @dmn_id_2g: 2GHz regdomain ID
1090  * @dmn_id_5g: 5GHz regdomain ID
1091  * @ctl_2g: 2GHz CTL value
1092  * @ctl_5g: 5GHzCTL value
1093  * @dfs_region: dfs region
1094  */
1095 struct cur_regdmn_info {
1096 	uint16_t regdmn_pair_id;
1097 	uint16_t dmn_id_2g;
1098 	uint16_t dmn_id_5g;
1099 	uint8_t ctl_2g;
1100 	uint8_t ctl_5g;
1101 	uint8_t dfs_region;
1102 };
1103 
1104 /**
1105  * struct ch_avoid_freq_type
1106  * @start_freq: start freq
1107  * @end_freq: end freq
1108  */
1109 struct ch_avoid_freq_type {
1110 	qdf_freq_t start_freq;
1111 	qdf_freq_t end_freq;
1112 };
1113 
1114 /**
1115  * struct ch_avoid_ind_type
1116  * @ch_avoid_range_cnt: count
1117  * @avoid_freq_range: avoid freq range array
1118  */
1119 struct ch_avoid_ind_type {
1120 	uint32_t ch_avoid_range_cnt;
1121 	struct ch_avoid_freq_type avoid_freq_range[CH_AVOID_MAX_RANGE];
1122 };
1123 
1124 /**
1125  * struct unsafe_ch_list
1126  * @chan_cnt: no.of channels
1127  * @chan_freq_list: channel frequency list
1128  */
1129 struct unsafe_ch_list {
1130 	uint16_t chan_cnt;
1131 	uint16_t chan_freq_list[NUM_CHANNELS];
1132 };
1133 
1134 /**
1135  * struct avoid_freq_ind_data
1136  * @freq_list: frequency list
1137  * @chan_list: channel list
1138  */
1139 struct avoid_freq_ind_data {
1140 	struct ch_avoid_ind_type freq_list;
1141 	struct unsafe_ch_list chan_list;
1142 };
1143 
1144 #define FIVEG_STARTING_FREQ        5000
1145 #define TWOG_STARTING_FREQ         2407
1146 #define TWOG_CHAN_14_IN_MHZ        2484
1147 #define TWOG_CHAN_1_IN_MHZ         2412
1148 #define TWOG_CHAN_5_IN_MHZ         2432
1149 #define TWOG_CHAN_6_IN_MHZ         2437
1150 #define TWOG_CHAN_13_IN_MHZ        2472
1151 
1152 /**
1153  * struct reg_ctl_params - reg ctl and regd info
1154  * @regd: regdomain pair
1155  * @regd_2g: 2g sub domain code
1156  * @regd_5g: 5g sub domain code
1157  * @ctl_2g: 2g ctl info
1158  * @ctl_5g: 5g ctl info
1159  */
1160 struct reg_ctl_params {
1161 	uint32_t regd;
1162 	uint16_t regd_2g;
1163 	uint16_t regd_5g;
1164 	uint8_t ctl_2g;
1165 	uint8_t ctl_5g;
1166 };
1167 
1168 /**
1169  * enum reg_phymode - Regulatory phymode
1170  * @REG_PHYMODE_INVALID: Invalid phymode
1171  * @REG_PHYMODE_11B: 802.11b phymode
1172  * @REG_PHYMODE_11G: 802.11g phymode
1173  * @REG_PHYMODE_11A: 802.11a phymode
1174  * @REG_PHYMODE_11N: 802.11n phymode
1175  * @REG_PHYMODE_11AC: 802.11ac phymode
1176  * @REG_PHYMODE_11AX: 802.11ax phymode
1177  * @REG_PHYMODE_MAX: placeholder for future phymodes
1178  */
1179 enum reg_phymode {
1180 	REG_PHYMODE_INVALID,
1181 	REG_PHYMODE_11B,
1182 	REG_PHYMODE_11G,
1183 	REG_PHYMODE_11A,
1184 	REG_PHYMODE_11N,
1185 	REG_PHYMODE_11AC,
1186 	REG_PHYMODE_11AX,
1187 	REG_PHYMODE_MAX,
1188 };
1189 
1190 #endif
1191