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