xref: /wlan-dirver/qca-wifi-host-cmn/umac/dfs/dispatcher/inc/wlan_dfs_ucfg_api.h (revision bea437e2293c3d4fb1b5704fcf633aedac996962)
1 /*
2  * Copyright (c) 2016-2020 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_UCFG_API_H_
26 #define _WLAN_DFS_UCFG_API_H_
27 
28 #include <wlan_objmgr_psoc_obj.h>
29 #include <wlan_objmgr_pdev_obj.h>
30 #include <wlan_dfs_ioctl.h>
31 
32 /**
33  * struct dfs_to_mlme - These are MLME function pointer used by DFS component.
34  * @pdev_component_obj_attach:         Attach DFS object to PDEV.
35  * @pdev_component_obj_detach:         Detach DFS object from PDEV.
36  * @pdev_get_comp_private_obj:         Get DFS object from PDEV.
37  * @dfs_start_rcsa:                    Send RCSA to RootAP.
38  * @mlme_mark_dfs:                     Calls dfs_action function.
39  * @mlme_start_csa:                    Sends CSA.
40  * @mlme_proc_cac:                     Process the CAC completion event.
41  * @mlme_deliver_event_up_after_cac:   Send a CAC timeout, VAP up event to user
42  *                                     space
43  * @mlme_get_dfs_ch_nchans:            Get number of channels in the channel
44  *                                     list.
45  * @mlme_get_extchan:                  Gets the extension channel.
46  * @mlme_set_no_chans_available:       Sets no_chans_available flag.
47  * @mlme_ieee2mhz:                     Gets Channel freq from ieee number.
48  * @mlme_find_dot11_channel:           Find dot11 channel.
49  * @mlme_get_dfs_ch_channels:          Get the channel list.
50  * @mlme_dfs_ch_flags_ext:             Gets channel extension flag.
51  * @mlme_channel_change_by_precac:     Channel change triggered by PreCAC.
52  * @mlme_precac_chan_change_csa:       Channel change triggered by PrCAC using
53  *                                     Channel Switch Announcement.
54  * @mlme_nol_timeout_notification:     NOL timeout notification.
55  * @mlme_clist_update:                 Updates the channel list.
56  * @mlme_is_opmode_sta:                Check if pdev opmode is STA.
57  * @mlme_get_cac_timeout:              Gets the CAC timeout.
58  * @mlme_rebuild_chan_list_with_non_dfs_channel: Rebuild channels with non-dfs
59  *                                     channels.
60  * @mlme_restart_vaps_with_non_dfs_chan: Restart vaps with non-dfs channel.
61  * @mlme_check_allowed_prim_chanlist:  Check whether the given channel is
62  *                                     present in the primary allowed channel
63  *                                     list or not.
64  * @mlme_update_scan_channel_list:     Update the scan channel list sent to FW.
65  * @mlme_bringdown_vaps:               Bringdown vaps if no chans is present.
66  * @mlme_dfs_deliver_event:            Deliver DFS events to user space
67  * @mlme_precac_chan_change_csa_for_freq:Channel change triggered by PrCAC using
68  *                                     Channel Switch Announcement.
69  * @mlme_mark_dfs_for_freq:            Mark DFS channel frequency as radar.
70  * @mlme_get_extchan_for_freq:         Get the extension channel.
71  * @mlme_find_dot11_chan_for_freq:     Find a channel pointer.
72  * @mlme_get_dfs_channels_for_freq:    Get DFS channels from current channel
73  *                                     list.
74  * @mlme_get_cac_timeout_for_freq:     Get CAC timeout for a given channel
75  *                                     frequency.
76  * @mlme_acquire_radar_mode_switch_lock: Acquire lock for radar processing over
77  *                                     mode switch.
78  * @mlme_release_radar_mode_switch_lock: Release lock taken for radar processing
79  *                                     over mode switch.
80  */
81 struct dfs_to_mlme {
82 	QDF_STATUS (*pdev_component_obj_attach)(struct wlan_objmgr_pdev *pdev,
83 			enum wlan_umac_comp_id id,
84 			void *comp_priv_obj,
85 			QDF_STATUS status);
86 	QDF_STATUS (*pdev_component_obj_detach)(struct wlan_objmgr_pdev *pdev,
87 			enum wlan_umac_comp_id id,
88 			void *comp_priv_obj);
89 	QDF_STATUS (*dfs_start_rcsa)(struct wlan_objmgr_pdev *pdev,
90 			bool *wait_for_csa);
91 #ifdef CONFIG_CHAN_NUM_API
92 	QDF_STATUS (*mlme_mark_dfs)(struct wlan_objmgr_pdev *pdev,
93 			uint8_t ieee,
94 			uint16_t freq,
95 			uint8_t vhtop_ch_freq_seg2,
96 			uint64_t flags);
97 #endif
98 #ifdef CONFIG_CHAN_FREQ_API
99 	QDF_STATUS (*mlme_mark_dfs_for_freq)(struct wlan_objmgr_pdev *pdev,
100 					     uint8_t ieee,
101 					     uint16_t freq,
102 					     uint16_t ic_mhz_freq_seg2,
103 					     uint64_t flags);
104 #endif
105 #ifdef CONFIG_CHAN_NUM_API
106 	QDF_STATUS (*mlme_start_csa)(struct wlan_objmgr_pdev *pdev,
107 			uint8_t ieee_chan, uint16_t freq,
108 			uint8_t cfreq2, uint64_t flags);
109 #endif
110 #ifdef CONFIG_CHAN_FREQ_API
111 	QDF_STATUS (*mlme_start_csa_for_freq)(struct wlan_objmgr_pdev *pdev,
112 					      uint8_t ieee_chan, uint16_t freq,
113 					      uint16_t cfreq2, uint64_t flags);
114 #endif
115 
116 	QDF_STATUS (*mlme_proc_cac)(struct wlan_objmgr_pdev *pdev);
117 	QDF_STATUS (*mlme_deliver_event_up_after_cac)(
118 			struct wlan_objmgr_pdev *pdev);
119 	QDF_STATUS (*mlme_get_dfs_ch_nchans)(struct wlan_objmgr_pdev *pdev,
120 			int *nchans);
121 #ifdef CONFIG_CHAN_NUM_API
122 	QDF_STATUS (*mlme_get_extchan)(struct wlan_objmgr_pdev *pdev,
123 			uint16_t *dfs_ch_freq,
124 			uint64_t *dfs_ch_flags,
125 			uint16_t *dfs_ch_flagext,
126 			uint8_t *dfs_ch_ieee,
127 			uint8_t *dfs_ch_vhtop_ch_freq_seg1,
128 			uint8_t *dfs_ch_vhtop_ch_freq_seg2);
129 #endif
130 #ifdef CONFIG_CHAN_FREQ_API
131 	QDF_STATUS (*mlme_get_extchan_for_freq)(struct wlan_objmgr_pdev *pdev,
132 						uint16_t *dfs_ch_freq,
133 						uint64_t *dfs_ch_flags,
134 						uint16_t *dfs_ch_flagext,
135 						uint8_t *dfs_ch_ieee,
136 						uint8_t *dfs_vhtop_ch_freq_seg1,
137 						uint8_t *dfs_vhtop_ch_freq_seg2,
138 						uint16_t *dfs_ch_mhz_freq_seg1,
139 						uint16_t *dfs_ch_mhz_freq_seg2);
140 #endif
141 	QDF_STATUS (*mlme_set_no_chans_available)(struct wlan_objmgr_pdev *pdev,
142 			int val);
143 	QDF_STATUS (*mlme_ieee2mhz)(struct wlan_objmgr_pdev *pdev,
144 			int ieee,
145 			uint64_t flag,
146 			int *freq);
147 #ifdef CONFIG_CHAN_NUM_API
148 	QDF_STATUS (*mlme_find_dot11_channel)(struct wlan_objmgr_pdev *pdev,
149 			uint8_t ieee,
150 			uint8_t des_cfreq2,
151 			int mode,
152 			uint16_t *dfs_ch_freq,
153 			uint64_t *dfs_ch_flags,
154 			uint16_t *dfs_ch_flagext,
155 			uint8_t *dfs_ch_ieee,
156 			uint8_t *dfs_ch_vhtop_ch_freq_seg1,
157 			uint8_t *dfs_ch_vhtop_ch_freq_seg2);
158 #endif
159 #ifdef CONFIG_CHAN_FREQ_API
160 	QDF_STATUS (*mlme_find_dot11_chan_for_freq)(struct wlan_objmgr_pdev *,
161 						    uint16_t freq,
162 						    uint16_t des_cfreq2_mhz,
163 						    int mode,
164 						    uint16_t *dfs_ch_freq,
165 						    uint64_t *dfs_ch_flags,
166 						    uint16_t *dfs_ch_flagext,
167 						    uint8_t *dfs_ch_ieee,
168 						    uint8_t *dfs_ch_freq_seg1,
169 						    uint8_t *dfs_ch_freq_seg2,
170 						    uint16_t *dfs_cfreq1_mhz,
171 						    uint16_t *dfs_cfreq2_mhz);
172 #endif
173 #ifdef CONFIG_CHAN_NUM_API
174 	QDF_STATUS (*mlme_get_dfs_ch_channels)(struct wlan_objmgr_pdev *pdev,
175 			uint16_t *dfs_ch_freq,
176 			uint64_t *dfs_ch_flags,
177 			uint16_t *dfs_ch_flagext,
178 			uint8_t *dfs_ch_ieee,
179 			uint8_t *dfs_ch_vhtop_ch_freq_seg1,
180 			uint8_t *dfs_ch_vhtop_ch_freq_seg2,
181 			int index);
182 #endif
183 #ifdef CONFIG_CHAN_FREQ_API
184 	QDF_STATUS (*mlme_get_dfs_channels_for_freq)(
185 			struct wlan_objmgr_pdev *pdev,
186 			uint16_t *dfs_chan_freq,
187 			uint64_t *dfs_chan_flags,
188 			uint16_t *dfs_chan_flagext,
189 			uint8_t *dfs_chan_ieee,
190 			uint8_t *dfs_chan_vhtop_ch_freq_seg1,
191 			uint8_t *dfs_chan_vhtop_ch_freq_seg2,
192 			uint16_t *dfs_chan_mhz_freq_seg1,
193 			uint16_t *dfs_chan_mhz_freq_seg2,
194 			int index);
195 #endif
196 	QDF_STATUS (*mlme_dfs_ch_flags_ext)(struct wlan_objmgr_pdev *pdev,
197 			uint16_t *flag_ext);
198 	QDF_STATUS (*mlme_channel_change_by_precac)(
199 			struct wlan_objmgr_pdev *pdev);
200 #ifdef WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT
201 #ifdef CONFIG_CHAN_FREQ_API
202 	QDF_STATUS
203 	    (*mlme_precac_chan_change_csa_for_freq)(struct wlan_objmgr_pdev *,
204 						    uint16_t des_chan_freq,
205 						    enum wlan_phymode des_mode);
206 #endif
207 #ifdef CONFIG_CHAN_NUM_API
208 	QDF_STATUS
209 		(*mlme_precac_chan_change_csa)(struct wlan_objmgr_pdev *,
210 					       uint8_t des_chan,
211 					       enum wlan_phymode des_mode);
212 #endif
213 #endif
214 	QDF_STATUS (*mlme_nol_timeout_notification)(
215 			struct wlan_objmgr_pdev *pdev);
216 	QDF_STATUS (*mlme_clist_update)(struct wlan_objmgr_pdev *pdev,
217 			void *nollist,
218 			int nentries);
219 	bool (*mlme_is_opmode_sta)(struct wlan_objmgr_pdev *pdev);
220 #ifdef CONFIG_CHAN_NUM_API
221 	QDF_STATUS (*mlme_get_cac_timeout)(struct wlan_objmgr_pdev *pdev,
222 			uint16_t dfs_ch_freq,
223 			uint8_t c_vhtop_ch_freq_seg2,
224 			uint64_t dfs_ch_flags,
225 			int *cac_timeout);
226 #endif
227 #ifdef CONFIG_CHAN_FREQ_API
228 	QDF_STATUS
229 	    (*mlme_get_cac_timeout_for_freq)(struct wlan_objmgr_pdev *pdev,
230 					     uint16_t dfs_ch_freq,
231 					     uint16_t c_vhtop_ch_freq_seg2,
232 					     uint64_t dfs_ch_flags,
233 					     int *cac_timeout);
234 #endif
235 	QDF_STATUS (*mlme_rebuild_chan_list_with_non_dfs_channels)
236 			(struct wlan_objmgr_pdev *pdev);
237 	QDF_STATUS (*mlme_restart_vaps_with_non_dfs_chan)
238 			(struct wlan_objmgr_pdev *pdev, int no_chans_avail);
239 	bool (*mlme_check_allowed_prim_chanlist)
240 			(struct wlan_objmgr_pdev *pdev, uint32_t chan);
241 	QDF_STATUS (*mlme_update_scan_channel_list)
242 			(struct wlan_objmgr_pdev *pdev);
243 	QDF_STATUS (*mlme_bringdown_vaps)
244 			(struct wlan_objmgr_pdev *pdev);
245 	void (*mlme_dfs_deliver_event)
246 			(struct wlan_objmgr_pdev *pdev,
247 			 uint16_t freq,
248 			 enum WLAN_DFS_EVENTS event);
249 	void (*mlme_acquire_radar_mode_switch_lock)
250 			(struct wlan_objmgr_pdev *pdev);
251 	void (*mlme_release_radar_mode_switch_lock)
252 			(struct wlan_objmgr_pdev *pdev);
253 };
254 
255 extern struct dfs_to_mlme global_dfs_to_mlme;
256 
257 /**
258  * wlan_dfs_pdev_obj_create_notification() - DFS pdev object create handler.
259  * @pdev: Pointer to DFS pdev object.
260  */
261 QDF_STATUS wlan_dfs_pdev_obj_create_notification(struct wlan_objmgr_pdev *pdev,
262 		void *arg);
263 
264 /**
265  * wlan_dfs_pdev_obj_destroy_notification() - DFS pdev object delete handler.
266  * @pdev: Pointer to DFS pdev object.
267  */
268 QDF_STATUS wlan_dfs_pdev_obj_destroy_notification(struct wlan_objmgr_pdev *pdev,
269 		void *arg);
270 
271 /**
272  * ucfg_dfs_is_ap_cac_timer_running() - Returns the dfs cac timer.
273  * @pdev: Pointer to DFS pdev object.
274  * @is_ap_cac_timer_running: Pointer to save dfs_cac_timer_running value.
275  *
276  * Wrapper function for dfs_is_ap_cac_timer_running().
277  * This function called from outside of dfs component.
278  */
279 QDF_STATUS ucfg_dfs_is_ap_cac_timer_running(struct wlan_objmgr_pdev *pdev,
280 		int *is_ap_cac_timer_running);
281 
282 /**
283  * ucfg_dfs_getnol() - Wrapper function for dfs_get_nol()
284  * @pdev: Pointer to DFS pdev object.
285  * @dfs_nolinfo: Pointer to dfsreq_nolinfo structure.
286  *
287  * Wrapper function for dfs_getnol().
288  * This function called from outside of dfs component.
289  */
290 QDF_STATUS ucfg_dfs_getnol(struct wlan_objmgr_pdev *pdev, void *dfs_nolinfo);
291 
292 /**
293  * ucfg_dfs_override_cac_timeout() -  Override the default CAC timeout.
294  * @pdev: Pointer to DFS pdev object.
295  * @cac_timeout: CAC timeout value.
296  *
297  * Wrapper function for dfs_override_cac_timeout().
298  * This function called from outside of dfs component.
299  */
300 QDF_STATUS ucfg_dfs_override_cac_timeout(struct wlan_objmgr_pdev *pdev,
301 		int cac_timeout, int *status);
302 
303 /**
304  * ucfg_dfs_get_override_cac_timeout() -  Get override CAC timeout value.
305  * @pdev: Pointer to DFS pdev object.
306  * @cac_timeout: Pointer to save the CAC timeout value.
307  *
308  * Wrapper function for dfs_get_override_cac_timeout().
309  * This function called from outside of dfs component.
310  */
311 QDF_STATUS ucfg_dfs_get_override_cac_timeout(struct wlan_objmgr_pdev *pdev,
312 		int *cac_timeout, int *status);
313 
314 /**
315  * ucfg_dfs_get_override_precac_timeout() - Get precac timeout.
316  * @pdev: Pointer to DFS pdev object.
317  * @precac_timeout: Get precac timeout value in this variable.
318  *
319  * Wrapper function for dfs_get_override_precac_timeout().
320  * This function called from outside of dfs component.
321  */
322 QDF_STATUS ucfg_dfs_get_override_precac_timeout(struct wlan_objmgr_pdev *pdev,
323 		int *precac_timeout);
324 
325 /**
326  * ucfg_dfs_override_precac_timeout() - Override the default precac timeout.
327  * @pdev: Pointer to DFS pdev object.
328  * @precac_timeout: Precac timeout value.
329  *
330  * Wrapper function for dfs_override_precac_timeout().
331  * This function called from outside of dfs component.
332  */
333 QDF_STATUS ucfg_dfs_override_precac_timeout(struct wlan_objmgr_pdev *pdev,
334 		int precac_timeout);
335 
336 /**
337  * ucfg_dfs_set_precac_enable() - Set precac enable flag.
338  * @pdev: Pointer to DFS pdev object.
339  * @value: input value for dfs_legacy_precac_ucfg flag.
340  *
341  * Wrapper function for dfs_set_precac_enable().
342  * This function called from outside of dfs component.
343  */
344 QDF_STATUS ucfg_dfs_set_precac_enable(struct wlan_objmgr_pdev *pdev,
345 				      uint32_t value);
346 
347 /**
348  * ucfg_dfs_get_legacy_precac_enable() - Get the legacy precac enable flag.
349  * @pdev: Pointer to DFS pdev object.
350  * @buff: Pointer to save precac_enable value.
351  *
352  * Wrapper function for dfs_is_legacy_precac_enabled() and returns the
353  * legacy precac enable flag for partial offload chipsets.
354  * This function called from outside of dfs component.
355  */
356 QDF_STATUS ucfg_dfs_get_legacy_precac_enable(struct wlan_objmgr_pdev *pdev,
357 					     bool *buff);
358 
359 /**
360  * ucfg_dfs_get_agile_precac_enable() - Get agile precac enable flag.
361  * @pdev: Pointer to DFS pdev object.
362  * @buff: Pointer to save dfs_agile_precac_ucfg value.
363  *
364  * Wrapper function for dfs_is_legacy_precac_enabled().
365  * This function called from outside of dfs component.
366  *
367  * Return:
368  * * QDF_STATUS_SUCCESS: Successfully able to get agile precac flag.
369  * * QDF_STATUS_E_FAILURE: Failed to get agile precac flag.
370  */
371 QDF_STATUS ucfg_dfs_get_agile_precac_enable(struct wlan_objmgr_pdev *pdev,
372 					    bool *buff);
373 
374 #ifdef WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT
375 /**
376  * ucfg_dfs_set_precac_intermediate_chan() - Set intermediate channel
377  *                                           for preCAC.
378  * @pdev: Pointer to DFS pdev object.
379  * @value: Channel number of intermediate channel
380  *
381  * Wrapper function for dfs_set_precac_intermediate_chan().
382  * This function is called from outside of dfs component.
383  *
384  * Return:
385  * * QDF_STATUS_SUCCESS  : Successfully set intermediate channel.
386  * * QDF_STATUS_E_FAILURE: Failed to set intermediate channel.
387  */
388 QDF_STATUS ucfg_dfs_set_precac_intermediate_chan(struct wlan_objmgr_pdev *pdev,
389 						 uint32_t value);
390 
391 /**
392  * ucfg_dfs_get_precac_intermediate_chan() - Get intermediate channel
393  *						for preCAC.
394  * @pdev: Pointer to DFS pdev object.
395  * @buff: Pointer to Channel number of intermediate channel.
396  *
397  * Wrapper function for dfs_get_precac_intermediate_chan().
398  * This function is called from outside of dfs component.
399  *
400  * Return: Configured intermediate precac channel.
401  */
402 QDF_STATUS ucfg_dfs_get_precac_intermediate_chan(struct wlan_objmgr_pdev *pdev,
403 						 int *buff);
404 
405 /**
406  * ucfg_dfs_get_precac_chan_state() - Get precac status for the given channel.
407  * @pdev: Pointer to DFS pdev object.
408  * @precac_chan: Channel number for which precac state needs to be determined.
409  *
410  * Wrapper function for dfs_get_precac_chan_state().
411  * This function called from outside of dfs component.
412  *
413  * Return: Precac state of the given channel.
414  */
415 #ifdef CONFIG_CHAN_NUM_API
416 enum precac_chan_state
417 ucfg_dfs_get_precac_chan_state(struct wlan_objmgr_pdev *pdev,
418 			       uint8_t precac_chan);
419 #endif
420 
421 /**
422  * ucfg_dfs_get_precac_chan_state_for_freq() - Get precac status for the
423  * given channel.
424  * @pdev: Pointer to DFS pdev object.
425  * @precac_chan: Channel frequency for which precac state needs to be
426  *               determined.
427  *
428  * Wrapper function for dfs_get_precac_chan_state().
429  * This function called from outside of dfs component.
430  *
431  * Return: Precac state of the given channel.
432  */
433 #ifdef CONFIG_CHAN_FREQ_API
434 enum precac_chan_state
435 ucfg_dfs_get_precac_chan_state_for_freq(struct wlan_objmgr_pdev *pdev,
436 					uint16_t precac_freq);
437 #endif
438 
439 #endif
440 
441 #ifdef QCA_MCL_DFS_SUPPORT
442 /**
443  * ucfg_dfs_update_config() - Update DFS user config.
444  * @psoc: Pointer to psoc.
445  * @req: DFS user config.
446  *
447  * Return: QDF_STATUS
448  */
449 QDF_STATUS ucfg_dfs_update_config(struct wlan_objmgr_psoc *psoc,
450 		struct dfs_user_config *req);
451 #else
452 static inline QDF_STATUS ucfg_dfs_update_config(struct wlan_objmgr_psoc *psoc,
453 		struct dfs_user_config *req)
454 {
455 	return QDF_STATUS_SUCCESS;
456 }
457 #endif
458 
459 /**
460  * ucfg_dfs_set_override_status_timeout() - override the value of host dfs
461  * status wait timeout.
462  * @pdev: Pointer to DFS pdev object.
463  * @status_timeout: timeout value.
464  *
465  * Wrapper function for dfs_set_override_status_timeout().
466  * This function called from outside of dfs component.
467  *
468  * Return: QDF_STATUS
469  */
470 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
471 QDF_STATUS ucfg_dfs_set_override_status_timeout(struct wlan_objmgr_pdev *pdev,
472 					    int status_timeout);
473 #else
474 static inline
475 QDF_STATUS ucfg_dfs_set_override_status_timeout(struct wlan_objmgr_pdev *pdev,
476 					    int status_timeout)
477 {
478 	return QDF_STATUS_SUCCESS;
479 }
480 #endif
481 
482 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(WLAN_DFS_SYNTHETIC_RADAR)
483 /**
484  * ucfg_dfs_allow_hw_pulses() - Set or unset dfs-allow_hw_pulses
485  * which isolates synthetic radar pulse detection from actual radar detection.
486  * @pdev: Pointer to DFS pdev object.
487  * @allow_hw_pulses: Allow synthetic pulse detection true/false.
488  *
489  * Wrapper function for dfs_set_allow_hw_pulses().
490  * This function called from outside of dfs component.
491  *
492  * Return: void
493  */
494 void ucfg_dfs_allow_hw_pulses(struct wlan_objmgr_pdev *pdev,
495 			      bool allow_hw_pulses);
496 
497 /**
498  * ucfg_dfs_is_hw_pulses_allowed() - Check if actual radar detection is allowed
499  * or synthetic pulse detection is enabled.
500  * @pdev: Pointer to DFS pdev object.
501  *
502  * Wrapper function for dfs_is_hw_pulses_allowed().
503  * This function called from outside of dfs component.
504  *
505  * Return: bool
506  */
507 bool ucfg_dfs_is_hw_pulses_allowed(struct wlan_objmgr_pdev *pdev);
508 #else
509 static inline
510 void ucfg_dfs_allow_hw_pulses(struct wlan_objmgr_pdev *pdev,
511 			      bool allow_hw_pulses)
512 {
513 }
514 
515 static inline
516 bool ucfg_dfs_is_hw_pulses_allowed(struct wlan_objmgr_pdev *pdev)
517 {
518 	return true;
519 }
520 #endif
521 
522 /**
523  * ucfg_dfs_get_override_status_timeout() - Get the value of host dfs status
524  * wait timeout.
525  * @pdev: Pointer to DFS pdev object.
526  * @status_timeout: Pointer to save the timeout value.
527  *
528  * Wrapper function for dfs_get_override_status_timeout().
529  * This function called from outside of dfs component.
530  *
531  * Return: QDF_STATUS
532  */
533 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
534 QDF_STATUS ucfg_dfs_get_override_status_timeout(struct wlan_objmgr_pdev *pdev,
535 						int *status_timeout);
536 #else
537 static inline
538 QDF_STATUS ucfg_dfs_get_override_status_timeout(struct wlan_objmgr_pdev *pdev,
539 						int *status_timeout)
540 {
541 	return QDF_STATUS_SUCCESS;
542 }
543 #endif
544 
545 /**
546  * ucfg_dfs_set_nol_subchannel_marking() - Set or unset NOL subchannel marking.
547  * @pdev: Pointer to DFS pdev object.
548  * @nol_subchannel_marking: Set NOL subchannel marking based on this value.
549  *
550  * Wrapper function for dfs_set_nol_subchannel_marking().
551  * This function is called from outside of dfs component.
552  *
553  * Return: QDF_STATUS
554  */
555 QDF_STATUS ucfg_dfs_set_nol_subchannel_marking(struct wlan_objmgr_pdev *pdev,
556 					       bool nol_subchannel_marking);
557 
558 /**
559  * ucfg_dfs_get_nol_subchannel_marking() - Get the value of NOL subchannel
560  * marking.
561  * @pdev: Pointer to DFS pdev object.
562  * @nol_subchannel_marking: Store the value of  NOL subchannel marking.
563  *
564  * Wrapper function for dfs_get_nol_subchannel_marking().
565  * This function is called from outside of dfs component.
566  *
567  * Return: QDF_STATUS
568  */
569 QDF_STATUS ucfg_dfs_get_nol_subchannel_marking(struct wlan_objmgr_pdev *pdev,
570 					       bool *nol_subchannel_marking);
571 /**
572  * ucfg_dfs_reinit_timers() - Init DFS timers.
573  * @pdev: Pointer to wlan_objmgr_pdev structure.
574  *
575  * Wrapper function to reset CAC, NOL, DFS Test Timer and ZeroCAC Timer.
576  * This is invoked per pdev to reinitialize timers after HW Mode Switch is
577  * triggered.
578  */
579 QDF_STATUS ucfg_dfs_reinit_timers(struct wlan_objmgr_pdev *pdev);
580 
581 /**
582  * ucfg_dfs_reset_agile_config() - Reset ADFS config.
583  * @pdev: Pointer to wlan_objmgr_pdev structure.
584  *
585  * Wrapper function to reset Agile DFS config such as the variables which hold
586  * information about the state of the preCAC timer, active precac
587  * dfs index and OCAC status. It is invoked before HW Mode switch is triggered
588  * to ensure ADFS config is in a well known consistent state.
589  */
590 #ifdef QCA_SUPPORT_AGILE_DFS
591 QDF_STATUS ucfg_dfs_reset_agile_config(struct wlan_objmgr_psoc *psoc);
592 #else
593 static inline QDF_STATUS ucfg_dfs_reset_agile_config(struct wlan_objmgr_psoc
594 						    *psoc)
595 {
596 	return QDF_STATUS_SUCCESS;
597 }
598 #endif
599 #endif /* _WLAN_DFS_UCFG_API_H_ */
600