1 /* 2 * Copyright (c) 2017-2018 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 init/deinit public api 21 */ 22 23 #ifndef _WLAN_SCAN_MAIN_API_H_ 24 #define _WLAN_SCAN_MAIN_API_H_ 25 26 #include <qdf_atomic.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_cache_db.h" 32 #include "wlan_scan_11d.h" 33 34 #define scm_alert(params...) \ 35 QDF_TRACE_FATAL(QDF_MODULE_ID_SCAN, params) 36 #define scm_err(params...) \ 37 QDF_TRACE_ERROR(QDF_MODULE_ID_SCAN, params) 38 #define scm_warn(params...) \ 39 QDF_TRACE_WARN(QDF_MODULE_ID_SCAN, params) 40 #define scm_notice(params...) \ 41 QDF_TRACE_INFO(QDF_MODULE_ID_SCAN, params) 42 #define scm_info(params...) \ 43 QDF_TRACE_INFO(QDF_MODULE_ID_SCAN, params) 44 #define scm_debug(params...) \ 45 QDF_TRACE_DEBUG(QDF_MODULE_ID_SCAN, params) 46 47 #define scm_hex_dump(level, data, buf_len) \ 48 qdf_trace_hex_dump(QDF_MODULE_ID_SCAN, level, data, buf_len) 49 50 51 #define MAX_SCAN_EVENT_HANDLERS_PER_PDEV 100 52 #define WLAN_MAX_MODULE_NAME 40 53 #define WLAN_MAX_REQUESTORS 200 54 #define WLAN_SCAN_ID_MASK 0x00000FFF 55 #define WLAN_HOST_SCAN_REQ_ID_PREFIX 0x0000A000 56 #define SCAN_NPROBES_DEFAULT 2 57 #define WLAN_P2P_SOCIAL_CHANNELS 3 58 59 #define SCAN_BURST_SCAN_MAX_NUM_OFFCHANNELS (3) 60 #define SCAN_SCAN_IDLE_TIME_DEFAULT (25) 61 #define SCAN_3PORT_CONC_SCAN_MAX_BURST_DURATION (25) 62 #define SCAN_CTS_DURATION_MS_MAX (32) 63 #define SCAN_ROAM_SCAN_CHANNEL_SWITCH_TIME (4) 64 #define SCAN_DWELL_TIME_PROBE_TIME_MAP_SIZE (11) 65 #define SCAN_GO_MIN_ACTIVE_SCAN_BURST_DURATION (40) 66 #define SCAN_GO_MAX_ACTIVE_SCAN_BURST_DURATION (120) 67 #define SCAN_P2P_SCAN_MAX_BURST_DURATION (180) 68 69 /** 70 * struct probe_time_dwell_time - probe time, dwell time map 71 * @dwell_time: dwell time 72 * @probe_time: repeat probe time 73 */ 74 struct probe_time_dwell_time { 75 uint8_t dwell_time; 76 uint8_t probe_time; 77 }; 78 79 /* 80 * For the requestor id: 81 * bit 0~12 is used for real requestor id. 82 * bit 13~15 is used for requestor prefix. 83 * bit 16~19 is used by specific user to aware it is issued by himself. 84 * bit 20~31 is reserved. 85 */ 86 #define WLAN_SCAN_REQUESTER_ID_PREFIX 0x0000A000 87 #define WLAN_SCAN_REQUESTER_ID_MASK 0x00001FFF 88 89 #define SCM_NUM_RSSI_CAT 15 90 #define SCAN_STA_MIRACAST_MCC_REST_TIME 400 91 92 #ifdef CONFIG_MCL 93 #define MAX_SCAN_CACHE_SIZE 300 94 #define SCAN_ACTIVE_DWELL_TIME 40 95 #define SCAN_PASSIVE_DWELL_TIME 110 96 #define SCAN_MAX_REST_TIME 0 97 #define SCAN_MIN_REST_TIME 0 98 #define SCAN_BURST_DURATION 0 99 #define SCAN_CONC_ACTIVE_DWELL_TIME 20 100 #define SCAN_CONC_PASSIVE_DWELL_TIME 100 101 #define SCAN_CONC_IDLE_TIME 25 102 #define SCAN_CONC_MAX_REST_TIME 20 103 #define SCAN_CONC_MIN_REST_TIME 10 104 #define SCAN_REPEAT_PROBE_TIME 20 105 #define SCAN_PROBE_SPACING_TIME 0 106 #define SCAN_PROBE_DELAY 0 107 #define SCAN_MAX_SCAN_TIME 30000 108 #define SCAN_NUM_PROBES 2 109 #define SCAN_NETWORK_IDLE_TIMEOUT 0 110 #define HIDDEN_SSID_TIME (1*60*1000) 111 #define SCAN_CHAN_STATS_EVENT_ENAB (false) 112 #else 113 #define MAX_SCAN_CACHE_SIZE 1024 114 #define SCAN_ACTIVE_DWELL_TIME 105 115 #define SCAN_PASSIVE_DWELL_TIME 300 116 #define SCAN_MAX_REST_TIME 0 117 #define SCAN_MIN_REST_TIME 50 118 #define SCAN_BURST_DURATION 0 119 #define SCAN_CONC_ACTIVE_DWELL_TIME 0 120 #define SCAN_CONC_PASSIVE_DWELL_TIME 0 121 #define SCAN_CONC_IDLE_TIME 0 122 #define SCAN_CONC_MAX_REST_TIME 0 123 #define SCAN_CONC_MIN_REST_TIME 0 124 #define SCAN_REPEAT_PROBE_TIME 50 125 #define SCAN_PROBE_SPACING_TIME 0 126 #define SCAN_PROBE_DELAY 0 127 #define SCAN_MAX_SCAN_TIME 50000 128 #define SCAN_NUM_PROBES 0 129 #define SCAN_NETWORK_IDLE_TIMEOUT 200 130 #define HIDDEN_SSID_TIME (0xFFFFFFFF) 131 #define SCAN_CHAN_STATS_EVENT_ENAB (true) 132 #endif 133 134 #define SCAN_TIMEOUT_GRACE_PERIOD 10 135 /* scan age time in millisec */ 136 #ifdef QCA_WIFI_NAPIER_EMULATION 137 #define SCAN_CACHE_AGING_TIME (90 * 1000) 138 #else 139 #define SCAN_CACHE_AGING_TIME (30 * 1000) 140 #endif 141 #define SCAN_MAX_BSS_PDEV 100 142 #define SCAN_PRIORITY SCAN_PRIORITY_LOW 143 144 /* DBS Scan policy selection ext flags */ 145 #define SCAN_FLAG_EXT_DBS_SCAN_POLICY_MASK 0x00000003 146 #define SCAN_FLAG_EXT_DBS_SCAN_POLICY_BIT 0 147 #define SCAN_DBS_POLICY_DEFAULT 0x0 148 #define SCAN_DBS_POLICY_FORCE_NONDBS 0x1 149 #define SCAN_DBS_POLICY_IGNORE_DUTY 0x2 150 #define SCAN_DBS_POLICY_MAX 0x3 151 /* Minimum number of channels for enabling DBS Scan */ 152 #define SCAN_MIN_CHAN_DBS_SCAN_THRESHOLD 8 153 /* 154 * Enable Reception of Public Action frame with this flag 155 */ 156 #define SCAN_FLAG_EXT_FILTER_PUBLIC_ACTION_FRAME 0x4 157 158 /* Passive dwell time if bt_a2dp is enabled. Time in msecs*/ 159 #define PASSIVE_DWELL_TIME_BT_A2DP_ENABLED 28 160 161 /** 162 * struct cb_handler - defines scan event handler 163 * call back function and arguments 164 * @func: handler function pointer 165 * @arg: argument to handler function 166 */ 167 struct cb_handler { 168 scan_event_handler func; 169 void *arg; 170 }; 171 172 /** 173 * struct pdev_scan_ev_handler - pdev scan event handlers 174 * @cb_handler: array of registered scan handlers 175 */ 176 struct pdev_scan_ev_handler { 177 uint32_t handler_cnt; 178 struct cb_handler cb_handlers[MAX_SCAN_EVENT_HANDLERS_PER_PDEV]; 179 }; 180 181 /** 182 * struct global_scan_ev_handlers - per pdev registered scan event handlers 183 * @pdev_scan_ev_handler: per pdev registered scan event handlers 184 */ 185 struct global_scan_ev_handlers { 186 struct pdev_scan_ev_handler pdev_ev_handlers[WLAN_UMAC_MAX_PDEVS]; 187 }; 188 189 /** 190 * struct scan_requester_info - defines scan requester id 191 * and event handler mapping 192 * @requester: requester ID allocated 193 * @module: module name of requester 194 * @ev_handler: event handlerto be invoked 195 */ 196 struct scan_requester_info { 197 wlan_scan_requester requester; 198 uint8_t module[WLAN_MAX_MODULE_NAME]; 199 struct cb_handler ev_handler; 200 }; 201 202 /** 203 * struct pdev_scan_info - defines per pdev scan info 204 * @wide_band_scan: wide band scan capability 205 * @last_scan_time: time of last scan start on this pdev 206 * @custom_chan_list: scan only these channels 207 */ 208 struct pdev_scan_info { 209 bool wide_band_scan; 210 qdf_time_t last_scan_time; 211 struct chan_list custom_chan_list; 212 }; 213 214 /** 215 * struct scan_vdev_obj - scan vdev obj 216 * @pno_match_evt_received: pno match received 217 * @pno_in_progress: pno in progress 218 * @is_vdev_delete_in_progress: flag to indicate if vdev del is in progress 219 */ 220 struct scan_vdev_obj { 221 bool pno_match_evt_received; 222 bool pno_in_progress; 223 bool is_vdev_delete_in_progress; 224 }; 225 226 /** 227 * struct pno_def_config - def configuration for PNO 228 * @channel_prediction: config PNO channel prediction feature status 229 * @top_k_num_of_channels: def top K number of channels are used for tanimoto 230 * distance calculation. 231 * @stationary_thresh: def threshold val to determine that STA is stationary. 232 * @pnoscan_adaptive_dwell_mode: def adaptive dwelltime mode for pno scan 233 * @channel_prediction_full_scan: def periodic timer upon which full scan needs 234 * to be triggered. 235 * @pno_wake_lock: pno wake lock 236 * @pno_cb: callback to call on PNO completion 237 * @mawc_params: Configuration parameters for NLO MAWC. 238 */ 239 struct pno_def_config { 240 bool channel_prediction; 241 uint8_t top_k_num_of_channels; 242 uint8_t stationary_thresh; 243 enum scan_dwelltime_adaptive_mode adaptive_dwell_mode; 244 uint32_t channel_prediction_full_scan; 245 qdf_wake_lock_t pno_wake_lock; 246 struct cb_handler pno_cb; 247 struct nlo_mawc_params mawc_params; 248 }; 249 250 251 /** 252 * struct scan_default_params - default scan parameters to be used 253 * @active_dwell: default active dwell time 254 * @passive_dwell:default passive dwell time 255 * @max_rest_time: default max rest time 256 * @sta_miracast_mcc_rest_time: max rest time for miracast and mcc 257 * @min_rest_time: default min rest time 258 * @idle_time: default idle time 259 * @conc_active_dwell: default concurrent active dwell time 260 * @conc_passive_dwell: default concurrent passive dwell time 261 * @conc_max_rest_time: default concurrent max rest time 262 * @conc_min_rest_time: default concurrent min rest time 263 * @conc_idle_time: default concurrent idle time 264 * @repeat_probe_time: default repeat probe time 265 * @probe_spacing_time: default probe spacing time 266 * @probe_delay: default probe delay 267 * @burst_duration: default burst duration 268 * @max_scan_time: default max scan time 269 * @num_probes: default maximum number of probes to sent 270 * @cache_aging_time: default scan cache aging time 271 * @prefer_5ghz: Prefer 5ghz AP over 2.4Ghz AP 272 * @select_5gh_margin: Prefer connecting to 5G AP even if 273 * its RSSI is lower by select_5gh_margin dbm than 2.4G AP. 274 * applicable if prefer_5ghz is set. 275 * @is_bssid_hint_priority: True if bssid_hint is given priority 276 * @enable_mac_spoofing: enable mac address spoof in scan 277 * @bss_prefer_val: bss prefer value for the RSSI category 278 * @rssi_cat: RSSI category 279 * @max_bss_per_pdev: maximum number of bss entries to be maintained per pdev 280 * @max_active_scans_allowed: maximum number of active parallel scan allowed 281 * per psoc 282 * @scan_priority: default scan priority 283 * @scan_f_passive: passively scan all channels including active channels 284 * @scan_f_bcast_probe: add wild card ssid prbreq even if ssid_list is specified 285 * @scan_f_cck_rates: add cck rates to rates/xrates ie in prb req 286 * @scan_f_ofdm_rates: add ofdm rates to rates/xrates ie in prb req 287 * @scan_f_chan_stat_evnt: enable indication of chan load and noise floor 288 * @scan_f_filter_prb_req: filter Probe request frames 289 * @scan_f_bypass_dfs_chn: when set, do not scan DFS channels 290 * @scan_f_continue_on_err:continue scan even if few certain erros have occurred 291 * @scan_f_offchan_mgmt_tx: allow mgmt transmission during off channel scan 292 * @scan_f_offchan_data_tx: allow data transmission during off channel scan 293 * @scan_f_promisc_mode: scan with promiscuous mode 294 * @scan_f_capture_phy_err: enable capture ppdu with phy errrors 295 * @scan_f_strict_passive_pch: do passive scan on passive channels 296 * @scan_f_half_rate: enable HALF (10MHz) rate support 297 * @scan_f_quarter_rate: set Quarter (5MHz) rate support 298 * @scan_f_force_active_dfs_chn: allow to send probe req on DFS channel 299 * @scan_f_add_tpc_ie_in_probe: add TPC ie in probe req frame 300 * @scan_f_add_ds_ie_in_probe: add DS ie in probe req frame 301 * @scan_f_add_spoofed_mac_in_probe: use random mac address for TA in probe 302 * @scan_f_add_rand_seq_in_probe: use random sequence number in probe 303 * @scan_f_en_ie_whitelist_in_probe: enable ie whitelist in probe 304 * @scan_f_forced: force scan even in presence of data traffic 305 * @scan_f_2ghz: scan 2.4 GHz channels 306 * @scan_f_5ghz: scan 5 GHz channels 307 * @scan_f_wide_band: scan in 40 MHz or higher bandwidth 308 * @scan_flags: variable to read and set scan_f_* flags in one shot 309 * can be used to dump all scan_f_* flags for debug 310 * @scan_ev_started: notify scan started event 311 * @scan_ev_completed: notify scan completed event 312 * @scan_ev_bss_chan: notify bss chan event 313 * @scan_ev_foreign_chan: notify foreign chan event 314 * @scan_ev_dequeued: notify scan request dequed event 315 * @scan_ev_preempted: notify scan preempted event 316 * @scan_ev_start_failed: notify scan start failed event 317 * @scan_ev_restarted: notify scan restarted event 318 * @scan_ev_foreign_chn_exit: notify foreign chan exit event 319 * @scan_ev_invalid: notify invalid scan request event 320 * @scan_ev_gpio_timeout: notify gpio timeout event 321 * @scan_ev_suspended: notify scan suspend event 322 * @scan_ev_resumed: notify scan resumed event 323 * @scan_events: variable to read and set scan_ev_* flags in one shot 324 * can be used to dump all scan_ev_* flags for debug 325 * @roam_params: roam related params 326 */ 327 struct scan_default_params { 328 uint32_t active_dwell; 329 uint32_t passive_dwell; 330 uint32_t max_rest_time; 331 uint32_t sta_miracast_mcc_rest_time; 332 uint32_t min_rest_time; 333 uint32_t idle_time; 334 uint32_t conc_active_dwell; 335 uint32_t conc_passive_dwell; 336 uint32_t conc_max_rest_time; 337 uint32_t conc_min_rest_time; 338 uint32_t conc_idle_time; 339 uint32_t repeat_probe_time; 340 uint32_t probe_spacing_time; 341 uint32_t probe_delay; 342 uint32_t burst_duration; 343 uint32_t max_scan_time; 344 uint32_t num_probes; 345 uint32_t scan_cache_aging_time; 346 uint32_t prefer_5ghz; 347 uint32_t select_5ghz_margin; 348 bool enable_mac_spoofing; 349 bool is_bssid_hint_priority; 350 uint32_t usr_cfg_probe_rpt_time; 351 uint32_t usr_cfg_num_probes; 352 /* each RSSI category has one value */ 353 uint32_t bss_prefer_val[SCM_NUM_RSSI_CAT]; 354 int rssi_cat[SCM_NUM_RSSI_CAT]; 355 uint16_t max_bss_per_pdev; 356 uint32_t max_active_scans_allowed; 357 enum scan_priority scan_priority; 358 enum scan_dwelltime_adaptive_mode adaptive_dwell_time_mode; 359 union { 360 struct { 361 uint32_t scan_f_passive:1, 362 scan_f_bcast_probe:1, 363 scan_f_cck_rates:1, 364 scan_f_ofdm_rates:1, 365 scan_f_chan_stat_evnt:1, 366 scan_f_filter_prb_req:1, 367 scan_f_bypass_dfs_chn:1, 368 scan_f_continue_on_err:1, 369 scan_f_offchan_mgmt_tx:1, 370 scan_f_offchan_data_tx:1, 371 scan_f_promisc_mode:1, 372 scan_f_capture_phy_err:1, 373 scan_f_strict_passive_pch:1, 374 scan_f_half_rate:1, 375 scan_f_quarter_rate:1, 376 scan_f_force_active_dfs_chn:1, 377 scan_f_add_tpc_ie_in_probe:1, 378 scan_f_add_ds_ie_in_probe:1, 379 scan_f_add_spoofed_mac_in_probe:1, 380 scan_f_add_rand_seq_in_probe:1, 381 scan_f_en_ie_whitelist_in_probe:1, 382 scan_f_forced:1, 383 scan_f_2ghz:1, 384 scan_f_5ghz:1, 385 scan_f_wide_band:1; 386 }; 387 uint32_t scan_flags; 388 }; 389 union { 390 struct { 391 uint32_t scan_ev_started:1, 392 scan_ev_completed:1, 393 scan_ev_bss_chan:1, 394 scan_ev_foreign_chan:1, 395 scan_ev_dequeued:1, 396 scan_ev_preempted:1, 397 scan_ev_start_failed:1, 398 scan_ev_restarted:1, 399 scan_ev_foreign_chn_exit:1, 400 scan_ev_invalid:1, 401 scan_ev_gpio_timeout:1, 402 scan_ev_suspended:1, 403 scan_ev_resumed:1; 404 }; 405 uint32_t scan_events; 406 }; 407 struct roam_filter_params roam_params; 408 struct scoring_config score_config; 409 }; 410 411 /** 412 * struct scan_cb - nif/sif function callbacks 413 * @inform_beacon: cb to indicate frame to OS 414 * @update_beacon: cb to indicate frame to MLME 415 */ 416 struct scan_cb { 417 update_beacon_cb inform_beacon; 418 update_beacon_cb update_beacon; 419 /* Define nif/sif function callbacks here */ 420 }; 421 422 /** 423 * struct wlan_scan_obj - scan object definition 424 * @enable_scan: if scan is enabled 425 * @scan_db: scan cache data base 426 * @cc_db: pointer of country code data base 427 * @lock: spin lock 428 * @scan_def: default scan parameters 429 * @cb: nif/sif function callbacks 430 * @requesters: requester allocation pool 431 * @scan_ids: last allocated scan id 432 * @global_evhandlers: registered scan event handlers 433 * @pdev_info: pointer to pdev info 434 * @pno_cfg: default pno configuration 435 * @ie_whitelist: default ie whitelist attrs 436 * @bt_a2dp_enabled: if bt a2dp is enabled 437 * @miracast_enabled: miracast enabled 438 * @disable_timeout: command timeout disabled 439 * @drop_bcn_on_chan_mismatch: drop bcn if channel mismatch 440 * @scan_start_request_buff: buffer used to pass 441 * scan config to event handlers 442 */ 443 struct wlan_scan_obj { 444 bool enable_scan; 445 qdf_spinlock_t lock; 446 qdf_atomic_t scan_ids; 447 struct scan_dbs scan_db[WLAN_UMAC_MAX_PDEVS]; 448 struct scan_country_code_db *cc_db; 449 struct scan_default_params scan_def; 450 struct scan_cb cb; 451 struct scan_requester_info requesters[WLAN_MAX_REQUESTORS]; 452 struct global_scan_ev_handlers global_evhandlers; 453 struct pdev_scan_info pdev_info[WLAN_UMAC_MAX_PDEVS]; 454 struct pno_def_config pno_cfg; 455 struct probe_req_whitelist_attr ie_whitelist; 456 bool bt_a2dp_enabled; 457 bool miracast_enabled; 458 bool disable_timeout; 459 bool drop_bcn_on_chan_mismatch; 460 struct scan_start_request scan_start_request_buff; 461 }; 462 463 /** 464 * wlan_psoc_get_scan_obj() - private API to get scan object from psoc 465 * @psoc: psoc object 466 * 467 * Return: scan object 468 */ 469 static inline struct wlan_scan_obj * 470 wlan_psoc_get_scan_obj(struct wlan_objmgr_psoc *psoc) 471 { 472 struct wlan_scan_obj *scan_obj; 473 474 scan_obj = (struct wlan_scan_obj *) 475 wlan_objmgr_psoc_get_comp_private_obj(psoc, 476 WLAN_UMAC_COMP_SCAN); 477 478 return scan_obj; 479 } 480 481 /** 482 * wlan_pdev_get_scan_obj() - private API to get scan object from pdev 483 * @psoc: pdev object 484 * 485 * Return: scan object 486 */ 487 static inline struct wlan_scan_obj * 488 wlan_pdev_get_scan_obj(struct wlan_objmgr_pdev *pdev) 489 { 490 struct wlan_objmgr_psoc *psoc; 491 492 psoc = wlan_pdev_get_psoc(pdev); 493 494 return wlan_psoc_get_scan_obj(psoc); 495 } 496 497 /** 498 * wlan_vdev_get_scan_obj() - private API to get scan object from vdev 499 * @psoc: vdev object 500 * 501 * Return: scan object 502 */ 503 static inline struct wlan_scan_obj * 504 wlan_vdev_get_scan_obj(struct wlan_objmgr_vdev *vdev) 505 { 506 struct wlan_objmgr_pdev *pdev; 507 508 pdev = wlan_vdev_get_pdev(vdev); 509 510 return wlan_pdev_get_scan_obj(pdev); 511 } 512 513 /** 514 * wlan_get_vdev_scan_obj() - private API to get scan object vdev 515 * @vdev: vdev object 516 * 517 * Return: scan object 518 */ 519 static inline struct scan_vdev_obj * 520 wlan_get_vdev_scan_obj(struct wlan_objmgr_vdev *vdev) 521 { 522 struct scan_vdev_obj *scan_vdev_obj; 523 524 scan_vdev_obj = (struct scan_vdev_obj *) 525 wlan_objmgr_vdev_get_comp_private_obj(vdev, 526 WLAN_UMAC_COMP_SCAN); 527 528 return scan_vdev_obj; 529 } 530 531 /** 532 * wlan_scan_vdev_get_pdev_id() - private API to get pdev id from vdev object 533 * @vdev: vdev object 534 * 535 * Return: parent pdev id 536 */ 537 static inline uint8_t 538 wlan_scan_vdev_get_pdev_id(struct wlan_objmgr_vdev *vdev) 539 { 540 struct wlan_objmgr_pdev *pdev; 541 542 pdev = wlan_vdev_get_pdev(vdev); 543 544 return wlan_objmgr_pdev_get_pdev_id(pdev); 545 } 546 547 /** 548 * wlan_pdev_get_pdev_scan_ev_handlers() - private API to get 549 * pdev scan event handlers 550 * @vdev: pdev object 551 * 552 * Return: pdev_scan_ev_handler object 553 */ 554 static inline struct pdev_scan_ev_handler* 555 wlan_pdev_get_pdev_scan_ev_handlers(struct wlan_objmgr_pdev *pdev) 556 { 557 uint8_t pdevid; 558 struct wlan_scan_obj *scan; 559 struct pdev_scan_ev_handler *pdev_ev_handler; 560 561 pdevid = wlan_objmgr_pdev_get_pdev_id(pdev); 562 563 scan = wlan_pdev_get_scan_obj(pdev); 564 565 pdev_ev_handler = 566 &scan->global_evhandlers.pdev_ev_handlers[pdevid]; 567 568 return pdev_ev_handler; 569 } 570 571 /** 572 * wlan_vdev_get_pdev_scan_ev_handlers() - private API to get 573 * pdev scan event handlers 574 * @vdev: vdev object 575 * 576 * Return: pdev_scan_ev_handler object 577 */ 578 static inline struct pdev_scan_ev_handler* 579 wlan_vdev_get_pdev_scan_ev_handlers(struct wlan_objmgr_vdev *vdev) 580 { 581 struct wlan_objmgr_pdev *pdev; 582 583 pdev = wlan_vdev_get_pdev(vdev); 584 585 return wlan_pdev_get_pdev_scan_ev_handlers(pdev); 586 } 587 588 /** 589 * wlan_scan_psoc_get_def_params() - private API to get scan defaults 590 * @psoc: psoc object 591 * 592 * Return: scan defaults 593 */ 594 static inline struct scan_default_params* 595 wlan_scan_psoc_get_def_params(struct wlan_objmgr_psoc *psoc) 596 { 597 struct wlan_scan_obj *scan = NULL; 598 599 if (!psoc) { 600 scm_err("null psoc"); 601 return NULL; 602 } 603 scan = wlan_psoc_get_scan_obj(psoc); 604 605 if (!scan) 606 return NULL; 607 608 return &scan->scan_def; 609 } 610 611 /** 612 * wlan_vdev_get_def_scan_params() - private API to get scan defaults 613 * @vdev: vdev object 614 * 615 * Return: scan defaults 616 */ 617 static inline struct scan_default_params* 618 wlan_vdev_get_def_scan_params(struct wlan_objmgr_vdev *vdev) 619 { 620 struct wlan_objmgr_psoc *psoc = NULL; 621 622 if (!vdev) { 623 scm_err("null vdev"); 624 return NULL; 625 } 626 psoc = wlan_vdev_get_psoc(vdev); 627 628 return wlan_scan_psoc_get_def_params(psoc); 629 } 630 631 /** 632 * wlan_scan_psoc_created_notification() - scan psoc create handler 633 * @psoc: psoc object 634 * @arg_list: Argument list 635 * 636 * Return: QDF_STATUS 637 */ 638 QDF_STATUS wlan_scan_psoc_created_notification(struct wlan_objmgr_psoc *psoc, 639 void *arg_list); 640 641 /** 642 * wlan_scan_psoc_deleted_notification() - scan psoc delete handler 643 * @psoc: psoc object 644 * @arg_list: Argument list 645 * 646 * Return: QDF_STATUS 647 */ 648 QDF_STATUS wlan_scan_psoc_destroyed_notification(struct wlan_objmgr_psoc *psoc, 649 void *arg_list); 650 651 /** 652 * wlan_scan_vdev_created_notification() - scan psoc create handler 653 * @vdev: vdev object 654 * @arg_list: Argument list 655 * 656 * Return: QDF_STATUS 657 */ 658 QDF_STATUS wlan_scan_vdev_created_notification(struct wlan_objmgr_vdev *vdev, 659 void *arg_list); 660 661 /** 662 * wlan_scan_vdev_destroyed_notification() - scan psoc delete handler 663 * @vdev: vdev object 664 * @arg_list: Argument list 665 * 666 * Return: QDF_STATUS 667 */ 668 QDF_STATUS wlan_scan_vdev_destroyed_notification(struct wlan_objmgr_vdev *vdev, 669 void *arg_list); 670 671 #endif 672