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