xref: /wlan-dirver/qca-wifi-host-cmn/umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h (revision 8ddef7dd9a290d4a9b1efd5d3efacf51d78a1a0d)
1 /*
2  * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
3  *
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /**
21  * DOC: This file has the DFS dispatcher API which is exposed to outside of DFS
22  * component.
23  */
24 
25 #ifndef _WLAN_DFS_UTILS_API_H_
26 #define _WLAN_DFS_UTILS_API_H_
27 
28 #include "wlan_dfs_ucfg_api.h"
29 #include "wlan_reg_services_api.h"
30 #include <wlan_objmgr_vdev_obj.h>
31 
32 /* Add channel to nol */
33 #define DFS_NOL_SET                  1
34 
35 /* Remove channel from nol */
36 #define DFS_NOL_RESET                0
37 
38 /* Mark nol-history flag for the channel */
39 #define DFS_NOL_HISTORY_SET 1
40 
41 /* Clear nol-history flag from the channel */
42 #define DFS_NOL_HISTORY_RESET 0
43 
44 /* Max nol channels */
45 #define DFS_MAX_NOL_CHANNEL         80
46 
47 /* WLAN 2.4GHz start freq */
48 #define DFS_24_GHZ_BASE_FREQ     (2407)
49 
50 /* WLAN 5GHz start freq */
51 #define DFS_5_GHZ_BASE_FREQ      (5000)
52 
53 /* WLAN 2.4 GHz channel number 6 */
54 #define DFS_24_GHZ_CHANNEL_6        (6)
55 
56 /* WLAN 2.4 GHz channel number 14 */
57 #define DFS_24_GHZ_CHANNEL_14      (14)
58 
59 /* WLAN 2.4 GHz channel number 15 */
60 #define DFS_24_GHZ_CHANNEL_15      (15)
61 
62 /* WLAN 2.4 GHz channel number 27 */
63 #define DFS_24_GHZ_CHANNEL_27      (27)
64 
65 /* WLAN 5GHz channel number 170 */
66 #define DFS_5_GHZ_CHANNEL_170     (170)
67 
68 /* WLAN 5MHz channel spacing */
69 #define DFS_CHAN_SPACING_5MHZ       (5)
70 
71 /* WLAN 20Hz channel spacing */
72 #define DFS_CHAN_SPACING_20MHZ     (20)
73 
74 /* WLAN 2.4GHz channel number 14 freq */
75 #define DFS_CHAN_14_FREQ         (2484)
76 
77 /* WLAN 2.4GHz channel number 15 freq */
78 #define DFS_CHAN_15_FREQ         (2512)
79 
80 /* WLAN 5GHz channel number 170 freq */
81 #define DFS_CHAN_170_FREQ        (5852)
82 
83 
84 
85 extern struct dfs_to_mlme global_dfs_to_mlme;
86 
87 /**
88  * utils_dfs_cac_valid_reset() - Cancels the dfs_cac_valid_timer timer.
89  * @pdev: Pointer to DFS pdev object.
90  * @prevchan_ieee: Prevchan number.
91  * @prevchan_flags: Prevchan flags.
92  *
93  * Wrapper function for dfs_cac_valid_reset(). This function called from
94  * outside of DFS component.
95  */
96 
97 QDF_STATUS utils_dfs_cac_valid_reset(struct wlan_objmgr_pdev *pdev,
98 		uint8_t prevchan_ieee,
99 		uint32_t prevchan_flags);
100 
101 /**
102  * utils_dfs_reset() - Reset DFS members.
103  * @pdev: Pointer to DFS pdev object.
104  */
105 QDF_STATUS utils_dfs_reset(struct wlan_objmgr_pdev *pdev);
106 
107 /**
108  * utils_dfs_freq_is_in_nol() -  check if given channel in nol list
109  * @pdev: Pointer to DFS pdev object
110  * @freq: channel frequency
111  *
112  * check if given channel in nol list.
113  *
114  * Return: true if channel in nol, false else
115  */
116 bool utils_dfs_freq_is_in_nol(struct wlan_objmgr_pdev *pdev, uint32_t freq);
117 
118 /**
119  * utils_dfs_reset_precaclists() - Clears and initiakizes precac_required_list,
120  *                                 precac_done_list and precac_nol_list.
121  * @pdev: Pointer to DFS pdev object.
122  *
123  * Wrapper function for dfs_reset_precaclists(). This function called from
124  * outside of DFS component.
125  */
126 QDF_STATUS utils_dfs_reset_precaclists(struct wlan_objmgr_pdev *pdev);
127 
128 /**
129  * utils_dfs_reset_etsi_precaclists() - Clears and initializes etsi
130  *                                      precac_required_list,
131  *                                      etsi precac_done_list and
132  *                                      etsi precac_nol_list.
133  * @pdev: Pointer to DFS pdev object.
134  *
135  * Wrapper function for dfs_reset_etsiprecaclists(). This function called from
136  * outside of DFS component.
137  */
138 #ifdef QCA_SUPPORT_ETSI_PRECAC_DFS
139 QDF_STATUS utils_dfs_reset_etsi_precaclists(struct wlan_objmgr_pdev *pdev);
140 #else
141 static inline QDF_STATUS utils_dfs_reset_etsi_precaclists(
142 		struct wlan_objmgr_pdev *pdev)
143 {
144 	return QDF_STATUS_SUCCESS;
145 }
146 #endif
147 
148 /**
149  * utils_dfs_cancel_precac_timer() - Cancel the precac timer.
150  * @pdev: Pointer to DFS pdev object.
151  *
152  * wrapper function for dfs_cancel_precac_timer(). this function called from
153  * outside of dfs component.
154  */
155 QDF_STATUS utils_dfs_cancel_precac_timer(struct wlan_objmgr_pdev *pdev);
156 
157 /**
158  * utils_dfs_start_precac_timer() - Start the precac timer.
159  * @pdev: Pointer to DFS pdev object.
160  *
161  * Wrapper function for dfs_start_precac_timer(). This function called from
162  * outside of dfs component.
163  *
164  * Return:
165  * * QDF_STATUS_E_FAILURE: Failed to start timer.
166  * * QDF_STATUS_SUCCESS: Timer started successfully.
167  */
168 QDF_STATUS utils_dfs_start_precac_timer(struct wlan_objmgr_pdev *pdev);
169 
170 #ifdef WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT
171 /**
172  * utils_dfs_precac_decide_pref_chan() - Choose preferred channel
173  * @pdev: Pointer to DFS pdev object.
174  * @ch_ieee: Pointer to channel number.
175  * @mode: Configured PHY mode.
176  *
177  * Wrapper function for dfs_decide_precac_preferred_chan(). This
178  * function called from outside of dfs component.
179  *
180  * Return: True if intermediate channel needs to configure. False otherwise.
181  */
182 bool
183 utils_dfs_precac_decide_pref_chan(struct wlan_objmgr_pdev *pdev,
184 				  uint8_t *ch_ieee,
185 				  enum wlan_phymode mode);
186 #endif
187 
188 /**
189  * utils_dfs_cancel_cac_timer() - Cancels the CAC timer.
190  * @pdev: Pointer to DFS pdev object.
191  *
192  * wrapper function for dfs_cancel_cac_timer(). this
193  * function called from outside of dfs component.
194  */
195 QDF_STATUS utils_dfs_cancel_cac_timer(struct wlan_objmgr_pdev *pdev);
196 
197 /**
198  * utils_dfs_start_cac_timer() - Starts the CAC timer.
199  * @pdev: Pointer to DFS pdev object.
200  *
201  * wrapper function for dfs_start_cac_timer(). this
202  * function called from outside of dfs component.
203  */
204 QDF_STATUS utils_dfs_start_cac_timer(struct wlan_objmgr_pdev *pdev);
205 
206 /**
207  * utils_dfs_cac_stop() - Clear the AP CAC timer.
208  * @pdev: Pointer to DFS pdev object.
209  *
210  * wrapper function for dfs_cac_stop(). this
211  * function called from outside of dfs component.
212  */
213 QDF_STATUS utils_dfs_cac_stop(struct wlan_objmgr_pdev *pdev);
214 
215 /**
216  * utils_dfs_stacac_stop() - Clear the STA CAC timer.
217  * @pdev: Pointer to DFS pdev object.
218  *
219  * wrapper function for dfs_stacac_stop(). this
220  * function called from outside of dfs component.
221  */
222 QDF_STATUS utils_dfs_stacac_stop(struct wlan_objmgr_pdev *pdev);
223 
224 /**
225  * utils_dfs_get_usenol() - Returns use_nol flag.
226  * @pdev: Pointer to DFS pdev object.
227  * @usenol: Pointer to usenol value.
228  *
229  * wrapper function for dfs_get_usenol(). this
230  * function called from outside of dfs component.
231  */
232 QDF_STATUS utils_dfs_get_usenol(struct wlan_objmgr_pdev *pdev,
233 		uint16_t *usenol);
234 
235 /**
236  * utils_dfs_radar_disable() - Disables the radar.
237  * @pdev: Pointer to DFS pdev object.
238  *
239  * wrapper function for  dfs_radar_disable(). this
240  * function called from outside of dfs component.
241  */
242 QDF_STATUS utils_dfs_radar_disable(struct wlan_objmgr_pdev *pdev);
243 
244 /**
245  * utils_dfs_set_update_nol_flag() - Sets update_nol flag.
246  * @pdev: Pointer to DFS pdev object.
247  * @val: update_nol flag.
248  *
249  * wrapper function for dfs_set_update_nol_flag(). this
250  * function called from outside of dfs component.
251  */
252 QDF_STATUS utils_dfs_set_update_nol_flag(struct wlan_objmgr_pdev *pdev,
253 		bool val);
254 
255 /**
256  * utils_dfs_get_update_nol_flag() - Returns update_nol flag.
257  * @pdev: Pointer to DFS pdev object.
258  * @nol_flag: Fill nol_flag in this variable.
259  *
260  * wrapper function for dfs_get_update_nol_flag(). this
261  * function called from outside of dfs component.
262  */
263 QDF_STATUS utils_dfs_get_update_nol_flag(struct wlan_objmgr_pdev *pdev,
264 		bool *nol_flag);
265 
266 /**
267  * utils_dfs_get_dfs_use_nol() - Get usenol.
268  * @pdev: Pointer to DFS pdev object.
269  * @dfs_use_nol: Pointer to dfs_use_nol.
270  *
271  * wrapper function for dfs_get_dfs_use_nol(). this
272  * function called from outside of dfs component.
273  */
274 QDF_STATUS utils_dfs_get_dfs_use_nol(struct wlan_objmgr_pdev *pdev,
275 		int *dfs_use_nol);
276 
277 /**
278  * utils_dfs_get_nol_timeout() - Get NOL timeout.
279  * @pdev: Pointer to DFS pdev object.
280  * @dfs_nol_timeout: Pointer to dfs_nol_timeout.
281  *
282  * wrapper function for dfs_get_nol_timeout(). this
283  * function called from outside of dfs component.
284  */
285 QDF_STATUS utils_dfs_get_nol_timeout(struct wlan_objmgr_pdev *pdev,
286 		int *dfs_nol_timeout);
287 
288 /**
289  * utils_dfs_nol_addchan() - Add channel to NOL.
290  * @pdev: Pointer to DFS pdev object.
291  * @chan: channel t o add NOL.
292  * @dfs_nol_timeout: NOL timeout.
293  *
294  * wrapper function for dfs_nol_addchan(). this
295  * function called from outside of dfs component.
296  */
297 QDF_STATUS utils_dfs_nol_addchan(struct wlan_objmgr_pdev *pdev,
298 		uint16_t freq,
299 		uint32_t dfs_nol_timeout);
300 
301 /**
302  * utils_dfs_nol_update() - NOL update
303  * @pdev: Pointer to DFS pdev object.
304  *
305  * wrapper function for dfs_nol_update(). this
306  * function called from outside of dfs component.
307  */
308 QDF_STATUS utils_dfs_nol_update(struct wlan_objmgr_pdev *pdev);
309 
310 /**
311  * utils_dfs_second_segment_radar_disable() - Disables the second segment radar.
312  * @pdev: Pointer to DFS pdev object.
313  *
314  * This is called when AP detects the radar, to (potentially) disable
315  * the radar code.
316  */
317 QDF_STATUS utils_dfs_second_segment_radar_disable(
318 		struct wlan_objmgr_pdev *pdev);
319 
320 /**
321  * utils_dfs_fetch_nol_ie_info() - Fills the arguments with NOL information
322  * needed for sending RCSA.
323  * pdev: Pointer to DFS pdev object.
324  * nol_ie_bandwidth: Minimum DFS subchannel Bandwidth.
325  * nol_ie_startfreq: Radar affected channel list start subchannel's centre
326  * frequency.
327  * nol_ie_bitmap: Bitmap of radar affected subchannels.
328  */
329 QDF_STATUS utils_dfs_fetch_nol_ie_info(struct wlan_objmgr_pdev *pdev,
330 				       uint8_t *nol_ie_bandwidth,
331 				       uint16_t *nol_ie_startfreq,
332 				       uint8_t *nol_ie_bitmap);
333 
334 /**
335  * utils_dfs_set_rcsa_flags() - Set flags that are required for sending
336  * RCSA and NOL IE.
337  * pdev: Pointer to DFS pdev object.
338  * is_rcsa_ie_sent: Boolean to check if RCSA IE should be sent or not.
339  * is_nol_ie_sent: Boolean to check if NOL IE should be sent or not.
340  */
341 
342 QDF_STATUS utils_dfs_set_rcsa_flags(struct wlan_objmgr_pdev *pdev,
343 				    bool is_rcsa_ie_sent,
344 				    bool is_nol_ie_sent);
345 
346 /**
347  * utils_dfs_get_rcsa_flags() - Get flags that are required for sending
348  * RCSA and NOL IE.
349  * pdev: Pointer to DFS pdev object.
350  * is_rcsa_ie_sent: Boolean to check if RCSA IE should be sent or not.
351  * is_nol_ie_sent: Boolean to check if NOL IE should be sent or not.
352  */
353 
354 QDF_STATUS utils_dfs_get_rcsa_flags(struct wlan_objmgr_pdev *pdev,
355 				    bool *is_rcsa_ie_sent,
356 				    bool *is_nol_ie_sent);
357 
358 /**
359  * utils_dfs_process_nol_ie_bitmap() - Update NOL with external radar
360  * information.
361  * pdev: Pointer to DFS pdev object.
362  * nol_ie_bandwidth: Minimum DFS subchannel Bandwidth.
363  * nol_ie_startfreq: Radar affected channel list start channel's
364  * centre frequency.
365  * nol_ie_bitmap: Bitmap of radar affected subchannels.
366  *
367  * Return: True if NOL IE should be propagated, else false.
368  */
369 bool utils_dfs_process_nol_ie_bitmap(struct wlan_objmgr_pdev *pdev,
370 				     uint8_t nol_ie_bandwidth,
371 				     uint16_t nol_ie_startfreq,
372 				     uint8_t nol_ie_bitmap);
373 
374 /**
375  * utils_dfs_bw_reduce() - Set bw reduce.
376  * @pdev: Pointer to DFS pdev object.
377  * @bw_reduce: Fill bw_reduce value in this variable.
378  *
379  * Return: QDF_STATUS
380  */
381 QDF_STATUS utils_dfs_bw_reduce(struct wlan_objmgr_pdev *pdev,
382 				bool bw_reduce);
383 
384 /**
385  * utils_dfs_is_bw_reduce() - Get bw reduce.
386  * @pdev: Pointer to DFS pdev object.
387  * @bw_reduce: Pointer to get bw_reduce value.
388  *
389  * Return: QDF_STATUS
390  */
391 QDF_STATUS utils_dfs_is_bw_reduce(struct wlan_objmgr_pdev *pdev,
392 				  bool *bw_reduce);
393 /**
394  * utils_dfs_set_cac_timer_running() - Sets the cac timer running.
395  * @pdev: Pointer to DFS pdev object.
396  * @val: Set this value to dfs_cac_timer_running variable.
397  */
398 QDF_STATUS utils_dfs_set_cac_timer_running(struct wlan_objmgr_pdev *pdev,
399 		int val);
400 
401 /**
402  * utils_dfs_get_nol_chfreq_and_chwidth() - Sets the cac timer running.
403  * @pdev: Pointer to DFS pdev object.
404  * @nollist: Pointer to NOL channel entry.
405  * @nol_chfreq: Pointer to save channel frequency.
406  * @nol_chwidth: Pointer to save channel width.
407  * @index: Index into nol list.
408  */
409 QDF_STATUS utils_dfs_get_nol_chfreq_and_chwidth(struct wlan_objmgr_pdev *pdev,
410 		void *nollist,
411 		uint32_t *nol_chfreq,
412 		uint32_t *nol_chwidth,
413 		int index);
414 
415 /**
416  * utils_dfs_get_random_channel() - Get random channel.
417  * @pdev: Pointer to DFS pdev object.
418  * @flags: random channel selection flags.
419  * @ch_params: current channel params.
420  * @hw_mode: current operating mode.
421  * @target_chan: Pointer to target_chan.
422  * @acs_info: acs range info.
423  *
424  * wrapper function for get_random_chan(). this
425  * function called from outside of dfs component.
426  *
427  * Return: QDF_STATUS
428  */
429 QDF_STATUS utils_dfs_get_random_channel(struct wlan_objmgr_pdev *pdev,
430 		uint16_t flags, struct ch_params *ch_params,
431 		uint32_t *hw_mode, uint8_t *target_chan,
432 		struct dfs_acs_info *acs_info);
433 
434 /**
435  * utils_dfs_bw_reduced_channel() - Get BW reduced channel.
436  * @pdev: Pointer to DFS pdev object.
437  * @ch_params: current channel params.
438  * @hw_mode: current operating mode.
439  * @target_chan: Pointer to target_chan.
440  *
441  * wrapper function for get bw_reduced_channel. this
442  * function called from outside of dfs component.
443  *
444  * Return: QDF_STATUS
445  */
446 QDF_STATUS utils_dfs_bw_reduced_channel(struct wlan_objmgr_pdev *pdev,
447 					struct ch_params *ch_params,
448 					uint32_t *hw_mode,
449 					uint8_t *target_chan);
450 /**
451  * utils_dfs_init_nol() - Initialize nol from platform driver.
452  * @pdev: pdev handler.
453  *
454  * Initialize nol from platform driver.
455  *
456  * Return: None
457  */
458 #ifdef QCA_DFS_NOL_PLATFORM_DRV_SUPPORT
459 void utils_dfs_init_nol(struct wlan_objmgr_pdev *pdev);
460 #else
461 static inline void utils_dfs_init_nol(struct wlan_objmgr_pdev *pdev)
462 {
463 }
464 #endif
465 /**
466  * utils_dfs_save_nol() - save nol list to platform driver.
467  * @pdev: pdev handler.
468  *
469  * Save nol list to platform driver.
470  *
471  * Return: None
472  */
473 void utils_dfs_save_nol(struct wlan_objmgr_pdev *pdev);
474 
475 /**
476  * utils_dfs_print_nol_channels() - log nol channels.
477  * @pdev: pdev handler.
478  *
479  * log nol channels.
480  *
481  * Return: None
482  */
483 #ifdef DFS_COMPONENT_ENABLE
484 void utils_dfs_print_nol_channels(struct wlan_objmgr_pdev *pdev);
485 #else
486 static inline void utils_dfs_print_nol_channels(struct wlan_objmgr_pdev *pdev)
487 {
488 }
489 #endif
490 
491 /**
492  * utils_dfs_clear_nol_channels() - clear nol list.
493  * @pdev: pdev handler.
494  *
495  * log nol channels.
496  *
497  * Return: None
498  */
499 void utils_dfs_clear_nol_channels(struct wlan_objmgr_pdev *pdev);
500 
501 /**
502  * utils_is_dfs_ch() - is channel dfs.
503  * @pdev: pdev handler.
504  *
505  * is channel dfs.
506  *
507  * Return: True if channel dfs, else false.
508  */
509 static inline bool utils_is_dfs_ch(struct wlan_objmgr_pdev *pdev, uint32_t chan)
510 {
511 	return wlan_reg_is_dfs_ch(pdev, chan);
512 }
513 /**
514  * utils_dfs_reg_update_nol_ch() - set nol channel
515  *
516  * @pdev: pdev ptr
517  * @ch_list: channel list to be returned
518  * @num_ch: number of channels
519  * @nol_ch: nol flag
520  *
521  * Return: void
522  */
523 void utils_dfs_reg_update_nol_ch(struct wlan_objmgr_pdev *pdev,
524 		uint8_t *ch_list,
525 		uint8_t num_ch,
526 		bool nol_ch);
527 
528 /**
529  * utils_dfs_freq_to_chan () - convert channel freq to channel number
530  * @freq: frequency
531  *
532  * Return: channel number
533  */
534 uint8_t utils_dfs_freq_to_chan(uint32_t freq);
535 
536 /**
537  * utils_dfs_chan_to_freq () - convert channel number to frequency
538  * @chan: channel number
539  *
540  * Return: frequency
541  */
542 #ifdef DFS_COMPONENT_ENABLE
543 uint32_t utils_dfs_chan_to_freq(uint8_t chan);
544 #else
545 static inline uint32_t utils_dfs_chan_to_freq(uint8_t chan)
546 {
547 	return 0;
548 }
549 #endif
550 /**
551  * utils_dfs_update_cur_chan_flags() - Update DFS channel flag and flagext.
552  * @pdev: Pointer to DFS pdev object.
553  * @flags: New channel flags
554  * @flagext: New Extended flags
555  *
556  * Return: QDF_STATUS
557  */
558 QDF_STATUS utils_dfs_update_cur_chan_flags(struct wlan_objmgr_pdev *pdev,
559 		uint64_t flags,
560 		uint16_t flagext);
561 
562 #ifdef QCA_MCL_DFS_SUPPORT
563 /**
564  * utils_dfs_mark_leaking_ch() - to mark channel leaking in to nol
565  * @pdev: Pointer to pdev structure.
566  * @ch_width: channel width
567  * @temp_ch_lst_sz: the target channel list
568  * @temp_ch_lst: the target channel list
569  *
570  * This function removes the channels from temp channel list that
571  * (if selected as target channel) will cause leakage in one of
572  * the NOL channels
573  *
574  * Return: QDF_STATUS
575  */
576 QDF_STATUS utils_dfs_mark_leaking_ch(struct wlan_objmgr_pdev *pdev,
577 	enum phy_ch_width ch_width,
578 	uint8_t temp_ch_lst_sz,
579 	uint8_t *temp_ch_lst);
580 #else
581 static inline QDF_STATUS utils_dfs_mark_leaking_ch
582 	(struct wlan_objmgr_pdev *pdev,
583 	enum phy_ch_width ch_width,
584 	uint8_t temp_ch_lst_sz,
585 	uint8_t *temp_ch_lst)
586 {
587 	return QDF_STATUS_SUCCESS;
588 }
589 #endif
590 /**
591  * utils_get_dfsdomain() - Get DFS domain.
592  * @pdev: Pointer to PDEV structure.
593  *
594  * Return: DFS domain.
595  */
596 int utils_get_dfsdomain(struct wlan_objmgr_pdev *pdev);
597 
598 /**
599  * utils_dfs_get_cur_rd() - Get current regdomain.
600  * @pdev: pdev ptr
601  *
602  * Return: Regdomain pair id.
603  */
604 uint16_t utils_dfs_get_cur_rd(struct wlan_objmgr_pdev *pdev);
605 
606 /**
607  * utils_dfs_is_spoof_check_failed() - get spoof check status.
608  * @pdev: pdev ptr
609  * @is_spoof_check_failed: pointer containing the status.
610  *
611  * Return: QDF_STATUS.
612  */
613 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
614 QDF_STATUS utils_dfs_is_spoof_check_failed(struct wlan_objmgr_pdev *pdev,
615 					   bool *is_spoof_check_failed);
616 #else
617 static inline
618 QDF_STATUS utils_dfs_is_spoof_check_failed(struct wlan_objmgr_pdev *pdev,
619 					   bool *is_spoof_check_failed)
620 {
621 	return QDF_STATUS_SUCCESS;
622 }
623 #endif
624 
625 /**
626  * dfs_get_num_chans() - Get the number of channels supported by the regulatory.
627  *
628  * Return: Number of supported channels.
629  */
630 int dfs_get_num_chans(void);
631 
632 /**
633  * utils_dfs_get_chan_list() - Get channel list from regdb.
634  * @pdev: Pointer to DFS pdev object.
635  * @clist: Pointer to current channel list
636  * @num_chan: number of channels in the current channel list.
637  */
638 void utils_dfs_get_chan_list(struct wlan_objmgr_pdev *pdev,
639 			     void *clist,
640 			     uint32_t *num_chan);
641 
642 /**
643  * utils_dfs_get_nol_history_chan_list() - Get nol_history channels from regdb
644  * component.
645  * @pdev: Pointer to pdev structure.
646  * @clist: Pointer to channel list.
647  * @num_chan: number of channels.
648  */
649 void utils_dfs_get_nol_history_chan_list(struct wlan_objmgr_pdev *pdev,
650 					 void *clist, uint32_t *num_chan);
651 
652 /**
653  * utils_dfs_reg_update_nol_history_ch() - set nol history channel
654  *
655  * @pdev: pdev ptr
656  * @ch_list: channel list to be returned
657  * @num_ch: number of channels
658  * @nol_history_ch: nol history flag
659  *
660  * Return: void
661  */
662 void utils_dfs_reg_update_nol_history_ch(struct wlan_objmgr_pdev *pdev,
663 					 uint8_t *ch_list,
664 					 uint8_t num_ch,
665 					 bool nol_history_ch);
666 
667 /**
668  * utils_dfs_check_for_cac_start() - Check for DFS CAC start conditions.
669  * @pdev: pdev ptr
670  * @continue_current_cac: If AP can start CAC then this variable indicates
671  * whether to continue with the current CAC or restart the CAC. This variable
672  * is valid only if this function returns true.
673  *
674  * Return: true if AP can start or continue the current CAC, else false.
675  */
676 bool utils_dfs_check_for_cac_start(struct wlan_objmgr_pdev *pdev,
677 				   bool *continue_current_cac);
678 
679 /** utils_dfs_is_precac_done() - Check if precac has been done in chosen channel
680  * @pdev: Pointer to DFS pdev object.
681  * @wlan_chan: Pointer to wlan channel object that can be accessed by other
682  * components.
683  * Wrapper function for dfs_is_precac_done(). This API is called from outside
684  * the dfs component.
685  *
686  * Return:
687  * * True :If precac is done on channel.
688  * * False:If precac is not done on channel.
689  */
690 bool utils_dfs_is_precac_done(struct wlan_objmgr_pdev *pdev,
691 			      struct wlan_channel *wlan_chan);
692 /**
693  * utils_dfs_get_disable_radar_marking - Retrieve the value of disable radar
694  * marking.
695  * @pdev: Pointer to DFS pdev object.
696  * @dis_radar_marking: pointer to retrieve the value of disable_radar_marking.
697  */
698 #if defined(WLAN_DFS_FULL_OFFLOAD) && defined(QCA_DFS_NOL_OFFLOAD)
699 QDF_STATUS utils_dfs_get_disable_radar_marking(struct wlan_objmgr_pdev *pdev,
700 					       bool *disable_radar_marking);
701 #else
702 static inline
703 QDF_STATUS utils_dfs_get_disable_radar_marking(struct wlan_objmgr_pdev *pdev,
704 					       bool *disable_radar_marking)
705 {
706 	return QDF_STATUS_SUCCESS;
707 }
708 #endif
709 
710 /**
711  * utils_dfs_clear_cac_started_chan() - Clear dfs cac started channel.
712  * @pdev: pdev ptr
713  */
714 void utils_dfs_clear_cac_started_chan(struct wlan_objmgr_pdev *pdev);
715 #endif /* _WLAN_DFS_UTILS_API_H_ */
716