xref: /wlan-driver/qca-wifi-host-cmn/umac/dfs/core/src/dfs_channel.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2016-2018,2020-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2008 Atheros Communications, Inc.
4  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
5  *
6  * Permission to use, copy, modify, and/or distribute this software for
7  * any purpose with or without fee is hereby granted, provided that the
8  * above copyright notice and this permission notice appear in all
9  * copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
12  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
13  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
14  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
15  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
16  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
17  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18  * PERFORMANCE OF THIS SOFTWARE.
19  */
20 
21 /**
22  * DOC: This file has channel related information.
23  */
24 
25 #ifndef _DFS_CHANNEL_H_
26 #define _DFS_CHANNEL_H_
27 
28 /* Channel attributes */
29 #ifdef WLAN_COMP_CHAN_MODE
30 
31 #define WLAN_CHAN_20MHZ            0x0000000000000100
32 
33 #define WLAN_CHAN_40PLUS           0x0000000000000200
34 
35 #define WLAN_CHAN_40MINUS          0x0000000000000300
36 
37 #define WLAN_CHAN_80MHZ            0x0000000000000400
38 
39 #define WLAN_CHAN_160MHZ           0x0000000000000500
40 
41 #define WLAN_CHAN_80_80MHZ         0x0000000000000600
42 
43 #define WLAN_CHAN_320MHZ           0x0000000000000700
44 
45 #define WLAN_CHAN_HTCAP            0x0000000000001000
46 
47 #define WLAN_CHAN_VHTCAP           0x0000000000002000
48 
49 #define WLAN_CHAN_HECAP            0x0000000000003000
50 
51 #define WLAN_CHAN_EHTCAP           0x0000000000004000
52 
53 /* 2 GHz spectrum channel. */
54 #define WLAN_CHAN_2GHZ             0x0000000000000010
55 
56 /* 5 GHz spectrum channel */
57 #define WLAN_CHAN_5GHZ             0x0000000000000020
58 
59 /* 6 GHz spectrum channel */
60 #define WLAN_CHAN_6GHZ             0x0000000000000030
61 
62 /* HT 20 channel */
63 #define WLAN_CHAN_HT20             (WLAN_CHAN_HTCAP | WLAN_CHAN_20MHZ)
64 
65 /* HT 40 with extension channel above */
66 #define WLAN_CHAN_HT40PLUS         (WLAN_CHAN_HTCAP | WLAN_CHAN_40PLUS)
67 
68 /* HT 40 with extension channel below */
69 #define WLAN_CHAN_HT40MINUS        (WLAN_CHAN_HTCAP | WLAN_CHAN_40MINUS)
70 
71 /* VHT 20 channel */
72 #define WLAN_CHAN_VHT20            (WLAN_CHAN_VHTCAP | WLAN_CHAN_20MHZ)
73 
74 /* VHT 40 with extension channel above */
75 #define WLAN_CHAN_VHT40PLUS        (WLAN_CHAN_VHTCAP | WLAN_CHAN_40PLUS)
76 
77 /* VHT 40 with extension channel below */
78 #define WLAN_CHAN_VHT40MINUS       (WLAN_CHAN_VHTCAP | WLAN_CHAN_40MINUS)
79 
80 /* VHT 80 channel */
81 #define WLAN_CHAN_VHT80            (WLAN_CHAN_VHTCAP | WLAN_CHAN_80MHZ)
82 
83 /* VHT 160 channel */
84 #define WLAN_CHAN_VHT160           (WLAN_CHAN_VHTCAP | WLAN_CHAN_160MHZ)
85 
86 /* VHT 80_80 channel */
87 #define WLAN_CHAN_VHT80_80         (WLAN_CHAN_VHTCAP | WLAN_CHAN_80_80MHZ)
88 
89 /* HE 20 channel */
90 #define WLAN_CHAN_HE20             (WLAN_CHAN_HECAP | WLAN_CHAN_20MHZ)
91 
92 /* HE 40 with extension channel above */
93 #define WLAN_CHAN_HE40PLUS         (WLAN_CHAN_HECAP | WLAN_CHAN_40PLUS)
94 
95 /* HE 40 with extension channel below */
96 #define WLAN_CHAN_HE40MINUS        (WLAN_CHAN_HECAP | WLAN_CHAN_40MINUS)
97 
98 /* HE 80 channel */
99 #define WLAN_CHAN_HE80             (WLAN_CHAN_HECAP | WLAN_CHAN_80MHZ)
100 
101 /* HE 160 channel */
102 #define WLAN_CHAN_HE160            (WLAN_CHAN_HECAP | WLAN_CHAN_160MHZ)
103 
104 /* HE 80_80 channel */
105 #define WLAN_CHAN_HE80_80          (WLAN_CHAN_HECAP | WLAN_CHAN_80_80MHZ)
106 
107 /* EHT 20 channel */
108 #define WLAN_CHAN_EHT20            (WLAN_CHAN_EHTCAP | WLAN_CHAN_20MHZ)
109 
110 /* EHT 40 with extension channel above */
111 #define WLAN_CHAN_EHT40PLUS        (WLAN_CHAN_EHTCAP | WLAN_CHAN_40PLUS)
112 
113 /* EHT 40 with extension channel below */
114 #define WLAN_CHAN_EHT40MINUS       (WLAN_CHAN_EHTCAP | WLAN_CHAN_40MINUS)
115 
116 /* EHT 80 channel */
117 #define WLAN_CHAN_EHT80            (WLAN_CHAN_EHTCAP | WLAN_CHAN_80MHZ)
118 
119 /* EHT 160 channel */
120 #define WLAN_CHAN_EHT160           (WLAN_CHAN_EHTCAP | WLAN_CHAN_160MHZ)
121 
122 /* EHT 320 channel */
123 #define WLAN_CHAN_EHT320           (WLAN_CHAN_EHTCAP | WLAN_CHAN_320MHZ)
124 
125 /* OFDM channel */
126 #define WLAN_CHAN_OFDM             0x0000000000400000
127 
128 /* Turbo Channel */
129 #define WLAN_CHAN_TURBO            0x0000000020000000
130 
131 /* Radar found on channel */
132 #define WLAN_CHAN_DFS_RADAR        0x0000000002000000
133 
134 #define WLAN_CHAN_BAND_MASK        0x00000000000000F0
135 
136 #define WLAN_CHAN_BW_MASK          0x000000000000FF00
137 
138 #define WLAN_IS_CHAN_2GHZ(_c)        WLAN_IS_FLAG_2GHZ((_c)->dfs_ch_flags)
139 
140 #define WLAN_IS_CHAN_5GHZ(_c)        WLAN_IS_FLAG_5GHZ((_c)->dfs_ch_flags)
141 
142 #define WLAN_IS_CHAN_6GHZ(_c)        WLAN_IS_FLAG_6GHZ((_c)->dfs_ch_flags)
143 
144 #define WLAN_IS_CHAN_HT20(_c)        WLAN_IS_FLAG_HT20((_c)->dfs_ch_flags)
145 
146 #define WLAN_IS_CHAN_HT40PLUS(_c)    WLAN_IS_FLAG_HT40PLUS((_c)->dfs_ch_flags)
147 
148 #define WLAN_IS_CHAN_HT40MINUS(_c)   WLAN_IS_FLAG_HT40MINUS((_c)->dfs_ch_flags)
149 
150 #define WLAN_IS_CHAN_HT40(_c)        WLAN_IS_FLAG_HT40((_c)->dfs_ch_flags)
151 
152 #define WLAN_IS_CHAN_VHT20(_c)       WLAN_IS_FLAG_VHT20((_c)->dfs_ch_flags)
153 
154 #define WLAN_IS_CHAN_VHT40PLUS(_c)   WLAN_IS_FLAG_VHT40PLUS((_c)->dfs_ch_flags)
155 
156 #define WLAN_IS_CHAN_VHT40MINUS(_c)  WLAN_IS_FLAG_VHT40MINUS((_c)->dfs_ch_flags)
157 
158 #define WLAN_IS_CHAN_VHT40(_c)       WLAN_IS_FLAG_VHT40((_c)->dfs_ch_flags)
159 
160 #define WLAN_IS_CHAN_VHT80(_c)       WLAN_IS_FLAG_VHT80((_c)->dfs_ch_flags)
161 
162 #define WLAN_IS_CHAN_VHT160(_c)      WLAN_IS_FLAG_VHT160((_c)->dfs_ch_flags)
163 
164 #define WLAN_IS_CHAN_VHT80_80(_c)    WLAN_IS_FLAG_VHT80_80((_c)->dfs_ch_flags)
165 
166 #define WLAN_IS_CHAN_VHT40(_c)       WLAN_IS_FLAG_VHT40((_c)->dfs_ch_flags)
167 
168 #define WLAN_IS_CHAN_HE20(_c)        WLAN_IS_FLAG_HE20((_c)->dfs_ch_flags)
169 
170 #define WLAN_IS_CHAN_HE40PLUS(_c)    WLAN_IS_FLAG_HE40PLUS((_c)->dfs_ch_flags)
171 
172 #define WLAN_IS_CHAN_HE40MINUS(_c)   WLAN_IS_FLAG_HE40MINUS((_c)->dfs_ch_flags)
173 
174 #define WLAN_IS_CHAN_HE40(_c)        WLAN_IS_FLAG_HE40((_c)->dfs_ch_flags)
175 
176 #define WLAN_IS_CHAN_HE80(_c)        WLAN_IS_FLAG_HE80((_c)->dfs_ch_flags)
177 
178 #define WLAN_IS_CHAN_HE160(_c)       WLAN_IS_FLAG_HE160((_c)->dfs_ch_flags)
179 
180 #define WLAN_IS_CHAN_HE80_80(_c)     WLAN_IS_FLAG_HE80_80((_c)->dfs_ch_flags)
181 
182 #define WLAN_IS_CHAN_EHT20(_c)       WLAN_IS_FLAG_EHT20((_c)->dfs_ch_flags)
183 
184 #define WLAN_IS_CHAN_EHT40PLUS(_c)   WLAN_IS_FLAG_EHT40PLUS((_c)->dfs_ch_flags)
185 
186 #define WLAN_IS_CHAN_EHT40MINUS(_c)  WLAN_IS_FLAG_EHT40MINUS((_c)->dfs_ch_flags)
187 
188 #define WLAN_IS_CHAN_EHT40(_c)       WLAN_IS_FLAG_EHT40((_c)->dfs_ch_flags)
189 
190 #define WLAN_IS_CHAN_EHT80(_c)       WLAN_IS_FLAG_EHT80((_c)->dfs_ch_flags)
191 
192 #define WLAN_IS_CHAN_EHT160(_c)      WLAN_IS_FLAG_EHT160((_c)->dfs_ch_flags)
193 
194 #define WLAN_IS_CHAN_EHT320(_c)      WLAN_IS_FLAG_EHT320((_c)->dfs_ch_flags)
195 
196 #define WLAN_IS_CHAN_OFDM(_c)        WLAN_IS_FLAG_OFDM((_c)->dfs_ch_flags)
197 
198 #define WLAN_IS_CHAN_TURBO(_c)       WLAN_IS_FLAG_TURBO((_c)->dfs_ch_flags)
199 
200 #define WLAN_IS_FLAG_2GHZ(_flag) \
201 	(((_flag) & WLAN_CHAN_BAND_MASK) == WLAN_CHAN_2GHZ)
202 
203 #define WLAN_IS_FLAG_5GHZ(_flag) \
204 	(((_flag) & WLAN_CHAN_BAND_MASK) == WLAN_CHAN_5GHZ)
205 
206 #define WLAN_IS_FLAG_6GHZ(_flag) \
207 	(((_flag) & WLAN_CHAN_BAND_MASK) == WLAN_CHAN_6GHZ)
208 
209 #define WLAN_IS_FLAG_HT20(_flag) \
210 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_HT20)
211 
212 #define WLAN_IS_FLAG_HT40PLUS(_flag) \
213 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_HT40PLUS)
214 
215 #define WLAN_IS_FLAG_HT40MINUS(_flag) \
216 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_HT40MINUS)
217 
218 #define WLAN_IS_FLAG_VHT20(_flag) \
219 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_VHT20)
220 
221 #define WLAN_IS_FLAG_VHT40PLUS(_flag) \
222 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_VHT40PLUS)
223 
224 #define WLAN_IS_FLAG_VHT40MINUS(_flag) \
225 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_VHT40MINUS)
226 
227 #define WLAN_IS_FLAG_VHT80(_flag) \
228 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_VHT80)
229 
230 #define WLAN_IS_FLAG_VHT160(_flag) \
231 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_VHT160)
232 
233 #define WLAN_IS_FLAG_VHT80_80(_flag) \
234 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_VHT80_80)
235 
236 #define WLAN_IS_FLAG_HE20(_flag) \
237 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_HE20)
238 
239 #define WLAN_IS_FLAG_HE40PLUS(_flag) \
240 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_HE40PLUS)
241 
242 #define WLAN_IS_FLAG_HE40MINUS(_flag) \
243 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_HE40MINUS)
244 
245 #define WLAN_IS_FLAG_HE80(_flag) \
246 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_HE80)
247 
248 #define WLAN_IS_FLAG_HE160(_flag) \
249 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_HE160)
250 
251 #define WLAN_IS_FLAG_HE80_80(_flag) \
252 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_HE80_80)
253 
254 #define WLAN_IS_FLAG_EHT20(_flag) \
255 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_EHT20)
256 
257 #define WLAN_IS_FLAG_EHT40PLUS(_flag) \
258 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_EHT40PLUS)
259 
260 #define WLAN_IS_FLAG_EHT40MINUS(_flag) \
261 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_EHT40MINUS)
262 
263 #define WLAN_IS_FLAG_EHT40(_flag) \
264 	((WLAN_IS_FLAG_EHT40PLUS(flag)) || (WLAN_IS_FLAG_EHT40MINUS(flag)))
265 
266 #define WLAN_IS_FLAG_EHT80(_flag) \
267 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_EHT80)
268 
269 #define WLAN_IS_FLAG_EHT160(_flag) \
270 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_EHT160)
271 
272 #define WLAN_IS_FLAG_EHT320(_flag) \
273 	(((_flag) & WLAN_CHAN_BW_MASK) == WLAN_CHAN_EHT320)
274 
275 #define WLAN_IS_FLAG_OFDM(_flag) \
276 	((_flag) & WLAN_CHAN_OFDM)
277 
278 #define WLAN_IS_FLAG_TURBO(_flag) \
279 	((_flag) & WLAN_CHAN_TURBO)
280 
281 #define WLAN_IS_CHAN_11N_HT40(_c) \
282 	(WLAN_IS_CHAN_HT40PLUS(_c) || WLAN_IS_CHAN_HT40MINUS(_c))
283 
284 #define WLAN_IS_CHAN_11N_HT40PLUS(_c) WLAN_IS_CHAN_HT40PLUS(_c)
285 
286 #define WLAN_IS_CHAN_11N_HT40MINUS(_c) WLAN_IS_CHAN_HT40MINUS(_c)
287 
288 #define WLAN_IS_CHAN_A(_c) \
289 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_OFDM(_c))
290 
291 #define WLAN_IS_CHAN_11NA_HT20(_c) \
292 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_HT20(_c))
293 
294 #define WLAN_IS_CHAN_11NA_HT40PLUS(_c) \
295 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_HT40PLUS(_c))
296 
297 #define WLAN_IS_CHAN_11NA_HT40MINUS(_c) \
298 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_HT40MINUS(_c))
299 
300 #define WLAN_IS_CHAN_11AC_VHT20(_c) \
301 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_VHT20(_c))
302 
303 #define WLAN_IS_CHAN_11AC_VHT40(_c) \
304 	(WLAN_IS_CHAN_11AC_VHT40MINUS(_c) || WLAN_IS_CHAN_11AC_VHT40PLUS(_c))
305 
306 #define WLAN_IS_CHAN_11AC_VHT40PLUS(_c) \
307 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_VHT40PLUS(_c))
308 
309 #define WLAN_IS_CHAN_11AC_VHT40MINUS(_c) \
310 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_VHT40MINUS(_c))
311 
312 #define WLAN_IS_CHAN_11AC_VHT80(_c) \
313 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_VHT80(_c))
314 
315 #define WLAN_IS_CHAN_11AC_VHT160(_c) \
316 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_VHT160(_c))
317 
318 #define WLAN_IS_CHAN_11AC_VHT80_80(_c) \
319 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_VHT80_80(_c))
320 
321 #define WLAN_IS_CHAN_11AXA_HE20_5G(_c) \
322 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_HE20(_c))
323 
324 #define WLAN_IS_CHAN_11AXA_HE40_5G(_c) \
325 	(WLAN_IS_CHAN_11AXA_HE40MINUS_5G(_c) ||  \
326 	 WLAN_IS_CHAN_11AXA_HE40PLUS_5G(_c))
327 
328 #define WLAN_IS_CHAN_11AXA_HE40PLUS_5G(_c) \
329 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_HE40PLUS(_c))
330 
331 #define WLAN_IS_CHAN_11AXA_HE40MINUS_5G(_c) \
332 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_HE40MINUS(_c))
333 
334 #define WLAN_IS_CHAN_11AXA_HE80_5G(_c) \
335 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_HE80(_c))
336 
337 #define WLAN_IS_CHAN_11AXA_HE160_5G(_c) \
338 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_HE160(_c))
339 
340 #define WLAN_IS_CHAN_11AXA_HE80_80_5G(_c) \
341 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_HE80_80(_c))
342 
343 #define WLAN_IS_CHAN_11BE_EHT20_5G(_c) \
344 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_EHT20(_c))
345 
346 #define WLAN_IS_CHAN_11BE_EHT40PLUS_5G(_c) \
347 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_EHT40PLUS(_c))
348 
349 #define WLAN_IS_CHAN_11BE_EHT40MINUS_5G(_c) \
350 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_EHT40MINUS(_c))
351 
352 #define WLAN_IS_CHAN_11BE_EHT40_5G(_c) \
353 	(WLAN_IS_CHAN_11BE_EHT40MINUS_5G(_c) ||  \
354 	 WLAN_IS_CHAN_11BE_EHT40PLUS_5G(_c))
355 
356 #define WLAN_IS_CHAN_11BE_EHT80_5G(_c) \
357 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_EHT80(_c))
358 
359 #define WLAN_IS_CHAN_11BE_EHT160_5G(_c) \
360 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_EHT160(_c))
361 
362 #define WLAN_IS_CHAN_11BE_EHT320_5G(_c) \
363 	(WLAN_IS_CHAN_5GHZ(_c) && WLAN_IS_CHAN_EHT320(_c))
364 
365 #define WLAN_IS_CHAN_11AXA_HE20_6G(_c) \
366 	(WLAN_IS_CHAN_6GHZ(_c) && WLAN_IS_CHAN_HE20(_c))
367 
368 #define WLAN_IS_CHAN_11AXA_HE40_6G(_c) \
369 	(WLAN_IS_CHAN_11AXA_HE40MINUS_6G(_c) || \
370 	 WLAN_IS_CHAN_11AXA_HE40PLUS_6G(_c))
371 
372 #define WLAN_IS_CHAN_11AXA_HE40PLUS_6G(_c) \
373 	(WLAN_IS_CHAN_6GHZ(_c) && WLAN_IS_CHAN_HE40PLUS(_c))
374 
375 #define WLAN_IS_CHAN_11AXA_HE40MINUS_6G(_c) \
376 	(WLAN_IS_CHAN_6GHZ(_c) && WLAN_IS_CHAN_HE40MINUS(_c))
377 
378 #define WLAN_IS_CHAN_11AXA_HE80_6G(_c) \
379 	(WLAN_IS_CHAN_6GHZ(_c) && WLAN_IS_CHAN_HE80(_c))
380 
381 #define WLAN_IS_CHAN_11AXA_HE160_6G(_c) \
382 	(WLAN_IS_CHAN_6GHZ(_c) && WLAN_IS_CHAN_HE160(_c))
383 
384 #define WLAN_IS_CHAN_11AXA_HE80_80_6G(_c) \
385 	(WLAN_IS_CHAN_6GHZ(_c) && WLAN_IS_CHAN_HE80_80(_c))
386 
387 #define WLAN_IS_CHAN_11BE_EHT20_6G(_c) \
388 	(WLAN_IS_CHAN_6GHZ(_c) && WLAN_IS_CHAN_EHT20(_c))
389 
390 #define WLAN_IS_CHAN_11BE_EHT40PLUS_6G(_c) \
391 	(WLAN_IS_CHAN_6GHZ(_c) && WLAN_IS_CHAN_EHT40PLUS(_c))
392 
393 #define WLAN_IS_CHAN_11BE_EHT40MINUS_6G(_c) \
394 	(WLAN_IS_CHAN_6GHZ(_c) && WLAN_IS_CHAN_EHT40MINUS(_c))
395 
396 #define WLAN_IS_CHAN_11BE_EHT40_6G(_c) \
397 	(WLAN_IS_CHAN_11BE_EHT40MINUS_6G(_c) ||  \
398 	 WLAN_IS_CHAN_11BE_EHT40PLUS_6G(_c))
399 
400 #define WLAN_IS_CHAN_11BE_EHT80_6G(_c) \
401 	(WLAN_IS_CHAN_6GHZ(_c) && WLAN_IS_CHAN_EHT80(_c))
402 
403 #define WLAN_IS_CHAN_11BE_EHT160_6G(_c) \
404 	(WLAN_IS_CHAN_6GHZ(_c) && WLAN_IS_CHAN_EHT160(_c))
405 
406 #define WLAN_IS_CHAN_11BE_EHT320_6G(_c) \
407 	(WLAN_IS_CHAN_6GHZ(_c) && WLAN_IS_CHAN_EHT320(_c))
408 
409 #define WLAN_IS_CHAN_11AXA_HE20(_c) \
410 	(WLAN_IS_CHAN_11AXA_HE20_5G(_c) || WLAN_IS_CHAN_11AXA_HE20_6G(_c))
411 
412 #define WLAN_IS_CHAN_11AXA_HE40PLUS(_c) \
413 	(WLAN_IS_CHAN_11AXA_HE40PLUS_5G(_c) || \
414 	 WLAN_IS_CHAN_11AXA_HE40PLUS_6G(_c))
415 
416 #define WLAN_IS_CHAN_11AXA_HE40MINUS(_c) \
417 	(WLAN_IS_CHAN_11AXA_HE40MINUS_5G(_c) || \
418 	 WLAN_IS_CHAN_11AXA_HE40MINUS_6G(_c))
419 
420 #define WLAN_IS_CHAN_11AXA_HE80(_c) \
421 	(WLAN_IS_CHAN_11AXA_HE80_5G(_c) || WLAN_IS_CHAN_11AXA_HE80_6G(_c))
422 
423 #define WLAN_IS_CHAN_11AXA_HE160(_c) \
424 	(WLAN_IS_CHAN_11AXA_HE160_5G(_c) || WLAN_IS_CHAN_11AXA_HE160_6G(_c))
425 
426 #define WLAN_IS_CHAN_11AXA_HE80_80(_c) \
427 	(WLAN_IS_CHAN_11AXA_HE80_80_5G(_c) || WLAN_IS_CHAN_11AXA_HE80_80_6G(_c))
428 
429 #define WLAN_IS_CHAN_11BE_EHT20(_c) \
430 	(WLAN_IS_CHAN_11BE_EHT20_5G(_c) || WLAN_IS_CHAN_11BE_EHT20_6G(_c))
431 
432 #define WLAN_IS_CHAN_11BE_EHT40PLUS(_c) \
433 	(WLAN_IS_CHAN_11BE_EHT40PLUS_5G(_c) || \
434 	 WLAN_IS_CHAN_11BE_EHT40PLUS_6G(_c))
435 
436 #define WLAN_IS_CHAN_11BE_EHT40MINUS(_c) \
437 	(WLAN_IS_CHAN_11BE_EHT40MINUS_5G(_c) || \
438 	 WLAN_IS_CHAN_11BE_EHT40MINUS_6G(_c))
439 
440 #define WLAN_IS_CHAN_11BE_EHT40(_c) \
441 	(WLAN_IS_CHAN_11BE_EHT40PLUS(_c) || WLAN_IS_CHAN_11BE_EHT40MINUS(_c))
442 
443 #define WLAN_IS_CHAN_11BE_EHT80(_c) \
444 	(WLAN_IS_CHAN_11BE_EHT80_5G(_c) || WLAN_IS_CHAN_11BE_EHT80_6G(_c))
445 
446 #define WLAN_IS_CHAN_11BE_EHT160(_c) \
447 	(WLAN_IS_CHAN_11BE_EHT160_5G(_c) || WLAN_IS_CHAN_11BE_EHT160_6G(_c))
448 
449 #define WLAN_IS_CHAN_11BE_EHT320(_c) \
450 	(WLAN_IS_CHAN_11BE_EHT320_5G(_c) || WLAN_IS_CHAN_11BE_EHT320_6G(_c))
451 #else
452 
453 /* OFDM channel */
454 #define WLAN_CHAN_OFDM             0x0000000000000040
455 
456 /* 2 GHz spectrum channel. */
457 #define WLAN_CHAN_2GHZ             0x0000000000000080
458 
459 /* 5 GHz spectrum channel */
460 #define WLAN_CHAN_5GHZ             0x0000000000000100
461 
462 /* 6 GHz spectrum channel */
463 #define WLAN_CHAN_6GHZ             0x0000001000000000
464 
465 /* Radar found on channel */
466 #define WLAN_CHAN_DFS_RADAR        0x0000000000001000
467 
468 /* HT 20 channel */
469 #define WLAN_CHAN_HT20             0x0000000000010000
470 
471 /* HT 40 with extension channel above */
472 #define WLAN_CHAN_HT40PLUS         0x0000000000020000
473 
474 /* HT 40 with extension channel below */
475 #define WLAN_CHAN_HT40MINUS        0x0000000000040000
476 
477 /* VHT 20 channel */
478 #define WLAN_CHAN_VHT20            0x0000000000100000
479 
480 /* VHT 40 with extension channel above */
481 #define WLAN_CHAN_VHT40PLUS        0x0000000000200000
482 
483 /* VHT 40 with extension channel below */
484 #define WLAN_CHAN_VHT40MINUS       0x0000000000400000
485 
486 /* VHT 80 channel */
487 #define WLAN_CHAN_VHT80            0x0000000000800000
488 
489 /* VHT 160 channel */
490 #define WLAN_CHAN_VHT160           0x0000000004000000
491 
492 /* VHT 80_80 channel */
493 #define WLAN_CHAN_VHT80_80         0x0000000008000000
494 
495 /* HE 20 channel */
496 #define WLAN_CHAN_HE20             0x0000000010000000
497 
498 /* HE 40 with extension channel above */
499 #define WLAN_CHAN_HE40PLUS         0x0000000020000000
500 
501 /* HE 40 with extension channel below */
502 #define WLAN_CHAN_HE40MINUS        0x0000000040000000
503 
504 /* HE 80 channel */
505 #define WLAN_CHAN_HE80             0x0000000200000000
506 
507 /* HE 160 channel */
508 #define WLAN_CHAN_HE160            0x0000000400000000
509 
510 /* HE 80_80 channel */
511 #define WLAN_CHAN_HE80_80          0x0000000800000000
512 
513 /* EHT 20 channel */
514 #define WLAN_CHAN_EHT20            0x0000001000000000
515 
516 /* EHT 40 with extension channel above */
517 #define WLAN_CHAN_EHT40PLUS        0x0000002000000000
518 
519 /* EHT 40 with extension channel below */
520 #define WLAN_CHAN_EHT40MINUS       0x0000004000000000
521 
522 /* EHT 80 channel */
523 #define WLAN_CHAN_EHT80            0x0000008000000000
524 
525 /* HE 160 channel */
526 #define WLAN_CHAN_EHT160           0x0000010000000000
527 
528 /* HE 320 channel */
529 #define WLAN_CHAN_EHT320           0x0000020000000000
530 
531 /* Turbo Channel */
532 #define WLAN_CHAN_TURBO            0x0000000000000010
533 
534 #define WLAN_IS_CHAN_2GHZ(_c) \
535 	(((_c)->dfs_ch_flags & WLAN_CHAN_2GHZ) != 0)
536 
537 #define WLAN_IS_CHAN_5GHZ(_c) \
538 	(((_c)->dfs_ch_flags & WLAN_CHAN_5GHZ) != 0)
539 
540 #define WLAN_IS_CHAN_11N_HT40(_c) \
541 	(((_c)->dfs_ch_flags & (WLAN_CHAN_HT40PLUS | \
542 					WLAN_CHAN_HT40MINUS)) != 0)
543 
544 #define WLAN_IS_CHAN_11N_HT40PLUS(_c) \
545 	(((_c)->dfs_ch_flags & WLAN_CHAN_HT40PLUS) != 0)
546 
547 #define WLAN_IS_CHAN_11N_HT40MINUS(_c) \
548 	(((_c)->dfs_ch_flags & WLAN_CHAN_HT40MINUS) != 0)
549 
550 #define WLAN_IS_CHAN_VHT40PLUS(_c) \
551 	(((_c)->dfs_ch_flags & WLAN_CHAN_VHT40PLUS) != 0)
552 
553 #define WLAN_IS_CHAN_VHT40MINUS(_c) \
554 	(((_c)->dfs_ch_flags & WLAN_CHAN_VHT40MINUS) != 0)
555 
556 #define WLAN_CHAN_A \
557 	(WLAN_CHAN_5GHZ | WLAN_CHAN_OFDM)
558 
559 #define WLAN_IS_CHAN_A(_c) \
560 	(((_c)->dfs_ch_flags & WLAN_CHAN_A) == WLAN_CHAN_A)
561 
562 #define WLAN_CHAN_11NA_HT20 \
563 	(WLAN_CHAN_5GHZ | WLAN_CHAN_HT20)
564 
565 #define WLAN_CHAN_11NA_HT40PLUS \
566 	(WLAN_CHAN_5GHZ | WLAN_CHAN_HT40PLUS)
567 
568 #define WLAN_CHAN_11NA_HT40MINUS \
569 	(WLAN_CHAN_5GHZ | WLAN_CHAN_HT40MINUS)
570 
571 #define WLAN_IS_CHAN_11NA_HT20(_c) \
572 	(((_c)->dfs_ch_flags & WLAN_CHAN_11NA_HT20) == \
573 	 WLAN_CHAN_11NA_HT20)
574 
575 #define WLAN_IS_CHAN_11NA_HT40PLUS(_c) \
576 	(((_c)->dfs_ch_flags & WLAN_CHAN_11NA_HT40PLUS) == \
577 	WLAN_CHAN_11NA_HT40PLUS)
578 
579 #define WLAN_IS_CHAN_11NA_HT40MINUS(_c) \
580 	(((_c)->dfs_ch_flags & WLAN_CHAN_11NA_HT40MINUS) == \
581 	 WLAN_CHAN_11NA_HT40MINUS)
582 
583 #define WLAN_CHAN_11AC_VHT20 \
584 	(WLAN_CHAN_5GHZ | WLAN_CHAN_VHT20)
585 
586 #define WLAN_CHAN_11AC_VHT40PLUS \
587 	(WLAN_CHAN_5GHZ | WLAN_CHAN_VHT40PLUS)
588 
589 #define WLAN_CHAN_11AC_VHT40MINUS \
590 	(WLAN_CHAN_5GHZ | WLAN_CHAN_VHT40MINUS)
591 
592 #define WLAN_CHAN_11AC_VHT80 \
593 	(WLAN_CHAN_5GHZ | WLAN_CHAN_VHT80)
594 
595 #define WLAN_CHAN_11AC_VHT160 \
596 	(WLAN_CHAN_5GHZ | WLAN_CHAN_VHT160)
597 
598 #define WLAN_CHAN_11AC_VHT80_80 \
599 	(WLAN_CHAN_5GHZ | WLAN_CHAN_VHT80_80)
600 
601 #define WLAN_IS_CHAN_11AC_VHT20(_c) \
602 	(((_c)->dfs_ch_flags & WLAN_CHAN_11AC_VHT20) == \
603 	 WLAN_CHAN_11AC_VHT20)
604 
605 #define WLAN_IS_CHAN_11AC_VHT40(_c) \
606 	(((_c)->dfs_ch_flags & (WLAN_CHAN_VHT40PLUS | \
607 			    WLAN_CHAN_VHT40MINUS)) != 0)
608 
609 #define WLAN_IS_CHAN_11AC_VHT40PLUS(_c) \
610 	(((_c)->dfs_ch_flags & WLAN_CHAN_11AC_VHT40PLUS) == \
611 	WLAN_CHAN_11AC_VHT40PLUS)
612 
613 #define WLAN_IS_CHAN_11AC_VHT40MINUS(_c) \
614 	(((_c)->dfs_ch_flags & WLAN_CHAN_11AC_VHT40MINUS) == \
615 	WLAN_CHAN_11AC_VHT40MINUS)
616 
617 #define WLAN_IS_CHAN_11AC_VHT80(_c) \
618 	(((_c)->dfs_ch_flags & WLAN_CHAN_11AC_VHT80) == \
619 	 WLAN_CHAN_11AC_VHT80)
620 
621 #define WLAN_IS_CHAN_11AC_VHT160(_c) \
622 	(((_c)->dfs_ch_flags & WLAN_CHAN_11AC_VHT160) == \
623 	 WLAN_CHAN_11AC_VHT160)
624 
625 #define WLAN_IS_CHAN_11AC_VHT80_80(_c) \
626 	(((_c)->dfs_ch_flags & WLAN_CHAN_11AC_VHT80_80) == \
627 	WLAN_CHAN_11AC_VHT80_80)
628 
629 #define WLAN_CHAN_11AXA_HE20 \
630 	(WLAN_CHAN_5GHZ | WLAN_CHAN_HE20)
631 
632 #define WLAN_CHAN_11AXA_HE20_6G \
633 	(WLAN_CHAN_6GHZ | WLAN_CHAN_HE20)
634 
635 #define WLAN_CHAN_11AXA_HE40PLUS \
636 	(WLAN_CHAN_5GHZ | WLAN_CHAN_HE40PLUS)
637 
638 #define WLAN_CHAN_11AXA_HE40PLUS_6G \
639 	(WLAN_CHAN_6GHZ | WLAN_CHAN_HE40PLUS)
640 
641 #define WLAN_CHAN_11AXA_HE40MINUS \
642 	(WLAN_CHAN_5GHZ | WLAN_CHAN_HE40MINUS)
643 
644 #define WLAN_CHAN_11AXA_HE40MINUS_6G \
645 	(WLAN_CHAN_6GHZ | WLAN_CHAN_HE40MINUS)
646 
647 #define WLAN_CHAN_11AXA_HE80 \
648 	(WLAN_CHAN_5GHZ | WLAN_CHAN_HE80)
649 
650 #define WLAN_CHAN_11AXA_HE80_6G \
651 	(WLAN_CHAN_6GHZ | WLAN_CHAN_HE80)
652 
653 #define WLAN_CHAN_11AXA_HE160 \
654 	(WLAN_CHAN_5GHZ | WLAN_CHAN_HE160)
655 
656 #define WLAN_CHAN_11AXA_HE160_6G \
657 	(WLAN_CHAN_6GHZ | WLAN_CHAN_HE160)
658 
659 #define WLAN_CHAN_11AXA_HE80_80 \
660 	(WLAN_CHAN_5GHZ | WLAN_CHAN_HE80_80)
661 
662 #define WLAN_CHAN_11AXA_HE80_80_6G \
663 	(WLAN_CHAN_6GHZ | WLAN_CHAN_HE80_80)
664 
665 #define WLAN_CHAN_11BE_EHT20 \
666 	(WLAN_CHAN_5GHZ | WLAN_CHAN_EHT20)
667 
668 #define WLAN_CHAN_11BE_EHT20_6G \
669 	(WLAN_CHAN_6GHZ | WLAN_CHAN_EHT20)
670 
671 #define WLAN_CHAN_11BE_EHT40PLUS \
672 	(WLAN_CHAN_5GHZ | WLAN_CHAN_EHT40PLUS)
673 
674 #define WLAN_CHAN_11BE_EHT40PLUS_6G \
675 	(WLAN_CHAN_6GHZ | WLAN_CHAN_EHT40PLUS)
676 
677 #define WLAN_CHAN_11BE_EHT40MINUS \
678 	(WLAN_CHAN_5GHZ | WLAN_CHAN_EHT40MINUS)
679 
680 #define WLAN_CHAN_11BE_EHT40MINUS_6G \
681 	(WLAN_CHAN_6GHZ | WLAN_CHAN_EHT40MINUS)
682 
683 #define WLAN_CHAN_11BE_EHT80 \
684 	(WLAN_CHAN_5GHZ | WLAN_CHAN_EHT80)
685 
686 #define WLAN_CHAN_11BE_EHT80_6G \
687 	(WLAN_CHAN_6GHZ | WLAN_CHAN_EHT80)
688 
689 #define WLAN_CHAN_11BE_EHT160 \
690 	(WLAN_CHAN_5GHZ | WLAN_CHAN_EHT160)
691 
692 #define WLAN_CHAN_11BE_EHT160_6G \
693 	(WLAN_CHAN_6GHZ | WLAN_CHAN_EHT160)
694 
695 #define WLAN_CHAN_11BE_EHT320 \
696 	(WLAN_CHAN_5GHZ | WLAN_CHAN_EHT320)
697 
698 #define WLAN_CHAN_11BE_EHT320_6G \
699 	(WLAN_CHAN_6GHZ | WLAN_CHAN_EHT320)
700 
701 #define WLAN_CHAN_108G \
702 	(WLAN_CHAN_2GHZ | WLAN_CHAN_OFDM | WLAN_CHAN_TURBO)
703 
704 #define WLAN_IS_CHAN_11AXA_HE20(_c) \
705 	((((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE20) == \
706 	 WLAN_CHAN_11AXA_HE20) || \
707 	 (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE20_6G) == \
708 	 WLAN_CHAN_11AXA_HE20_6G))
709 
710 #define WLAN_IS_CHAN_11AXA_HE40PLUS(_c) \
711 	((((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE40PLUS) == \
712 	 WLAN_CHAN_11AXA_HE40PLUS) || \
713 	 (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE40PLUS_6G) == \
714 	  WLAN_CHAN_11AXA_HE40PLUS_6G))
715 
716 #define WLAN_IS_CHAN_11AXA_HE40MINUS(_c) \
717 	((((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE40MINUS) == \
718 	 WLAN_CHAN_11AXA_HE40MINUS) || \
719 	 (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE40MINUS_6G) == \
720 	 WLAN_CHAN_11AXA_HE40MINUS_6G))
721 
722 #define WLAN_IS_CHAN_11AXA_HE80(_c) \
723 	((((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE80) == \
724 	 WLAN_CHAN_11AXA_HE80) || \
725 	 (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE80_6G) == \
726 	  WLAN_CHAN_11AXA_HE80_6G))
727 
728 #define WLAN_IS_CHAN_11AXA_HE160(_c) \
729 	((((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE160) == \
730 	 WLAN_CHAN_11AXA_HE160) || \
731 	 (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE160_6G) == \
732 	  WLAN_CHAN_11AXA_HE160_6G))
733 
734 #define WLAN_IS_CHAN_11AXA_HE80_80(_c) \
735 	((((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE80_80) == \
736 	 WLAN_CHAN_11AXA_HE80_80) || \
737 	 (((_c)->dfs_ch_flags & WLAN_CHAN_11AXA_HE80_80_6G) == \
738 	  WLAN_CHAN_11AXA_HE80_80_6G))
739 
740 #define WLAN_IS_CHAN_11BE_EHT20(_c) \
741 	((((_c)->dfs_ch_flags & WLAN_CHAN_11BE_EHT20) == \
742 	 WLAN_CHAN_11BE_EHT20) || \
743 	 (((_c)->dfs_ch_flags & WLAN_CHAN_11BE_EHT20_6G) == \
744 	 WLAN_CHAN_11BE_EHT20_6G))
745 
746 #define WLAN_IS_CHAN_11BE_EHT40PLUS(_c) \
747 	((((_c)->dfs_ch_flags & WLAN_CHAN_11BE_EHT40PLUS) == \
748 	 WLAN_CHAN_11BE_EHT40PLUS) || \
749 	 (((_c)->dfs_ch_flags & WLAN_CHAN_11BE_EHT40PLUS_6G) == \
750 	  WLAN_CHAN_11BE_EHT40PLUS_6G))
751 
752 #define WLAN_IS_CHAN_11BE_EHT40MINUS(_c) \
753 	((((_c)->dfs_ch_flags & WLAN_CHAN_11BE_EHT40MINUS) == \
754 	 WLAN_CHAN_11BE_EHT40MINUS) || \
755 	 (((_c)->dfs_ch_flags & WLAN_CHAN_11BE_EHT40MINUS_6G) == \
756 	 WLAN_CHAN_11BE_EHT40MINUS_6G))
757 
758 #define WLAN_IS_CHAN_11BE_EHT80(_c) \
759 	((((_c)->dfs_ch_flags & WLAN_CHAN_11BE_EHT80) == \
760 	 WLAN_CHAN_11BE_EHT80) || \
761 	 (((_c)->dfs_ch_flags & WLAN_CHAN_11BE_EHT80_6G) == \
762 	  WLAN_CHAN_11BE_EHT80_6G))
763 
764 #define WLAN_IS_CHAN_11BE_EHT160(_c) \
765 	((((_c)->dfs_ch_flags & WLAN_CHAN_11BE_EHT160) == \
766 	 WLAN_CHAN_11BE_EHT160) || \
767 	 (((_c)->dfs_ch_flags & WLAN_CHAN_11BE_EHT160_6G) == \
768 	  WLAN_CHAN_11BE_EHT160_6G))
769 
770 #define WLAN_IS_CHAN_11BE_EHT320(_c) \
771 	((((_c)->dfs_ch_flags & WLAN_CHAN_11BE_EHT320) == \
772 	 WLAN_CHAN_11BE_EHT320) || \
773 	 (((_c)->dfs_ch_flags & WLAN_CHAN_11BE_EHT320_6G) == \
774 	  WLAN_CHAN_11BE_EHT320_6G))
775 
776 #define WLAN_IS_CHAN_TURBO(_c) \
777 	(((_c)->dfs_ch_flags & WLAN_CHAN_TURBO) != 0)
778 
779 #endif /* WLAN_COMP_CHAN_MODE */
780 
781 #define WLAN_CHAN_108G \
782 	(WLAN_CHAN_2GHZ | WLAN_CHAN_OFDM | WLAN_CHAN_TURBO)
783 
784 #define WLAN_IS_CHAN_108G(_c) \
785 	(((_c)->dfs_ch_flags & WLAN_CHAN_108G) == WLAN_CHAN_108G)
786 
787 /* flagext */
788 #define WLAN_CHAN_DFS_RADAR_FOUND    0x01
789 
790 /* DFS required on channel */
791 #define WLAN_CHAN_DFS              0x0002
792 
793 /* DFS required on channel for 2nd band of 80+80*/
794 #define WLAN_CHAN_DFS_CFREQ2       0x0004
795 
796 /* if channel has been checked for DFS */
797 #define WLAN_CHAN_DFS_CLEAR        0x0008
798 
799 /* DFS radar history for client device(STA mode) */
800 #define WLAN_CHAN_HISTORY_RADAR    0x0100
801 
802 /* DFS CAC valid for  client device(STA mode) */
803 #define WLAN_CHAN_CAC_VALID        0x0200
804 
805 #define WLAN_IS_CHAN_DFS(_c) \
806 	(((_c)->dfs_ch_flagext & \
807 	(WLAN_CHAN_DFS | WLAN_CHAN_DFS_CLEAR)) == WLAN_CHAN_DFS)
808 
809 #define WLAN_IS_CHAN_DFS_CFREQ2(_c) \
810 	(((_c)->dfs_ch_flagext & \
811 	(WLAN_CHAN_DFS_CFREQ2|WLAN_CHAN_DFS_CLEAR)) == \
812 	WLAN_CHAN_DFS_CFREQ2)
813 
814 #define WLAN_IS_PRIMARY_OR_SECONDARY_CHAN_DFS(_c) \
815 	(WLAN_IS_CHAN_DFS(_c) || \
816 	 ((WLAN_IS_CHAN_11AC_VHT160(_c) || \
817 	 WLAN_IS_CHAN_11AC_VHT80_80(_c) || \
818 	 WLAN_IS_CHAN_11AXA_HE160(_c) || \
819 	 WLAN_IS_CHAN_11AXA_HE80_80(_c) || \
820 	 WLAN_IS_CHAN_11BE_EHT160(_c) || \
821 	 WLAN_IS_CHAN_11BE_EHT320(_c)) \
822 	&& WLAN_IS_CHAN_DFS_CFREQ2(_c)))
823 
824 #ifdef CONFIG_HOST_FIND_CHAN
825 #define WLAN_IS_CHAN_RADAR wlan_is_chan_radar
826 #define WLAN_IS_CHAN_HISTORY_RADAR wlan_is_chan_history_radar
827 #else
828 #define WLAN_IS_CHAN_RADAR(_dfs, _c)    \
829 	(((_c)->dfs_ch_flags & WLAN_CHAN_DFS_RADAR) == \
830 	 WLAN_CHAN_DFS_RADAR)
831 
832 #define WLAN_IS_CHAN_HISTORY_RADAR(_dfs, _c)    \
833 	(((_c)->dfs_ch_flagext & WLAN_CHAN_HISTORY_RADAR) == \
834 	WLAN_CHAN_HISTORY_RADAR)
835 
836 #endif
837 
838 #define WLAN_CHAN_CLR_HISTORY_RADAR(_c)    \
839 	((_c)->dfs_ch_flagext &= ~WLAN_CHAN_HISTORY_RADAR)
840 
841 #define WLAN_CHAN_ANY      (-1)    /* token for ``any channel'' */
842 
843 #define WLAN_CHAN_ANYC \
844 	((struct dfs_channel *) WLAN_CHAN_ANY)
845 
846 #define WLAN_IS_CHAN_MODE_20(_c)      \
847 	(WLAN_IS_CHAN_A(_c)        ||    \
848 	 WLAN_IS_CHAN_11NA_HT20(_c)  ||  \
849 	 WLAN_IS_CHAN_11AC_VHT20(_c) ||  \
850 	 WLAN_IS_CHAN_11AXA_HE20(_c) ||  \
851 	 WLAN_IS_CHAN_11BE_EHT20(_c))
852 
853 #define WLAN_IS_CHAN_MODE_40(_c)          \
854 	(WLAN_IS_CHAN_11AC_VHT40PLUS(_c)  || \
855 	 WLAN_IS_CHAN_11AC_VHT40MINUS(_c) || \
856 	 WLAN_IS_CHAN_11NA_HT40PLUS(_c)   || \
857 	 WLAN_IS_CHAN_11NA_HT40MINUS(_c)  || \
858 	 WLAN_IS_CHAN_11AXA_HE40PLUS(_c)  || \
859 	 WLAN_IS_CHAN_11AXA_HE40MINUS(_c) || \
860 	 WLAN_IS_CHAN_11BE_EHT40PLUS(_c)  || \
861 	 WLAN_IS_CHAN_11BE_EHT40MINUS(_c))
862 
863 #define WLAN_IS_CHAN_MODE_80(_c)          \
864 	(WLAN_IS_CHAN_11AC_VHT80(_c)      || \
865 	 WLAN_IS_CHAN_11AXA_HE80(_c)      || \
866 	 WLAN_IS_CHAN_11BE_EHT80(_c))
867 
868 #define WLAN_IS_CHAN_MODE_160(_c)         \
869 	(WLAN_IS_CHAN_11AC_VHT160(_c)     || \
870 	 WLAN_IS_CHAN_11AXA_HE160(_c)     || \
871 	 WLAN_IS_CHAN_11BE_EHT160(_c))
872 
873 #define WLAN_IS_CHAN_MODE_80_80(_c)       \
874 	(WLAN_IS_CHAN_11AC_VHT80_80(_c)   || \
875 	 WLAN_IS_CHAN_11AXA_HE80_80(_c))
876 
877 #define WLAN_IS_CHAN_MODE_165(_dfs, _c) \
878 	(dfs_is_restricted_80p80mhz_supported(_dfs) && \
879 	WLAN_IS_CHAN_MODE_80_80(_c))
880 
881 #define WLAN_IS_CHAN_MODE_320(_c) WLAN_IS_CHAN_11BE_EHT320(_c)
882 
883 #define WLAN_IS_CHAN_11BE(_c)             \
884 	(WLAN_IS_CHAN_11BE_EHT20(_c)      || \
885 	 WLAN_IS_CHAN_11BE_EHT40PLUS(_c)  || \
886 	 WLAN_IS_CHAN_11BE_EHT40MINUS(_c) || \
887 	 WLAN_IS_CHAN_11BE_EHT80(_c)      || \
888 	 WLAN_IS_CHAN_11BE_EHT160(_c)     || \
889 	 WLAN_IS_CHAN_11BE_EHT320(_c))
890 
891 #define WLAN_IS_CHAN_11AXA(_c)            \
892 	(WLAN_IS_CHAN_11AXA_HE20(_c)      || \
893 	 WLAN_IS_CHAN_11AXA_HE40PLUS(_c)  || \
894 	 WLAN_IS_CHAN_11AXA_HE40MINUS(_c) || \
895 	 WLAN_IS_CHAN_11AXA_HE80(_c)      || \
896 	 WLAN_IS_CHAN_11AXA_HE160(_c)     || \
897 	 WLAN_IS_CHAN_11AXA_HE80_80(_c))
898 
899 #define WLAN_IS_CHAN_11AC(_c)             \
900 	(WLAN_IS_CHAN_11AC_VHT20(_c)      || \
901 	 WLAN_IS_CHAN_11AC_VHT40PLUS(_c)  || \
902 	 WLAN_IS_CHAN_11AC_VHT40MINUS(_c) || \
903 	 WLAN_IS_CHAN_11AC_VHT80(_c)      || \
904 	 WLAN_IS_CHAN_11AC_VHT160(_c)     || \
905 	 WLAN_IS_CHAN_11AC_VHT80_80(_c))
906 
907 #endif /* _DFS_CHANNEL_H_ */
908