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_init() - Scan module initialization API 536 * 537 * Return: QDF_STATUS 538 */ 539 QDF_STATUS ucfg_scan_init(void); 540 541 /** 542 * ucfg_scan_deinit() - Scan module deinitialization API 543 * 544 * Return: QDF_STATUS 545 */ 546 QDF_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 */ 554 QDF_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 */ 562 QDF_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 */ 570 QDF_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 */ 578 QDF_STATUS ucfg_scan_psoc_close(struct wlan_objmgr_psoc *psoc); 579 580 /** 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 */ 587 uint32_t ucfg_scan_get_max_active_scans(struct wlan_objmgr_psoc *psoc); 588 589 /** 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 */ 598 bool 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 */ 612 bool ucfg_copy_ie_whitelist_attrs(struct wlan_objmgr_psoc *psoc, 613 struct probe_req_whitelist_attr *ie_whitelist); 614 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 */ 622 void 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 */ 630 bool ucfg_scan_get_bt_activity(struct wlan_objmgr_psoc *psoc); 631 632 /** 633 * 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 */ 638 bool ucfg_scan_is_mac_spoofing_enabled(struct wlan_objmgr_psoc *psoc); 639 640 /** 641 * 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 */ 647 enum scan_dwelltime_adaptive_mode 648 ucfg_scan_get_extscan_adaptive_dwell_mode(struct wlan_objmgr_psoc *psoc); 649 650 /** 651 * ucfg_scan_cfg_set_active_dwelltime() - API to set scan active dwelltime 652 * @psoc: pointer to psoc object 653 * @dwell_time: scan active dwell time 654 * 655 * Return: none 656 */ 657 static inline 658 void 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 } 663 664 /** 665 * ucfg_scan_cfg_get_active_dwelltime() - API to get active dwelltime 666 * @psoc: pointer to psoc object 667 * @dwell_time: scan active dwelltime 668 * 669 * Return: scan active dwell time 670 */ 671 static inline 672 void 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 */ 685 static inline 686 void 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 */ 698 static inline 699 void 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 } 704 705 /** 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 */ 712 static inline 713 void 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 */ 726 static inline 727 void 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 */ 740 static inline 741 void 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 */ 754 static inline 755 void 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 /** 762 * 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 */ 768 static inline 769 void 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 */ 782 static inline 783 void 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 /** 790 * 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 */ 796 bool ucfg_scan_wake_lock_in_user_scan(struct wlan_objmgr_psoc *psoc); 797 798 /** 799 * 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 */ 805 static inline 806 bool 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 /** 812 * 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 */ 818 static inline 819 void 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 */ 832 static inline 833 void 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 839 #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 */ 846 bool 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 */ 856 void 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 */ 864 bool 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 */ 872 uint8_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 */ 881 bool 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 */ 890 uint32_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 */ 899 uint32_t ucfg_scan_get_slow_scan_multiplier(struct wlan_objmgr_psoc *psoc); 900 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 */ 908 uint32_t 909 ucfg_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 */ 918 uint32_t 919 ucfg_scan_get_max_sched_scan_plan_iterations(struct wlan_objmgr_psoc *psoc); 920 921 #else 922 static inline 923 bool ucfg_scan_is_pno_offload_enabled(struct wlan_objmgr_psoc *psoc) 924 { 925 return 0; 926 } 927 928 static inline 929 void ucfg_scan_set_pno_offload(struct wlan_objmgr_psoc *psoc, bool value) 930 { 931 } 932 933 static inline 934 bool ucfg_scan_get_pno_scan_support(struct wlan_objmgr_psoc *psoc) 935 { 936 return 0; 937 } 938 939 static inline 940 uint8_t ucfg_get_scan_backoff_multiplier(struct wlan_objmgr_psoc *psoc) 941 { 942 return 0; 943 } 944 945 static inline 946 bool ucfg_scan_is_dfs_chnl_scan_enabled(struct wlan_objmgr_psoc *psoc) 947 { 948 return 0; 949 } 950 951 static inline 952 uint32_t ucfg_scan_get_scan_timer_repeat_value(struct wlan_objmgr_psoc *psoc) 953 { 954 return 0; 955 } 956 957 static inline 958 uint32_t ucfg_scan_get_slow_scan_multiplier(struct wlan_objmgr_psoc *psoc) 959 { 960 return 0; 961 } 962 963 static inline uint32_t 964 ucfg_scan_get_max_sched_scan_plan_interval(struct wlan_objmgr_psoc *psoc) 965 { 966 return 0; 967 } 968 969 static inline uint32_t 970 ucfg_scan_get_max_sched_scan_plan_iterations(struct wlan_objmgr_psoc *psoc) 971 { 972 return 0; 973 } 974 975 #endif /* FEATURE_WLAN_SCAN_PNO */ 976 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 */ 983 bool 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 */ 991 static inline 992 bool ucfg_scan_is_snr_monitor_enabled(struct wlan_objmgr_psoc *psoc) 993 { 994 return wlan_scan_is_snr_monitor_enabled(psoc); 995 } 996 #endif 997