1 /* 2 * Copyright (c) 2017-2019 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_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 */ 173 QDF_STATUS 174 ucfg_scan_start(struct scan_start_request *req); 175 176 /** 177 * ucfg_scan_set_psoc_enable() - Public API to enable scans for psoc 178 * @psoc: psoc on which scans need to be disabled 179 * @reason: reason for enable/disabled 180 * 181 * Return: QDF_STATUS. 182 */ 183 QDF_STATUS ucfg_scan_psoc_set_enable(struct wlan_objmgr_psoc *psoc, 184 enum scan_disable_reason reason); 185 186 /** 187 * 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 190 * 191 * Return: QDF_STATUS. 192 */ 193 QDF_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 */ 203 QDF_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 */ 213 QDF_STATUS ucfg_scan_vdev_set_disable(struct wlan_objmgr_vdev *vdev, 214 enum scan_disable_reason reason); 215 216 217 218 /** 219 * 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 */ 225 QDF_STATUS ucfg_scan_set_miracast( 226 struct wlan_objmgr_psoc *psoc, bool enable); 227 228 /** 229 * 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 233 * 234 * Return: QDF_STATUS. 235 */ 236 QDF_STATUS 237 ucfg_scan_set_global_config(struct wlan_objmgr_psoc *psoc, 238 enum scan_config config, uint32_t val); 239 240 /** 241 * 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 245 * 246 * Return: QDF_STATUS. 247 */ 248 QDF_STATUS 249 ucfg_scan_get_global_config(struct wlan_objmgr_psoc *psoc, 250 enum scan_config config, uint32_t *val); 251 252 /** 253 * 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 */ 259 QDF_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 */ 269 bool ucfg_scan_get_wide_band_scan(struct wlan_objmgr_pdev *pdev); 270 271 /** 272 * 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 */ 279 QDF_STATUS ucfg_scan_set_custom_scan_chan_list( 280 struct wlan_objmgr_pdev *pdev, struct chan_list *chan_list); 281 /** 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 291 QDF_STATUS 292 ucfg_scan_config_hidden_ssid_for_bssid(struct wlan_objmgr_pdev *pdev, 293 uint8_t *bssid, 294 struct wlan_ssid *ssid); 295 #else 296 static inline QDF_STATUS 297 ucfg_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 */ 304 /** 305 * 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 */ 312 QDF_STATUS 313 ucfg_scan_cancel(struct scan_cancel_request *req); 314 315 /** 316 * 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 */ 325 QDF_STATUS 326 ucfg_scan_cancel_sync(struct scan_cancel_request *req); 327 328 /** 329 * 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 */ 337 qdf_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 */ 348 QDF_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 */ 359 QDF_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 366 * @chan_list: valid channel list 367 * @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 */ 374 void ucfg_scan_filter_valid_channel(struct wlan_objmgr_pdev *pdev, 375 uint8_t *chan_list, uint32_t num_chan); 376 377 /** 378 * 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 */ 388 QDF_STATUS 389 ucfg_scan_db_iterate(struct wlan_objmgr_pdev *pdev, 390 scan_iterator_func func, void *arg); 391 392 /** 393 * ucfg_scan_update_mlme_by_bssinfo() - The Public API to update mlme 394 * info in the scan entry 395 * @pdev: pdev object 396 * @bssid: bssid info to find the matching scan entry 397 * @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 */ 404 QDF_STATUS 405 ucfg_scan_update_mlme_by_bssinfo(struct wlan_objmgr_pdev *pdev, 406 struct bss_info *bss_info, 407 struct mlme_info *mlme_info); 408 409 /** 410 * ucfg_scan_register_event_handler() - The Public API to register 411 * an event cb handler 412 * @pdev: pdev object 413 * @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 417 * any scan event is received on @pdev. 418 * 419 * Return: 0 for success or error code. 420 */ 421 422 QDF_STATUS 423 ucfg_scan_register_event_handler(struct wlan_objmgr_pdev *pdev, 424 scan_event_handler event_cb, void *arg); 425 426 /** 427 * ucfg_scan_unregister_event_handler() - Public API to unregister 428 * event cb handler 429 * @pdev: pdev object 430 * @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 439 void 440 ucfg_scan_unregister_event_handler(struct wlan_objmgr_pdev *pdev, 441 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 */ 452 QDF_STATUS 453 ucfg_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 */ 465 QDF_STATUS 466 ucfg_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 */ 477 QDF_STATUS 478 ucfg_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 484 * @num_chans: number of channels in channel list 485 * @chan_list: channel list 486 * @phymode: phymode in which scan shall be done 487 * 488 * Return: QDF_STATUS_SUCCESS for success or error code 489 */ 490 QDF_STATUS 491 ucfg_scan_init_chanlist_params(struct scan_start_request *scan_req, 492 uint32_t num_chans, uint32_t *chan_list, uint32_t *phymode); 493 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 */ 500 enum scm_scan_status 501 ucfg_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 */ 509 enum scm_scan_status 510 ucfg_scan_get_pdev_status(struct wlan_objmgr_pdev *pdev); 511 512 /** 513 * 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 */ 521 QDF_STATUS ucfg_scan_register_bcn_cb(struct wlan_objmgr_psoc *psoc, 522 update_beacon_cb cb, enum scan_cb_type type); 523 524 /* 525 * 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 */ 531 QDF_STATUS ucfg_scan_update_user_config(struct wlan_objmgr_psoc *psoc, 532 struct scan_user_cfg *scan_cfg); 533 534 /** 535 * ucfg_scan_update_roam_params() - Store/Update the roam params 536 * @psoc: psoc 537 * @roam_params: roam params 538 * 539 * Return: QDF_STATUS 540 */ 541 QDF_STATUS ucfg_scan_update_roam_params(struct wlan_objmgr_psoc *psoc, 542 struct roam_filter_params *roam_params); 543 544 /* 545 * ucfg_scan_init() - Scan module initialization API 546 * 547 * Return: QDF_STATUS 548 */ 549 QDF_STATUS ucfg_scan_init(void); 550 551 /** 552 * ucfg_scan_deinit() - Scan module deinitialization API 553 * 554 * Return: QDF_STATUS 555 */ 556 QDF_STATUS ucfg_scan_deinit(void); 557 558 /** 559 * ucfg_scan_psoc_enable() - Scan module enable API 560 * @psoc: psoc object 561 * 562 * Return: QDF_STATUS 563 */ 564 QDF_STATUS ucfg_scan_psoc_enable(struct wlan_objmgr_psoc *psoc); 565 566 /** 567 * ucfg_scan_psoc_enable() - Scan module disable API 568 * @psoc: psoc object 569 * 570 * Return: QDF_STATUS 571 */ 572 QDF_STATUS ucfg_scan_psoc_disable(struct wlan_objmgr_psoc *psoc); 573 574 /** 575 * ucfg_scan_psoc_open() - Scan module psoc open API 576 * @psoc: psoc object 577 * 578 * Return: QDF_STATUS 579 */ 580 QDF_STATUS ucfg_scan_psoc_open(struct wlan_objmgr_psoc *psoc); 581 582 /** 583 * ucfg_scan_psoc_close() - Scan module psoc close API 584 * @psoc: psoc object 585 * 586 * Return: QDF_STATUS 587 */ 588 QDF_STATUS ucfg_scan_psoc_close(struct wlan_objmgr_psoc *psoc); 589 590 /** 591 * ucfg_scan_get_max_active_scans() - API to get max active scans 592 * supported on this psoc 593 * @psoc: psoc object 594 * 595 * Return: uint32_t 596 */ 597 uint32_t ucfg_scan_get_max_active_scans(struct wlan_objmgr_psoc *psoc); 598 599 /** 600 * ucfg_ie_whitelist_enabled() - Checks for IE whitelisting enable 601 * @psoc: pointer to psoc object 602 * @vdev: pointer to vdev 603 * 604 * This function is used to check whether IE whitelisting is enabled or not 605 * 606 * Return: If enabled returns true else returns false 607 */ 608 bool ucfg_ie_whitelist_enabled(struct wlan_objmgr_psoc *psoc, 609 struct wlan_objmgr_vdev *vdev); 610 611 /** 612 * ucfg_copy_ie_whitelist_attrs() - Populate probe req IE whitelist attrs 613 * @psoc: pointer to psoc object 614 * @ie_whitelist: output parameter to hold ie whitelist attrs 615 * 616 * If IE whitelisting is enabled then invoke this function to copy 617 * IE whitelisting attrs from wlan scan object 618 * 619 * Return: true - successful copy 620 * false - copy failed 621 */ 622 bool ucfg_copy_ie_whitelist_attrs(struct wlan_objmgr_psoc *psoc, 623 struct probe_req_whitelist_attr *ie_whitelist); 624 625 /** 626 * ucfg_scan_set_bt_activity() - API to set bt activity 627 * @psoc: pointer to psoc object 628 * @bt_a2dp_active: bt activiy value 629 * 630 * Return: None 631 */ 632 void ucfg_scan_set_bt_activity(struct wlan_objmgr_psoc *psoc, 633 bool bt_a2dp_active); 634 /** 635 * ucfg_scan_get_bt_activity() - API to get bt activity 636 * @psoc: pointer to psoc object 637 * 638 * Return: true if enabled else false. 639 */ 640 bool ucfg_scan_get_bt_activity(struct wlan_objmgr_psoc *psoc); 641 642 /** 643 * ucfg_scan_is_mac_spoofing_enabled() - API to check if mac spoofing is enabled 644 * @psoc: pointer to psoc object 645 * 646 * Return: true if enabled else false. 647 */ 648 bool ucfg_scan_is_mac_spoofing_enabled(struct wlan_objmgr_psoc *psoc); 649 650 /** 651 * ucfg_scan_get_extscan_adaptive_dwell_mode() - API to get the adaptive dwell 652 * mode during ext scan 653 * @psoc: pointer to psoc object 654 * 655 * Return: value of type enum scan_dwelltime_adaptive_mode 656 */ 657 enum scan_dwelltime_adaptive_mode 658 ucfg_scan_get_extscan_adaptive_dwell_mode(struct wlan_objmgr_psoc *psoc); 659 660 /** 661 * ucfg_scan_cfg_set_active_dwelltime() - API to set scan active dwelltime 662 * @psoc: pointer to psoc object 663 * @dwell_time: scan active dwell time 664 * 665 * Return: none 666 */ 667 static inline 668 void ucfg_scan_cfg_set_active_dwelltime(struct wlan_objmgr_psoc *psoc, 669 uint32_t dwell_time) 670 { 671 return wlan_scan_cfg_set_active_dwelltime(psoc, dwell_time); 672 } 673 674 /** 675 * ucfg_scan_cfg_get_active_dwelltime() - API to get active dwelltime 676 * @psoc: pointer to psoc object 677 * @dwell_time: scan active dwelltime 678 * 679 * Return: scan active dwell time 680 */ 681 static inline 682 void ucfg_scan_cfg_get_active_dwelltime(struct wlan_objmgr_psoc *psoc, 683 uint32_t *dwell_time) 684 { 685 return wlan_scan_cfg_get_active_dwelltime(psoc, dwell_time); 686 } 687 688 /** 689 * ucfg_scan_cfg_set_passive_dwelltime() - API to set scan passive dwelltime 690 * @psoc: pointer to psoc object 691 * @dwell_time: scan passive dwell time 692 * 693 * Return: none 694 */ 695 static inline 696 void ucfg_scan_cfg_set_passive_dwelltime(struct wlan_objmgr_psoc *psoc, 697 uint32_t dwell_time) 698 { 699 return wlan_scan_cfg_set_passive_dwelltime(psoc, dwell_time); 700 } 701 /** 702 * ucfg_scan_cfg_get_passive_dwelltime() - API to get passive dwelltime 703 * @psoc: pointer to psoc object 704 * @dwell_time: scan passive dwelltime 705 * 706 * Return: scan passive dwell time 707 */ 708 static inline 709 void ucfg_scan_cfg_get_passive_dwelltime(struct wlan_objmgr_psoc *psoc, 710 uint32_t *dwell_time) 711 { 712 return wlan_scan_cfg_get_passive_dwelltime(psoc, dwell_time); 713 } 714 715 /** 716 * ucfg_scan_cfg_get_conc_active_dwelltime() - Get concurrent active dwelltime 717 * @psoc: pointer to psoc object 718 * @dwell_time: scan active dwelltime 719 * 720 * Return: scan concurrent active dwell time 721 */ 722 static inline 723 void ucfg_scan_cfg_get_conc_active_dwelltime(struct wlan_objmgr_psoc *psoc, 724 uint32_t *dwell_time) 725 { 726 return wlan_scan_cfg_get_conc_active_dwelltime(psoc, dwell_time); 727 } 728 729 /** 730 * ucfg_scan_cfg_set_conc_active_dwelltime() - Set concurrent active dwelltime 731 * @psoc: pointer to psoc object 732 * @dwell_time: scan active dwelltime 733 * 734 * Return: scan concurrent active dwell time 735 */ 736 static inline 737 void ucfg_scan_cfg_set_conc_active_dwelltime(struct wlan_objmgr_psoc *psoc, 738 uint32_t dwell_time) 739 { 740 return wlan_scan_cfg_set_conc_active_dwelltime(psoc, dwell_time); 741 } 742 743 /** 744 * ucfg_scan_cfg_get_conc_passive_dwelltime() - Get passive concurrent dwelltime 745 * @psoc: pointer to psoc object 746 * @dwell_time: scan passive dwelltime 747 * 748 * Return: scan concurrent passive dwell time 749 */ 750 static inline 751 void ucfg_scan_cfg_get_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc, 752 uint32_t *dwell_time) 753 { 754 return wlan_scan_cfg_get_conc_passive_dwelltime(psoc, dwell_time); 755 } 756 757 /** 758 * ucfg_scan_cfg_set_conc_passive_dwelltime() - Set passive concurrent dwelltime 759 * @psoc: pointer to psoc object 760 * @dwell_time: scan passive dwelltime 761 * 762 * Return: scan concurrent passive dwell time 763 */ 764 static inline 765 void ucfg_scan_cfg_set_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc, 766 uint32_t dwell_time) 767 { 768 return wlan_scan_cfg_set_conc_passive_dwelltime(psoc, dwell_time); 769 } 770 771 /** 772 * ucfg_scan_cfg_get_dfs_chan_scan_allowed() - API to get dfs scan enabled 773 * @psoc: pointer to psoc object 774 * @enable_dfs_scan: DFS scan enabled or not. 775 * 776 * Return: None 777 */ 778 static inline 779 void ucfg_scan_cfg_get_dfs_chan_scan_allowed(struct wlan_objmgr_psoc *psoc, 780 bool *dfs_scan_enable) 781 { 782 return wlan_scan_cfg_get_dfs_chan_scan_allowed(psoc, dfs_scan_enable); 783 } 784 785 /** 786 * ucfg_scan_cfg_set_dfs_channel_scan() - API to set dfs scan enabled 787 * @psoc: pointer to psoc object 788 * @enable_dfs_scan: Set DFS scan enabled or not. 789 * 790 * Return: None 791 */ 792 static inline 793 void ucfg_scan_cfg_set_dfs_chan_scan_allowed(struct wlan_objmgr_psoc *psoc, 794 bool dfs_scan_enable) 795 { 796 return wlan_scan_cfg_set_dfs_chan_scan_allowed(psoc, dfs_scan_enable); 797 } 798 799 /** 800 * ucfg_scan_wake_lock_in_user_scan() - API to determine if wake lock in user 801 * scan is used. 802 * @psoc: pointer to psoc object 803 * 804 * Return: true if wake lock in user scan is required 805 */ 806 bool ucfg_scan_wake_lock_in_user_scan(struct wlan_objmgr_psoc *psoc); 807 808 /** 809 * ucfg_scan_cfg_honour_nl_scan_policy_flags() - API to get nl scan policy 810 * flags honoured. 811 * @psoc: pointer to psoc object 812 * 813 * Return: nl scan flags is honoured or not 814 */ 815 static inline 816 bool ucfg_scan_cfg_honour_nl_scan_policy_flags(struct wlan_objmgr_psoc *psoc) 817 { 818 return wlan_scan_cfg_honour_nl_scan_policy_flags(psoc); 819 } 820 821 /** 822 * ucfg_scan_cfg_get_conc_max_resttime() - API to get max rest time 823 * @psoc: pointer to psoc object 824 * @rest_time: scan concurrent max resttime 825 * 826 * Return: scan concurrent max rest time 827 */ 828 static inline 829 void ucfg_scan_cfg_get_conc_max_resttime(struct wlan_objmgr_psoc *psoc, 830 uint32_t *rest_time) 831 { 832 return wlan_scan_cfg_get_conc_max_resttime(psoc, rest_time); 833 } 834 835 /** 836 * ucfg_scan_cfg_get_conc_min_resttime() - API to get concurrent min rest time 837 * @psoc: pointer to psoc object 838 * @rest_time: scan concurrent min rest time 839 * 840 * Return: scan concurrent min rest time 841 */ 842 static inline 843 void ucfg_scan_cfg_get_conc_min_resttime(struct wlan_objmgr_psoc *psoc, 844 uint32_t *rest_time) 845 { 846 return wlan_scan_cfg_get_conc_min_resttime(psoc, rest_time); 847 } 848 849 #ifdef FEATURE_WLAN_SCAN_PNO 850 /** 851 * ucfg_scan_is_pno_offload_enabled() - Check if pno offload is enabled 852 * @psoc: pointer to psoc object 853 * 854 * Return: pno_offload_enabled flag 855 */ 856 bool ucfg_scan_is_pno_offload_enabled(struct wlan_objmgr_psoc *psoc); 857 858 /** 859 * ucfg_scan_set_pno_offload() - API to set pno offload flag based on the 860 * capability received from the firmware. 861 * @psoc: pointer to psoc object 862 * @rest_time: scan concurrent min rest time 863 * 864 * Return: scan concurrent min rest time 865 */ 866 void ucfg_scan_set_pno_offload(struct wlan_objmgr_psoc *psoc, bool value); 867 868 /** 869 * ucfg_scan_get_pno_scan_support() - Check if pno scan support is enabled 870 * @psoc: pointer to psoc object 871 * 872 * Return: scan_support_enabled flag 873 */ 874 bool ucfg_scan_get_pno_scan_support(struct wlan_objmgr_psoc *psoc); 875 876 /** 877 * ucfg_get_scan_backoff_multiplier() - get scan backoff multiplier value 878 * @psoc: pointer to psoc object 879 * 880 * Return: scan_support_enabled flag 881 */ 882 uint8_t ucfg_get_scan_backoff_multiplier(struct wlan_objmgr_psoc *psoc); 883 884 /** 885 * ucfg_scan_is_dfs_chnl_scan_enabled() - Check if PNO dfs channel scan support 886 * is enabled 887 * @psoc: pointer to psoc object 888 * 889 * Return: dfs_chnl_scan_enabled flag 890 */ 891 bool ucfg_scan_is_dfs_chnl_scan_enabled(struct wlan_objmgr_psoc *psoc); 892 893 /** 894 * ucfg_scan_get_scan_timer_repeat_value() - API to get PNO scan timer repeat 895 * value 896 * @psoc: pointer to psoc object 897 * 898 * Return: scan_timer_repeat_value 899 */ 900 uint32_t ucfg_scan_get_scan_timer_repeat_value(struct wlan_objmgr_psoc *psoc); 901 902 /** 903 * ucfg_scan_get_slow_scan_multiplier() - API to get PNO slow scan multiplier 904 * value 905 * @psoc: pointer to psoc object 906 * 907 * Return: slow_scan_multiplier value 908 */ 909 uint32_t ucfg_scan_get_slow_scan_multiplier(struct wlan_objmgr_psoc *psoc); 910 911 /** 912 * ucfg_scan_get_max_sched_scan_plan_interval() - API to get maximum scheduled 913 * scan plan interval 914 * @psoc: pointer to psoc object 915 * 916 * Return: max_sched_scan_plan_interval value. 917 */ 918 uint32_t 919 ucfg_scan_get_max_sched_scan_plan_interval(struct wlan_objmgr_psoc *psoc); 920 921 /** 922 * ucfg_scan_get_max_sched_scan_plan_iterations() - API to get maximum scheduled 923 * scan plan iterations 924 * @psoc: pointer to psoc object 925 * 926 * Return: value. 927 */ 928 uint32_t 929 ucfg_scan_get_max_sched_scan_plan_iterations(struct wlan_objmgr_psoc *psoc); 930 931 #else 932 static inline 933 bool ucfg_scan_is_pno_offload_enabled(struct wlan_objmgr_psoc *psoc) 934 { 935 return 0; 936 } 937 938 static inline 939 void ucfg_scan_set_pno_offload(struct wlan_objmgr_psoc *psoc, bool value) 940 { 941 } 942 943 static inline 944 bool ucfg_scan_get_pno_scan_support(struct wlan_objmgr_psoc *psoc) 945 { 946 return 0; 947 } 948 949 static inline 950 uint8_t ucfg_get_scan_backoff_multiplier(struct wlan_objmgr_psoc *psoc) 951 { 952 return 0; 953 } 954 955 static inline 956 bool ucfg_scan_is_dfs_chnl_scan_enabled(struct wlan_objmgr_psoc *psoc) 957 { 958 return 0; 959 } 960 961 static inline 962 uint32_t ucfg_scan_get_scan_timer_repeat_value(struct wlan_objmgr_psoc *psoc) 963 { 964 return 0; 965 } 966 967 static inline 968 uint32_t ucfg_scan_get_slow_scan_multiplier(struct wlan_objmgr_psoc *psoc) 969 { 970 return 0; 971 } 972 973 static inline uint32_t 974 ucfg_scan_get_max_sched_scan_plan_interval(struct wlan_objmgr_psoc *psoc) 975 { 976 return 0; 977 } 978 979 static inline uint32_t 980 ucfg_scan_get_max_sched_scan_plan_iterations(struct wlan_objmgr_psoc *psoc) 981 { 982 return 0; 983 } 984 985 #endif /* FEATURE_WLAN_SCAN_PNO */ 986 987 /** 988 * ucfg_scan_is_connected_scan_enabled() - API to get scan enabled after connect 989 * @psoc: pointer to psoc object 990 * 991 * Return: value. 992 */ 993 bool ucfg_scan_is_connected_scan_enabled(struct wlan_objmgr_psoc *psoc); 994 995 /** 996 * ucfg_scan_is_snr_monitor_enabled() - API to get SNR monitoring enabled or not 997 * @psoc: pointer to psoc object 998 * 999 * Return: value. 1000 */ 1001 static inline 1002 bool ucfg_scan_is_snr_monitor_enabled(struct wlan_objmgr_psoc *psoc) 1003 { 1004 return wlan_scan_is_snr_monitor_enabled(psoc); 1005 } 1006 #endif 1007