blob: 7a9b9143c9639fba92e185837e2bd59592889213 [file] [log] [blame]
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +05301/*
gaurank kathpalia575539a2019-01-07 17:23:37 +05302 * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +05303 *
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>
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +053027#include <wlan_objmgr_psoc_obj.h>
28#include <wlan_objmgr_pdev_obj.h>
29#include <wlan_objmgr_vdev_obj.h>
Om Prakash Tripathi22f95dc2016-12-19 10:45:59 +053030#include <wlan_scan_public_structs.h>
Harprit Chhabada2de9f012018-10-30 15:10:52 -070031#include "wlan_scan_api.h"
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +053032
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 */
49wlan_scan_requester
50ucfg_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 */
63void 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 */
76uint8_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 */
89wlan_scan_id
90ucfg_scan_get_scan_id(struct wlan_objmgr_psoc *psoc);
91
Abhishek Singh8c6e82d2017-03-03 21:57:29 +053092#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 */
100QDF_STATUS ucfg_scan_pno_start(struct wlan_objmgr_vdev *vdev,
101struct pno_scan_req_params *req);
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530102
103/**
Abhishek Singh8c6e82d2017-03-03 21:57:29 +0530104 * 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 */
110QDF_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 */
118bool 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 */
126bool 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 */
136QDF_STATUS
137ucfg_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 */
147QDF_STATUS
148ucfg_scan_get_pno_def_params(struct wlan_objmgr_vdev *vdev,
149 struct pno_scan_req_params *req);
150
151#else
152
153static inline bool
154ucfg_scan_get_pno_in_progress(struct wlan_objmgr_vdev *vdev)
155{
156 return false;
157}
158
159static inline bool
160ucfg_scan_get_pno_match(struct wlan_objmgr_vdev *vdev)
161{
162 return false;
163}
164#endif /* FEATURE_WLAN_SCAN_PNO */
165/**
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530166 * ucfg_scan_start() - Public API to start a scan
167 * @req: start scan req params
168 *
169 * The Public API to start a scan. Post a msg to target_if queue
170 *
171 * Return: 0 for success or error code.
172 */
173QDF_STATUS
174ucfg_scan_start(struct scan_start_request *req);
175
176/**
Abhishek Singh502095b2018-11-21 14:34:49 +0530177 * ucfg_scan_set_psoc_enable() - Public API to enable scans for psoc
Abhishek Singh65c4be72017-10-12 11:06:33 +0530178 * @psoc: psoc on which scans need to be disabled
Abhishek Singh502095b2018-11-21 14:34:49 +0530179 * @reason: reason for enable/disabled
Abhishek Singh65c4be72017-10-12 11:06:33 +0530180 *
181 * Return: QDF_STATUS.
182 */
Abhishek Singh502095b2018-11-21 14:34:49 +0530183QDF_STATUS ucfg_scan_psoc_set_enable(struct wlan_objmgr_psoc *psoc,
184 enum scan_disable_reason reason);
Abhishek Singh65c4be72017-10-12 11:06:33 +0530185
186/**
Abhishek Singh502095b2018-11-21 14:34:49 +0530187 * ucfg_scan_psoc_set_disable() - Public API to disable scans for psoc
188 * @psoc: psoc on which scans need to be disabled
189 * @reason: reason for enable/disabled
Abhishek Singh65c4be72017-10-12 11:06:33 +0530190 *
Abhishek Singh502095b2018-11-21 14:34:49 +0530191 * Return: QDF_STATUS.
Abhishek Singh65c4be72017-10-12 11:06:33 +0530192 */
Abhishek Singh502095b2018-11-21 14:34:49 +0530193QDF_STATUS ucfg_scan_psoc_set_disable(struct wlan_objmgr_psoc *psoc,
194 enum scan_disable_reason reason);
195
196/**
197 * ucfg_scan_vdev_set_enable() - Public API to enable scans for vdev
198 * @psoc: psoc on which scans need to be disabled
199 * @reason: reason for enable/disabled
200 *
201 * Return: QDF_STATUS.
202 */
203QDF_STATUS ucfg_scan_vdev_set_enable(struct wlan_objmgr_vdev *vdev,
204 enum scan_disable_reason reason);
205
206/**
207 * ucfg_scan_vdev_set_disable() - Public API to disable scans for vdev
208 * @psoc: psoc on which scans need to be disabled
209 * @reason: reason for enable/disabled
210 *
211 * Return: QDF_STATUS.
212 */
213QDF_STATUS ucfg_scan_vdev_set_disable(struct wlan_objmgr_vdev *vdev,
214 enum scan_disable_reason reason);
215
216
Abhishek Singh65c4be72017-10-12 11:06:33 +0530217
218/**
Yeshwanth Sriram Guntukaf70a37b2018-01-18 16:08:25 +0530219 * ucfg_scan_set_miracast() - Public API to disable/enable miracast flag
220 * @psoc: psoc pointer
221 * @enable: enable miracast if true disable is false
222 *
223 * Return: QDF_STATUS.
224 */
225QDF_STATUS ucfg_scan_set_miracast(
226 struct wlan_objmgr_psoc *psoc, bool enable);
227
228/**
Om Prakash Tripathi5e47d432018-02-23 16:56:09 +0530229 * ucfg_scan_set_global_config() - Public API to set global scan config
230 * @psoc: psoc context
231 * @config: config to set
232 * @val: new config value
Om Prakash Tripathi339dc262018-02-08 15:23:20 +0530233 *
234 * Return: QDF_STATUS.
235 */
236QDF_STATUS
Om Prakash Tripathi5e47d432018-02-23 16:56:09 +0530237ucfg_scan_set_global_config(struct wlan_objmgr_psoc *psoc,
238 enum scan_config config, uint32_t val);
Om Prakash Tripathi339dc262018-02-08 15:23:20 +0530239
240/**
Om Prakash Tripathi5e47d432018-02-23 16:56:09 +0530241 * ucfg_scan_get_global_config() - Public API to get global scan config
242 * @psoc: psoc context
243 * @config: config to set
244 * @val: uint32* to hold returned config value
Om Prakash Tripathi339dc262018-02-08 15:23:20 +0530245 *
Om Prakash Tripathi5e47d432018-02-23 16:56:09 +0530246 * Return: QDF_STATUS.
Om Prakash Tripathi339dc262018-02-08 15:23:20 +0530247 */
Om Prakash Tripathi5e47d432018-02-23 16:56:09 +0530248QDF_STATUS
249ucfg_scan_get_global_config(struct wlan_objmgr_psoc *psoc,
250 enum scan_config config, uint32_t *val);
Om Prakash Tripathi339dc262018-02-08 15:23:20 +0530251
252/**
Om Prakash Tripathi3e166ff2017-11-03 16:11:11 +0530253 * ucfg_scan_set_wide_band_scan() - Public API to disable/enable wide band scan
254 * @pdev: psoc on which scans need to be disabled
255 * @enable: enable wide band scan if @enable is true, disable otherwise
256 *
257 * Return: QDF_STATUS.
258 */
259QDF_STATUS ucfg_scan_set_wide_band_scan(
260 struct wlan_objmgr_pdev *pdev, bool enable);
261
262/**
263 * ucfg_scan_get_wide_band_scan() - Public API to check if
264 * wide band scan is enabled or disabled
265 * @pdev: psoc on which scans status need to be checked
266 *
267 * Return: true if enabled else false.
268 */
269bool ucfg_scan_get_wide_band_scan(struct wlan_objmgr_pdev *pdev);
270
271/**
Om Prakash Tripathi8a4564f2018-04-10 14:54:54 +0530272 * ucfg_scan_set_custom_scan_chan_list() - Public API to restrict scan
273 * to few pre configured channels
274 * @pdev: psoc on which scans need to be disabled
275 * @chan_list: list of channels to scan if set
276 *
277 * Return: QDF_STATUS.
278 */
279QDF_STATUS ucfg_scan_set_custom_scan_chan_list(
280 struct wlan_objmgr_pdev *pdev, struct chan_list *chan_list);
Basamma Yakkanahalliab48ce32018-07-06 18:49:19 +0530281/**
282 * ucfg_scan_set_ssid_bssid_hidden_ssid_beacon() - API to configure
283 * ssid, bssid of hidden beacon
284 * @pdev: psoc on which ssid bssid need to configure
285 * @bssid: bssid of the hidden AP
286 * @ssid: desired ssid
287 *
288 * Return: QDF_STATUS.
289 */
290#ifdef WLAN_DFS_CHAN_HIDDEN_SSID
291QDF_STATUS
292ucfg_scan_config_hidden_ssid_for_bssid(struct wlan_objmgr_pdev *pdev,
293 uint8_t *bssid,
294 struct wlan_ssid *ssid);
295#else
296static inline QDF_STATUS
297ucfg_scan_config_hidden_ssid_for_bssid(struct wlan_objmgr_pdev *pdev,
298 uint8_t *bssid,
299 struct wlan_ssid *ssid)
300{
301 return QDF_STATUS_SUCCESS;
302}
303#endif /* WLAN_DFS_CHAN_HIDDEN_SSID */
Om Prakash Tripathi8a4564f2018-04-10 14:54:54 +0530304/**
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530305 * ucfg_scan_cancel() - Public API to stop a scan
306 * @req: stop scan request params
307 *
308 * The Public API to stop a scan. Post a msg to target_if queue
309 *
310 * Return: 0 for success or error code.
311 */
312QDF_STATUS
313ucfg_scan_cancel(struct scan_cancel_request *req);
314
315/**
Abhishek Singhf95b9e42017-04-25 12:12:01 +0530316 * ucfg_scan_cancel_sync() - Public API to stop a scan and wait
317 * till all scan are completed
318 * @req: stop scan request params
319 *
320 * The Public API to stop a scan and wait
321 * till all scan are completed
322 *
323 * Return: 0 for success or error code.
324 */
325QDF_STATUS
326ucfg_scan_cancel_sync(struct scan_cancel_request *req);
327
328/**
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530329 * ucfg_scan_get_result() - The Public API to get scan results
330 * @pdev: pdev info
331 * @filter: Filters
332 *
333 * This function fetches scan result
334 *
335 * Return: scan list pointer
336 */
337qdf_list_t *ucfg_scan_get_result(struct wlan_objmgr_pdev *pdev,
338 struct scan_filter *filter);
339
340/**
341 * ucfg_scan_purge_results() - purge the scan list
342 * @scan_list: scan list to be purged
343 *
344 * This function purge the temp scan list
345 *
346 * Return: QDF_STATUS
347 */
348QDF_STATUS ucfg_scan_purge_results(qdf_list_t *scan_list);
349
350/**
351 * ucfg_scan_flush_results() - The Public API to flush scan result
352 * @pdev: pdev object
353 * @filter: filter to flush the scan entries
354 *
355 * The Public API to flush scan result.
356 *
357 * Return: 0 for success or error code.
358 */
359QDF_STATUS ucfg_scan_flush_results(struct wlan_objmgr_pdev *pdev,
360 struct scan_filter *filter);
361
362/**
363 * ucfg_scan_filter_valid_channel() - The Public API to filter scan result
364 * based on valid channel list
365 * @pdev: pdev object
hque131d312019-11-21 17:55:27 +0800366 * @chan_freq_list: valid channel frequency (in MHz) list
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530367 * @num_chan: number of valid channels
368 *
369 * The Public API to to filter scan result
370 * based on valid channel list.
371 *
372 * Return: void.
373 */
374void ucfg_scan_filter_valid_channel(struct wlan_objmgr_pdev *pdev,
hque131d312019-11-21 17:55:27 +0800375 uint32_t *chan_freq_list, uint32_t num_chan);
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530376
377/**
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530378 * ucfg_scan_db_iterate() - function to iterate scan table
379 * @pdev: pdev object
380 * @func: iterator function pointer
381 * @arg: argument to be passed to func()
382 *
383 * API, this API iterates scan table and invokes func
384 * on each scan enetry by passing scan entry and arg.
385 *
386 * Return: QDF_STATUS
387 */
388QDF_STATUS
389ucfg_scan_db_iterate(struct wlan_objmgr_pdev *pdev,
390 scan_iterator_func func, void *arg);
391
392/**
Sandeep Puligillae062e822018-02-28 00:27:10 -0800393 * ucfg_scan_update_mlme_by_bssinfo() - The Public API to update mlme
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530394 * info in the scan entry
Sandeep Puligillae062e822018-02-28 00:27:10 -0800395 * @pdev: pdev object
396 * @bssid: bssid info to find the matching scan entry
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530397 * @mlme_info: mlme info to be updated.
398 *
399 * The Public API to update mlme info in the scan entry.
400 * Post a msg to target_if queue
401 *
402 * Return: 0 for success or error code.
403 */
404QDF_STATUS
Sandeep Puligillae062e822018-02-28 00:27:10 -0800405ucfg_scan_update_mlme_by_bssinfo(struct wlan_objmgr_pdev *pdev,
406 struct bss_info *bss_info,
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530407 struct mlme_info *mlme_info);
408
409/**
410 * ucfg_scan_register_event_handler() - The Public API to register
411 * an event cb handler
Om Prakash Tripathid088a8a2017-04-04 17:12:51 +0530412 * @pdev: pdev object
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530413 * @event_cb: callback function to register
414 * @arg: component specific priv argument to @event_cb callback function
415 *
416 * The Public API to register a event cb handler. This cb is called whenever
Om Prakash Tripathid088a8a2017-04-04 17:12:51 +0530417 * any scan event is received on @pdev.
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530418 *
419 * Return: 0 for success or error code.
420 */
421
422QDF_STATUS
Om Prakash Tripathid088a8a2017-04-04 17:12:51 +0530423ucfg_scan_register_event_handler(struct wlan_objmgr_pdev *pdev,
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530424 scan_event_handler event_cb, void *arg);
425
426/**
427 * ucfg_scan_unregister_event_handler() - Public API to unregister
428 * event cb handler
Om Prakash Tripathid088a8a2017-04-04 17:12:51 +0530429 * @pdev: pdev object
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530430 * @event_cb: callback function to unregister
431 * @arg: component specific priv argument to @event_cb callback function
432 *
433 * Unregister a event cb handler. cb and arg will be used to
434 * find the calback.
435 *
436 * Return: void
437 */
438
439void
Om Prakash Tripathid088a8a2017-04-04 17:12:51 +0530440ucfg_scan_unregister_event_handler(struct wlan_objmgr_pdev *pdev,
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530441 scan_event_handler event_cb, void *arg);
442
443/**
444 * ucfg_scan_init_default_params() - get the defaults scan params
445 * @vdev: vdev object
446 * @req: scan request object
447 *
448 * get the defaults scan params
449 *
450 * Return: QDF_STATUS_SUCCESS or error code
451 */
452QDF_STATUS
453ucfg_scan_init_default_params(struct wlan_objmgr_vdev *vdev,
454 struct scan_start_request *req);
455
456/**
457 * ucfg_scan_init_ssid_params() - initialize scan request ssid list
458 *
459 * @scan_req: scan request object
460 * @num_ssid: number of ssid's in ssid list
461 * @ssid_list: ssid list
462 *
463 * Return: QDF_STATUS_SUCCESS for success or error code
464 */
465QDF_STATUS
466ucfg_scan_init_ssid_params(struct scan_start_request *scan_req,
467 uint32_t num_ssid, struct wlan_ssid *ssid_list);
468
469/**
470 * ucfg_scan_init_bssid_params() - initialize scan request bssid list
471 * @scan_req: scan request object
472 * @num_ssid: number of bssid's in bssid list
473 * @bssid_list: bssid list
474 *
475 * Return: QDF_STATUS_SUCCESS for success or error code
476 */
477QDF_STATUS
478ucfg_scan_init_bssid_params(struct scan_start_request *scan_req,
479 uint32_t num_ssid, struct qdf_mac_addr *bssid_list);
480
481/**
482 * ucfg_scan_init_chanlist_params() - initialize scan request channel list
483 * @scan_req: scan request object
Om Prakash Tripathi3e166ff2017-11-03 16:11:11 +0530484 * @num_chans: number of channels in channel list
485 * @chan_list: channel list
486 * @phymode: phymode in which scan shall be done
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530487 *
488 * Return: QDF_STATUS_SUCCESS for success or error code
489 */
490QDF_STATUS
491ucfg_scan_init_chanlist_params(struct scan_start_request *scan_req,
Om Prakash Tripathi3e166ff2017-11-03 16:11:11 +0530492 uint32_t num_chans, uint32_t *chan_list, uint32_t *phymode);
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530493
494/**
495 * ucfg_scan_get_vdev_status() - API to check vdev scan status
496 * @vdev: vdev object
497 *
498 * Return: enum scm_scan_status
499 */
500enum scm_scan_status
501ucfg_scan_get_vdev_status(struct wlan_objmgr_vdev *vdev);
502
503/**
504 * ucfg_scan_get_pdev_status() - API to check pdev scan status
505 * @pdev: vdev object
506 *
507 * Return: enum scm_scan_status
508 */
509enum scm_scan_status
510ucfg_scan_get_pdev_status(struct wlan_objmgr_pdev *pdev);
511
512/**
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530513 * ucfg_scan_register_bcn_cb() - API to register api
514 * to inform/update bcn/probe as soon as they are received
515 * @pdev: psoc
516 * @cb: callback to be registered
517 * @type: Type of callback to be registered
518 *
519 * Return: enum scm_scan_status
520 */
521QDF_STATUS ucfg_scan_register_bcn_cb(struct wlan_objmgr_psoc *psoc,
522 update_beacon_cb cb, enum scan_cb_type type);
523
524/*
Abhishek Singh2f132462017-03-06 16:48:59 +0530525 * ucfg_scan_update_user_config() - Update scan cache user config
526 * @psoc: psoc
527 * @scan_cfg: scan user config
528 *
529 * Return: QDF_STATUS
530 */
531QDF_STATUS ucfg_scan_update_user_config(struct wlan_objmgr_psoc *psoc,
532 struct scan_user_cfg *scan_cfg);
533
534/*
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530535 * ucfg_scan_init() - Scan module initialization API
536 *
537 * Return: QDF_STATUS
538 */
539QDF_STATUS ucfg_scan_init(void);
540
541/**
Jeff Johnson090ee922018-05-12 13:22:27 -0700542 * ucfg_scan_deinit() - Scan module deinitialization API
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530543 *
544 * Return: QDF_STATUS
545 */
546QDF_STATUS ucfg_scan_deinit(void);
547
548/**
549 * ucfg_scan_psoc_enable() - Scan module enable API
550 * @psoc: psoc object
551 *
552 * Return: QDF_STATUS
553 */
554QDF_STATUS ucfg_scan_psoc_enable(struct wlan_objmgr_psoc *psoc);
555
556/**
557 * ucfg_scan_psoc_enable() - Scan module disable API
558 * @psoc: psoc object
559 *
560 * Return: QDF_STATUS
561 */
562QDF_STATUS ucfg_scan_psoc_disable(struct wlan_objmgr_psoc *psoc);
563
564/**
565 * ucfg_scan_psoc_open() - Scan module psoc open API
566 * @psoc: psoc object
567 *
568 * Return: QDF_STATUS
569 */
570QDF_STATUS ucfg_scan_psoc_open(struct wlan_objmgr_psoc *psoc);
571
572/**
573 * ucfg_scan_psoc_close() - Scan module psoc close API
574 * @psoc: psoc object
575 *
576 * Return: QDF_STATUS
577 */
578QDF_STATUS ucfg_scan_psoc_close(struct wlan_objmgr_psoc *psoc);
579
Om Prakash Tripathi0078b782017-04-12 12:23:40 +0530580/**
581 * ucfg_scan_get_max_active_scans() - API to get max active scans
582 * supported on this psoc
583 * @psoc: psoc object
584 *
585 * Return: uint32_t
586 */
587uint32_t ucfg_scan_get_max_active_scans(struct wlan_objmgr_psoc *psoc);
588
Rajeev Kumar Sirasanagandlaa3f4a292017-06-21 12:01:22 +0530589/**
590 * ucfg_ie_whitelist_enabled() - Checks for IE whitelisting enable
591 * @psoc: pointer to psoc object
592 * @vdev: pointer to vdev
593 *
594 * This function is used to check whether IE whitelisting is enabled or not
595 *
596 * Return: If enabled returns true else returns false
597 */
598bool ucfg_ie_whitelist_enabled(struct wlan_objmgr_psoc *psoc,
599 struct wlan_objmgr_vdev *vdev);
600
601/**
602 * ucfg_copy_ie_whitelist_attrs() - Populate probe req IE whitelist attrs
603 * @psoc: pointer to psoc object
604 * @ie_whitelist: output parameter to hold ie whitelist attrs
605 *
606 * If IE whitelisting is enabled then invoke this function to copy
607 * IE whitelisting attrs from wlan scan object
608 *
609 * Return: true - successful copy
610 * false - copy failed
611 */
612bool ucfg_copy_ie_whitelist_attrs(struct wlan_objmgr_psoc *psoc,
613 struct probe_req_whitelist_attr *ie_whitelist);
Yeshwanth Sriram Guntukab9e2f662017-12-14 17:56:04 +0530614
615/**
616 * ucfg_scan_set_bt_activity() - API to set bt activity
617 * @psoc: pointer to psoc object
618 * @bt_a2dp_active: bt activiy value
619 *
620 * Return: None
621 */
622void ucfg_scan_set_bt_activity(struct wlan_objmgr_psoc *psoc,
623 bool bt_a2dp_active);
624/**
625 * ucfg_scan_get_bt_activity() - API to get bt activity
626 * @psoc: pointer to psoc object
627 *
628 * Return: true if enabled else false.
629 */
630bool ucfg_scan_get_bt_activity(struct wlan_objmgr_psoc *psoc);
Krunal Soni3bdf3802018-06-20 16:45:03 -0700631
632/**
Pragaspathi Thilagaraj9d9a3c42019-02-01 11:53:59 +0530633 * ucfg_scan_is_mac_spoofing_enabled() - API to check if mac spoofing is enabled
634 * @psoc: pointer to psoc object
635 *
636 * Return: true if enabled else false.
637 */
638bool ucfg_scan_is_mac_spoofing_enabled(struct wlan_objmgr_psoc *psoc);
639
640/**
Pragaspathi Thilagaraj1e618d62019-02-06 20:03:27 +0530641 * ucfg_scan_get_extscan_adaptive_dwell_mode() - API to get the adaptive dwell
642 * mode during ext scan
643 * @psoc: pointer to psoc object
644 *
645 * Return: value of type enum scan_dwelltime_adaptive_mode
646 */
647enum scan_dwelltime_adaptive_mode
648ucfg_scan_get_extscan_adaptive_dwell_mode(struct wlan_objmgr_psoc *psoc);
649
650/**
Harprit Chhabada2de9f012018-10-30 15:10:52 -0700651 * ucfg_scan_cfg_set_active_dwelltime() - API to set scan active dwelltime
Sandeep Puligillaba6526d2018-04-05 01:10:13 -0700652 * @psoc: pointer to psoc object
653 * @dwell_time: scan active dwell time
654 *
655 * Return: none
656 */
Harprit Chhabada2de9f012018-10-30 15:10:52 -0700657static inline
658void ucfg_scan_cfg_set_active_dwelltime(struct wlan_objmgr_psoc *psoc,
659 uint32_t dwell_time)
660{
661 return wlan_scan_cfg_set_active_dwelltime(psoc, dwell_time);
662}
Sandeep Puligillaba6526d2018-04-05 01:10:13 -0700663
664/**
Harprit Chhabada2de9f012018-10-30 15:10:52 -0700665 * ucfg_scan_cfg_get_active_dwelltime() - API to get active dwelltime
Sandeep Puligillaba6526d2018-04-05 01:10:13 -0700666 * @psoc: pointer to psoc object
667 * @dwell_time: scan active dwelltime
668 *
669 * Return: scan active dwell time
670 */
Harprit Chhabada2de9f012018-10-30 15:10:52 -0700671static inline
672void ucfg_scan_cfg_get_active_dwelltime(struct wlan_objmgr_psoc *psoc,
673 uint32_t *dwell_time)
674{
675 return wlan_scan_cfg_get_active_dwelltime(psoc, dwell_time);
676}
677
678/**
679 * ucfg_scan_cfg_set_passive_dwelltime() - API to set scan passive dwelltime
680 * @psoc: pointer to psoc object
681 * @dwell_time: scan passive dwell time
682 *
683 * Return: none
684 */
685static inline
686void ucfg_scan_cfg_set_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
687 uint32_t dwell_time)
688{
689 return wlan_scan_cfg_set_passive_dwelltime(psoc, dwell_time);
690}
691/**
692 * ucfg_scan_cfg_get_passive_dwelltime() - API to get passive dwelltime
693 * @psoc: pointer to psoc object
694 * @dwell_time: scan passive dwelltime
695 *
696 * Return: scan passive dwell time
697 */
698static inline
699void ucfg_scan_cfg_get_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
700 uint32_t *dwell_time)
701{
702 return wlan_scan_cfg_get_passive_dwelltime(psoc, dwell_time);
703}
Sandeep Puligillaba6526d2018-04-05 01:10:13 -0700704
Sandeep Puligilla5957f002018-07-19 19:04:18 -0700705/**
706 * ucfg_scan_cfg_get_conc_active_dwelltime() - Get concurrent active dwelltime
707 * @psoc: pointer to psoc object
708 * @dwell_time: scan active dwelltime
709 *
710 * Return: scan concurrent active dwell time
711 */
712static inline
713void ucfg_scan_cfg_get_conc_active_dwelltime(struct wlan_objmgr_psoc *psoc,
714 uint32_t *dwell_time)
715{
716 return wlan_scan_cfg_get_conc_active_dwelltime(psoc, dwell_time);
717}
718
719/**
720 * ucfg_scan_cfg_set_conc_active_dwelltime() - Set concurrent active dwelltime
721 * @psoc: pointer to psoc object
722 * @dwell_time: scan active dwelltime
723 *
724 * Return: scan concurrent active dwell time
725 */
726static inline
727void ucfg_scan_cfg_set_conc_active_dwelltime(struct wlan_objmgr_psoc *psoc,
728 uint32_t dwell_time)
729{
730 return wlan_scan_cfg_set_conc_active_dwelltime(psoc, dwell_time);
731}
732
733/**
734 * ucfg_scan_cfg_get_conc_passive_dwelltime() - Get passive concurrent dwelltime
735 * @psoc: pointer to psoc object
736 * @dwell_time: scan passive dwelltime
737 *
738 * Return: scan concurrent passive dwell time
739 */
740static inline
741void ucfg_scan_cfg_get_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
742 uint32_t *dwell_time)
743{
744 return wlan_scan_cfg_get_conc_passive_dwelltime(psoc, dwell_time);
745}
746
747/**
748 * ucfg_scan_cfg_set_conc_passive_dwelltime() - Set passive concurrent dwelltime
749 * @psoc: pointer to psoc object
750 * @dwell_time: scan passive dwelltime
751 *
752 * Return: scan concurrent passive dwell time
753 */
754static inline
755void ucfg_scan_cfg_set_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
756 uint32_t dwell_time)
757{
758 return wlan_scan_cfg_set_conc_passive_dwelltime(psoc, dwell_time);
759}
760
761/**
gaurank kathpalia575539a2019-01-07 17:23:37 +0530762 * ucfg_scan_cfg_get_dfs_chan_scan_allowed() - API to get dfs scan enabled
763 * @psoc: pointer to psoc object
764 * @enable_dfs_scan: DFS scan enabled or not.
765 *
766 * Return: None
767 */
768static inline
769void ucfg_scan_cfg_get_dfs_chan_scan_allowed(struct wlan_objmgr_psoc *psoc,
770 bool *dfs_scan_enable)
771{
772 return wlan_scan_cfg_get_dfs_chan_scan_allowed(psoc, dfs_scan_enable);
773}
774
775/**
776 * ucfg_scan_cfg_set_dfs_channel_scan() - API to set dfs scan enabled
777 * @psoc: pointer to psoc object
778 * @enable_dfs_scan: Set DFS scan enabled or not.
779 *
780 * Return: None
781 */
782static inline
783void ucfg_scan_cfg_set_dfs_chan_scan_allowed(struct wlan_objmgr_psoc *psoc,
784 bool dfs_scan_enable)
785{
786 return wlan_scan_cfg_set_dfs_chan_scan_allowed(psoc, dfs_scan_enable);
787}
788
789/**
Abhishek Singh0c1dedb2018-11-13 18:24:20 +0530790 * ucfg_scan_wake_lock_in_user_scan() - API to determine if wake lock in user
791 * scan is used.
792 * @psoc: pointer to psoc object
793 *
794 * Return: true if wake lock in user scan is required
795 */
796bool ucfg_scan_wake_lock_in_user_scan(struct wlan_objmgr_psoc *psoc);
797
798/**
bings47c737d2019-04-19 14:38:25 +0800799 * ucfg_scan_cfg_honour_nl_scan_policy_flags() - API to get nl scan policy
800 * flags honoured.
801 * @psoc: pointer to psoc object
802 *
803 * Return: nl scan flags is honoured or not
804 */
805static inline
806bool ucfg_scan_cfg_honour_nl_scan_policy_flags(struct wlan_objmgr_psoc *psoc)
807{
808 return wlan_scan_cfg_honour_nl_scan_policy_flags(psoc);
809}
810
811/**
Sandeep Puligilla5957f002018-07-19 19:04:18 -0700812 * ucfg_scan_cfg_get_conc_max_resttime() - API to get max rest time
813 * @psoc: pointer to psoc object
814 * @rest_time: scan concurrent max resttime
815 *
816 * Return: scan concurrent max rest time
817 */
818static inline
819void ucfg_scan_cfg_get_conc_max_resttime(struct wlan_objmgr_psoc *psoc,
820 uint32_t *rest_time)
821{
822 return wlan_scan_cfg_get_conc_max_resttime(psoc, rest_time);
823}
824
825/**
826 * ucfg_scan_cfg_get_conc_min_resttime() - API to get concurrent min rest time
827 * @psoc: pointer to psoc object
828 * @rest_time: scan concurrent min rest time
829 *
830 * Return: scan concurrent min rest time
831 */
832static inline
833void ucfg_scan_cfg_get_conc_min_resttime(struct wlan_objmgr_psoc *psoc,
834 uint32_t *rest_time)
835{
836 return wlan_scan_cfg_get_conc_min_resttime(psoc, rest_time);
837}
838
Pragaspathi Thilagarajcc3af932018-11-28 00:10:18 +0530839#ifdef FEATURE_WLAN_SCAN_PNO
840/**
841 * ucfg_scan_is_pno_offload_enabled() - Check if pno offload is enabled
842 * @psoc: pointer to psoc object
843 *
844 * Return: pno_offload_enabled flag
845 */
846bool ucfg_scan_is_pno_offload_enabled(struct wlan_objmgr_psoc *psoc);
847
848/**
849 * ucfg_scan_set_pno_offload() - API to set pno offload flag based on the
850 * capability received from the firmware.
851 * @psoc: pointer to psoc object
852 * @rest_time: scan concurrent min rest time
853 *
854 * Return: scan concurrent min rest time
855 */
856void ucfg_scan_set_pno_offload(struct wlan_objmgr_psoc *psoc, bool value);
857
858/**
859 * ucfg_scan_get_pno_scan_support() - Check if pno scan support is enabled
860 * @psoc: pointer to psoc object
861 *
862 * Return: scan_support_enabled flag
863 */
864bool ucfg_scan_get_pno_scan_support(struct wlan_objmgr_psoc *psoc);
865
866/**
867 * ucfg_get_scan_backoff_multiplier() - get scan backoff multiplier value
868 * @psoc: pointer to psoc object
869 *
870 * Return: scan_support_enabled flag
871 */
872uint8_t ucfg_get_scan_backoff_multiplier(struct wlan_objmgr_psoc *psoc);
873
874/**
875 * ucfg_scan_is_dfs_chnl_scan_enabled() - Check if PNO dfs channel scan support
876 * is enabled
877 * @psoc: pointer to psoc object
878 *
879 * Return: dfs_chnl_scan_enabled flag
880 */
881bool ucfg_scan_is_dfs_chnl_scan_enabled(struct wlan_objmgr_psoc *psoc);
882
883/**
884 * ucfg_scan_get_scan_timer_repeat_value() - API to get PNO scan timer repeat
885 * value
886 * @psoc: pointer to psoc object
887 *
888 * Return: scan_timer_repeat_value
889 */
890uint32_t ucfg_scan_get_scan_timer_repeat_value(struct wlan_objmgr_psoc *psoc);
891
892/**
893 * ucfg_scan_get_slow_scan_multiplier() - API to get PNO slow scan multiplier
894 * value
895 * @psoc: pointer to psoc object
896 *
897 * Return: slow_scan_multiplier value
898 */
899uint32_t ucfg_scan_get_slow_scan_multiplier(struct wlan_objmgr_psoc *psoc);
Pragaspathi Thilagaraj9d9a3c42019-02-01 11:53:59 +0530900
901/**
902 * ucfg_scan_get_max_sched_scan_plan_interval() - API to get maximum scheduled
903 * scan plan interval
904 * @psoc: pointer to psoc object
905 *
906 * Return: max_sched_scan_plan_interval value.
907 */
908uint32_t
909ucfg_scan_get_max_sched_scan_plan_interval(struct wlan_objmgr_psoc *psoc);
910
911/**
912 * ucfg_scan_get_max_sched_scan_plan_iterations() - API to get maximum scheduled
913 * scan plan iterations
914 * @psoc: pointer to psoc object
915 *
916 * Return: value.
917 */
918uint32_t
919ucfg_scan_get_max_sched_scan_plan_iterations(struct wlan_objmgr_psoc *psoc);
920
Pragaspathi Thilagarajcc3af932018-11-28 00:10:18 +0530921#else
922static inline
923bool ucfg_scan_is_pno_offload_enabled(struct wlan_objmgr_psoc *psoc)
924{
925 return 0;
926}
927
928static inline
929void ucfg_scan_set_pno_offload(struct wlan_objmgr_psoc *psoc, bool value)
930{
931}
932
933static inline
934bool ucfg_scan_get_pno_scan_support(struct wlan_objmgr_psoc *psoc)
935{
936 return 0;
937}
938
939static inline
940uint8_t ucfg_get_scan_backoff_multiplier(struct wlan_objmgr_psoc *psoc)
941{
942 return 0;
943}
944
945static inline
946bool ucfg_scan_is_dfs_chnl_scan_enabled(struct wlan_objmgr_psoc *psoc)
947{
948 return 0;
949}
950
951static inline
952uint32_t ucfg_scan_get_scan_timer_repeat_value(struct wlan_objmgr_psoc *psoc)
953{
954 return 0;
955}
956
957static inline
958uint32_t ucfg_scan_get_slow_scan_multiplier(struct wlan_objmgr_psoc *psoc)
959{
960 return 0;
961}
Pragaspathi Thilagaraj9d9a3c42019-02-01 11:53:59 +0530962
963static inline uint32_t
964ucfg_scan_get_max_sched_scan_plan_interval(struct wlan_objmgr_psoc *psoc)
965{
966 return 0;
967}
968
969static inline uint32_t
970ucfg_scan_get_max_sched_scan_plan_iterations(struct wlan_objmgr_psoc *psoc)
971{
972 return 0;
973}
974
Pragaspathi Thilagarajcc3af932018-11-28 00:10:18 +0530975#endif /* FEATURE_WLAN_SCAN_PNO */
Sandeep Puligillaeb272d02019-01-16 01:40:26 -0800976
977/**
978 * ucfg_scan_is_connected_scan_enabled() - API to get scan enabled after connect
979 * @psoc: pointer to psoc object
980 *
981 * Return: value.
982 */
983bool ucfg_scan_is_connected_scan_enabled(struct wlan_objmgr_psoc *psoc);
984
985/**
986 * ucfg_scan_is_snr_monitor_enabled() - API to get SNR monitoring enabled or not
987 * @psoc: pointer to psoc object
988 *
989 * Return: value.
990 */
991static inline
992bool ucfg_scan_is_snr_monitor_enabled(struct wlan_objmgr_psoc *psoc)
993{
994 return wlan_scan_is_snr_monitor_enabled(psoc);
995}
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530996#endif