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