1 /* 2 * Copyright (c) 2017-2021 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_obss_scan_offload() - Public API to set obss scan flag 271 * @psoc: psoc context 272 * @val: the value to be set 273 * 274 * Return: void. 275 */ 276 void ucfg_scan_set_obss_scan_offload(struct wlan_objmgr_psoc *psoc, bool value); 277 278 /** 279 * ucfg_scan_set_wide_band_scan() - Public API to disable/enable wide band scan 280 * @pdev: psoc on which scans need to be disabled 281 * @enable: enable wide band scan if @enable is true, disable otherwise 282 * 283 * Return: QDF_STATUS. 284 */ 285 QDF_STATUS ucfg_scan_set_wide_band_scan( 286 struct wlan_objmgr_pdev *pdev, bool enable); 287 288 /** 289 * ucfg_scan_get_wide_band_scan() - Public API to check if 290 * wide band scan is enabled or disabled 291 * @pdev: psoc on which scans status need to be checked 292 * 293 * Return: true if enabled else false. 294 */ 295 bool ucfg_scan_get_wide_band_scan(struct wlan_objmgr_pdev *pdev); 296 297 /** 298 * ucfg_scan_set_custom_scan_chan_list() - Public API to restrict scan 299 * to few pre configured channels 300 * @pdev: psoc on which scans need to be disabled 301 * @chan_list: list of channels to scan if set 302 * 303 * Return: QDF_STATUS. 304 */ 305 QDF_STATUS ucfg_scan_set_custom_scan_chan_list( 306 struct wlan_objmgr_pdev *pdev, struct chan_list *chan_list); 307 /** 308 * ucfg_scan_set_ssid_bssid_hidden_ssid_beacon() - API to configure 309 * ssid, bssid of hidden beacon 310 * @pdev: psoc on which ssid bssid need to configure 311 * @bssid: bssid of the hidden AP 312 * @ssid: desired ssid 313 * 314 * Return: QDF_STATUS. 315 */ 316 #ifdef WLAN_DFS_CHAN_HIDDEN_SSID 317 QDF_STATUS 318 ucfg_scan_config_hidden_ssid_for_bssid(struct wlan_objmgr_pdev *pdev, 319 uint8_t *bssid, 320 struct wlan_ssid *ssid); 321 #else 322 static inline QDF_STATUS 323 ucfg_scan_config_hidden_ssid_for_bssid(struct wlan_objmgr_pdev *pdev, 324 uint8_t *bssid, 325 struct wlan_ssid *ssid) 326 { 327 return QDF_STATUS_SUCCESS; 328 } 329 #endif /* WLAN_DFS_CHAN_HIDDEN_SSID */ 330 331 /** 332 * ucfg_scan_cancel() - ucfg Public API to cancel the scan 333 * @req: stop scan request params 334 * 335 * The ucfg public API to stop a scan. Post a msg to target_if queue 336 * 337 * Return: QDF_STATUS. 338 */ 339 static inline QDF_STATUS ucfg_scan_cancel(struct scan_cancel_request *req) 340 { 341 return wlan_scan_cancel(req); 342 } 343 344 /** 345 * ucfg_scan_cancel_sync() - Public API to stop a scan and wait 346 * till all scan are completed 347 * @req: stop scan request params 348 * 349 * The Public API to stop a scan and wait 350 * till all scan are completed 351 * 352 * Return: 0 for success or error code. 353 */ 354 QDF_STATUS 355 ucfg_scan_cancel_sync(struct scan_cancel_request *req); 356 357 /** 358 * ucfg_scan_get_result() - The Public API to get scan results 359 * @pdev: pdev info 360 * @filter: Filters 361 * 362 * This function fetches scan result 363 * 364 * Return: scan list pointer 365 */ 366 qdf_list_t *ucfg_scan_get_result(struct wlan_objmgr_pdev *pdev, 367 struct scan_filter *filter); 368 369 /** 370 * ucfg_scan_purge_results() - purge the scan list 371 * @scan_list: scan list to be purged 372 * 373 * This function purge the temp scan list 374 * 375 * Return: QDF_STATUS 376 */ 377 QDF_STATUS ucfg_scan_purge_results(qdf_list_t *scan_list); 378 379 /** 380 * ucfg_scan_flush_results() - The Public API to flush scan result 381 * @pdev: pdev object 382 * @filter: filter to flush the scan entries 383 * 384 * The Public API to flush scan result. 385 * 386 * Return: 0 for success or error code. 387 */ 388 QDF_STATUS ucfg_scan_flush_results(struct wlan_objmgr_pdev *pdev, 389 struct scan_filter *filter); 390 391 /** 392 * ucfg_scan_filter_valid_channel() - The Public API to filter scan result 393 * based on valid channel list 394 * @pdev: pdev object 395 * @chan_freq_list: valid channel frequency (in MHz) list 396 * @num_chan: number of valid channels 397 * 398 * The Public API to to filter scan result 399 * based on valid channel list. 400 * 401 * Return: void. 402 */ 403 void ucfg_scan_filter_valid_channel(struct wlan_objmgr_pdev *pdev, 404 uint32_t *chan_freq_list, uint32_t num_chan); 405 406 /** 407 * ucfg_scan_db_iterate() - function to iterate scan table 408 * @pdev: pdev object 409 * @func: iterator function pointer 410 * @arg: argument to be passed to func() 411 * 412 * API, this API iterates scan table and invokes func 413 * on each scan enetry by passing scan entry and arg. 414 * 415 * Return: QDF_STATUS 416 */ 417 QDF_STATUS 418 ucfg_scan_db_iterate(struct wlan_objmgr_pdev *pdev, 419 scan_iterator_func func, void *arg); 420 421 /** 422 * ucfg_scan_update_mlme_by_bssinfo() - The Public API to update mlme 423 * info in the scan entry 424 * @pdev: pdev object 425 * @bssid: bssid info to find the matching scan entry 426 * @mlme_info: mlme info to be updated. 427 * 428 * The Public API to update mlme info in the scan entry. 429 * Post a msg to target_if queue 430 * 431 * Return: 0 for success or error code. 432 */ 433 QDF_STATUS 434 ucfg_scan_update_mlme_by_bssinfo(struct wlan_objmgr_pdev *pdev, 435 struct bss_info *bss_info, 436 struct mlme_info *mlme_info); 437 438 /** 439 * ucfg_scan_register_event_handler() - The Public API to register 440 * an event cb handler 441 * @pdev: pdev object 442 * @event_cb: callback function to register 443 * @arg: component specific priv argument to @event_cb callback function 444 * 445 * The Public API to register a event cb handler. This cb is called whenever 446 * any scan event is received on @pdev. 447 * 448 * Return: 0 for success or error code. 449 */ 450 451 QDF_STATUS 452 ucfg_scan_register_event_handler(struct wlan_objmgr_pdev *pdev, 453 scan_event_handler event_cb, void *arg); 454 455 /** 456 * ucfg_scan_unregister_event_handler() - Public API to unregister 457 * event cb handler 458 * @pdev: pdev object 459 * @event_cb: callback function to unregister 460 * @arg: component specific priv argument to @event_cb callback function 461 * 462 * Unregister a event cb handler. cb and arg will be used to 463 * find the calback. 464 * 465 * Return: void 466 */ 467 468 void 469 ucfg_scan_unregister_event_handler(struct wlan_objmgr_pdev *pdev, 470 scan_event_handler event_cb, void *arg); 471 472 /** 473 * ucfg_scan_init_default_params() - Public ucfg API to initialize scan params 474 * @vdev: vdev object 475 * @req: scan request object 476 * 477 * Public ucfg API to initialize scan start request with defaults scan params 478 * 479 * Return: QDF_STATUS_SUCCESS or error code 480 */ 481 static inline QDF_STATUS 482 ucfg_scan_init_default_params(struct wlan_objmgr_vdev *vdev, 483 struct scan_start_request *req) 484 { 485 return wlan_scan_init_default_params(vdev, req); 486 } 487 488 /** 489 * ucfg_scan_init_ssid_params() - initialize scan request ssid list 490 * 491 * @scan_req: scan request object 492 * @num_ssid: number of ssid's in ssid list 493 * @ssid_list: ssid list 494 * 495 * Return: QDF_STATUS_SUCCESS for success or error code 496 */ 497 QDF_STATUS 498 ucfg_scan_init_ssid_params(struct scan_start_request *scan_req, 499 uint32_t num_ssid, struct wlan_ssid *ssid_list); 500 501 /** 502 * ucfg_scan_init_bssid_params() - initialize scan request bssid list 503 * @scan_req: scan request object 504 * @num_ssid: number of bssid's in bssid list 505 * @bssid_list: bssid list 506 * 507 * Return: QDF_STATUS_SUCCESS for success or error code 508 */ 509 QDF_STATUS 510 ucfg_scan_init_bssid_params(struct scan_start_request *scan_req, 511 uint32_t num_ssid, struct qdf_mac_addr *bssid_list); 512 513 /** 514 * ucfg_scan_init_chanlist_params() - initialize scan request channel list 515 * @scan_req: scan request object 516 * @num_chans: number of channels in channel list 517 * @chan_list: channel list 518 * @phymode: phymode in which scan shall be done 519 * 520 * Return: QDF_STATUS_SUCCESS for success or error code 521 */ 522 QDF_STATUS 523 ucfg_scan_init_chanlist_params(struct scan_start_request *scan_req, 524 uint32_t num_chans, uint32_t *chan_list, uint32_t *phymode); 525 526 /** 527 * ucfg_scan_get_vdev_status() - API to check vdev scan status 528 * @vdev: vdev object 529 * 530 * Return: enum scm_scan_status 531 */ 532 enum scm_scan_status 533 ucfg_scan_get_vdev_status(struct wlan_objmgr_vdev *vdev); 534 535 /** 536 * ucfg_scan_get_pdev_status() - API to check pdev scan status 537 * @pdev: pdev object 538 * 539 * Return: enum scm_scan_status 540 */ 541 enum scm_scan_status 542 ucfg_scan_get_pdev_status(struct wlan_objmgr_pdev *pdev); 543 544 /** 545 * ucfg_scan_register_bcn_cb() - API to register api 546 * to inform/update bcn/probe as soon as they are received 547 * @pdev: psoc 548 * @cb: callback to be registered 549 * @type: Type of callback to be registered 550 * 551 * Return: enum scm_scan_status 552 */ 553 QDF_STATUS ucfg_scan_register_bcn_cb(struct wlan_objmgr_psoc *psoc, 554 update_beacon_cb cb, enum scan_cb_type type); 555 556 /* 557 * ucfg_scan_update_user_config() - Update scan cache user config 558 * @psoc: psoc 559 * @scan_cfg: scan user config 560 * 561 * Return: QDF_STATUS 562 */ 563 QDF_STATUS ucfg_scan_update_user_config(struct wlan_objmgr_psoc *psoc, 564 struct scan_user_cfg *scan_cfg); 565 566 /* 567 * ucfg_scan_init() - Scan module initialization API 568 * 569 * Return: QDF_STATUS 570 */ 571 QDF_STATUS ucfg_scan_init(void); 572 573 /** 574 * ucfg_scan_deinit() - Scan module deinitialization API 575 * 576 * Return: QDF_STATUS 577 */ 578 QDF_STATUS ucfg_scan_deinit(void); 579 580 /** 581 * ucfg_scan_psoc_enable() - Scan module enable API 582 * @psoc: psoc object 583 * 584 * Return: QDF_STATUS 585 */ 586 QDF_STATUS ucfg_scan_psoc_enable(struct wlan_objmgr_psoc *psoc); 587 588 /** 589 * ucfg_scan_psoc_enable() - Scan module disable API 590 * @psoc: psoc object 591 * 592 * Return: QDF_STATUS 593 */ 594 QDF_STATUS ucfg_scan_psoc_disable(struct wlan_objmgr_psoc *psoc); 595 596 /** 597 * ucfg_scan_psoc_open() - Scan module psoc open API 598 * @psoc: psoc object 599 * 600 * Return: QDF_STATUS 601 */ 602 QDF_STATUS ucfg_scan_psoc_open(struct wlan_objmgr_psoc *psoc); 603 604 /** 605 * ucfg_scan_psoc_close() - Scan module psoc close API 606 * @psoc: psoc object 607 * 608 * Return: QDF_STATUS 609 */ 610 QDF_STATUS ucfg_scan_psoc_close(struct wlan_objmgr_psoc *psoc); 611 612 /** 613 * ucfg_scan_get_max_active_scans() - API to get max active scans 614 * supported on this psoc 615 * @psoc: psoc object 616 * 617 * Return: uint32_t 618 */ 619 uint32_t ucfg_scan_get_max_active_scans(struct wlan_objmgr_psoc *psoc); 620 621 /** 622 * ucfg_ie_whitelist_enabled() - Checks for IE whitelisting enable 623 * @psoc: pointer to psoc object 624 * @vdev: pointer to vdev 625 * 626 * This function is used to check whether IE whitelisting is enabled or not 627 * 628 * Return: If enabled returns true else returns false 629 */ 630 bool ucfg_ie_whitelist_enabled(struct wlan_objmgr_psoc *psoc, 631 struct wlan_objmgr_vdev *vdev); 632 633 /** 634 * ucfg_copy_ie_whitelist_attrs() - Populate probe req IE whitelist attrs 635 * @psoc: pointer to psoc object 636 * @ie_whitelist: output parameter to hold ie whitelist attrs 637 * 638 * If IE whitelisting is enabled then invoke this function to copy 639 * IE whitelisting attrs from wlan scan object 640 * 641 * Return: true - successful copy 642 * false - copy failed 643 */ 644 bool ucfg_copy_ie_whitelist_attrs(struct wlan_objmgr_psoc *psoc, 645 struct probe_req_whitelist_attr *ie_whitelist); 646 647 /** 648 * ucfg_scan_set_bt_activity() - API to set bt activity 649 * @psoc: pointer to psoc object 650 * @bt_a2dp_active: bt activiy value 651 * 652 * Return: None 653 */ 654 void ucfg_scan_set_bt_activity(struct wlan_objmgr_psoc *psoc, 655 bool bt_a2dp_active); 656 /** 657 * ucfg_scan_get_bt_activity() - API to get bt activity 658 * @psoc: pointer to psoc object 659 * 660 * Return: true if enabled else false. 661 */ 662 bool ucfg_scan_get_bt_activity(struct wlan_objmgr_psoc *psoc); 663 664 /** 665 * ucfg_scan_is_mac_spoofing_enabled() - API to check if mac spoofing is enabled 666 * @psoc: pointer to psoc object 667 * 668 * Return: true if enabled else false. 669 */ 670 bool ucfg_scan_is_mac_spoofing_enabled(struct wlan_objmgr_psoc *psoc); 671 672 /** 673 * ucfg_scan_get_extscan_adaptive_dwell_mode() - API to get the adaptive dwell 674 * mode during ext scan 675 * @psoc: pointer to psoc object 676 * 677 * Return: value of type enum scan_dwelltime_adaptive_mode 678 */ 679 enum scan_dwelltime_adaptive_mode 680 ucfg_scan_get_extscan_adaptive_dwell_mode(struct wlan_objmgr_psoc *psoc); 681 682 /** 683 * ucfg_scan_cfg_set_active_dwelltime() - API to set scan active dwelltime 684 * @psoc: pointer to psoc object 685 * @dwell_time: scan active dwell time 686 * 687 * Return: none 688 */ 689 static inline 690 void ucfg_scan_cfg_set_active_dwelltime(struct wlan_objmgr_psoc *psoc, 691 uint32_t dwell_time) 692 { 693 return wlan_scan_cfg_set_active_dwelltime(psoc, dwell_time); 694 } 695 696 /** 697 * ucfg_scan_cfg_set_active_2g_dwelltime() - API to set scan active 2g dwelltime 698 * @psoc: pointer to psoc object 699 * @dwell_time: scan active dwell time 700 * 701 * Return: none 702 */ 703 static inline 704 void ucfg_scan_cfg_set_active_2g_dwelltime(struct wlan_objmgr_psoc *psoc, 705 uint32_t dwell_time) 706 { 707 return wlan_scan_cfg_set_active_2g_dwelltime(psoc, dwell_time); 708 } 709 710 /** 711 * ucfg_scan_cfg_get_active_dwelltime() - API to get active dwelltime 712 * @psoc: pointer to psoc object 713 * @dwell_time: scan active dwelltime 714 * 715 * Return: scan active dwell time 716 */ 717 static inline 718 void ucfg_scan_cfg_get_active_dwelltime(struct wlan_objmgr_psoc *psoc, 719 uint32_t *dwell_time) 720 { 721 return wlan_scan_cfg_get_active_dwelltime(psoc, dwell_time); 722 } 723 724 /** 725 * ucfg_scan_cfg_set_passive_dwelltime() - API to set scan passive dwelltime 726 * @psoc: pointer to psoc object 727 * @dwell_time: scan passive dwell time 728 * 729 * Return: none 730 */ 731 static inline 732 void ucfg_scan_cfg_set_passive_dwelltime(struct wlan_objmgr_psoc *psoc, 733 uint32_t dwell_time) 734 { 735 return wlan_scan_cfg_set_passive_dwelltime(psoc, dwell_time); 736 } 737 /** 738 * ucfg_scan_cfg_get_passive_dwelltime() - API to get passive dwelltime 739 * @psoc: pointer to psoc object 740 * @dwell_time: scan passive dwelltime 741 * 742 * Return: scan passive dwell time 743 */ 744 static inline 745 void ucfg_scan_cfg_get_passive_dwelltime(struct wlan_objmgr_psoc *psoc, 746 uint32_t *dwell_time) 747 { 748 return wlan_scan_cfg_get_passive_dwelltime(psoc, dwell_time); 749 } 750 751 /** 752 * ucfg_scan_cfg_get_active_2g_dwelltime() - API to get active 2g dwelltime 753 * @psoc: pointer to psoc object 754 * @dwell_time: scan active 2g dwelltime 755 * 756 * Return: scan active 2g dwelltime 757 */ 758 static inline 759 void ucfg_scan_cfg_get_active_2g_dwelltime(struct wlan_objmgr_psoc *psoc, 760 uint32_t *dwell_time) 761 { 762 return wlan_scan_cfg_get_active_2g_dwelltime(psoc, dwell_time); 763 } 764 765 #ifdef CONFIG_BAND_6GHZ 766 /** 767 * ucfg_scan_cfg_set_active_6g_dwelltime() - API to set scan active 6g dwelltime 768 * @psoc: pointer to psoc object 769 * @dwell_time: scan active dwell time 770 * 771 * Return: QDF_STATUS 772 */ 773 static inline 774 QDF_STATUS ucfg_scan_cfg_set_active_6g_dwelltime(struct wlan_objmgr_psoc *psoc, 775 uint32_t dwell_time) 776 { 777 return wlan_scan_cfg_set_active_6g_dwelltime(psoc, dwell_time); 778 } 779 780 /** 781 * ucfg_scan_cfg_get_passive_6g_dwelltime() - API to get passive 6g dwelltime 782 * @psoc: pointer to psoc object 783 * @dwell_time: scan passive 6g dwelltime 784 * 785 * Return: QDF_STATUS 786 */ 787 static inline 788 QDF_STATUS ucfg_scan_cfg_get_passive_6g_dwelltime(struct wlan_objmgr_psoc *psoc, 789 uint32_t *dwell_time) 790 { 791 return wlan_scan_cfg_get_passive_6g_dwelltime(psoc, dwell_time); 792 } 793 794 /** 795 * ucfg_scan_cfg_set_passive_6g_dwelltime() - API to set scan passive 6g 796 * dwelltime 797 * @psoc: pointer to psoc object 798 * @dwell_time: scan passive dwell time 799 * 800 * Return: QDF_STATUS 801 */ 802 static inline 803 QDF_STATUS ucfg_scan_cfg_set_passive_6g_dwelltime(struct wlan_objmgr_psoc *psoc, 804 uint32_t dwell_time) 805 { 806 return wlan_scan_cfg_set_passive_6g_dwelltime(psoc, dwell_time); 807 } 808 809 /** 810 * ucfg_scan_cfg_get_active_6g_dwelltime() - API to get active 6g dwelltime 811 * @psoc: pointer to psoc object 812 * @dwell_time: scan active 6g dwelltime 813 * 814 * Return: QDF_STATUS 815 */ 816 static inline 817 QDF_STATUS ucfg_scan_cfg_get_active_6g_dwelltime(struct wlan_objmgr_psoc *psoc, 818 uint32_t *dwell_time) 819 { 820 return wlan_scan_cfg_get_active_6g_dwelltime(psoc, dwell_time); 821 } 822 #endif 823 824 /** 825 * ucfg_scan_cfg_get_conc_active_dwelltime() - Get concurrent active dwelltime 826 * @psoc: pointer to psoc object 827 * @dwell_time: scan active dwelltime 828 * 829 * Return: scan concurrent active dwell time 830 */ 831 static inline 832 void ucfg_scan_cfg_get_conc_active_dwelltime(struct wlan_objmgr_psoc *psoc, 833 uint32_t *dwell_time) 834 { 835 return wlan_scan_cfg_get_conc_active_dwelltime(psoc, dwell_time); 836 } 837 838 /** 839 * ucfg_scan_cfg_set_conc_active_dwelltime() - Set concurrent active dwelltime 840 * @psoc: pointer to psoc object 841 * @dwell_time: scan active dwelltime 842 * 843 * Return: scan concurrent active dwell time 844 */ 845 static inline 846 void ucfg_scan_cfg_set_conc_active_dwelltime(struct wlan_objmgr_psoc *psoc, 847 uint32_t dwell_time) 848 { 849 return wlan_scan_cfg_set_conc_active_dwelltime(psoc, dwell_time); 850 } 851 852 /** 853 * ucfg_scan_cfg_get_conc_passive_dwelltime() - Get passive concurrent dwelltime 854 * @psoc: pointer to psoc object 855 * @dwell_time: scan passive dwelltime 856 * 857 * Return: scan concurrent passive dwell time 858 */ 859 static inline 860 void ucfg_scan_cfg_get_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc, 861 uint32_t *dwell_time) 862 { 863 return wlan_scan_cfg_get_conc_passive_dwelltime(psoc, dwell_time); 864 } 865 866 /** 867 * ucfg_scan_cfg_set_conc_passive_dwelltime() - Set passive concurrent dwelltime 868 * @psoc: pointer to psoc object 869 * @dwell_time: scan passive dwelltime 870 * 871 * Return: scan concurrent passive dwell time 872 */ 873 static inline 874 void ucfg_scan_cfg_set_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc, 875 uint32_t dwell_time) 876 { 877 return wlan_scan_cfg_set_conc_passive_dwelltime(psoc, dwell_time); 878 } 879 880 /** 881 * ucfg_scan_cfg_get_dfs_chan_scan_allowed() - API to get dfs scan enabled 882 * @psoc: pointer to psoc object 883 * @enable_dfs_scan: DFS scan enabled or not. 884 * 885 * Return: None 886 */ 887 static inline 888 void ucfg_scan_cfg_get_dfs_chan_scan_allowed(struct wlan_objmgr_psoc *psoc, 889 bool *dfs_scan_enable) 890 { 891 return wlan_scan_cfg_get_dfs_chan_scan_allowed(psoc, dfs_scan_enable); 892 } 893 894 /** 895 * ucfg_scan_cfg_set_dfs_channel_scan() - API to set dfs scan enabled 896 * @psoc: pointer to psoc object 897 * @enable_dfs_scan: Set DFS scan enabled or not. 898 * 899 * Return: None 900 */ 901 static inline 902 void ucfg_scan_cfg_set_dfs_chan_scan_allowed(struct wlan_objmgr_psoc *psoc, 903 bool dfs_scan_enable) 904 { 905 return wlan_scan_cfg_set_dfs_chan_scan_allowed(psoc, dfs_scan_enable); 906 } 907 908 /** 909 * ucfg_scan_wake_lock_in_user_scan() - API to determine if wake lock in user 910 * scan is used. 911 * @psoc: pointer to psoc object 912 * 913 * Return: true if wake lock in user scan is required 914 */ 915 bool ucfg_scan_wake_lock_in_user_scan(struct wlan_objmgr_psoc *psoc); 916 917 /** 918 * ucfg_scan_cfg_honour_nl_scan_policy_flags() - API to get nl scan policy 919 * flags honoured. 920 * @psoc: pointer to psoc object 921 * 922 * Return: nl scan flags is honoured or not 923 */ 924 static inline 925 bool ucfg_scan_cfg_honour_nl_scan_policy_flags(struct wlan_objmgr_psoc *psoc) 926 { 927 return wlan_scan_cfg_honour_nl_scan_policy_flags(psoc); 928 } 929 930 /** 931 * ucfg_scan_cfg_get_conc_max_resttime() - API to get max rest time 932 * @psoc: pointer to psoc object 933 * @rest_time: scan concurrent max resttime 934 * 935 * Return: scan concurrent max rest time 936 */ 937 static inline 938 void ucfg_scan_cfg_get_conc_max_resttime(struct wlan_objmgr_psoc *psoc, 939 uint32_t *rest_time) 940 { 941 return wlan_scan_cfg_get_conc_max_resttime(psoc, rest_time); 942 } 943 944 /** 945 * ucfg_scan_cfg_get_conc_min_resttime() - API to get concurrent min rest time 946 * @psoc: pointer to psoc object 947 * @rest_time: scan concurrent min rest time 948 * 949 * Return: scan concurrent min rest time 950 */ 951 static inline 952 void ucfg_scan_cfg_get_conc_min_resttime(struct wlan_objmgr_psoc *psoc, 953 uint32_t *rest_time) 954 { 955 return wlan_scan_cfg_get_conc_min_resttime(psoc, rest_time); 956 } 957 958 #ifdef FEATURE_WLAN_SCAN_PNO 959 /** 960 * ucfg_scan_is_pno_offload_enabled() - Check if pno offload is enabled 961 * @psoc: pointer to psoc object 962 * 963 * Return: pno_offload_enabled flag 964 */ 965 bool ucfg_scan_is_pno_offload_enabled(struct wlan_objmgr_psoc *psoc); 966 967 /** 968 * ucfg_scan_set_pno_offload() - API to set pno offload flag based on the 969 * capability received from the firmware. 970 * @psoc: pointer to psoc object 971 * @rest_time: scan concurrent min rest time 972 * 973 * Return: scan concurrent min rest time 974 */ 975 void ucfg_scan_set_pno_offload(struct wlan_objmgr_psoc *psoc, bool value); 976 977 /** 978 * ucfg_scan_get_pno_scan_support() - Check if pno scan support is enabled 979 * @psoc: pointer to psoc object 980 * 981 * Return: scan_support_enabled flag 982 */ 983 bool ucfg_scan_get_pno_scan_support(struct wlan_objmgr_psoc *psoc); 984 985 /** 986 * ucfg_get_scan_backoff_multiplier() - get scan backoff multiplier value 987 * @psoc: pointer to psoc object 988 * 989 * Return: scan_support_enabled flag 990 */ 991 uint8_t ucfg_get_scan_backoff_multiplier(struct wlan_objmgr_psoc *psoc); 992 993 /** 994 * ucfg_scan_is_dfs_chnl_scan_enabled() - Check if PNO dfs channel scan support 995 * is enabled 996 * @psoc: pointer to psoc object 997 * 998 * Return: dfs_chnl_scan_enabled flag 999 */ 1000 bool ucfg_scan_is_dfs_chnl_scan_enabled(struct wlan_objmgr_psoc *psoc); 1001 1002 /** 1003 * ucfg_scan_get_scan_timer_repeat_value() - API to get PNO scan timer repeat 1004 * value 1005 * @psoc: pointer to psoc object 1006 * 1007 * Return: scan_timer_repeat_value 1008 */ 1009 uint32_t ucfg_scan_get_scan_timer_repeat_value(struct wlan_objmgr_psoc *psoc); 1010 1011 /** 1012 * ucfg_scan_get_slow_scan_multiplier() - API to get PNO slow scan multiplier 1013 * value 1014 * @psoc: pointer to psoc object 1015 * 1016 * Return: slow_scan_multiplier value 1017 */ 1018 uint32_t ucfg_scan_get_slow_scan_multiplier(struct wlan_objmgr_psoc *psoc); 1019 1020 /** 1021 * ucfg_scan_get_max_sched_scan_plan_interval() - API to get maximum scheduled 1022 * scan plan interval 1023 * @psoc: pointer to psoc object 1024 * 1025 * Return: max_sched_scan_plan_interval value. 1026 */ 1027 uint32_t 1028 ucfg_scan_get_max_sched_scan_plan_interval(struct wlan_objmgr_psoc *psoc); 1029 1030 /** 1031 * ucfg_scan_get_max_sched_scan_plan_iterations() - API to get maximum scheduled 1032 * scan plan iterations 1033 * @psoc: pointer to psoc object 1034 * 1035 * Return: value. 1036 */ 1037 uint32_t 1038 ucfg_scan_get_max_sched_scan_plan_iterations(struct wlan_objmgr_psoc *psoc); 1039 1040 /** 1041 * ucfg_scan_get_user_config_sched_scan_plan() - API to get user config sched 1042 * scan plan configuration value 1043 * @psoc: pointer to psoc object 1044 * 1045 * Return: value. 1046 */ 1047 bool 1048 ucfg_scan_get_user_config_sched_scan_plan(struct wlan_objmgr_psoc *psoc); 1049 1050 #ifdef WLAN_POLICY_MGR_ENABLE 1051 /* 1052 * ucfg_scan_update_pno_dwell_time() - update active and passive dwell time 1053 * depending on active concurrency modes 1054 * @vdev: vdev object pointer 1055 * @req: scan request 1056 * 1057 * Return: void 1058 */ 1059 static inline 1060 void ucfg_scan_update_pno_dwell_time(struct wlan_objmgr_vdev *vdev, 1061 struct pno_scan_req_params *req, 1062 struct scan_default_params *scan_def) 1063 { 1064 wlan_scan_update_pno_dwell_time(vdev, req, scan_def); 1065 } 1066 1067 #else 1068 static inline 1069 void ucfg_scan_update_pno_dwell_time(struct wlan_objmgr_vdev *vdev, 1070 struct pno_scan_req_params *req, 1071 struct scan_default_params *scan_def) 1072 {} 1073 1074 #endif 1075 1076 #else 1077 static inline 1078 bool ucfg_scan_is_pno_offload_enabled(struct wlan_objmgr_psoc *psoc) 1079 { 1080 return 0; 1081 } 1082 1083 static inline 1084 void ucfg_scan_set_pno_offload(struct wlan_objmgr_psoc *psoc, bool value) 1085 { 1086 } 1087 1088 static inline 1089 bool ucfg_scan_get_pno_scan_support(struct wlan_objmgr_psoc *psoc) 1090 { 1091 return 0; 1092 } 1093 1094 static inline 1095 uint8_t ucfg_get_scan_backoff_multiplier(struct wlan_objmgr_psoc *psoc) 1096 { 1097 return 0; 1098 } 1099 1100 static inline 1101 bool ucfg_scan_is_dfs_chnl_scan_enabled(struct wlan_objmgr_psoc *psoc) 1102 { 1103 return 0; 1104 } 1105 1106 static inline 1107 uint32_t ucfg_scan_get_scan_timer_repeat_value(struct wlan_objmgr_psoc *psoc) 1108 { 1109 return 0; 1110 } 1111 1112 static inline 1113 uint32_t ucfg_scan_get_slow_scan_multiplier(struct wlan_objmgr_psoc *psoc) 1114 { 1115 return 0; 1116 } 1117 1118 static inline uint32_t 1119 ucfg_scan_get_max_sched_scan_plan_interval(struct wlan_objmgr_psoc *psoc) 1120 { 1121 return 0; 1122 } 1123 1124 static inline uint32_t 1125 ucfg_scan_get_max_sched_scan_plan_iterations(struct wlan_objmgr_psoc *psoc) 1126 { 1127 return 0; 1128 } 1129 1130 static inline bool 1131 ucfg_scan_get_user_config_sched_scan_plan(struct wlan_objmgr_psoc *psoc) 1132 { 1133 return true; 1134 } 1135 1136 #endif /* FEATURE_WLAN_SCAN_PNO */ 1137 1138 /** 1139 * ucfg_scan_is_connected_scan_enabled() - API to get scan enabled after connect 1140 * @psoc: pointer to psoc object 1141 * 1142 * Return: value. 1143 */ 1144 bool ucfg_scan_is_connected_scan_enabled(struct wlan_objmgr_psoc *psoc); 1145 1146 /** 1147 * ucfg_scan_is_snr_monitor_enabled() - API to get SNR monitoring enabled or not 1148 * @psoc: pointer to psoc object 1149 * 1150 * Return: value. 1151 */ 1152 static inline 1153 bool ucfg_scan_is_snr_monitor_enabled(struct wlan_objmgr_psoc *psoc) 1154 { 1155 return wlan_scan_is_snr_monitor_enabled(psoc); 1156 } 1157 #endif 1158