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