xref: /wlan-dirver/qca-wifi-host-cmn/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h (revision d94f0fb619d3da5ae22f9943f88d4634e2d28581)
1 /*
2  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
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: contains scan north bound interface api
22  */
23 
24 #ifndef _WLAN_SCAN_UCFG_API_H_
25 #define _WLAN_SCAN_UCFG_API_H_
26 
27 #include <scheduler_api.h>
28 #include <wlan_objmgr_psoc_obj.h>
29 #include <wlan_objmgr_pdev_obj.h>
30 #include <wlan_objmgr_vdev_obj.h>
31 #include <wlan_scan_public_structs.h>
32 #include "wlan_scan_api.h"
33 
34 /**
35  * ucfg_scan_register_requester() - Public ucfg API, assigns requester ID
36  * to caller and registers scan event call back handler
37  * @psoc:       psoc object
38  * @module_name:name of requester module
39  * @event_cb:   event callback function pointer
40  * @arg:        argument to @event_cb
41  *
42  * API, allows other components to allocate requester id.
43  * Normally used by modules at init time to register their callback
44  * and get one requester id. @event_cb will be invoked for
45  * all scan events whose requester id matches with @requester.
46  *
47  * Return: assigned non zero requester id for success
48  *         zero (0) for failure
49  */
50 static inline wlan_scan_requester
51 ucfg_scan_register_requester(struct wlan_objmgr_psoc *psoc,
52 	uint8_t *module_name, scan_event_handler event_cb, void *arg)
53 {
54 	return wlan_scan_register_requester(psoc, module_name, event_cb, arg);
55 }
56 
57 /**
58  * ucfg_scan_unregister_requester() -Public ucfg API, reclaims previously
59  * allocated requester ID
60  * @psoc:       psoc object
61  * @requester:  requester ID to reclaim.
62  *
63  * API, reclaims previously allocated requester id.
64  *
65  * Return: void
66  */
67 static inline
68 void ucfg_scan_unregister_requester(struct wlan_objmgr_psoc *psoc,
69 	wlan_scan_requester requester)
70 {
71 	return wlan_scan_unregister_requester(psoc, requester);
72 }
73 
74 /**
75  * ucfg_get_scan_requester_name()- returns module name of requester ID owner
76  * @psoc:       psoc object
77  * @requester:  requester ID
78  *
79  * API, returns module name of requester id owner
80  *
81  * Return: pointer to module name or "unknown" if requester id not found.
82  */
83 uint8_t *ucfg_get_scan_requester_name(struct wlan_objmgr_psoc *psoc,
84 	wlan_scan_requester requester);
85 
86 /**
87  * ucfg_scan_get_scan_id() - Public ucfg API to allocate scan ID
88  * @psoc: psoc object
89  *
90  * Public ucfg API, allocates a new scan id for caller
91  *
92  * Return: newly allocated scan ID
93  */
94 static inline
95 wlan_scan_id ucfg_scan_get_scan_id(struct wlan_objmgr_psoc *psoc)
96 {
97 	return wlan_scan_get_scan_id(psoc);
98 }
99 
100 #ifdef FEATURE_WLAN_SCAN_PNO
101 /**
102  * ucfg_scan_pno_start() - Public API to start PNO
103  * @vdev: vdev pointer
104  * @req: pno req params
105  *
106  * Return: 0 for success or error code.
107  */
108 QDF_STATUS ucfg_scan_pno_start(struct wlan_objmgr_vdev *vdev,
109 			       struct pno_scan_req_params *req);
110 
111 /**
112  * ucfg_scan_pno_add_all_valid_6g_channels() - This API to update all valid 6g
113  * channels to pno scan request
114  * @vdev: vdev pointer
115  * @req: pno req params
116  * @num_scan_ch: total number of channels present in pno scan request
117  *
118  * Return: None
119  */
120 void ucfg_scan_pno_add_all_valid_6g_channels(struct wlan_objmgr_vdev *vdev,
121 					     struct pno_scan_req_params *req,
122 					     uint8_t *num_scan_ch);
123 
124 /**
125  * ucfg_is_6ghz_pno_scan_optimization_supported() - Public API to check
126  * 6ghz pno scan optimization supported in fw
127  * @psoc: psoc object
128  *
129  * Return: 0 for success.
130  */
131 bool
132 ucfg_is_6ghz_pno_scan_optimization_supported(struct wlan_objmgr_psoc *psoc);
133 
134 /**
135  * ucfg_scan_pno_stop() - Public API to stop PNO
136  * @vdev: vdev pointer
137  * @req: pno req params
138  *
139  * Return: 0 for success or error code.
140  */
141 QDF_STATUS ucfg_scan_pno_stop(struct wlan_objmgr_vdev *vdev);
142 
143 /**
144  * ucfg_scan_get_pno_in_progress() - Public API to check if pno is in progress
145  * @vdev: vdev pointer
146  *
147  * Return: true if pno in progress else false.
148  */
149 bool ucfg_scan_get_pno_in_progress(struct wlan_objmgr_vdev *vdev);
150 
151 /**
152  * ucfg_scan_get_pno_match() - Public API to check if pno matched
153  * @vdev: vdev pointer
154  *
155  * Return: true if pno matched else false.
156  */
157 bool ucfg_scan_get_pno_match(struct wlan_objmgr_vdev *vdev);
158 
159 /**
160  * ucfg_scan_register_pno_cb() - register pno cb
161  * @psoc: psoc object
162  * @event_cb: callback function pointer
163  * @arg: argument to @event_cb
164  *
165  * Return: QDF_STATUS
166  */
167 QDF_STATUS
168 ucfg_scan_register_pno_cb(struct wlan_objmgr_psoc *psoc,
169 	scan_event_handler event_cb, void *arg);
170 
171 /**
172  * ucfg_scan_get_pno_def_params() - get the defaults pno params
173  * @vdev: vdev object
174  * @req: pno request object
175  *
176  * Return: QDF_STATUS_SUCCESS or error code
177  */
178 QDF_STATUS
179 ucfg_scan_get_pno_def_params(struct wlan_objmgr_vdev *vdev,
180 	struct pno_scan_req_params *req);
181 
182 #else
183 
184 static inline bool
185 ucfg_scan_get_pno_in_progress(struct wlan_objmgr_vdev *vdev)
186 {
187 	return false;
188 }
189 
190 static inline bool
191 ucfg_scan_get_pno_match(struct wlan_objmgr_vdev *vdev)
192 {
193 	return false;
194 }
195 #endif /* FEATURE_WLAN_SCAN_PNO */
196 /**
197  * ucfg_scm_scan_free_scan_request_mem() - Free scan request memory
198  * @req: scan_start_request object
199  *
200  * Return: QDF_STATUS
201  */
202 QDF_STATUS ucfg_scm_scan_free_scan_request_mem(struct scan_start_request *req);
203 
204 /**
205  * ucfg_scan_start() - ucfg Public API to start a scan
206  * @req: start scan req params
207  *
208  * The ucfg public API to start a scan. Post a msg to target_if queue
209  *
210  * Return: QDF_STATUS
211  */
212 static inline QDF_STATUS ucfg_scan_start(struct scan_start_request *req)
213 {
214 	return wlan_scan_start(req);
215 }
216 
217 /**
218  * ucfg_scan_set_psoc_enable() - Public API to enable scans for psoc
219  * @psoc: psoc on which scans need to be disabled
220  * @reason: reason for enable/disabled
221  *
222  * Return: QDF_STATUS.
223  */
224 QDF_STATUS ucfg_scan_psoc_set_enable(struct wlan_objmgr_psoc *psoc,
225 				     enum scan_disable_reason reason);
226 
227 /**
228  * ucfg_scan_psoc_set_disable() - Public API to disable scans for psoc
229  * @psoc: psoc on which scans need to be disabled
230  * @reason: reason for enable/disabled
231  *
232  * Return: QDF_STATUS.
233  */
234 QDF_STATUS ucfg_scan_psoc_set_disable(struct wlan_objmgr_psoc *psoc,
235 				      enum scan_disable_reason reason);
236 
237 /**
238  * ucfg_scan_vdev_set_enable() - Public API to enable scans for vdev
239  * @psoc: psoc on which scans need to be disabled
240  * @reason: reason for enable/disabled
241  *
242  * Return: QDF_STATUS.
243  */
244 QDF_STATUS ucfg_scan_vdev_set_enable(struct wlan_objmgr_vdev *vdev,
245 				     enum scan_disable_reason reason);
246 
247 /**
248  * ucfg_scan_vdev_set_disable() - Public API to disable scans for vdev
249  * @psoc: psoc on which scans need to be disabled
250  * @reason: reason for enable/disabled
251  *
252  * Return: QDF_STATUS.
253  */
254 QDF_STATUS ucfg_scan_vdev_set_disable(struct wlan_objmgr_vdev *vdev,
255 				      enum scan_disable_reason reason);
256 
257 
258 
259 /**
260  * ucfg_scan_set_miracast() - Public API to disable/enable miracast flag
261  * @psoc: psoc pointer
262  * @enable: enable miracast if true disable is false
263  *
264  * Return: QDF_STATUS.
265  */
266 QDF_STATUS ucfg_scan_set_miracast(
267 		struct wlan_objmgr_psoc *psoc, bool enable);
268 
269 /**
270  * ucfg_scan_set_global_config() - Public API to set global scan config
271  * @psoc: psoc context
272  * @config: config to set
273  * @val: new config value
274  *
275  * Return: QDF_STATUS.
276  */
277 QDF_STATUS
278 ucfg_scan_set_global_config(struct wlan_objmgr_psoc *psoc,
279 		enum scan_config config, uint32_t val);
280 
281 /**
282  * ucfg_scan_get_global_config() - Public API to get global scan config
283  * @psoc: psoc context
284  * @config: config to set
285  * @val: uint32* to hold returned config value
286  *
287  * Return: QDF_STATUS.
288  */
289 QDF_STATUS
290 ucfg_scan_get_global_config(struct wlan_objmgr_psoc *psoc,
291 		enum scan_config config, uint32_t *val);
292 
293 /**
294  * ucfg_scan_set_obss_scan_offload() - Public API to set obss scan flag
295  * @psoc: psoc context
296  * @val: the value to be set
297  *
298  * Return: void.
299  */
300 void ucfg_scan_set_obss_scan_offload(struct wlan_objmgr_psoc *psoc, bool value);
301 
302 /**
303  * ucfg_scan_set_wide_band_scan() - Public API to disable/enable wide band scan
304  * @pdev: psoc on which scans need to be disabled
305  * @enable: enable wide band scan if @enable is true, disable otherwise
306  *
307  * Return: QDF_STATUS.
308  */
309 QDF_STATUS ucfg_scan_set_wide_band_scan(
310 		struct wlan_objmgr_pdev *pdev, bool enable);
311 
312 /**
313  * ucfg_scan_get_wide_band_scan() - Public API to check if
314  * wide band scan is enabled or disabled
315  * @pdev: psoc on which scans status need to be checked
316  *
317  * Return: true if enabled else false.
318  */
319 bool ucfg_scan_get_wide_band_scan(struct wlan_objmgr_pdev *pdev);
320 
321 /**
322  * ucfg_scan_set_custom_scan_chan_list() - Public API to restrict scan
323  * to few pre configured channels
324  * @pdev: psoc on which scans need to be disabled
325  * @chan_list: list of channels to scan if set
326  *
327  * Return: QDF_STATUS.
328  */
329 QDF_STATUS ucfg_scan_set_custom_scan_chan_list(
330 		struct wlan_objmgr_pdev *pdev, struct chan_list *chan_list);
331 /**
332  * ucfg_scan_set_ssid_bssid_hidden_ssid_beacon() - API to configure
333  * ssid, bssid of hidden beacon
334  * @pdev: psoc on which ssid bssid need to configure
335  * @bssid: bssid of the hidden AP
336  * @ssid: desired ssid
337  *
338  * Return: QDF_STATUS.
339  */
340 #ifdef WLAN_DFS_CHAN_HIDDEN_SSID
341 QDF_STATUS
342 ucfg_scan_config_hidden_ssid_for_bssid(struct wlan_objmgr_pdev *pdev,
343 				       uint8_t *bssid,
344 				       struct wlan_ssid *ssid);
345 #else
346 static inline QDF_STATUS
347 ucfg_scan_config_hidden_ssid_for_bssid(struct wlan_objmgr_pdev *pdev,
348 				       uint8_t *bssid,
349 				       struct wlan_ssid *ssid)
350 {
351 	return QDF_STATUS_SUCCESS;
352 }
353 #endif /* WLAN_DFS_CHAN_HIDDEN_SSID */
354 
355 /**
356  * ucfg_scan_cancel() - ucfg Public API to cancel the scan
357  * @req: stop scan request params
358  *
359  * The ucfg public API to stop a scan. Post a msg to target_if queue
360  *
361  * Return: QDF_STATUS.
362  */
363 static inline QDF_STATUS ucfg_scan_cancel(struct scan_cancel_request *req)
364 {
365 	return wlan_scan_cancel(req);
366 }
367 
368 /**
369  * ucfg_scan_cancel_sync() - Public API to stop a scan and wait
370  * till all scan are completed
371  * @req: stop scan request params
372  *
373  * The Public API to stop a scan and wait
374  * till all scan are completed
375  *
376  * Return: 0 for success or error code.
377  */
378 QDF_STATUS
379 ucfg_scan_cancel_sync(struct scan_cancel_request *req);
380 
381 /**
382  * ucfg_scan_get_result() - The Public API to get scan results
383  * @pdev: pdev info
384  * @filter: Filters
385  *
386  * This function fetches scan result
387  *
388  * Return: scan list pointer
389  */
390 qdf_list_t *ucfg_scan_get_result(struct wlan_objmgr_pdev *pdev,
391 	struct scan_filter *filter);
392 
393 /**
394  * ucfg_scan_purge_results() - purge the scan list
395  * @scan_list: scan list to be purged
396  *
397  * This function purge the temp scan list
398  *
399  * Return: QDF_STATUS
400  */
401 QDF_STATUS ucfg_scan_purge_results(qdf_list_t *scan_list);
402 
403 /**
404  * ucfg_scan_flush_results() - The Public API to flush scan result
405  * @pdev: pdev object
406  * @filter: filter to flush the scan entries
407  *
408  * The Public API to flush scan result.
409  *
410  * Return: 0 for success or error code.
411  */
412 QDF_STATUS ucfg_scan_flush_results(struct wlan_objmgr_pdev *pdev,
413 	struct scan_filter *filter);
414 
415 /**
416  * ucfg_scan_filter_valid_channel() - The Public API to filter scan result
417  * based on valid channel list
418  * @pdev: pdev object
419  * @chan_freq_list: valid channel frequency (in MHz) list
420  * @num_chan: number of valid channels
421  *
422  * The Public API to to filter scan result
423  * based on valid channel list.
424  *
425  * Return: void.
426  */
427 void ucfg_scan_filter_valid_channel(struct wlan_objmgr_pdev *pdev,
428 	uint32_t *chan_freq_list, uint32_t num_chan);
429 
430 /**
431  * ucfg_scan_db_iterate() - function to iterate scan table
432  * @pdev: pdev object
433  * @func: iterator function pointer
434  * @arg: argument to be passed to func()
435  *
436  * API, this API iterates scan table and invokes func
437  * on each scan enetry by passing scan entry and arg.
438  *
439  * Return: QDF_STATUS
440  */
441 QDF_STATUS
442 ucfg_scan_db_iterate(struct wlan_objmgr_pdev *pdev,
443 	scan_iterator_func func, void *arg);
444 
445 /**
446  * ucfg_scan_update_mlme_by_bssinfo() - The Public API to update mlme
447  * info in the scan entry
448  * @pdev: pdev object
449  * @bssid: bssid info to find the matching scan entry
450  * @mlme_info: mlme info to be updated.
451  *
452  * The Public API to update mlme info in the scan entry.
453  * Post a msg to target_if queue
454  *
455  * Return: 0 for success or error code.
456  */
457 QDF_STATUS
458 ucfg_scan_update_mlme_by_bssinfo(struct wlan_objmgr_pdev *pdev,
459 	struct bss_info *bss_info,
460 	struct mlme_info *mlme_info);
461 
462 /**
463  * ucfg_scan_register_event_handler() - The Public API to register
464  * an event cb handler
465  * @pdev: pdev object
466  * @event_cb: callback function to register
467  * @arg: component specific priv argument to @event_cb callback function
468  *
469  * The Public API to register a event cb handler. This cb is called whenever
470  * any scan event is received on @pdev.
471  *
472  * Return: 0 for success or error code.
473  */
474 
475 QDF_STATUS
476 ucfg_scan_register_event_handler(struct wlan_objmgr_pdev *pdev,
477 	scan_event_handler event_cb, void *arg);
478 
479 /**
480  * ucfg_scan_unregister_event_handler() - Public API to unregister
481  * event cb handler
482  * @pdev: pdev object
483  * @event_cb: callback function to unregister
484  * @arg: component specific priv argument to @event_cb callback function
485  *
486  * Unregister a event cb handler. cb and arg will be used to
487  * find the calback.
488  *
489  * Return: void
490  */
491 
492 void
493 ucfg_scan_unregister_event_handler(struct wlan_objmgr_pdev *pdev,
494 	scan_event_handler event_cb, void *arg);
495 
496 /**
497  * ucfg_scan_init_default_params() - Public ucfg API to initialize scan params
498  * @vdev: vdev object
499  * @req: scan request object
500  *
501  * Public ucfg API to initialize scan start request with defaults scan params
502  *
503  * Return: QDF_STATUS_SUCCESS or error code
504  */
505 static inline QDF_STATUS
506 ucfg_scan_init_default_params(struct wlan_objmgr_vdev *vdev,
507 	struct scan_start_request *req)
508 {
509 	return wlan_scan_init_default_params(vdev, req);
510 }
511 
512 /**
513  * ucfg_scan_init_ssid_params() - initialize scan request ssid list
514  *
515  * @scan_req: scan request object
516  * @num_ssid: number of ssid's in ssid list
517  * @ssid_list: ssid list
518  *
519  * Return: QDF_STATUS_SUCCESS for success or error code
520  */
521 QDF_STATUS
522 ucfg_scan_init_ssid_params(struct scan_start_request *scan_req,
523 	uint32_t num_ssid, struct wlan_ssid *ssid_list);
524 
525 /**
526  * ucfg_scan_init_bssid_params() - initialize scan request bssid list
527  * @scan_req: scan request object
528  * @num_ssid: number of bssid's in bssid list
529  * @bssid_list: bssid list
530  *
531  * Return: QDF_STATUS_SUCCESS for success or error code
532  */
533 QDF_STATUS
534 ucfg_scan_init_bssid_params(struct scan_start_request *scan_req,
535 	uint32_t num_ssid, struct qdf_mac_addr *bssid_list);
536 
537 /**
538  * ucfg_scan_init_chanlist_params() - initialize scan request channel list
539  * @scan_req: scan request object
540  * @num_chans: number of channels in channel list
541  * @chan_list: channel list
542  * @phymode: phymode in which scan shall be done
543  *
544  * Return: QDF_STATUS_SUCCESS for success or error code
545  */
546 QDF_STATUS
547 ucfg_scan_init_chanlist_params(struct scan_start_request *scan_req,
548 	uint32_t num_chans, uint32_t *chan_list, uint32_t *phymode);
549 
550 /**
551  * ucfg_scan_get_vdev_status() - API to check vdev scan status
552  * @vdev: vdev object
553  *
554  * Return: enum scm_scan_status
555  */
556 enum scm_scan_status
557 ucfg_scan_get_vdev_status(struct wlan_objmgr_vdev *vdev);
558 
559 /**
560  * ucfg_scan_get_pdev_status() - API to check pdev scan status
561  * @pdev: pdev object
562  *
563  * Return: enum scm_scan_status
564  */
565 enum scm_scan_status
566 ucfg_scan_get_pdev_status(struct wlan_objmgr_pdev *pdev);
567 
568 /**
569  * ucfg_scan_register_bcn_cb() - API to register api
570  * to inform/update bcn/probe as soon as they are received
571  * @pdev: psoc
572  * @cb: callback to be registered
573  * @type: Type of callback to be registered
574  *
575  * Return: enum scm_scan_status
576  */
577 QDF_STATUS ucfg_scan_register_bcn_cb(struct wlan_objmgr_psoc *psoc,
578 	update_beacon_cb cb, enum scan_cb_type type);
579 
580 /*
581  * ucfg_scan_update_user_config() - Update scan cache user config
582  * @psoc: psoc
583  * @scan_cfg: scan user config
584  *
585  * Return: QDF_STATUS
586  */
587 QDF_STATUS ucfg_scan_update_user_config(struct wlan_objmgr_psoc *psoc,
588 	struct scan_user_cfg *scan_cfg);
589 
590 /*
591  * ucfg_scan_init() - Scan module initialization API
592  *
593  * Return: QDF_STATUS
594  */
595 QDF_STATUS ucfg_scan_init(void);
596 
597 /**
598  * ucfg_scan_deinit() - Scan module deinitialization API
599  *
600  * Return: QDF_STATUS
601  */
602 QDF_STATUS ucfg_scan_deinit(void);
603 
604 /**
605  * ucfg_scan_psoc_enable() - Scan module enable API
606  * @psoc: psoc object
607  *
608  * Return: QDF_STATUS
609  */
610 QDF_STATUS ucfg_scan_psoc_enable(struct wlan_objmgr_psoc *psoc);
611 
612 /**
613  * ucfg_scan_psoc_enable() - Scan module disable API
614  * @psoc: psoc object
615  *
616  * Return: QDF_STATUS
617  */
618 QDF_STATUS ucfg_scan_psoc_disable(struct wlan_objmgr_psoc *psoc);
619 
620 /**
621  * ucfg_scan_psoc_open() - Scan module psoc open API
622  * @psoc: psoc object
623  *
624  * Return: QDF_STATUS
625  */
626 QDF_STATUS ucfg_scan_psoc_open(struct wlan_objmgr_psoc *psoc);
627 
628 /**
629  * ucfg_scan_psoc_close() - Scan module psoc close API
630  * @psoc: psoc object
631  *
632  * Return: QDF_STATUS
633  */
634 QDF_STATUS ucfg_scan_psoc_close(struct wlan_objmgr_psoc *psoc);
635 
636 /**
637  * ucfg_scan_get_max_active_scans() - API to get max active scans
638  * supported on this psoc
639  * @psoc: psoc object
640  *
641  * Return: uint32_t
642  */
643 uint32_t ucfg_scan_get_max_active_scans(struct wlan_objmgr_psoc *psoc);
644 
645 /**
646  * ucfg_ie_allowlist_enabled() - Checks for IE allowlisting enable
647  * @psoc: pointer to psoc object
648  * @vdev: pointer to vdev
649  *
650  * This function is used to check whether IE allowlisting is enabled or not
651  *
652  * Return: If enabled returns true else returns false
653  */
654 bool ucfg_ie_allowlist_enabled(struct wlan_objmgr_psoc *psoc,
655 			       struct wlan_objmgr_vdev *vdev);
656 
657 /**
658  * ucfg_copy_ie_allowlist_attrs() - Populate probe req IE allowlist attrs
659  * @psoc: pointer to psoc object
660  * @ie_allowlist: output parameter to hold ie allowlist attrs
661  *
662  * If IE allowlisting is enabled then invoke this function to copy
663  * IE allowlisting attrs from wlan scan object
664  *
665  * Return: true - successful copy
666  *         false - copy failed
667  */
668 bool
669 ucfg_copy_ie_allowlist_attrs(struct wlan_objmgr_psoc *psoc,
670 			     struct probe_req_allowlist_attr *ie_allowlist);
671 
672 /**
673  * ucfg_scan_set_bt_activity() - API to set bt activity
674  * @psoc: pointer to psoc object
675  * @bt_a2dp_active: bt activiy value
676  *
677  * Return: None
678  */
679 void ucfg_scan_set_bt_activity(struct wlan_objmgr_psoc *psoc,
680 			       bool bt_a2dp_active);
681 /**
682  * ucfg_scan_get_bt_activity() - API to get bt activity
683  * @psoc: pointer to psoc object
684  *
685  * Return: true if enabled else false.
686  */
687 bool ucfg_scan_get_bt_activity(struct wlan_objmgr_psoc *psoc);
688 
689 /**
690  * ucfg_scan_is_mac_spoofing_enabled() - API to check if mac spoofing is enabled
691  * @psoc: pointer to psoc object
692  *
693  * Return: true if enabled else false.
694  */
695 bool ucfg_scan_is_mac_spoofing_enabled(struct wlan_objmgr_psoc *psoc);
696 
697 /**
698  * ucfg_scan_get_extscan_adaptive_dwell_mode() - API to get the adaptive dwell
699  * mode during ext scan
700  * @psoc: pointer to psoc object
701  *
702  * Return: value of type enum scan_dwelltime_adaptive_mode
703  */
704 enum scan_dwelltime_adaptive_mode
705 ucfg_scan_get_extscan_adaptive_dwell_mode(struct wlan_objmgr_psoc *psoc);
706 
707 /**
708  * ucfg_scan_cfg_set_active_dwelltime() - API to set scan active dwelltime
709  * @psoc: pointer to psoc object
710  * @dwell_time: scan active dwell time
711  *
712  * Return: none
713  */
714 static inline
715 void ucfg_scan_cfg_set_active_dwelltime(struct wlan_objmgr_psoc *psoc,
716 					uint32_t dwell_time)
717 {
718 	return wlan_scan_cfg_set_active_dwelltime(psoc, dwell_time);
719 }
720 
721 /**
722  * ucfg_scan_cfg_set_active_2g_dwelltime() - API to set scan active 2g dwelltime
723  * @psoc: pointer to psoc object
724  * @dwell_time: scan active dwell time
725  *
726  * Return: none
727  */
728 static inline
729 void ucfg_scan_cfg_set_active_2g_dwelltime(struct wlan_objmgr_psoc *psoc,
730 					   uint32_t dwell_time)
731 {
732 	return wlan_scan_cfg_set_active_2g_dwelltime(psoc, dwell_time);
733 }
734 
735 /**
736  * ucfg_scan_cfg_get_active_dwelltime() - API to get active dwelltime
737  * @psoc: pointer to psoc object
738  * @dwell_time: scan active dwelltime
739  *
740  * Return: scan active dwell time
741  */
742 static inline
743 void ucfg_scan_cfg_get_active_dwelltime(struct wlan_objmgr_psoc *psoc,
744 					uint32_t *dwell_time)
745 {
746 	return wlan_scan_cfg_get_active_dwelltime(psoc, dwell_time);
747 }
748 
749 /**
750  * ucfg_scan_cfg_set_passive_dwelltime() - API to set scan passive dwelltime
751  * @psoc: pointer to psoc object
752  * @dwell_time: scan passive dwell time
753  *
754  * Return: none
755  */
756 static inline
757 void ucfg_scan_cfg_set_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
758 					 uint32_t dwell_time)
759 {
760 	return wlan_scan_cfg_set_passive_dwelltime(psoc, dwell_time);
761 }
762 /**
763  * ucfg_scan_cfg_get_passive_dwelltime() - API to get passive dwelltime
764  * @psoc: pointer to psoc object
765  * @dwell_time: scan passive dwelltime
766  *
767  * Return: scan passive dwell time
768  */
769 static inline
770 void ucfg_scan_cfg_get_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
771 					 uint32_t *dwell_time)
772 {
773 	return wlan_scan_cfg_get_passive_dwelltime(psoc, dwell_time);
774 }
775 
776 /**
777  * ucfg_scan_cfg_get_active_2g_dwelltime() - API to get active 2g dwelltime
778  * @psoc: pointer to psoc object
779  * @dwell_time: scan active 2g dwelltime
780  *
781  * Return: scan active 2g dwelltime
782  */
783 static inline
784 void ucfg_scan_cfg_get_active_2g_dwelltime(struct wlan_objmgr_psoc *psoc,
785 					   uint32_t *dwell_time)
786 {
787 	return wlan_scan_cfg_get_active_2g_dwelltime(psoc, dwell_time);
788 }
789 
790 #ifdef CONFIG_BAND_6GHZ
791 /**
792  * ucfg_scan_cfg_set_active_6g_dwelltime() - API to set scan active 6g dwelltime
793  * @psoc: pointer to psoc object
794  * @dwell_time: scan active dwell time
795  *
796  * Return: QDF_STATUS
797  */
798 static inline
799 QDF_STATUS ucfg_scan_cfg_set_active_6g_dwelltime(struct wlan_objmgr_psoc *psoc,
800 						 uint32_t dwell_time)
801 {
802 	return wlan_scan_cfg_set_active_6g_dwelltime(psoc, dwell_time);
803 }
804 
805 /**
806  * ucfg_scan_cfg_get_passive_6g_dwelltime() - API to get passive 6g dwelltime
807  * @psoc: pointer to psoc object
808  * @dwell_time: scan passive 6g dwelltime
809  *
810  * Return: QDF_STATUS
811  */
812 static inline
813 QDF_STATUS ucfg_scan_cfg_get_passive_6g_dwelltime(struct wlan_objmgr_psoc *psoc,
814 						  uint32_t *dwell_time)
815 {
816 	return wlan_scan_cfg_get_passive_6g_dwelltime(psoc, dwell_time);
817 }
818 
819 /**
820  * ucfg_scan_cfg_set_passive_6g_dwelltime() - API to set scan passive 6g
821  *                                            dwelltime
822  * @psoc: pointer to psoc object
823  * @dwell_time: scan passive dwell time
824  *
825  * Return: QDF_STATUS
826  */
827 static inline
828 QDF_STATUS ucfg_scan_cfg_set_passive_6g_dwelltime(struct wlan_objmgr_psoc *psoc,
829 						  uint32_t dwell_time)
830 {
831 	return wlan_scan_cfg_set_passive_6g_dwelltime(psoc, dwell_time);
832 }
833 
834 /**
835  * ucfg_scan_cfg_get_active_6g_dwelltime() - API to get active 6g dwelltime
836  * @psoc: pointer to psoc object
837  * @dwell_time: scan active 6g dwelltime
838  *
839  * Return: QDF_STATUS
840  */
841 static inline
842 QDF_STATUS ucfg_scan_cfg_get_active_6g_dwelltime(struct wlan_objmgr_psoc *psoc,
843 						 uint32_t *dwell_time)
844 {
845 	return wlan_scan_cfg_get_active_6g_dwelltime(psoc, dwell_time);
846 }
847 #endif
848 
849 /**
850  * ucfg_scan_cfg_get_conc_active_dwelltime() - Get concurrent active dwelltime
851  * @psoc: pointer to psoc object
852  * @dwell_time: scan active dwelltime
853  *
854  * Return: scan concurrent active dwell time
855  */
856 static inline
857 void ucfg_scan_cfg_get_conc_active_dwelltime(struct wlan_objmgr_psoc *psoc,
858 					     uint32_t *dwell_time)
859 {
860 	return wlan_scan_cfg_get_conc_active_dwelltime(psoc, dwell_time);
861 }
862 
863 /**
864  * ucfg_scan_cfg_set_conc_active_dwelltime() - Set concurrent active dwelltime
865  * @psoc: pointer to psoc object
866  * @dwell_time: scan active dwelltime
867  *
868  * Return: scan concurrent active dwell time
869  */
870 static inline
871 void ucfg_scan_cfg_set_conc_active_dwelltime(struct wlan_objmgr_psoc *psoc,
872 					     uint32_t dwell_time)
873 {
874 	return wlan_scan_cfg_set_conc_active_dwelltime(psoc, dwell_time);
875 }
876 
877 /**
878  * ucfg_scan_cfg_get_conc_passive_dwelltime() - Get passive concurrent dwelltime
879  * @psoc: pointer to psoc object
880  * @dwell_time: scan passive dwelltime
881  *
882  * Return: scan concurrent passive dwell time
883  */
884 static inline
885 void ucfg_scan_cfg_get_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
886 					      uint32_t *dwell_time)
887 {
888 	return wlan_scan_cfg_get_conc_passive_dwelltime(psoc, dwell_time);
889 }
890 
891 /**
892  * ucfg_scan_cfg_set_conc_passive_dwelltime() - Set passive concurrent dwelltime
893  * @psoc: pointer to psoc object
894  * @dwell_time: scan passive dwelltime
895  *
896  * Return: scan concurrent passive dwell time
897  */
898 static inline
899 void ucfg_scan_cfg_set_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
900 					      uint32_t dwell_time)
901 {
902 	return wlan_scan_cfg_set_conc_passive_dwelltime(psoc, dwell_time);
903 }
904 
905 /**
906  * ucfg_scan_cfg_get_dfs_chan_scan_allowed() - API to get dfs scan enabled
907  * @psoc: pointer to psoc object
908  * @enable_dfs_scan: DFS scan enabled or not.
909  *
910  * Return: None
911  */
912 static inline
913 void ucfg_scan_cfg_get_dfs_chan_scan_allowed(struct wlan_objmgr_psoc *psoc,
914 					     bool *dfs_scan_enable)
915 {
916 	return wlan_scan_cfg_get_dfs_chan_scan_allowed(psoc, dfs_scan_enable);
917 }
918 
919 /**
920  * ucfg_scan_cfg_set_dfs_channel_scan() - API to set dfs scan enabled
921  * @psoc: pointer to psoc object
922  * @enable_dfs_scan: Set DFS scan enabled or not.
923  *
924  * Return: None
925  */
926 static inline
927 void ucfg_scan_cfg_set_dfs_chan_scan_allowed(struct wlan_objmgr_psoc *psoc,
928 					     bool dfs_scan_enable)
929 {
930 	return wlan_scan_cfg_set_dfs_chan_scan_allowed(psoc, dfs_scan_enable);
931 }
932 
933 /**
934  * ucfg_scan_wake_lock_in_user_scan() - API to determine if wake lock in user
935  * scan is used.
936  * @psoc: pointer to psoc object
937  *
938  * Return: true if wake lock in user scan is required
939  */
940 bool ucfg_scan_wake_lock_in_user_scan(struct wlan_objmgr_psoc *psoc);
941 
942 /**
943  * ucfg_scan_cfg_honour_nl_scan_policy_flags() - API to get nl scan policy
944  * flags honoured.
945  * @psoc: pointer to psoc object
946  *
947  * Return: nl scan flags is honoured or not
948  */
949 static inline
950 bool ucfg_scan_cfg_honour_nl_scan_policy_flags(struct wlan_objmgr_psoc *psoc)
951 {
952 	return wlan_scan_cfg_honour_nl_scan_policy_flags(psoc);
953 }
954 
955 /**
956  * ucfg_scan_cfg_get_conc_max_resttime() - API to get max rest time
957  * @psoc: pointer to psoc object
958  * @rest_time: scan concurrent max resttime
959  *
960  * Return: scan concurrent max rest time
961  */
962 static inline
963 void ucfg_scan_cfg_get_conc_max_resttime(struct wlan_objmgr_psoc *psoc,
964 					 uint32_t *rest_time)
965 {
966 	return wlan_scan_cfg_get_conc_max_resttime(psoc, rest_time);
967 }
968 
969 /**
970  * ucfg_scan_cfg_get_conc_min_resttime() - API to get concurrent min rest time
971  * @psoc: pointer to psoc object
972  * @rest_time: scan concurrent min rest time
973  *
974  * Return: scan concurrent min rest time
975  */
976 static inline
977 void ucfg_scan_cfg_get_conc_min_resttime(struct wlan_objmgr_psoc *psoc,
978 					 uint32_t *rest_time)
979 {
980 	return wlan_scan_cfg_get_conc_min_resttime(psoc, rest_time);
981 }
982 
983 #ifdef FEATURE_WLAN_SCAN_PNO
984 /**
985  * ucfg_scan_is_pno_offload_enabled() - Check if pno offload is enabled
986  * @psoc: pointer to psoc object
987  *
988  * Return: pno_offload_enabled flag
989  */
990 bool ucfg_scan_is_pno_offload_enabled(struct wlan_objmgr_psoc *psoc);
991 
992 /**
993  * ucfg_scan_set_pno_offload() - API to set pno offload flag based on the
994  * capability received from the firmware.
995  * @psoc: pointer to psoc object
996  * @rest_time: scan concurrent min rest time
997  *
998  * Return: scan concurrent min rest time
999  */
1000 void ucfg_scan_set_pno_offload(struct wlan_objmgr_psoc *psoc, bool value);
1001 
1002 /**
1003  * ucfg_scan_get_pno_scan_support() - Check if pno scan support is enabled
1004  * @psoc: pointer to psoc object
1005  *
1006  * Return: scan_support_enabled flag
1007  */
1008 bool ucfg_scan_get_pno_scan_support(struct wlan_objmgr_psoc *psoc);
1009 
1010 /**
1011  * ucfg_get_scan_backoff_multiplier() - get scan backoff multiplier value
1012  * @psoc: pointer to psoc object
1013  *
1014  * Return: scan_support_enabled flag
1015  */
1016 uint8_t ucfg_get_scan_backoff_multiplier(struct wlan_objmgr_psoc *psoc);
1017 
1018 /**
1019  * ucfg_scan_is_dfs_chnl_scan_enabled() - Check if PNO dfs channel scan support
1020  * is enabled
1021  * @psoc: pointer to psoc object
1022  *
1023  * Return: dfs_chnl_scan_enabled flag
1024  */
1025 bool ucfg_scan_is_dfs_chnl_scan_enabled(struct wlan_objmgr_psoc *psoc);
1026 
1027 /**
1028  * ucfg_scan_get_scan_timer_repeat_value() - API to get PNO scan timer repeat
1029  * value
1030  * @psoc: pointer to psoc object
1031  *
1032  * Return: scan_timer_repeat_value
1033  */
1034 uint32_t ucfg_scan_get_scan_timer_repeat_value(struct wlan_objmgr_psoc *psoc);
1035 
1036 /**
1037  * ucfg_scan_get_slow_scan_multiplier() - API to get PNO slow scan multiplier
1038  * value
1039  * @psoc: pointer to psoc object
1040  *
1041  * Return: slow_scan_multiplier value
1042  */
1043 uint32_t ucfg_scan_get_slow_scan_multiplier(struct wlan_objmgr_psoc *psoc);
1044 
1045 /**
1046  * ucfg_scan_get_max_sched_scan_plan_interval() - API to get maximum scheduled
1047  * scan plan interval
1048  * @psoc: pointer to psoc object
1049  *
1050  * Return: max_sched_scan_plan_interval value.
1051  */
1052 uint32_t
1053 ucfg_scan_get_max_sched_scan_plan_interval(struct wlan_objmgr_psoc *psoc);
1054 
1055 /**
1056  * ucfg_scan_get_max_sched_scan_plan_iterations() - API to get maximum scheduled
1057  * scan plan iterations
1058  * @psoc: pointer to psoc object
1059  *
1060  * Return: value.
1061  */
1062 uint32_t
1063 ucfg_scan_get_max_sched_scan_plan_iterations(struct wlan_objmgr_psoc *psoc);
1064 
1065 /**
1066  * ucfg_scan_get_user_config_sched_scan_plan() - API to get user config sched
1067  * scan plan configuration value
1068  * @psoc: pointer to psoc object
1069  *
1070  * Return: value.
1071  */
1072 bool
1073 ucfg_scan_get_user_config_sched_scan_plan(struct wlan_objmgr_psoc *psoc);
1074 
1075 #ifdef WLAN_POLICY_MGR_ENABLE
1076 /*
1077  * ucfg_scan_update_pno_dwell_time() - update active and passive dwell time
1078  * depending on active concurrency modes
1079  * @vdev: vdev object pointer
1080  * @req: scan request
1081  *
1082  * Return: void
1083  */
1084 static inline
1085 void ucfg_scan_update_pno_dwell_time(struct wlan_objmgr_vdev *vdev,
1086 				     struct pno_scan_req_params *req,
1087 				     struct scan_default_params *scan_def)
1088 {
1089 	wlan_scan_update_pno_dwell_time(vdev, req, scan_def);
1090 }
1091 
1092 #else
1093 static inline
1094 void ucfg_scan_update_pno_dwell_time(struct wlan_objmgr_vdev *vdev,
1095 				     struct pno_scan_req_params *req,
1096 				     struct scan_default_params *scan_def)
1097 {}
1098 
1099 #endif
1100 
1101 #else
1102 static inline
1103 bool ucfg_scan_is_pno_offload_enabled(struct wlan_objmgr_psoc *psoc)
1104 {
1105 	return 0;
1106 }
1107 
1108 static inline
1109 void ucfg_scan_set_pno_offload(struct wlan_objmgr_psoc *psoc, bool value)
1110 {
1111 }
1112 
1113 static inline
1114 bool ucfg_scan_get_pno_scan_support(struct wlan_objmgr_psoc *psoc)
1115 {
1116 	return 0;
1117 }
1118 
1119 static inline
1120 uint8_t ucfg_get_scan_backoff_multiplier(struct wlan_objmgr_psoc *psoc)
1121 {
1122 	return 0;
1123 }
1124 
1125 static inline
1126 bool ucfg_scan_is_dfs_chnl_scan_enabled(struct wlan_objmgr_psoc *psoc)
1127 {
1128 	return 0;
1129 }
1130 
1131 static inline
1132 uint32_t ucfg_scan_get_scan_timer_repeat_value(struct wlan_objmgr_psoc *psoc)
1133 {
1134 	return 0;
1135 }
1136 
1137 static inline
1138 uint32_t ucfg_scan_get_slow_scan_multiplier(struct wlan_objmgr_psoc *psoc)
1139 {
1140 	return 0;
1141 }
1142 
1143 static inline uint32_t
1144 ucfg_scan_get_max_sched_scan_plan_interval(struct wlan_objmgr_psoc *psoc)
1145 {
1146 	return 0;
1147 }
1148 
1149 static inline uint32_t
1150 ucfg_scan_get_max_sched_scan_plan_iterations(struct wlan_objmgr_psoc *psoc)
1151 {
1152 	return 0;
1153 }
1154 
1155 static inline bool
1156 ucfg_scan_get_user_config_sched_scan_plan(struct wlan_objmgr_psoc *psoc)
1157 {
1158 	return true;
1159 }
1160 
1161 #endif /* FEATURE_WLAN_SCAN_PNO */
1162 
1163 /**
1164  * ucfg_scan_is_connected_scan_enabled() - API to get scan enabled after connect
1165  * @psoc: pointer to psoc object
1166  *
1167  * Return: value.
1168  */
1169 bool ucfg_scan_is_connected_scan_enabled(struct wlan_objmgr_psoc *psoc);
1170 
1171 /**
1172  * ucfg_scan_is_snr_monitor_enabled() - API to get SNR monitoring enabled or not
1173  * @psoc: pointer to psoc object
1174  *
1175  * Return: value.
1176  */
1177 static inline
1178 bool ucfg_scan_is_snr_monitor_enabled(struct wlan_objmgr_psoc *psoc)
1179 {
1180 	return wlan_scan_is_snr_monitor_enabled(psoc);
1181 }
1182 #endif
1183