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