1 /* 2 * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. 3 * Copyright (c) 2021-2023 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 structure definitions 22 */ 23 24 #ifndef _WLAN_SCAN_STRUCTS_H_ 25 #define _WLAN_SCAN_STRUCTS_H_ 26 #include <wlan_cmn.h> 27 #include <qdf_time.h> 28 #include <qdf_list.h> 29 #include <qdf_atomic.h> 30 #include <wlan_cmn_ieee80211.h> 31 #include <wlan_mgmt_txrx_utils_api.h> 32 #include <reg_services_public_struct.h> 33 #ifdef WLAN_FEATURE_11BE_MLO 34 #include "wlan_mlo_mgr_public_structs.h" 35 #endif 36 37 typedef uint16_t wlan_scan_requester; 38 typedef uint32_t wlan_scan_id; 39 40 #define WLAN_SCAN_MAX_HINT_S_SSID 10 41 #define WLAN_SCAN_MAX_HINT_BSSID 10 42 /* 43 * For N(4 LINK) link MLO, Max RNR BSS will be given: 44 * 16(N_6G_LINKS) + N - (N_6G_LINKS) - 1(SELF_LINK) = 16*2 + N-2-1 = 33 45 */ 46 #define MAX_RNR_BSS 33 47 #define WLAN_SCAN_MAX_NUM_SSID 16 48 #define WLAN_SCAN_MAX_NUM_BSSID 4 49 50 #define SCM_CANCEL_SCAN_WAIT_TIME 50 51 #define SCM_CANCEL_SCAN_WAIT_ITERATION 600 52 53 #define INVAL_SCAN_ID 0xFFFFFFFF 54 #define CANCEL_HOST_SCAN_ID 0xFFFFFFFE 55 #define INVAL_VDEV_ID 0xFFFFFFFF 56 #define INVAL_PDEV_ID 0xFFFFFFFF 57 58 #define USER_SCAN_REQUESTOR_ID 0xA0000 59 #define PREAUTH_REQUESTOR_ID 0xC0000 60 61 #define BURST_SCAN_MAX_NUM_OFFCHANNELS 3 62 #define P2P_SCAN_MAX_BURST_DURATION 180 63 /* Increase dwell time for P2P search in ms */ 64 #define P2P_SEARCH_DWELL_TIME_INC 20 65 66 #define PROBE_REQ_BITMAP_LEN 8 67 #define MAX_PROBE_REQ_OUIS 16 68 69 #define TBTT_INFO_COUNT 16 70 71 /* 72 * IE Field nomenclature 73 * @MBSSID_INDICATOR_POS: Position of MaxBSSID indicator inside MBSSID tag 74 * @MIN_IE_LEN: 2bytes, which includes Tag Number and Tag length field 75 * @TAG_LEN_POS: Position of tag length field in MBSSID tag 76 * @VALID_ELEM_LEAST_LEN: Minimum fields required after tag length to call 77 * a MBSSID tag valid. (MaxBSSID Indicator + subelement ID + Subelement length 78 * atleast 1 byte of payload from subelement) 79 * @SUBELEMENT_START_POS: Starting position of 1st subelement in MBSSID tag 80 * @MAX_SUBELEM_LEN: Maximum length of a subelement 81 * @PAYLOAD_START_POS: Payload start position of a non tx bssid profile 82 * @FIXED_LENGTH: Length which includes header, timestamp, interval and 83 * capability 84 * @CAP_INFO_POS: Position of capability information in a non tx bssid profile 85 * @CAP_INFO_LEN: Length of capability information 86 * @SUBELEM_DATA_POS_FROM_MBSSID: Position of first byte of subelement payload 87 * from MBSSID Tag 88 * @ID_POS: Position of subelement ID in a non tx BSSID profile 89 * @NONTX_BSSID_CAP_TAG_LEN_POS: Position of tag length field of nontx bssid 90 * capability tag from starting of nontx bssid profile 91 * @VALID_BSS_PROF_LEAST_LEN: At least one tag should present to call it a valid 92 * non tx bssid profile and that is nothing but nontx bssid capability tag which 93 * is of 4 bytes 94 * @SPLIT_PROF_DATA_LEAST_LEN: Least possible length of second part of a split 95 * profile, which includes at least one tag, which may have tag number + tag 96 * length + atleast 1 byte of datai 97 * @BSS_INDEX_POS: Position of BSSID index field in Multiple BSSID index tag 98 * @MIN_VENDOR_TAG_LEN: Minimum length of a vendor specific tag 99 * @OUI_LEN: OUI + OUI Type + Min DATA 100 * @ELEM_ID_EXTN_POS: Position of element ID extension in an extension element 101 * @ELEM_ID_LIST_LEN_POS: Position of length field in list of element IDs 102 * @ELEM_ID_LIST_POS: Position to the start of element ID list 103 */ 104 #define MBSSID_INDICATOR_POS 2 105 #define MIN_IE_LEN 2 106 #define TAG_LEN_POS 1 107 #define VALID_ELEM_LEAST_LEN 4 108 #define SUBELEMENT_START_POS 3 109 #define MAX_SUBELEM_LEN 252 110 #define PAYLOAD_START_POS 2 111 #define FIXED_LENGTH 36 112 #define CAP_INFO_POS 4 113 #define CAP_INFO_LEN 2 114 #define SUBELEM_DATA_POS_FROM_MBSSID 5 115 #define ID_POS 0 116 #define NONTX_BSSID_CAP_TAG_LEN_POS 3 117 #define VALID_BSS_PROF_LEAST_LEN 4 118 #define SPLIT_PROF_DATA_LEAST_LEN 3 119 #define BSS_INDEX_POS 2 120 #define MIN_VENDOR_TAG_LEN 7 121 #define OUI_LEN 5 122 #define ELEM_ID_EXTN_POS 2 123 #define ELEM_ID_LIST_LEN_POS 3 124 #define ELEM_ID_LIST_POS 4 125 126 /* Active dwell time in low span scan mode(NL80211_SCAN_FLAG_LOW_SPAN) 127 * in msec 128 */ 129 #define LOW_SPAN_ACTIVE_DWELL_TIME 40 130 /* passive dwell time in low span scan mode (NL80211_SCAN_FLAG_LOW_SPAN) 131 * in msec 132 */ 133 #define LOW_SPAN_PASSIVE_DWELL_TIME 110 134 135 /* Min & Max offset from TBTT, after which Scan can start */ 136 #define SCAN_START_OFFSET_MIN 26 /* msec */ 137 #define SCAN_START_OFFSET_MAX 90 /* msec */ 138 139 /* forward declaration */ 140 struct wlan_objmgr_vdev; 141 struct wlan_objmgr_pdev; 142 struct wlan_objmgr_psoc; 143 144 /** 145 * struct channel_info - BSS channel information 146 * @chan_freq: channel frequency 147 * @cfreq0: channel frequency index0 148 * @cfreq1: channel frequency index1 149 * @puncture_bitmap: puncture bitmap advertised in beacon 150 * @priv: channel private information 151 */ 152 struct channel_info { 153 uint32_t chan_freq; 154 uint32_t cfreq0; 155 uint32_t cfreq1; 156 #ifdef WLAN_FEATURE_11BE 157 uint16_t puncture_bitmap; 158 #endif 159 void *priv; 160 }; 161 162 /** 163 * struct ie_list - pointers to various IEs 164 * @tim: pointer to tim ie 165 * @country: pointer to country ie 166 * @ssid: pointer to ssid ie 167 * @rates: pointer to supported rates ie 168 * @xrates: pointer to extended supported rate ie 169 * @ds_param: pointer to ds params 170 * @csa: pointer to csa ie 171 * @xcsa: pointer to extended csa ie 172 * @mcst: pointer to maximum channel switch time ie 173 * @wpa: pointer to wpa ie 174 * @wcn: pointer to wcn ie 175 * @rsn: pointer to rsn ie 176 * @wps: pointer to wps ie 177 * @wmeinfo: pointer to wmeinfo ie 178 * @wmeparam: pointer to wmeparam ie 179 * @quiet: pointer to quiet ie 180 * @htcap: pointer to htcap ie 181 * @htinfo: pointer to htinfo ie 182 * @athcaps: pointer to athcaps ie 183 * @athextcaps: pointer to extended athcaps ie 184 * @sfa: pointer to sfa ie 185 * @vendor: pointer to vendor ie 186 * @qbssload: pointer to qbssload ie 187 * @wapi: pointer to wapi ie 188 * @p2p: pointer to p2p ie 189 * @alt_wcn: pointer to alternate wcn ie 190 * @extcaps: pointer to extended caps ie 191 * @ibssdfs: pointer to ibssdfs ie 192 * @sonadv: pointer to wifi son ie 193 * @vhtcap: pointer to vhtcap ie 194 * @vhtop: pointer to vhtop ie 195 * @opmode: pointer to opmode ie 196 * @tpe: array of pointers to transmit power envelope ie 197 * @cswrp: pointer to channel switch announcement wrapper ie 198 * @widebw: pointer to wide band channel switch sub ie 199 * @txpwrenvlp: pointer to tx power envelop sub ie 200 * @hecap: pointer to hecap ie 201 * @hecap_6g: pointer to he 6ghz cap ie 202 * @srp: pointer to spatial reuse parameter sub extended ie 203 * @fils_indication: pointer to FILS indication ie 204 * @esp: pointer to ESP indication ie 205 * @mbo_oce: pointer to mbo/oce indication ie 206 * @rnrie: reduced neighbor report IE 207 * @adaptive_11r: pointer to adaptive 11r IE 208 * @single_pmk: Pointer to sae single pmk IE 209 * @rsnxe: Pointer to rsnxe IE 210 * @ehtcap: pointer to ehtcap ie 211 * @ehtop: pointer to eht op ie 212 * @bw_ind: pointer to bandwidth indication element sub ie 213 * @multi_link_bv: pointer to multi link basic variant IE 214 * @multi_link_rv: pointer to multi link reconfig IE 215 * @t2lm: array of pointers to t2lm op ie 216 * @bwnss_map: pointer to NSS map IE 217 * @secchanoff: pointer to secondary chan IE 218 * @mdie: pointer to md IE 219 * @heop: pointer to HE op IE 220 * @muedca: pointer to muedca IE 221 * @extender: pointer to extended IE 222 * @qcn: pointer to QCN IE 223 */ 224 struct ie_list { 225 uint8_t *tim; 226 uint8_t *country; 227 uint8_t *ssid; 228 uint8_t *rates; 229 uint8_t *xrates; 230 uint8_t *ds_param; 231 uint8_t *csa; 232 uint8_t *xcsa; 233 uint8_t *mcst; 234 uint8_t *wpa; 235 uint8_t *wcn; 236 uint8_t *rsn; 237 uint8_t *wps; 238 uint8_t *wmeinfo; 239 uint8_t *wmeparam; 240 uint8_t *quiet; 241 uint8_t *htcap; 242 uint8_t *htinfo; 243 uint8_t *athcaps; 244 uint8_t *athextcaps; 245 uint8_t *sfa; 246 uint8_t *vendor; 247 uint8_t *qbssload; 248 uint8_t *wapi; 249 uint8_t *p2p; 250 uint8_t *alt_wcn; 251 uint8_t *extcaps; 252 uint8_t *ibssdfs; 253 uint8_t *sonadv; 254 uint8_t *vhtcap; 255 uint8_t *vhtop; 256 uint8_t *opmode; 257 uint8_t *tpe[WLAN_MAX_NUM_TPE_IE]; 258 uint8_t *cswrp; 259 uint8_t *widebw; 260 uint8_t *txpwrenvlp; 261 uint8_t *bwnss_map; 262 uint8_t *secchanoff; 263 uint8_t *mdie; 264 uint8_t *hecap; 265 uint8_t *hecap_6g; 266 uint8_t *heop; 267 uint8_t *srp; 268 uint8_t *fils_indication; 269 uint8_t *esp; 270 uint8_t *mbo_oce; 271 uint8_t *muedca; 272 uint8_t *rnrie; 273 uint8_t *extender; 274 uint8_t *adaptive_11r; 275 uint8_t *single_pmk; 276 uint8_t *rsnxe; 277 #ifdef WLAN_FEATURE_11BE 278 uint8_t *ehtcap; 279 uint8_t *ehtop; 280 uint8_t *bw_ind; 281 #endif 282 #ifdef WLAN_FEATURE_11BE_MLO 283 uint8_t *multi_link_bv; 284 uint8_t *multi_link_rv; 285 uint8_t *t2lm[WLAN_MAX_T2LM_IE]; 286 #endif 287 uint8_t *qcn; 288 289 /* 290 * For any new IEs in this structure, add handling in 291 * util_scan_copy_beacon_data API. 292 */ 293 }; 294 295 enum scan_entry_connection_state { 296 SCAN_ENTRY_CON_STATE_NONE, 297 SCAN_ENTRY_CON_STATE_AUTH, 298 SCAN_ENTRY_CON_STATE_ASSOC 299 }; 300 301 /** 302 * struct mlme_info - mlme specific info 303 * temporarily maintained in scan cache for backward compatibility. 304 * must be removed as part of umac convergence. 305 * @bad_ap_time: time when this ap was marked bad 306 * @status: status 307 * @rank: rank 308 * @utility: utility 309 * @assoc_state: association state 310 * @chanload: channel load 311 */ 312 struct mlme_info { 313 qdf_time_t bad_ap_time; 314 uint32_t status; 315 uint32_t rank; 316 uint32_t utility; 317 uint32_t assoc_state; 318 uint32_t chanload; 319 }; 320 321 /** 322 * struct bss_info - information required to uniquely define a bss 323 * @freq: freq of operating primary channel 324 * @ssid: ssid of bss 325 * @bssid: bssid of bss 326 */ 327 struct bss_info { 328 uint32_t freq; 329 struct wlan_ssid ssid; 330 struct qdf_mac_addr bssid; 331 }; 332 333 #define SCAN_NODE_ACTIVE_COOKIE 0x1248F842 334 /** 335 * struct scan_cache_node - Scan cache entry node 336 * @node: node pointers 337 * @ref_cnt: ref count if in use 338 * @cookie: cookie to check if entry is logically active 339 * @entry: scan entry pointer 340 */ 341 struct scan_cache_node { 342 qdf_list_node_t node; 343 qdf_atomic_t ref_cnt; 344 uint32_t cookie; 345 struct scan_cache_entry *entry; 346 }; 347 348 /** 349 * struct security_info - Scan cache security info 350 * @authmodeset: auth mode 351 * @key_mgmt: key management 352 * @ucastcipherset: unicast cipher set 353 * @mcastcipherset: multicast cipher set 354 * @mgmtcipherset: mgmt cipher set 355 * @rsn_caps: rsn caps of scan entry 356 */ 357 struct security_info { 358 uint32_t authmodeset; 359 uint32_t key_mgmt; 360 uint32_t ucastcipherset; 361 uint32_t mcastcipherset; 362 uint32_t mgmtcipherset; 363 uint16_t rsn_caps; 364 }; 365 366 /** 367 * struct scan_mbssid_info - Scan mbssid information 368 * @profile_num: profile number 369 * @profile_count: total profile count 370 * @trans_bssid: TX BSSID address 371 * @split_profile: Indicates if next MBSSID tag has the other part 372 * of the non tx profile 373 * @prof_residue: Set prof_residue to true, if the first non TX 374 * profile of the subsequent MBSSID IE does not contain 375 * nontx BSSID Capability as the 1st tag of the payload 376 * of nontx profile 377 * @split_prof_continue: Indicates if we are evaluating the fragmented part 378 * present in the subsequent MBSSID tag 379 * @skip_bssid_copy: For the 2nd fragmented part of the split profile 380 * skip copying bssid if BSSID index is already found 381 * in the previous part of split profile 382 */ 383 struct scan_mbssid_info { 384 uint8_t profile_num; 385 uint8_t profile_count; 386 uint8_t trans_bssid[QDF_MAC_ADDR_SIZE]; 387 bool split_profile; 388 bool prof_residue; 389 bool split_prof_continue; 390 bool skip_bssid_copy; 391 }; 392 393 /** 394 * enum nontx_profile_reasoncode - Reason codes based on which the decision 395 * needs to be taken whether to continue with the on going nontx profile or 396 * move to the next one 397 * @VALID_NONTX_PROF: Continue with the on-going profile 398 * @INVALID_SPLIT_PROF: Invalid data seen in the split profile 399 * @INVALID_NONTX_PROF: Invalid data in a non split profile 400 */ 401 enum nontx_profile_reasoncode { 402 VALID_NONTX_PROF = 0, 403 INVALID_SPLIT_PROF = 0x1, 404 INVALID_NONTX_PROF = 0x2 405 }; 406 407 /** 408 * struct non_inheritance_ie - Non inheritance tag information 409 * @list_len: Length of element ID list 410 * @extn_len: Length of element ID extension list 411 * @non_inherit: Flag to indicate if any noninheritance tag present 412 * in the non tx BSSID profile 413 * @non_inh_ie_found: Flag to indicate if the noninheritance tag found 414 * from non tx BSSID profile present in the tx profile 415 * so that the copy of that IE can be skipped. 416 */ 417 struct non_inheritance_ie { 418 uint8_t list_len; 419 uint8_t extn_len; 420 bool non_inherit; 421 bool non_inh_ie_found; 422 }; 423 424 /** 425 * struct rnr_bss_info - Reduced Neighbor Report BSS information 426 * @neighbor_ap_tbtt_offset: Neighbor AP TBTT offset 427 * @channel_number: channel number 428 * @operating_class: operting class 429 * @bssid: BSS MAC address 430 * @short_ssid: short ssid 431 * @bss_params: BSS parameters 432 * @psd_20mhz: 20MHz power spectral density 433 * @mld_info_valid: valid MLD info 434 * @mld_info: MLD information 435 */ 436 struct rnr_bss_info { 437 uint8_t neighbor_ap_tbtt_offset; 438 uint32_t channel_number; 439 uint32_t operating_class; 440 struct qdf_mac_addr bssid; 441 uint32_t short_ssid; 442 uint8_t bss_params; 443 uint8_t psd_20mhz; 444 #ifdef WLAN_FEATURE_11BE_MLO 445 bool mld_info_valid; 446 struct rnr_mld_info mld_info; 447 #endif 448 }; 449 450 /** 451 * struct neighbor_ap_info_field - Neighbor information field 452 * @tbtt_header: TBTT information header 453 * @operting_class: operating class 454 * @channel_number: channel number 455 */ 456 struct neighbor_ap_info_field { 457 struct tbtt_information_header tbtt_header; 458 uint8_t operting_class; 459 uint8_t channel_number; 460 }; 461 462 /** 463 * enum tbtt_information_field - TBTT information field 464 * @TBTT_NEIGHBOR_AP_OFFSET_ONLY: TBTT information field type 465 * @TBTT_NEIGHBOR_AP_BSS_PARAM: neighbor AP and bss param 466 * @TBTT_NEIGHBOR_AP_SHORTSSID: neighbor AP and Short ssid 467 * @TBTT_NEIGHBOR_AP_S_SSID_BSS_PARAM: neighbor AP, short ssid and bss param 468 * @TBTT_NEIGHBOR_AP_BSSID: neighbor AP and bssid 469 * @TBTT_NEIGHBOR_AP_BSSID_BSS_PARAM: neighbor AP, bssid and bss param 470 * @TBTT_NEIGHBOR_AP_BSSID_BSS_PARAM_20MHZ_PSD: neighbor AP, bssid and bss 471 * param and 20MHz PSD 472 * @TBTT_NEIGHBOR_AP_BSSSID_S_SSID: neighbor AP, bssid and short ssid 473 * @TBTT_NEIGHBOR_AP_BSSID_S_SSID_BSS_PARAM: neighbor AP, bssid, short ssid 474 * and bss params 475 * @TBTT_NEIGHBOR_AP_BSSID_S_SSID_BSS_PARAM_20MHZ_PSD: neighbor AP, bssid, 476 * short ssid, bss params and 20MHz PSD 477 * bssid, short ssid, bss params, 20MHz PSD and MLD param 478 * @TBTT_NEIGHBOR_AP_BSSID_S_SSID_BSS_PARAM_20MHZ_PSD_MLD_PARAM: 479 */ 480 enum tbtt_information_field { 481 TBTT_NEIGHBOR_AP_OFFSET_ONLY = 1, 482 TBTT_NEIGHBOR_AP_BSS_PARAM = 2, 483 TBTT_NEIGHBOR_AP_SHORTSSID = 5, 484 TBTT_NEIGHBOR_AP_S_SSID_BSS_PARAM = 6, 485 TBTT_NEIGHBOR_AP_BSSID = 7, 486 TBTT_NEIGHBOR_AP_BSSID_BSS_PARAM = 8, 487 TBTT_NEIGHBOR_AP_BSSID_BSS_PARAM_20MHZ_PSD = 9, 488 TBTT_NEIGHBOR_AP_BSSSID_S_SSID = 11, 489 TBTT_NEIGHBOR_AP_BSSID_S_SSID_BSS_PARAM = 12, 490 TBTT_NEIGHBOR_AP_BSSID_S_SSID_BSS_PARAM_20MHZ_PSD = 13, 491 TBTT_NEIGHBOR_AP_BSSID_S_SSID_BSS_PARAM_20MHZ_PSD_MLD_PARAM = 16 492 }; 493 494 /** 495 * struct reduced_neighbor_report - Reduced Neighbor Report 496 * @count: number of RNR info 497 * @bss_info: RNR BSS Information 498 */ 499 struct reduced_neighbor_report { 500 uint8_t count; 501 struct rnr_bss_info bss_info[MAX_RNR_BSS]; 502 }; 503 504 #define SCAN_SECURITY_TYPE_WEP 0x01 505 #define SCAN_SECURITY_TYPE_WPA 0x02 506 #define SCAN_SECURITY_TYPE_WAPI 0x04 507 #define SCAN_SECURITY_TYPE_RSN 0x08 508 509 #ifdef WLAN_FEATURE_11BE_MLO 510 #define MLD_MAX_LINKS 4 511 512 /** 513 * struct partner_link_info: Partner link information of an ML 514 * @link_addr: BSSID of the link 515 * @freq: center frequency in MHz 516 * @cfreq2: center frequency of the secondary channel in MHz 517 * @link_id: Link id advertised by the AP 518 * @csa_ie: Pointer to CSA IE 519 * @ecsa_ie: Pointer to eCSA IE 520 * @max_cst_ie: Pointer to Max Channel Switch Time IE 521 * @is_valid_link: The partner link can be used if true 522 * @op_class: Operating class 523 */ 524 struct partner_link_info { 525 struct qdf_mac_addr link_addr; 526 uint16_t freq; 527 uint16_t cfreq2; 528 uint8_t link_id; 529 const uint8_t *csa_ie; 530 const uint8_t *ecsa_ie; 531 const uint8_t *max_cst_ie; 532 uint8_t is_valid_link; 533 uint8_t op_class; 534 }; 535 536 /** 537 * struct ml_info: Multi link formation of a 11be beacon 538 * @mld_mac_addr: MLD mac address 539 * @num_links: Number of links supported by ML AP 540 * @self_link_id: Link id of the scan entry 541 * @link_info: Array containing partner links information 542 * @ml_bss_score: Multi link BSS score 543 */ 544 struct ml_info { 545 struct qdf_mac_addr mld_mac_addr; 546 uint8_t num_links; 547 uint8_t self_link_id; 548 struct partner_link_info link_info[MLD_MAX_LINKS - 1]; 549 uint16_t ml_bss_score; 550 }; 551 552 /** 553 * enum number_of_partner_link: Enumeration for number of partner links 554 * @NO_LINK: Default value 555 * @ONE_LINK: Single Link 556 * @TWO_LINK: 2 Links 557 * @THREE_LINK: 3 Links 558 */ 559 enum number_of_partner_link { 560 NO_LINK, 561 ONE_LINK, 562 TWO_LINK, 563 THREE_LINK, 564 }; 565 #endif 566 567 /** 568 * struct scan_cache_entry: structure containing scan entry 569 * @frm_subtype: updated from beacon/probe 570 * @bssid: bssid 571 * @mac_addr: mac address 572 * @ssid: ssid 573 * @is_hidden_ssid: is AP having hidden ssid. 574 * @security_type: security supported 575 * @seq_num: sequence number 576 * @phy_mode: Phy mode of the AP 577 * @avg_rssi: Average RSSI of the AP 578 * @rssi_raw: The rssi of the last beacon/probe received 579 * @snr: The snr of the last beacon/probe received 580 * @avg_snr: Average SNR of the AP 581 * @bcn_int: Beacon interval of the AP 582 * @cap_info: Capability of the AP 583 * @tsf_info: TSF info 584 * @erp: erp info 585 * @dtim_period: dtime period 586 * @air_time_fraction: Air time fraction from ESP param 587 * @qbss_chan_load: Qbss channel load 588 * @nss: supported NSS information 589 * @is_p2p: is P2P entry 590 * @adaptive_11r_ap: flag to check if AP supports adaptive 11r 591 * @scan_entry_time: boottime in microsec when last beacon/probe is received 592 * @rssi_timestamp: boottime in microsec when RSSI was updated 593 * @hidden_ssid_timestamp: boottime in microsec when hidden 594 * ssid was received 595 * @mbssid_info: Multi bssid information 596 * @rnr: Reduced neighbor report information 597 * @channel: channel info on which AP is present 598 * @channel_mismatch: if channel received in metadata 599 * doesn't match the one in beacon 600 * @mlme_info: Mlme info, this will be updated by MLME for the scan entry 601 * @tsf_delta: TSF delta 602 * @bss_score: bss score calculated on basis of RSSI/caps etc. 603 * @neg_sec_info: negotiated security info 604 * @per_chain_rssi: per chain RSSI value received. 605 * @boottime_ns: boottime in ns. 606 * @rrm_parent_tsf: RRM parent tsf 607 * @alt_wcn_ie: alternate WCN IE 608 * @ie_list: IE list pointers 609 * @raw_frame: contain raw frame and the length of the raw frame 610 * @pdev_id: pdev id 611 * @ml_info: Multi link information 612 * @non_intersected_phymode: Non intersected phy mode of the AP 613 */ 614 struct scan_cache_entry { 615 uint8_t frm_subtype; 616 struct qdf_mac_addr bssid; 617 struct qdf_mac_addr mac_addr; 618 struct wlan_ssid ssid; 619 bool is_hidden_ssid; 620 uint8_t security_type; 621 uint16_t seq_num; 622 enum wlan_phymode phy_mode; 623 int32_t avg_rssi; 624 int8_t rssi_raw; 625 uint8_t snr; 626 uint32_t avg_snr; 627 uint16_t bcn_int; 628 union wlan_capability cap_info; 629 union { 630 uint8_t data[8]; 631 uint64_t tsf; 632 } tsf_info; 633 uint8_t erp; 634 uint8_t dtim_period; 635 uint8_t air_time_fraction; 636 uint8_t qbss_chan_load; 637 uint8_t nss; 638 bool is_p2p; 639 bool adaptive_11r_ap; 640 qdf_time_t scan_entry_time; 641 qdf_time_t rssi_timestamp; 642 qdf_time_t hidden_ssid_timestamp; 643 struct scan_mbssid_info mbssid_info; 644 struct reduced_neighbor_report rnr; 645 struct channel_info channel; 646 bool channel_mismatch; 647 struct mlme_info mlme_info; 648 uint32_t tsf_delta; 649 uint32_t bss_score; 650 struct security_info neg_sec_info; 651 uint8_t per_chain_rssi[WLAN_MGMT_TXRX_HOST_MAX_ANTENNA]; 652 uint64_t boottime_ns; 653 uint32_t rrm_parent_tsf; 654 struct element_info alt_wcn_ie; 655 struct ie_list ie_list; 656 struct element_info raw_frame; 657 /* 658 * This is added temporarily for 6GHz channel to freq conversion 659 * to get pdev wherever it requores to convert frequency to 660 * channel as regulatory apis requires pdev as argument 661 */ 662 uint8_t pdev_id; 663 #ifdef WLAN_FEATURE_11BE_MLO 664 struct ml_info ml_info; 665 #endif 666 enum wlan_phymode non_intersected_phymode; 667 }; 668 669 #define MAX_FAVORED_BSSID 16 670 #define MAX_ALLOWED_SSID_LIST 4 671 672 #define WLAN_SCAN_FILTER_NUM_SSID 5 673 #define WLAN_SCAN_FILTER_NUM_BSSID 5 674 675 #define REALM_HASH_LEN 2 676 #define CACHE_IDENTIFIER_LEN 2 677 #define HESSID_LEN 6 678 679 #ifdef WLAN_FEATURE_FILS_SK 680 /** 681 * struct fils_filter_info: FILS info present in scan filter 682 * @realm_check: whether realm check is required 683 * @fils_realm: realm hash value 684 * @security_type: type of security supported 685 */ 686 struct fils_filter_info { 687 bool realm_check; 688 uint8_t fils_realm[REALM_HASH_LEN]; 689 uint8_t security_type; 690 }; 691 #endif 692 693 /* 694 * struct filter_arg: Opaque pointer for the filter arguments 695 */ 696 struct filter_arg; 697 typedef struct filter_arg *bss_filter_arg_t; 698 699 /** 700 * enum dot11_mode_filter - Filter APs according to dot11mode 701 * @ALLOW_ALL: ignore check 702 * @ALLOW_11N_ONLY: allow only 11n AP 703 * @ALLOW_11AC_ONLY: allow only 11ac AP 704 * @ALLOW_11AX_ONLY: allow only 11ax AP 705 * @ALLOW_11BE_ONLY: allow only 11be AP 706 */ 707 enum dot11_mode_filter { 708 ALLOW_ALL, 709 ALLOW_11N_ONLY, 710 ALLOW_11AC_ONLY, 711 ALLOW_11AX_ONLY, 712 ALLOW_11BE_ONLY, 713 }; 714 715 /** 716 * struct scan_filter: scan filter 717 * @enable_adaptive_11r: flag to check if adaptive 11r ini is enabled 718 * @rrm_measurement_filter: For measurement reports.if set, only SSID, BSSID 719 * and channel is considered for filtering. 720 * @ignore_pmf_cap: Ignore pmf capability match 721 * @ignore_auth_enc_type: Ignore enc type if 722 * this is set (For WPS/OSEN connection) 723 * @ignore_nol_chan: Ignore entry with channel in the NOL list 724 * @ignore_6ghz_channel: ignore 6Ghz channels 725 * @age_threshold: If set return entry which are newer than the age_threshold 726 * @num_of_bssid: number of bssid passed 727 * @num_of_ssid: number of ssid 728 * @num_of_channels: number of channels 729 * @bss_type: bss type IBSS or BSS or ANY 730 * @pmf_cap: Pmf capability 731 * @dot11mode: Filter APs based upon dot11mode 732 * @rssi_threshold: AP having RSSI greater than 733 * rssi threasholed (ignored if set 0) 734 * @mobility_domain: Mobility domain for 11r 735 * @authmodeset: auth mode 736 * @key_mgmt: key management 737 * @ucastcipherset: unicast cipher set 738 * @mcastcipherset: multicast cipher set 739 * @mgmtcipherset: mgmt cipher set 740 * @fils_scan_filter: FILS info 741 * @bssid_hint: Mac address of bssid_hint 742 * @bssid_list: bssid list 743 * @ssid_list: ssid list 744 * @chan_freq_list: channel frequency list, frequency unit: MHz 745 * @match_security_func: Function pointer to custom security filter 746 * @match_security_func_arg: Function argument to custom security filter 747 * @ccx_validate_bss: Function pointer to custom bssid filter 748 * @ccx_validate_bss_arg: Function argument to custom bssid filter 749 * @band_bitmap: Allowed band bit map, BIT0: 2G, BIT1: 5G, BIT2: 6G 750 */ 751 struct scan_filter { 752 uint8_t enable_adaptive_11r:1, 753 rrm_measurement_filter:1, 754 ignore_pmf_cap:1, 755 ignore_auth_enc_type:1, 756 ignore_nol_chan:1, 757 ignore_6ghz_channel:1; 758 qdf_time_t age_threshold; 759 uint8_t num_of_bssid; 760 uint8_t num_of_ssid; 761 uint16_t num_of_channels; 762 enum wlan_bss_type bss_type; 763 enum wlan_pmf_cap pmf_cap; 764 enum dot11_mode_filter dot11mode; 765 uint8_t rssi_threshold; 766 uint32_t mobility_domain; 767 uint32_t authmodeset; 768 uint32_t key_mgmt; 769 uint32_t ucastcipherset; 770 uint32_t mcastcipherset; 771 uint32_t mgmtcipherset; 772 #ifdef WLAN_FEATURE_FILS_SK 773 struct fils_filter_info fils_scan_filter; 774 #endif 775 struct qdf_mac_addr bssid_hint; 776 /* Variable params list */ 777 struct qdf_mac_addr bssid_list[WLAN_SCAN_FILTER_NUM_BSSID]; 778 struct wlan_ssid ssid_list[WLAN_SCAN_FILTER_NUM_SSID]; 779 qdf_freq_t chan_freq_list[NUM_CHANNELS]; 780 bool (*match_security_func)(void *, struct scan_cache_entry *); 781 bss_filter_arg_t match_security_func_arg; 782 bool (*ccx_validate_bss)(void *, struct scan_cache_entry *, int); 783 bss_filter_arg_t ccx_validate_bss_arg; 784 #ifdef WLAN_FEATURE_11BE_MLO 785 uint32_t band_bitmap; 786 #endif 787 }; 788 789 /** 790 * enum scan_disable_reason - scan enable/disable reason 791 * @REASON_SUSPEND: reason is suspend 792 * @REASON_SYSTEM_DOWN: reason is system going down 793 * @REASON_USER_SPACE: reason is user space initiated 794 * @REASON_VDEV_DOWN: reason is vdev going down 795 */ 796 enum scan_disable_reason { 797 REASON_SUSPEND = 0x1, 798 REASON_SYSTEM_DOWN = 0x2, 799 REASON_USER_SPACE = 0x4, 800 REASON_VDEV_DOWN = 0x8, 801 }; 802 803 /** 804 * enum scan_priority - scan priority definitions 805 * @SCAN_PRIORITY_VERY_LOW: very low priority 806 * @SCAN_PRIORITY_LOW: low scan priority 807 * @SCAN_PRIORITY_MEDIUM: medium priority 808 * @SCAN_PRIORITY_HIGH: high priority 809 * @SCAN_PRIORITY_VERY_HIGH: very high priority 810 * @SCAN_PRIORITY_COUNT: number of priorities supported 811 */ 812 enum scan_priority { 813 SCAN_PRIORITY_VERY_LOW, 814 SCAN_PRIORITY_LOW, 815 SCAN_PRIORITY_MEDIUM, 816 SCAN_PRIORITY_HIGH, 817 SCAN_PRIORITY_VERY_HIGH, 818 SCAN_PRIORITY_COUNT, 819 }; 820 821 /** 822 * enum scan_phy_mode - phymode used for scan 823 * @SCAN_PHY_MODE_11A: 11a mode 824 * @SCAN_PHY_MODE_11G: 11g mode 825 * @SCAN_PHY_MODE_11B: 11b mode 826 * @SCAN_PHY_MODE_11GONLY: 11g only mode 827 * @SCAN_PHY_MODE_11NA_HT20: 11na ht20 mode 828 * @SCAN_PHY_MODE_11NG_HT20: 11ng ht20 mode 829 * @SCAN_PHY_MODE_11NA_HT40: 11na ht40 mode 830 * @SCAN_PHY_MODE_11NG_HT40: 11ng ht40 mode 831 * @SCAN_PHY_MODE_11AC_VHT20: 11ac vht20 mode 832 * @SCAN_PHY_MODE_11AC_VHT40: 11ac vht40 mode 833 * @SCAN_PHY_MODE_11AC_VHT80: 11ac vht80 mode 834 * @SCAN_PHY_MODE_11AC_VHT20_2G: 2GHz 11ac vht20 mode 835 * @SCAN_PHY_MODE_11AC_VHT40_2G: 2GHz 11ac vht40 mode 836 * @SCAN_PHY_MODE_11AC_VHT80_2G: 2GHz 11ac vht80 mode 837 * @SCAN_PHY_MODE_11AC_VHT80_80: 11ac vht 80+80 mode 838 * @SCAN_PHY_MODE_11AC_VHT160: 11ac vht160 mode 839 * @SCAN_PHY_MODE_11AX_HE20: 11ax he20 mode 840 * @SCAN_PHY_MODE_11AX_HE40: 11ax he40 mode 841 * @SCAN_PHY_MODE_11AX_HE80: 11ax he80 mode 842 * @SCAN_PHY_MODE_11AX_HE80_80: 11ax he80+80 mode 843 * @SCAN_PHY_MODE_11AX_HE160: 11ax he160 mode 844 * @SCAN_PHY_MODE_11AX_HE20_2G: 2GHz 11ax he20 mode 845 * @SCAN_PHY_MODE_11AX_HE40_2G: 2GHz 11ax he40 mode 846 * @SCAN_PHY_MODE_11AX_HE80_2G: 2GHz 11ax he80 mode 847 * @SCAN_PHY_MODE_11BE_EHT20: 11be EHT 20 mode 848 * @SCAN_PHY_MODE_11BE_EHT40: 11be EHT 40 mode 849 * @SCAN_PHY_MODE_11BE_EHT80: 11be EHT 80 mode 850 * @SCAN_PHY_MODE_11BE_EHT80_80: 11be EHT 80+80 mode 851 * @SCAN_PHY_MODE_11BE_EHT160: 11be EHT 160 mode 852 * @SCAN_PHY_MODE_11BE_EHT160_160: 11be EHT 160+160 mode 853 * @SCAN_PHY_MODE_11BE_EHT320: 11be EHT 320 mode 854 * @SCAN_PHY_MODE_11BE_EHT20_2G: 2GHz 11be EHT 20 mode 855 * @SCAN_PHY_MODE_11BE_EHT40_2G: 2GHz 11be EHT 40 mode 856 * @SCAN_PHY_MODE_11BE_EHT80_2G: 2GHz 11be EHT 80 mode 857 * @SCAN_PHY_MODE_UNKNOWN: unknown phy mode 858 * @SCAN_PHY_MODE_MAX: max valid phymode 859 */ 860 enum scan_phy_mode { 861 SCAN_PHY_MODE_11A = 0, 862 SCAN_PHY_MODE_11G = 1, 863 SCAN_PHY_MODE_11B = 2, 864 SCAN_PHY_MODE_11GONLY = 3, 865 SCAN_PHY_MODE_11NA_HT20 = 4, 866 SCAN_PHY_MODE_11NG_HT20 = 5, 867 SCAN_PHY_MODE_11NA_HT40 = 6, 868 SCAN_PHY_MODE_11NG_HT40 = 7, 869 SCAN_PHY_MODE_11AC_VHT20 = 8, 870 SCAN_PHY_MODE_11AC_VHT40 = 9, 871 SCAN_PHY_MODE_11AC_VHT80 = 10, 872 SCAN_PHY_MODE_11AC_VHT20_2G = 11, 873 SCAN_PHY_MODE_11AC_VHT40_2G = 12, 874 SCAN_PHY_MODE_11AC_VHT80_2G = 13, 875 SCAN_PHY_MODE_11AC_VHT80_80 = 14, 876 SCAN_PHY_MODE_11AC_VHT160 = 15, 877 SCAN_PHY_MODE_11AX_HE20 = 16, 878 SCAN_PHY_MODE_11AX_HE40 = 17, 879 SCAN_PHY_MODE_11AX_HE80 = 18, 880 SCAN_PHY_MODE_11AX_HE80_80 = 19, 881 SCAN_PHY_MODE_11AX_HE160 = 20, 882 SCAN_PHY_MODE_11AX_HE20_2G = 21, 883 SCAN_PHY_MODE_11AX_HE40_2G = 22, 884 SCAN_PHY_MODE_11AX_HE80_2G = 23, 885 #ifdef WLAN_FEATURE_11BE 886 SCAN_PHY_MODE_11BE_EHT20 = 24, 887 SCAN_PHY_MODE_11BE_EHT40 = 25, 888 SCAN_PHY_MODE_11BE_EHT80 = 26, 889 SCAN_PHY_MODE_11BE_EHT80_80 = 27, 890 SCAN_PHY_MODE_11BE_EHT160 = 28, 891 SCAN_PHY_MODE_11BE_EHT160_160 = 29, 892 SCAN_PHY_MODE_11BE_EHT320 = 30, 893 SCAN_PHY_MODE_11BE_EHT20_2G = 31, 894 SCAN_PHY_MODE_11BE_EHT40_2G = 32, 895 SCAN_PHY_MODE_11BE_EHT80_2G = 33, 896 #endif 897 SCAN_PHY_MODE_UNKNOWN = 34, 898 SCAN_PHY_MODE_MAX = 34 899 }; 900 901 /** 902 * enum scan_dwelltime_adaptive_mode: dwelltime_mode 903 * @SCAN_DWELL_MODE_DEFAULT: Use firmware default mode 904 * @SCAN_DWELL_MODE_CONSERVATIVE: Conservative adaptive mode 905 * @SCAN_DWELL_MODE_MODERATE: Moderate adaptive mode 906 * @SCAN_DWELL_MODE_AGGRESSIVE: Aggressive adaptive mode 907 * @SCAN_DWELL_MODE_STATIC: static adaptive mode 908 */ 909 enum scan_dwelltime_adaptive_mode { 910 SCAN_DWELL_MODE_DEFAULT = 0, 911 SCAN_DWELL_MODE_CONSERVATIVE = 1, 912 SCAN_DWELL_MODE_MODERATE = 2, 913 SCAN_DWELL_MODE_AGGRESSIVE = 3, 914 SCAN_DWELL_MODE_STATIC = 4 915 }; 916 917 /** 918 * struct scan_random_attr - holds scan randomization attrs 919 * @randomize: set to true for scan randomization 920 * @mac_addr: mac addr to be randomized 921 * @mac_mask: used to represent bits in mac_addr for randomization 922 */ 923 struct scan_random_attr { 924 bool randomize; 925 uint8_t mac_addr[QDF_MAC_ADDR_SIZE]; 926 uint8_t mac_mask[QDF_MAC_ADDR_SIZE]; 927 }; 928 929 /** 930 * struct probe_req_allowlist_attr - holds probe req ie allowlist attrs 931 * @allow_list: enable/disable allowlist 932 * @ie_bitmap: bitmap of IEs to be enabled 933 * @num_vendor_oui: number of vendor OUIs 934 * @voui: vendor oui buffer 935 */ 936 struct probe_req_allowlist_attr { 937 bool allow_list; 938 uint32_t ie_bitmap[PROBE_REQ_BITMAP_LEN]; 939 uint32_t num_vendor_oui; 940 uint32_t voui[MAX_PROBE_REQ_OUIS]; 941 }; 942 943 /** 944 * enum scan_flags: scan flags 945 * @FLAG_SCAN_ONLY_IF_RNR_FOUND: Set this flag for a 6g channel to scan it only 946 * if an RNR IE is found with that channel while scanning 2g/5g bands. 947 */ 948 enum scan_flags { 949 FLAG_SCAN_ONLY_IF_RNR_FOUND = 0x1, 950 }; 951 952 /** 953 * struct chan_info - channel information 954 * @freq: frequency to scan 955 * @phymode: phymode in which @frequency should be scanned 956 * @flags: Flags to define channel property as defined @enum scan_flags. 957 * Firmware can use this info for different operations, e.g.: scan 958 */ 959 struct chan_info { 960 qdf_freq_t freq; 961 enum scan_phy_mode phymode; 962 enum scan_flags flags; 963 }; 964 965 struct chan_list_info { 966 qdf_freq_t freq; 967 uint32_t last_scan_time; 968 }; 969 970 struct chan_list_scan_info { 971 uint8_t num_chan; 972 struct chan_list_info ch_scan_info[NUM_CHANNELS]; 973 }; 974 975 /** 976 * struct chan_list - list of frequencies to be scanned 977 * and their phymode 978 * @num_chan: number of channels to scan 979 * @chan: channel parameters used for this scan 980 */ 981 struct chan_list { 982 uint8_t num_chan; 983 struct chan_info chan[NUM_CHANNELS]; 984 }; 985 986 /** 987 * struct hint_short_ssid - short SSID hint 988 * and their phymode 989 * @freq_flags: freq unit: MHz (upper 16bits) 990 * flags (lower 16bits) 991 * @short_ssid: short SSID 992 */ 993 struct hint_short_ssid { 994 uint32_t freq_flags; 995 uint32_t short_ssid; 996 }; 997 998 /** 999 * struct hint_bssid - BSSID hint 1000 * and their phymode 1001 * @freq_flags: freq unit: MHz (upper 16bits) 1002 * flags (lower 16bits) 1003 * @bssid: BSSID 1004 */ 1005 struct hint_bssid { 1006 uint32_t freq_flags; 1007 struct qdf_mac_addr bssid; 1008 }; 1009 1010 /** 1011 * enum scan_request_type: scan type 1012 * @SCAN_TYPE_DEFAULT: Def scan 1013 * @SCAN_TYPE_P2P_SEARCH: P2P Search 1014 * @SCAN_TYPE_P2P_LISTEN: P2P listed 1015 * @SCAN_TYPE_RRM: RRM scan request 1016 * @SCAN_TYPE_SCAN_FOR_CONNECT : Scan for connect 1017 */ 1018 enum scan_request_type { 1019 SCAN_TYPE_DEFAULT = 0, 1020 SCAN_TYPE_P2P_SEARCH = 1, 1021 SCAN_TYPE_P2P_LISTEN = 2, 1022 SCAN_TYPE_RRM = 3, 1023 SCAN_TYPE_SCAN_FOR_CONNECT = 4 1024 }; 1025 1026 /** 1027 * struct scan_req_params - start scan request parameter 1028 * @scan_id: scan id 1029 * @scan_req_id: scan requester id 1030 * @vdev_id: vdev id where scan was originated 1031 * @pdev_id: pdev id of parent pdev 1032 * @scan_priority: scan priority 1033 * @scan_type: scan request type 1034 * @scan_ev_started: notify scan started event 1035 * @scan_ev_completed: notify scan completed event 1036 * @scan_ev_bss_chan: notify bss chan event 1037 * @scan_ev_foreign_chan: notify foreign chan event 1038 * @scan_ev_dequeued: notify scan request dequeued event 1039 * @scan_ev_preempted: notify scan preempted event 1040 * @scan_ev_start_failed: notify scan start failed event 1041 * @scan_ev_restarted: notify scan restarted event 1042 * @scan_ev_foreign_chn_exit: notify foreign chan exit event 1043 * @scan_ev_invalid: notify invalid scan request event 1044 * @scan_ev_gpio_timeout: notify gpio timeout event 1045 * @scan_ev_suspended: notify scan suspend event 1046 * @scan_ev_resumed: notify scan resumed event 1047 * @scan_events: variable to read and set scan_ev_* flags in one shot 1048 * can be used to dump all scan_ev_* flags for debug 1049 * @dwell_time_active: active dwell time 1050 * @dwell_time_active_2g: active dwell time for 2G channels, if it's not zero 1051 * @dwell_time_passive: passive dwell time 1052 * @min_dwell_time_6g: 6Ghz min dwell time 1053 * @dwell_time_active_6g: 6Ghz active dwell time 1054 * @dwell_time_passive_6g: 6Ghz passive dwell time 1055 * @min_rest_time: min rest time 1056 * @max_rest_time: max rest time 1057 * @repeat_probe_time: repeat probe time 1058 * @probe_spacing_time: probe spacing time 1059 * @idle_time: idle time 1060 * @max_scan_time: max scan time 1061 * @probe_delay: probe delay 1062 * @scan_offset_time: Support split scanning on the 1063 * same channel for CBS feature. 1064 * @scan_f_passive: passively scan all channels including active channels 1065 * @scan_f_bcast_probe: add wild card ssid prbreq even if ssid_list is specified 1066 * @scan_f_cck_rates: add cck rates to rates/xrates ie in prb req 1067 * @scan_f_ofdm_rates: add ofdm rates to rates/xrates ie in prb req 1068 * @scan_f_chan_stat_evnt: enable indication of chan load and noise floor 1069 * @scan_f_filter_prb_req: filter Probe request frames 1070 * @scan_f_bypass_dfs_chn: when set, do not scan DFS channels 1071 * @scan_f_continue_on_err:continue scan even if few certain errors have occurred 1072 * @scan_f_offchan_mgmt_tx: allow mgmt transmission during off channel scan 1073 * @scan_f_offchan_data_tx: allow data transmission during off channel scan 1074 * @scan_f_promisc_mode: scan with promiscuous mode 1075 * @scan_f_capture_phy_err: enable capture ppdu with phy errors 1076 * @scan_f_strict_passive_pch: do passive scan on passive channels 1077 * @scan_f_half_rate: enable HALF (10MHz) rate support 1078 * @scan_f_quarter_rate: set Quarter (5MHz) rate support 1079 * @scan_f_force_active_dfs_chn: allow to send probe req on DFS channel 1080 * @scan_f_add_tpc_ie_in_probe: add TPC ie in probe req frame 1081 * @scan_f_add_ds_ie_in_probe: add DS ie in probe req frame 1082 * @scan_f_add_spoofed_mac_in_probe: use random mac address for TA in probe 1083 * @scan_f_add_rand_seq_in_probe: use random sequence number in probe 1084 * @scan_f_en_ie_allowlist_in_probe: enable ie allowlist in probe 1085 * @scan_f_forced: force scan even in presence of data traffic 1086 * @scan_f_2ghz: scan 2.4 GHz channels 1087 * @scan_f_5ghz: scan 5 GHz channels 1088 * @scan_f_wide_band: scan in 40 MHz or higher bandwidth 1089 * @scan_f_pause_home_channel: To pause home channel in FW when scan channel is 1090 * same as home channel 1091 * @scan_f_report_cca_busy_for_each_20mhz: Allow FW to report CCA busy for each 1092 * possible 20Mhz subbands of the wideband scan channel 1093 * @scan_flags: variable to read and set scan_f_* flags in one shot 1094 * can be used to dump all scan_f_* flags for debug 1095 * @scan_policy_high_accuracy: 1096 * @scan_policy_low_span: 1097 * @scan_policy_low_power: 1098 * @scan_policy_colocated_6ghz: 1099 * @scan_policy_type: variable to read and set all scan_policy_* flags 1100 * @adaptive_dwell_time_mode: 1101 * @burst_duration: burst duration 1102 * @num_bssid: no of bssid 1103 * @num_ssids: no of ssid 1104 * @n_probes: no of probe 1105 * @chan_list: channel list 1106 * @ssid: ssid list 1107 * @bssid_list: Lisst of bssid to scan 1108 * @scan_random: scan randomization params 1109 * @ie_allowlist: probe req IE allowlist attrs 1110 * @extraie: list of optional/vendor specific ie's to be added in probe requests 1111 * @htcap: htcap ie 1112 * @vhtcap: vhtcap ie 1113 * @scan_ctrl_flags_ext: scan control flag extended 1114 * @num_hint_s_ssid: number of short SSID hints 1115 * @num_hint_bssid: number of BSSID hints 1116 * @hint_s_ssid: short SSID hints 1117 * @hint_bssid: BSSID hints 1118 */ 1119 struct scan_req_params { 1120 uint32_t scan_id; 1121 uint32_t scan_req_id; 1122 uint32_t vdev_id; 1123 uint32_t pdev_id; 1124 enum scan_priority scan_priority; 1125 enum scan_request_type scan_type; 1126 union { 1127 struct { 1128 uint32_t scan_ev_started:1, 1129 scan_ev_completed:1, 1130 scan_ev_bss_chan:1, 1131 scan_ev_foreign_chan:1, 1132 scan_ev_dequeued:1, 1133 scan_ev_preempted:1, 1134 scan_ev_start_failed:1, 1135 scan_ev_restarted:1, 1136 scan_ev_foreign_chn_exit:1, 1137 scan_ev_invalid:1, 1138 scan_ev_gpio_timeout:1, 1139 scan_ev_suspended:1, 1140 scan_ev_resumed:1; 1141 }; 1142 uint32_t scan_events; 1143 }; 1144 uint32_t dwell_time_active; 1145 uint32_t dwell_time_active_2g; 1146 uint32_t dwell_time_passive; 1147 uint32_t min_dwell_time_6g; 1148 uint32_t dwell_time_active_6g; 1149 uint32_t dwell_time_passive_6g; 1150 uint32_t min_rest_time; 1151 uint32_t max_rest_time; 1152 uint32_t repeat_probe_time; 1153 uint32_t probe_spacing_time; 1154 uint32_t idle_time; 1155 uint32_t max_scan_time; 1156 uint32_t probe_delay; 1157 uint32_t scan_offset_time; 1158 union { 1159 struct { 1160 uint32_t scan_f_passive:1, 1161 scan_f_bcast_probe:1, 1162 scan_f_cck_rates:1, 1163 scan_f_ofdm_rates:1, 1164 scan_f_chan_stat_evnt:1, 1165 scan_f_filter_prb_req:1, 1166 scan_f_bypass_dfs_chn:1, 1167 scan_f_continue_on_err:1, 1168 scan_f_offchan_mgmt_tx:1, 1169 scan_f_offchan_data_tx:1, 1170 scan_f_promisc_mode:1, 1171 scan_f_capture_phy_err:1, 1172 scan_f_strict_passive_pch:1, 1173 scan_f_half_rate:1, 1174 scan_f_quarter_rate:1, 1175 scan_f_force_active_dfs_chn:1, 1176 scan_f_add_tpc_ie_in_probe:1, 1177 scan_f_add_ds_ie_in_probe:1, 1178 scan_f_add_spoofed_mac_in_probe:1, 1179 scan_f_add_rand_seq_in_probe:1, 1180 scan_f_en_ie_allowlist_in_probe:1, 1181 scan_f_forced:1, 1182 scan_f_2ghz:1, 1183 scan_f_5ghz:1, 1184 scan_f_wide_band:1, 1185 scan_f_pause_home_channel:1, 1186 scan_f_report_cca_busy_for_each_20mhz:1; 1187 }; 1188 uint32_t scan_flags; 1189 }; 1190 union { 1191 struct { 1192 uint32_t scan_policy_high_accuracy:1, 1193 scan_policy_low_span:1, 1194 scan_policy_low_power:1, 1195 scan_policy_colocated_6ghz:1; 1196 }; 1197 uint32_t scan_policy_type; 1198 }; 1199 1200 enum scan_dwelltime_adaptive_mode adaptive_dwell_time_mode; 1201 uint32_t burst_duration; 1202 uint32_t num_bssid; 1203 uint32_t num_ssids; 1204 uint32_t n_probes; 1205 struct chan_list chan_list; 1206 struct wlan_ssid ssid[WLAN_SCAN_MAX_NUM_SSID]; 1207 struct qdf_mac_addr bssid_list[WLAN_SCAN_MAX_NUM_BSSID]; 1208 struct scan_random_attr scan_random; 1209 struct probe_req_allowlist_attr ie_allowlist; 1210 struct element_info extraie; 1211 struct element_info htcap; 1212 struct element_info vhtcap; 1213 uint32_t scan_ctrl_flags_ext; 1214 uint32_t num_hint_s_ssid; 1215 uint32_t num_hint_bssid; 1216 struct hint_short_ssid hint_s_ssid[WLAN_SCAN_MAX_HINT_S_SSID]; 1217 struct hint_bssid hint_bssid[WLAN_SCAN_MAX_HINT_BSSID]; 1218 }; 1219 1220 /** 1221 * struct scan_start_request - scan request config 1222 * @vdev: vdev 1223 * @scan_req: common scan start request parameters 1224 */ 1225 struct scan_start_request { 1226 struct wlan_objmgr_vdev *vdev; 1227 struct scan_req_params scan_req; 1228 }; 1229 1230 /** 1231 * enum scan_cancel_req_type - type specifiers for cancel scan request 1232 * @WLAN_SCAN_CANCEL_SINGLE: cancel particular scan specified by scan_id 1233 * @WLAN_SCAN_CANCEL_VDEV_ALL: cancel all scans running on a particular vdevid 1234 * @WLAN_SCAN_CANCEL_PDEV_ALL: cancel all scans running on parent pdev of vdevid 1235 * @WLAN_SCAN_CANCEL_HOST_VDEV_ALL: Cancel all host triggered scans alone on 1236 * vdev 1237 */ 1238 enum scan_cancel_req_type { 1239 WLAN_SCAN_CANCEL_SINGLE = 1, 1240 WLAN_SCAN_CANCEL_VDEV_ALL, 1241 WLAN_SCAN_CANCEL_PDEV_ALL, 1242 WLAN_SCAN_CANCEL_HOST_VDEV_ALL, 1243 }; 1244 1245 /** 1246 * struct scan_cancel_param - stop scan cmd parameter 1247 * @requester: scan requester 1248 * @scan_id: scan id 1249 * @req_type: scan request type 1250 * @vdev_id: vdev id 1251 * @pdev_id: pdev id of parent pdev 1252 */ 1253 struct scan_cancel_param { 1254 uint32_t requester; 1255 uint32_t scan_id; 1256 enum scan_cancel_req_type req_type; 1257 uint32_t vdev_id; 1258 uint32_t pdev_id; 1259 }; 1260 1261 /** 1262 * struct scan_cancel_request - stop scan cmd 1263 * @vdev: vdev object 1264 * @wait_tgt_cancel: wait for target to cancel scan 1265 * @cancel_req: stop scan cmd parameter 1266 */ 1267 struct scan_cancel_request { 1268 /* Extra parameters consumed by scan module or serialization */ 1269 struct wlan_objmgr_vdev *vdev; 1270 bool wait_tgt_cancel; 1271 /* Actual scan cancel request parameters */ 1272 struct scan_cancel_param cancel_req; 1273 }; 1274 1275 /** 1276 * enum scan_event_type - scan event types 1277 * @SCAN_EVENT_TYPE_STARTED: scan started 1278 * @SCAN_EVENT_TYPE_COMPLETED: scan completed 1279 * @SCAN_EVENT_TYPE_BSS_CHANNEL: HW came back to home channel 1280 * @SCAN_EVENT_TYPE_FOREIGN_CHANNEL: HW moved to foreign channel 1281 * @SCAN_EVENT_TYPE_DEQUEUED: scan request dequeued 1282 * @SCAN_EVENT_TYPE_PREEMPTED: scan got preempted 1283 * @SCAN_EVENT_TYPE_START_FAILED: couldn't start scan 1284 * @SCAN_EVENT_TYPE_RESTARTED: scan restarted 1285 * @SCAN_EVENT_TYPE_FOREIGN_CHANNEL_EXIT: HW exited foreign channel 1286 * @SCAN_EVENT_TYPE_SUSPENDED: scan got suspended 1287 * @SCAN_EVENT_TYPE_RESUMED: scan resumed 1288 * @SCAN_EVENT_TYPE_NLO_COMPLETE: NLO completed 1289 * @SCAN_EVENT_TYPE_NLO_MATCH: NLO match event 1290 * @SCAN_EVENT_TYPE_INVALID: invalid request 1291 * @SCAN_EVENT_TYPE_GPIO_TIMEOUT: gpio timeout 1292 * @SCAN_EVENT_TYPE_RADIO_MEASUREMENT_START: radio measurement start 1293 * @SCAN_EVENT_TYPE_RADIO_MEASUREMENT_END: radio measurement end 1294 * @SCAN_EVENT_TYPE_BSSID_MATCH: bssid match found 1295 * @SCAN_EVENT_TYPE_FOREIGN_CHANNEL_GET_NF: foreign channel noise floor 1296 * @SCAN_EVENT_TYPE_MAX: marker for invalid event 1297 */ 1298 enum scan_event_type { 1299 SCAN_EVENT_TYPE_STARTED, 1300 SCAN_EVENT_TYPE_COMPLETED, 1301 SCAN_EVENT_TYPE_BSS_CHANNEL, 1302 SCAN_EVENT_TYPE_FOREIGN_CHANNEL, 1303 SCAN_EVENT_TYPE_DEQUEUED, 1304 SCAN_EVENT_TYPE_PREEMPTED, 1305 SCAN_EVENT_TYPE_START_FAILED, 1306 SCAN_EVENT_TYPE_RESTARTED, 1307 SCAN_EVENT_TYPE_FOREIGN_CHANNEL_EXIT, 1308 SCAN_EVENT_TYPE_SUSPENDED, 1309 SCAN_EVENT_TYPE_RESUMED, 1310 SCAN_EVENT_TYPE_NLO_COMPLETE, 1311 SCAN_EVENT_TYPE_NLO_MATCH, 1312 SCAN_EVENT_TYPE_INVALID, 1313 SCAN_EVENT_TYPE_GPIO_TIMEOUT, 1314 SCAN_EVENT_TYPE_RADIO_MEASUREMENT_START, 1315 SCAN_EVENT_TYPE_RADIO_MEASUREMENT_END, 1316 SCAN_EVENT_TYPE_BSSID_MATCH, 1317 SCAN_EVENT_TYPE_FOREIGN_CHANNEL_GET_NF, 1318 SCAN_EVENT_TYPE_MAX, 1319 }; 1320 1321 /** 1322 * enum scan_completion_reason - scan completion reason 1323 * @SCAN_REASON_NONE: un specified reason 1324 * @SCAN_REASON_COMPLETED: scan successfully completed 1325 * @SCAN_REASON_CANCELLED: scan got cancelled 1326 * @SCAN_REASON_PREEMPTED: scan got preempted 1327 * @SCAN_REASON_TIMEDOUT: couldn't complete within specified time 1328 * @SCAN_REASON_INTERNAL_FAILURE: cancelled because of some failure 1329 * @SCAN_REASON_SUSPENDED: scan suspended 1330 * @SCAN_REASON_RUN_FAILED: run failed 1331 * @SCAN_REASON_TERMINATION_FUNCTION: termination function 1332 * @SCAN_REASON_MAX_OFFCHAN_RETRIES: max retries exceeded threshold 1333 * @SCAN_REASON_DFS_VIOLATION: Scan start failure due to DFS violation. 1334 * @SCAN_REASON_MAX: invalid completion reason marker 1335 */ 1336 enum scan_completion_reason { 1337 SCAN_REASON_NONE, 1338 SCAN_REASON_COMPLETED, 1339 SCAN_REASON_CANCELLED, 1340 SCAN_REASON_PREEMPTED, 1341 SCAN_REASON_TIMEDOUT, 1342 SCAN_REASON_INTERNAL_FAILURE, 1343 SCAN_REASON_SUSPENDED, 1344 SCAN_REASON_RUN_FAILED, 1345 SCAN_REASON_TERMINATION_FUNCTION, 1346 SCAN_REASON_MAX_OFFCHAN_RETRIES, 1347 SCAN_REASON_DFS_VIOLATION, 1348 SCAN_REASON_MAX, 1349 }; 1350 1351 /** 1352 * struct scan_event - scan event definition 1353 * @vdev_id: vdev where scan was run 1354 * @type: type of scan event 1355 * @reason: completion reason 1356 * @chan_freq: channel centre frequency 1357 * @requester: requester id 1358 * @scan_id: scan id 1359 * @timestamp: timestamp in microsec recorded by target for the scan event 1360 * @scan_start_req: scan request object used to start this scan 1361 */ 1362 struct scan_event { 1363 uint32_t vdev_id; 1364 enum scan_event_type type; 1365 enum scan_completion_reason reason; 1366 uint32_t chan_freq; 1367 uint32_t requester; 1368 uint32_t scan_id; 1369 uint32_t timestamp; 1370 struct scan_start_request *scan_start_req; 1371 }; 1372 1373 /** 1374 * struct scan_event_info - scan event information 1375 * @vdev: vdev object 1376 * @event: scan event 1377 */ 1378 struct scan_event_info { 1379 struct wlan_objmgr_vdev *vdev; 1380 struct scan_event event; 1381 }; 1382 1383 /** 1384 * enum scm_scan_status - scan status 1385 * @SCAN_NOT_IN_PROGRESS: Neither active nor pending scan in progress 1386 * @SCAN_IS_ACTIVE: scan request is present only in active list 1387 * @SCAN_IS_PENDING: scan request is present only in pending list 1388 * @SCAN_IS_ACTIVE_AND_PENDING: scan request is present in active 1389 * and pending both lists 1390 */ 1391 enum scm_scan_status { 1392 SCAN_NOT_IN_PROGRESS = 0, /* Must be 0 */ 1393 SCAN_IS_ACTIVE, 1394 SCAN_IS_PENDING, 1395 SCAN_IS_ACTIVE_AND_PENDING, 1396 }; 1397 1398 /** 1399 * typedef scan_event_handler() - function prototype of scan event handlers 1400 * @vdev: vdev object 1401 * @event: scan event 1402 * @arg: argument 1403 * 1404 * PROTO TYPE, scan event handler call back function prototype 1405 * 1406 * Return: void 1407 */ 1408 typedef void (*scan_event_handler) (struct wlan_objmgr_vdev *vdev, 1409 struct scan_event *event, void *arg); 1410 1411 /** 1412 * enum scan_cb_type - update beacon cb type 1413 * @SCAN_CB_TYPE_INFORM_BCN: Callback to indicate beacon to OS 1414 * @SCAN_CB_TYPE_UPDATE_BCN: Callback to indicate beacon 1415 * @SCAN_CB_TYPE_UNLINK_BSS: cb to unlink bss entry 1416 * to MLME and update MLME info 1417 * 1418 */ 1419 enum scan_cb_type { 1420 SCAN_CB_TYPE_INFORM_BCN, 1421 SCAN_CB_TYPE_UPDATE_BCN, 1422 SCAN_CB_TYPE_UNLINK_BSS, 1423 }; 1424 1425 /* Set PNO */ 1426 #define SCAN_PNO_MAX_PLAN_REQUEST 2 1427 #define SCAN_PNO_MAX_NETW_CHANNELS_EX (NUM_CHANNELS) 1428 #define SCAN_PNO_MAX_SUPP_NETWORKS 16 1429 #define SCAN_PNO_DEF_SLOW_SCAN_MULTIPLIER 6 1430 #define SCAN_PNO_DEF_SCAN_TIMER_REPEAT 20 1431 #define SCAN_PNO_MATCH_WAKE_LOCK_TIMEOUT (5 * 1000) /* in msec */ 1432 #define SCAN_MAX_IE_LENGTH 255 1433 #ifdef CONFIG_SLUB_DEBUG_ON 1434 #define SCAN_PNO_SCAN_COMPLETE_WAKE_LOCK_TIMEOUT (2 * 1000) /* in msec */ 1435 #else 1436 #define SCAN_PNO_SCAN_COMPLETE_WAKE_LOCK_TIMEOUT (1 * 1000) /* in msec */ 1437 #endif /* CONFIG_SLUB_DEBUG_ON */ 1438 1439 /** 1440 * enum ssid_bc_type - SSID broadcast type 1441 * @SSID_BC_TYPE_UNKNOWN: Broadcast unknown 1442 * @SSID_BC_TYPE_NORMAL: Broadcast normal 1443 * @SSID_BC_TYPE_HIDDEN: Broadcast hidden 1444 */ 1445 enum ssid_bc_type { 1446 SSID_BC_TYPE_UNKNOWN = 0, 1447 SSID_BC_TYPE_NORMAL = 1, 1448 SSID_BC_TYPE_HIDDEN = 2, 1449 }; 1450 1451 /** 1452 * struct pno_nw_type - pno nw type 1453 * @ssid: ssid 1454 * @authentication: authentication type 1455 * @encryption: encryption type 1456 * @bc_new_type: broadcast nw type 1457 * @pno_chan_list: pno channel list info 1458 * @rssi_thresh: rssi threshold 1459 */ 1460 struct pno_nw_type { 1461 struct wlan_ssid ssid; 1462 uint32_t authentication; 1463 uint32_t encryption; 1464 uint32_t bc_new_type; 1465 struct chan_list pno_chan_list; 1466 int32_t rssi_thresh; 1467 }; 1468 1469 /** 1470 * struct cpno_band_rssi_pref - BSS preference based on band and RSSI 1471 * @band: band preference 1472 * @rssi: RSSI preference 1473 */ 1474 struct cpno_band_rssi_pref { 1475 int8_t band; 1476 int8_t rssi; 1477 }; 1478 1479 /** 1480 * struct nlo_mawc_params - Motion Aided Wireless Connectivity based 1481 * Network List Offload configuration 1482 * @vdev_id: VDEV ID on which the configuration needs to be applied 1483 * @enable: flag to enable or disable 1484 * @exp_backoff_ratio: ratio of exponential backoff 1485 * @init_scan_interval: initial scan interval(msec) 1486 * @max_scan_interval: max scan interval(msec) 1487 */ 1488 struct nlo_mawc_params { 1489 uint8_t vdev_id; 1490 bool enable; 1491 uint32_t exp_backoff_ratio; 1492 uint32_t init_scan_interval; 1493 uint32_t max_scan_interval; 1494 }; 1495 1496 /** 1497 * struct pno_scan_req_params - PNO Scan request structure 1498 * @vdev: vdev object 1499 * @networks_cnt: Number of networks 1500 * @do_passive_scan: Flag to request passive scan to fw 1501 * @vdev_id: vdev id 1502 * @fast_scan_period: Fast Scan period 1503 * @slow_scan_period: Slow scan period 1504 * @delay_start_time: delay in seconds to use before starting the first scan 1505 * @fast_scan_max_cycles: Fast scan max cycles 1506 * @scan_backoff_multiplier: multiply fast scan period by this after max cycles 1507 * @pno_channel_prediction: PNO channel prediction feature status 1508 * @active_dwell_time: active dwell time 1509 * @passive_dwell_time: passive dwell time 1510 * @top_k_num_of_channels: top K number of channels are used for tanimoto 1511 * distance calculation. 1512 * @stationary_thresh: threshold value to determine that the STA is stationary. 1513 * @adaptive_dwell_mode: adaptive dwelltime mode for pno scan 1514 * @channel_prediction_full_scan: periodic timer upon which a full scan needs 1515 * to be triggered. 1516 * @networks_list: Preferred network list 1517 * @scan_random: scan randomization params 1518 * @ie_allowlist: probe req IE allowlist attrs 1519 * @relative_rssi_set: Flag to check whether realtive_rssi is set or not 1520 * @relative_rssi: Relative rssi threshold, used for connected pno 1521 * @band_rssi_pref: Band and RSSI preference that can be given to one BSS 1522 * over the other BSS 1523 * 1524 * E.g. 1525 * { fast_scan_period=120, fast_scan_max_cycles=2, 1526 * slow_scan_period=1800, scan_backoff_multiplier=2 } 1527 * Result: 120s x2, 240s x2, 480s x2, 960s x2, 1800s xN 1528 * @mawc_params: Configuration parameters for NLO MAWC. 1529 * @scan_policy_colocated_6ghz: colocated_6ghz flag is set in pno scan req 1530 */ 1531 struct pno_scan_req_params { 1532 struct wlan_objmgr_vdev *vdev; 1533 uint32_t networks_cnt; 1534 bool do_passive_scan; 1535 uint32_t vdev_id; 1536 uint32_t fast_scan_period; 1537 uint32_t slow_scan_period; 1538 uint32_t delay_start_time; 1539 uint32_t fast_scan_max_cycles; 1540 uint8_t scan_backoff_multiplier; 1541 uint32_t active_dwell_time; 1542 uint32_t passive_dwell_time; 1543 uint32_t pno_channel_prediction; 1544 uint32_t top_k_num_of_channels; 1545 uint32_t stationary_thresh; 1546 enum scan_dwelltime_adaptive_mode adaptive_dwell_mode; 1547 uint32_t channel_prediction_full_scan; 1548 struct pno_nw_type networks_list[SCAN_PNO_MAX_SUPP_NETWORKS]; 1549 struct scan_random_attr scan_random; 1550 struct probe_req_allowlist_attr ie_allowlist; 1551 bool relative_rssi_set; 1552 int8_t relative_rssi; 1553 struct cpno_band_rssi_pref band_rssi_pref; 1554 struct nlo_mawc_params mawc_params; 1555 bool scan_policy_colocated_6ghz; 1556 }; 1557 1558 /** 1559 * struct scan_user_cfg - user configuration required for for scan 1560 * @ie_allowlist: probe req IE allowlist attrs 1561 * @sta_miracast_mcc_rest_time: sta miracast mcc rest time 1562 */ 1563 struct scan_user_cfg { 1564 struct probe_req_allowlist_attr ie_allowlist; 1565 uint32_t sta_miracast_mcc_rest_time; 1566 }; 1567 1568 /** 1569 * typedef update_mbssid_bcn_prb_rsp() - cb to inform mbssid beacon or prob resp 1570 * @frame: the pointer of frame data 1571 * @frame_len: the length of frame data 1572 * @frm_subtype: frame type 1573 * @bssid: the pointer of bssid 1574 * 1575 * Return: QDF_STATUS 1576 */ 1577 typedef QDF_STATUS (*update_mbssid_bcn_prb_rsp)(uint8_t *frame, 1578 uint32_t frame_len, 1579 uint8_t frm_subtype, 1580 char *bssid); 1581 1582 /** 1583 * typedef update_beacon_cb() - cb to inform/update beacon 1584 * @pdev: pdev pointer 1585 * @scan_entry: scan entry to inform/update 1586 * 1587 * Return: void 1588 */ 1589 typedef void (*update_beacon_cb) (struct wlan_objmgr_pdev *pdev, 1590 struct scan_cache_entry *scan_entry); 1591 1592 /** 1593 * typedef scan_iterator_func() - function prototype of scan iterator function 1594 * @arg: extra argument 1595 * @scan_entry: scan entry object 1596 * 1597 * PROTO TYPE, scan iterator function prototype 1598 * 1599 * Return: QDF_STATUS 1600 */ 1601 typedef QDF_STATUS (*scan_iterator_func) (void *arg, 1602 struct scan_cache_entry *scan_entry); 1603 1604 /** 1605 * enum scan_config - scan configuration definitions 1606 * @SCAN_CFG_DISABLE_SCAN_COMMAND_TIMEOUT: disable scan command timeout 1607 * @SCAN_CFG_DROP_BCN_ON_CHANNEL_MISMATCH: config to drop beacon/probe 1608 * response frames if received channel and IE channels do not match 1609 */ 1610 enum scan_config { 1611 SCAN_CFG_DISABLE_SCAN_COMMAND_TIMEOUT, 1612 SCAN_CFG_DROP_BCN_ON_CHANNEL_MISMATCH, 1613 }; 1614 1615 /** 1616 * enum ext_cap_bit_field - Extended capabilities bit field 1617 * @BSS_2040_COEX_MGMT_SUPPORT: 20/40 BSS Coexistence Management Support field 1618 * @OBSS_NARROW_BW_RU_IN_ULOFDMA_TOLERENT_SUPPORT: OBSS Narrow Bandwidth RU 1619 * in UL OFDMA Tolerance Support 1620 */ 1621 enum ext_cap_bit_field { 1622 BSS_2040_COEX_MGMT_SUPPORT = 0, 1623 OBSS_NARROW_BW_RU_IN_ULOFDMA_TOLERENT_SUPPORT = 79, 1624 }; 1625 1626 /** 1627 * struct scan_rnr_info - RNR information 1628 * @timestamp: time stamp of beacon/probe 1629 * @short_ssid: Short SSID 1630 * @bssid: BSSID 1631 * @bss_params: bss params present in RNR IE 1632 */ 1633 struct scan_rnr_info { 1634 qdf_time_t timestamp; 1635 uint32_t short_ssid; 1636 struct qdf_mac_addr bssid; 1637 uint8_t bss_params; 1638 }; 1639 1640 /** 1641 * struct scan_rnr_node - Scan RNR entry node 1642 * @node: node pointers 1643 * @entry: scan RNR entry pointer 1644 */ 1645 struct scan_rnr_node { 1646 qdf_list_node_t node; 1647 struct scan_rnr_info entry; 1648 }; 1649 1650 /** 1651 * struct meta_rnr_channel - Channel information for scan priority algorithm 1652 * @chan_freq: channel frequency 1653 * @bss_beacon_probe_count: Beacon and probe request count 1654 * @saved_profile_count: Saved profile count 1655 * @beacon_probe_last_time_found: Timestamp of beacon/probe observed 1656 * @rnr_list: RNR list to store RNR IE information 1657 */ 1658 struct meta_rnr_channel { 1659 uint32_t chan_freq; 1660 uint32_t bss_beacon_probe_count; 1661 uint32_t saved_profile_count; 1662 qdf_time_t beacon_probe_last_time_found; 1663 qdf_list_t rnr_list; 1664 }; 1665 1666 #define RNR_UPDATE_SCAN_CNT_THRESHOLD 2 1667 /** 1668 * struct channel_list_db - Database for channel information 1669 * @channel: channel meta information 1670 * @scan_count: scan count since the db was updated 1671 */ 1672 struct channel_list_db { 1673 struct meta_rnr_channel channel[NUM_6GHZ_CHANNELS]; 1674 uint8_t scan_count; 1675 }; 1676 1677 /** 1678 * struct rnr_chan_weight - RNR channel weightage 1679 * @chan_freq: channel frequency 1680 * @weight: weightage of the channel 1681 * @phymode: phymode in which @frequency should be scanned 1682 * @flags: Flags to define channel property as defined @enum scan_flags. 1683 * Firmware can use this info for different operations, e.g.: scan 1684 */ 1685 struct rnr_chan_weight { 1686 uint32_t chan_freq; 1687 uint32_t weight; 1688 enum scan_phy_mode phymode; 1689 enum scan_flags flags; 1690 }; 1691 1692 /** 1693 * enum trim_channel_list - which channel list need trim 1694 * @TRIM_CHANNEL_LIST_NONE: no channel need trim 1695 * @TRIM_CHANNEL_LIST_5G: 5G channel need trim 1696 * @TRIM_CHANNEL_LIST_24G: 2.4G channel need trim 1697 */ 1698 enum trim_channel_list { 1699 TRIM_CHANNEL_LIST_NONE, 1700 TRIM_CHANNEL_LIST_5G, 1701 TRIM_CHANNEL_LIST_24G, 1702 }; 1703 1704 #ifdef FEATURE_SET 1705 /** 1706 * struct wlan_scan_features - Scan feature set structure 1707 * @pno_in_unassoc_state: is pno supported in unassoc state 1708 * @pno_in_assoc_state: is pno supported in assoc state 1709 */ 1710 struct wlan_scan_features { 1711 bool pno_in_unassoc_state; 1712 bool pno_in_assoc_state; 1713 }; 1714 #endif 1715 #endif 1716