1 /* 2 * Copyright 2008-2024 NXP 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 * 6 */ 7 8 /*! \file wifi-decl.h 9 * \brief Wifi structure declarations 10 */ 11 12 #ifndef __WIFI_DECL_H__ 13 #define __WIFI_DECL_H__ 14 15 #include <stdint.h> 16 #include <stdbool.h> 17 #include <wm_utils.h> 18 #include <mlan_decl.h> 19 #include <mlan_ioctl.h> 20 #include <wifi_events.h> 21 22 /* fixme: remove these after complete integration with mlan */ 23 #define MLAN_MAC_ADDR_LENGTH (6U) 24 /** Version string buffer length */ 25 #define MLAN_MAX_VER_STR_LEN 128 26 27 #define WIFI_MAX_CHANNEL_NUM 42 28 29 #define PMK_BIN_LEN 32 30 #define PMK_HEX_LEN 64 31 32 #define MOD_GROUPS 7 33 34 #if CONFIG_DRIVER_OWE 35 /** The open AP in OWE transmition Mode */ 36 #define OWE_TRANS_MODE_OPEN 1U 37 /** The security AP in OWE trsnsition Mode */ 38 #define OWE_TRANS_MODE_OWE 2U 39 #endif 40 41 #if CONFIG_WIFI_CAPA 42 #define WIFI_SUPPORT_11AX (1 << 3) 43 #define WIFI_SUPPORT_11AC (1 << 2) 44 #define WIFI_SUPPORT_11N (1 << 1) 45 #define WIFI_SUPPORT_LEGACY (1 << 0) 46 #endif 47 48 #if 0 49 /** channel_field.flags */ 50 #define CHANNEL_FLAGS_TURBO 0x0010 51 #define CHANNEL_FLAGS_CCK 0x0020 52 #define CHANNEL_FLAGS_OFDM 0x0040 53 #define CHANNEL_FLAGS_2GHZ 0x0080 54 #define CHANNEL_FLAGS_5GHZ 0x0100 55 #define CHANNEL_FLAGS_ONLY_PASSIVSCAN_ALLOW 0x0200 56 #define CHANNEL_FLAGS_DYNAMIC_CCK_OFDM 0x0400 57 #define CHANNEL_FLAGS_GFSK 0x0800 58 PACK_START struct channel_field { 59 t_u16 frequency; 60 t_u16 flags; 61 } PACK_END; 62 63 /** mcs_field.known */ 64 #define MCS_KNOWN_BANDWIDTH 0x01 65 #define MCS_KNOWN_MCS_INDEX_KNOWN 0x02 66 #define MCS_KNOWN_GUARD_INTERVAL 0x04 67 #define MCS_KNOWN_HT_FORMAT 0x08 68 #define MCS_KNOWN_FEC_TYPE 0x10 69 #define MCS_KNOWN_STBC_KNOWN 0x20 70 #define MCS_KNOWN_NESS_KNOWN 0x40 71 #define MCS_KNOWN_NESS_DATA 0x80 72 /** bandwidth */ 73 #define RX_BW_20 0 74 #define RX_BW_40 1 75 #define RX_BW_20L 2 76 #define RX_BW_20U 3 77 /** mcs_field.flags 78 The flags field is any combination of the following: 79 0x03 bandwidth - 0: 20, 1: 40, 2: 20L, 3: 20U 80 0x04 guard interval - 0: long GI, 1: short GI 81 0x08 HT format - 0: mixed, 1: greenfield 82 0x10 FEC type - 0: BCC, 1: LDPC 83 0x60 Number of STBC streams 84 0x80 Ness - bit 0 (LSB) of Number of extension spatial streams */ 85 PACK_START struct mcs_field { 86 t_u8 known; 87 t_u8 flags; 88 t_u8 mcs; 89 } PACK_END; 90 91 /** radiotap_body.flags */ 92 #define RADIOTAP_FLAGS_DURING_CFG 0x01 93 #define RADIOTAP_FLAGS_SHORT_PREAMBLE 0x02 94 #define RADIOTAP_FLAGS_WEP_ENCRYPTION 0x04 95 #define RADIOTAP_FLAGS_WITH_FRAGMENT 0x08 96 #define RADIOTAP_FLAGS_INCLUDE_FCS 0x10 97 #define RADIOTAP_FLAGS_PAD_BTW_HEADER_PAYLOAD 0x20 98 #define RADIOTAP_FLAGS_FAILED_FCS_CHECK 0x40 99 #define RADIOTAP_FLAGS_USE_SGI_HT 0x80 100 PACK_START struct radiotap_body { 101 t_u64 timestamp; 102 t_u8 flags; 103 t_u8 rate; 104 struct channel_field channel; 105 t_s8 antenna_signal; 106 t_s8 antenna_noise; 107 t_u8 antenna; 108 struct mcs_field mcs; 109 } PACK_END; 110 111 typedef PACK_START struct _radiotap_header { 112 struct ieee80211_radiotap_header hdr; 113 struct radiotap_body body; 114 } PACK_END radiotap_header_t; 115 #endif 116 117 /** Station information structure */ 118 typedef struct 119 { 120 /** MAC address buffer */ 121 t_u8 mac[MLAN_MAC_ADDR_LENGTH]; 122 /** 123 * Power management status 124 * 0 = active (not in power save) 125 * 1 = in power save status 126 */ 127 t_u8 power_mgmt_status; 128 /** RSSI: dBm */ 129 t_s8 rssi; 130 } wifi_sta_info_t; 131 132 /** Channel list structure */ 133 typedef PACK_START struct _wifi_scan_chan_list_t 134 { 135 /** Number of channels */ 136 uint8_t num_of_chan; 137 /** Channel number */ 138 uint8_t chan_number[MLAN_MAX_CHANNEL]; 139 } PACK_END wifi_scan_chan_list_t; 140 141 /** 142 * Note: This is variable length structure. The size of array mac_list is 143 * equal to count. The caller of the API which returns this structure does 144 * not need to separately free the array mac_list. It only needs to free 145 * the sta_list_t object after use. 146 */ 147 typedef struct 148 { 149 /** Count */ 150 int count; 151 /* 152 * Variable length array. Max size is MAX_NUM_CLIENTS. 153 */ 154 /* wifi_sta_info_t *list; */ 155 } wifi_sta_list_t; 156 157 /** BSS type : STA */ 158 #define BSS_TYPE_STA 0U 159 /** BSS type : UAP */ 160 #define BSS_TYPE_UAP 1U 161 162 #define UAP_DEFAULT_CHANNEL 0 163 #ifdef RW610 164 #define UAP_DEFAULT_BANDWIDTH 1 165 #else 166 #define UAP_DEFAULT_BANDWIDTH 2 167 #endif 168 #define UAP_DEFAULT_BEACON_PERIOD 100 169 #define UAP_DEFAULT_HIDDEN_SSID 0 170 171 enum wifi_bss_security 172 { 173 WIFI_SECURITY_NONE = 0, 174 WIFI_SECURITY_WEP_STATIC, 175 WIFI_SECURITY_WEP_DYNAMIC, 176 WIFI_SECURITY_WPA, 177 WIFI_SECURITY_WPA2, 178 }; 179 180 enum wifi_bss_features 181 { 182 WIFI_BSS_FEATURE_WMM = 0, 183 WIFI_BSS_FEATURE_WPS = 1, 184 }; 185 186 struct wifi_message 187 { 188 uint16_t event; 189 enum wifi_event_reason reason; 190 void *data; 191 }; 192 193 #if CONFIG_P2P 194 struct wifi_wfd_event 195 { 196 bool peer_event; 197 bool action_frame; 198 void *data; 199 }; 200 #endif 201 202 /* Wlan Cipher structure */ 203 typedef struct 204 { 205 /** 1 bit value can be set for none */ 206 uint16_t none : 1; 207 /** 1 bit value can be set for wep40 */ 208 uint16_t wep40 : 1; 209 /** 1 bit value can be set for wep104 */ 210 uint16_t wep104 : 1; 211 /** 1 bit value can be set for tkip */ 212 uint16_t tkip : 1; 213 /** 1 bit valuecan be set for ccmp */ 214 uint16_t ccmp : 1; 215 /** 1 bit valuecan be set for aes 128 cmac */ 216 uint16_t aes_128_cmac : 1; 217 /** 1 bit value can be set for gcmp */ 218 uint16_t gcmp : 1; 219 /** 1 bit value can be set for sms4 */ 220 uint16_t sms4 : 1; 221 /** 1 bit value can be set for gcmp 256 */ 222 uint16_t gcmp_256 : 1; 223 /** 1 bit valuecan be set for ccmp 256 */ 224 uint16_t ccmp_256 : 1; 225 /** 1 bit is reserved */ 226 uint16_t rsvd : 1; 227 /** 1 bit value can be set for bip gmac 128 */ 228 uint16_t bip_gmac_128 : 1; 229 /** 1 bit value can be set for bip gmac 256 */ 230 uint16_t bip_gmac_256 : 1; 231 /** 1 bit value can be set for bip cmac 256 */ 232 uint16_t bip_cmac_256 : 1; 233 /** 1 bit valuecan be set for gtk not used */ 234 uint16_t gtk_not_used : 1; 235 /** 4 bits are reserved */ 236 uint16_t rsvd2 : 2; 237 } _Cipher_t; 238 239 /* Security mode structure */ 240 typedef struct 241 { 242 /** No security */ 243 uint32_t noRsn : 1; 244 /** WEP static */ 245 uint32_t wepStatic : 1; 246 /** WEP dynamic */ 247 uint32_t wepDynamic : 1; 248 /** WPA */ 249 uint32_t wpa : 1; 250 /** WPA none */ 251 uint32_t wpaNone : 1; 252 /** WPA 2 */ 253 uint32_t wpa2 : 1; 254 /** WPA 2 sha256 */ 255 uint32_t wpa2_sha256 : 1; 256 /** OWE */ 257 uint32_t owe : 1; 258 /** WPA3 SAE */ 259 uint32_t wpa3_sae : 1; 260 /** 802.1x */ 261 uint32_t wpa2_entp : 1; 262 /** 802.1x sha256 */ 263 uint32_t wpa2_entp_sha256 : 1; 264 /** FT 802.1x */ 265 uint32_t ft_1x : 1; 266 /** FT 802.1x sha384 */ 267 uint32_t ft_1x_sha384 : 1; 268 /** FT PSK */ 269 uint32_t ft_psk : 1; 270 /** FT SAE */ 271 uint32_t ft_sae : 1; 272 /** WPA3 802.1x sha256 */ 273 uint32_t wpa3_1x_sha256 : 1; 274 /** WPA3 802.1x sha384 */ 275 uint32_t wpa3_1x_sha384 : 1; 276 /** Reserved 16 bits */ 277 uint32_t rsvd : 16; 278 } _SecurityMode_t; 279 280 /* TODO: clean up the parts brought over from the Host SME BSSDescriptor_t, 281 * remove ifdefs, consolidate security info */ 282 283 /** MLAN Maximum SSID Length */ 284 #define MLAN_MAX_SSID_LENGTH (32U) 285 /** MLAN Maximum PASSPHRASE Length */ 286 #define MLAN_MAX_PASS_LENGTH (64) 287 288 /** Scan result information */ 289 struct wifi_scan_result2 290 { 291 uint8_t bssid[MLAN_MAC_ADDR_LENGTH]; /*!< BSSID array */ 292 bool is_ibss_bit_set; /*!< Is bssid set? */ 293 294 uint8_t ssid[MLAN_MAX_SSID_LENGTH]; /*!< ssid array */ 295 int ssid_len; /*!< SSID length */ 296 uint8_t Channel; /*!< Channel associated to the BSSID */ 297 uint8_t RSSI; /*!< Received signal strength */ 298 uint16_t beacon_period; /*!< Beacon period */ 299 uint16_t dtim_period; /*!< DTIM period */ 300 _SecurityMode_t WPA_WPA2_WEP; /*!< Security mode info */ 301 _Cipher_t wpa_mcstCipher; /*!< WPA multicast cipher */ 302 _Cipher_t wpa_ucstCipher; /*!< WPA unicast cipher */ 303 _Cipher_t rsn_mcstCipher; /*!< No security multicast cipher */ 304 _Cipher_t rsn_ucstCipher; /*!< No security unicast cipher */ 305 bool is_pmf_required; /*!< Is pmf required flag */ 306 t_u8 ap_mfpc; /*!< MFPC bit of AP */ 307 t_u8 ap_mfpr; /*!< MFPR bit of AP */ 308 t_u8 ap_pwe; /*!< PWE bit of AP */ 309 310 /*!< 311 ** WPA_WPA2 = 0 => Security not enabled 312 ** = 1 => WPA mode 313 ** = 2 => WPA2 mode 314 ** = 3 => WEP mode 315 */ 316 bool phtcap_ie_present; /*!< PHT CAP IE present info */ 317 bool phtinfo_ie_present; /*!< PHT INFO IE present info */ 318 #if CONFIG_11AC 319 /** 11AC VHT capab support */ 320 bool pvhtcap_ie_present; 321 #endif 322 #if CONFIG_11AX 323 /** 11AX HE capab support */ 324 bool phecap_ie_present; 325 #endif 326 327 bool wmm_ie_present; /*!< WMM IE present info */ 328 uint16_t band; /*!< Band info */ 329 330 bool wps_IE_exist; /*!< WPS IE exist info */ 331 uint16_t wps_session; /*!< WPS session */ 332 bool wpa2_entp_IE_exist; /*!< WPA2 enterprise IE exist info */ 333 uint8_t trans_mode; /*!< Trans mode */ 334 uint8_t trans_bssid[MLAN_MAC_ADDR_LENGTH]; /*!< Trans bssid array */ 335 uint8_t trans_ssid[MLAN_MAX_SSID_LENGTH]; /*!< Trans ssid array */ 336 int trans_ssid_len; /*!< Trans bssid length */ 337 #if CONFIG_DRIVER_MBO 338 bool mbo_assoc_disallowed; /*!< MBO disallowed */ 339 #endif 340 #if CONFIG_11R 341 /** Mobility domain identifier */ 342 uint16_t mdid; 343 #endif 344 #if CONFIG_11K 345 /** Neigbort report support */ 346 bool neighbor_report_supported; 347 #endif 348 #if CONFIG_11V 349 /** bss transition support */ 350 bool bss_transition_supported; 351 #endif 352 }; 353 354 /** MAC address */ 355 typedef struct 356 { 357 /** Mac address array */ 358 char mac[MLAN_MAC_ADDR_LENGTH]; 359 } wifi_mac_addr_t; 360 361 /** Firmware version */ 362 typedef struct 363 { 364 /** Firmware version string */ 365 char version_str[MLAN_MAX_VER_STR_LEN]; 366 } wifi_fw_version_t; 367 368 /** Extended Firmware version */ 369 typedef struct 370 { 371 /** ID for extended version select */ 372 uint8_t version_str_sel; 373 /** Firmware version string */ 374 char version_str[MLAN_MAX_VER_STR_LEN]; 375 } wifi_fw_version_ext_t; 376 377 enum wlan_type 378 { 379 WLAN_TYPE_NORMAL = 0, 380 WLAN_TYPE_WIFI_CALIB, 381 WLAN_TYPE_FCC_CERTIFICATION, 382 }; 383 384 /** Tx power levels */ 385 typedef struct 386 { 387 /** Current power level */ 388 uint16_t current_level; 389 /** Maximum power level */ 390 uint8_t max_power; 391 /** Minimum power level */ 392 uint8_t min_power; 393 394 } wifi_tx_power_t; 395 396 /** Rf channel */ 397 typedef struct 398 { 399 /** Current channel */ 400 uint16_t current_channel; 401 /** RF Type */ 402 uint16_t rf_type; 403 } wifi_rf_channel_t; 404 405 /** Remain on channel info structure */ 406 typedef struct 407 { 408 /** Remove */ 409 uint16_t remove; 410 /** Current status */ 411 uint8_t status; 412 /** band configuration */ 413 uint8_t bandcfg; 414 /** Channel */ 415 uint8_t channel; 416 /** Remain on channel period */ 417 uint32_t remain_period; 418 } wifi_remain_on_channel_t; 419 420 #if CONFIG_11AX 421 /** TX Rate Setting */ 422 typedef PACK_START struct _txrate_setting 423 { 424 /** Preamble */ 425 t_u16 preamble : 2; /*BIT1-BIT0: 426 * For legacy 11b: preamble type 427 * 00 = long 428 * 01 = short 429 * 10/11 = reserved 430 * For legacy 11g: reserved 431 * For 11n: Green field PPDU indicator 432 * 00 = HT-mix 433 * 01 = HT-GF 434 * 10/11 = reserved. 435 * For 11ac: reserved. 436 * For 11ax: 437 * 00 = HE-SU 438 * 01 = HE-EXT-SU 439 * 10 = HE-MU 440 * 11 = HE trigger based 441 */ 442 /** Bandwidth */ 443 t_u16 bandwidth : 3; /* BIT2- BIT4 444 * For 11n and 11ac traffic: Bandwidth 445 * 0 = 20Mhz 446 * 1 = 40Mhz 447 * 2 = 80 Mhz 448 * 3 = 160 Mhz 449 * 4-7 = reserved 450 * For legacy rate : BW>0 implies non-HT duplicates. 451 * For HE SU PPDU: 452 * 0 = 20Mhz 453 * 1 = 40Mhz 454 * 2 = 80 Mhz 455 * 3 = 160 Mhz 456 * 4-7 = reserved 457 * For HE ER SU PPDU: 458 * 0 = 242-tone RU 459 * 1 = upper frequency 106 tone RU within the primary 20 Mhz. 460 * For HE MU PPDU: 461 * 0 = 20Mhz. 462 * 1 = 40Mhz. 463 * 2 = 80Mhz non-preamble puncturing mode 464 * 3 = 160Mhz and 80+80 Mhz non-preamble. 465 * 4 = for preemble puncturing in 80 Mhz , 466 * where in the preamble only the secondary 20Mhz is punctured. 467 * 5 = for preemble puncturing in 80 Mhz , 468 * where in the preamble only one of the two 20Mhz subchannels in the secondary 40Mhz is 469 * punctured. 6 = for preemble puncturing in 160 Mhz or 80 Mhz + 80 Mhz, where in the primary 470 * 80 Mhz of the preamble only the secondary 20 Mhz is punctured. 7 = for preemble puncturing 471 * in 160 Mhz or 80 Mhz + 80 Mhz, where in the primary 80 Mhz of the preamble the primary 40 472 * Mhz is present. 473 */ 474 /** Short GI */ 475 t_u16 shortGI : 2; /*BIT5- BIT6 476 * For legacy: not used 477 * For 11n: 00 = normal, 01 =shortGI, 10/11 = reserved 478 * For 11ac: SGI map to VHT-SIG-A2[0] 479 * VHT-SIG-A2[1] is set to 1 if short guard interval is used 480 * and NSYM mod 10 = 9, otherwise set to 0. 481 * For 11ax: 482 * 00 = 1xHELTF+GI0.8usec 483 * 01 = 2xHELTF+GI0.8usec 484 * 10 = 2xHELTF+GI1.6usec 485 * 11 = 4xHELTF+GI0.8 usec if both DCM and STBC are 1 486 * 4xHELTF+GI3.2 usec otherwise 487 */ 488 /** STBC */ 489 t_u16 stbc : 1; // BIT7, 0: no STBC; 1: STBC 490 /** DCM */ 491 t_u16 dcm : 1; // BIT8, 0: no DCM; 1: DCM used. 492 /** Adv coding */ 493 t_u16 adv_coding : 1; // BIT9, 0: BCC; 1: LDPC. 494 /** Doppler */ 495 t_u16 doppler : 2; /* BIT11-BIT10, 496 00: Doppler0 497 01: Doppler 1 with Mma =10 498 10: Doppler 1 with Mma =20 499 */ 500 /** Max PK text */ 501 t_u16 max_pktext : 2; /*BIT12-BIT13: 502 * Max packet extension 503 * 0 - 0 usec 504 * 1 - 8 usec 505 * 2 - 16 usec. 506 */ 507 /** Reserved */ 508 t_u16 reserverd : 2; // BIT14-BIT15 509 } PACK_END txrate_setting; 510 511 #if CONFIG_MMSF 512 typedef struct 513 { 514 t_u8 *enable; 515 t_u8 *Density; 516 t_u8 *MMSF; 517 } wifi_mmsf_cfg_t; 518 #endif 519 #endif 520 521 /** Data structure for cmd txratecfg */ 522 typedef PACK_START struct _wifi_rate_cfg_t 523 { 524 /** LG rate: 0, HT rate: 1, VHT rate: 2 */ 525 mlan_rate_format rate_format; 526 /** Rate/MCS index (0xFF: auto) */ 527 t_u32 rate_index; 528 /** Rate rate */ 529 t_u32 rate; 530 #if (CONFIG_11AC) || (CONFIG_11AX) 531 /** NSS */ 532 t_u32 nss; 533 #endif 534 /** Rate Setting */ 535 t_u16 rate_setting; 536 } PACK_END wifi_rate_cfg_t; 537 538 /** Data structure for cmd get data rate */ 539 typedef PACK_START struct _wifi_data_rate_t 540 { 541 /** Tx data rate */ 542 t_u32 tx_data_rate; 543 /** Rx data rate */ 544 t_u32 rx_data_rate; 545 546 /** Tx channel bandwidth */ 547 t_u32 tx_bw; 548 /** Tx guard interval */ 549 t_u32 tx_gi; 550 /** Rx channel bandwidth */ 551 t_u32 rx_bw; 552 /** Rx guard interval */ 553 t_u32 rx_gi; 554 555 #ifndef SD8801 556 /** MCS index */ 557 t_u32 tx_mcs_index; 558 /** MCS index */ 559 t_u32 rx_mcs_index; 560 #if (CONFIG_11AC) || (CONFIG_11AX) 561 /** NSS */ 562 t_u32 tx_nss; 563 /** NSS */ 564 t_u32 rx_nss; 565 #endif 566 /** LG rate: 0, HT rate: 1, VHT rate: 2 */ 567 mlan_rate_format tx_rate_format; 568 /** LG rate: 0, HT rate: 1, VHT rate: 2 */ 569 mlan_rate_format rx_rate_format; 570 #endif 571 } PACK_END wifi_data_rate_t; 572 573 enum wifi_ds_command_type 574 { 575 WIFI_DS_RATE_CFG = 0, 576 WIFI_DS_GET_DATA_RATE = 1, 577 }; 578 579 /** Type definition of wifi_ds_rate */ 580 typedef PACK_START struct _wifi_ds_rate 581 { 582 /** Sub-command */ 583 enum wifi_ds_command_type sub_command; 584 #if CONFIG_AUTO_NULL_TX 585 /** Only set auto tx fix rate */ 586 t_u16 auto_null_fixrate_enable; 587 #endif 588 /** Rate configuration parameter */ 589 union 590 { 591 /** Rate configuration for MLAN_OID_RATE_CFG */ 592 wifi_rate_cfg_t rate_cfg; 593 /** Data rate for MLAN_OID_GET_DATA_RATE */ 594 wifi_data_rate_t data_rate; 595 } param; 596 } PACK_END wifi_ds_rate; 597 598 /** Type definition of wifi_ed_mac_ctrl_t */ 599 typedef PACK_START struct _wifi_ed_mac_ctrl_t 600 { 601 /** ED CTRL 2G */ 602 t_u16 ed_ctrl_2g; 603 /** ED Offset 2G */ 604 t_s16 ed_offset_2g; 605 /** ED CTRL 5G */ 606 t_u16 ed_ctrl_5g; 607 /** ED Offset 5G */ 608 t_s16 ed_offset_5g; 609 } PACK_END wifi_ed_mac_ctrl_t; 610 611 /** Type definition of wifi_bandcfg_t */ 612 typedef PACK_START struct _wifi_bandcfg_t 613 { 614 /** Infra band */ 615 t_u16 config_bands; 616 /** fw supported band */ 617 t_u16 fw_bands; 618 } PACK_END wifi_bandcfg_t; 619 620 #ifdef SD8801 621 /** Type definition of wifi_ext_coex_config_t */ 622 typedef PACK_START struct _wifi_ext_coex_config_t 623 { 624 /** Enable or disable external coexistence */ 625 t_u8 Enabled; 626 /** Ignore the priority of the external radio request */ 627 t_u8 IgnorePriority; 628 /** Default priority when the priority of the external radio 629 request is ignored */ 630 t_u8 DefaultPriority; 631 /** Input request GPIO pin for EXT_RADIO_REQ signal */ 632 t_u8 EXT_RADIO_REQ_ip_gpio_num; 633 /** Input request GPIO polarity for EXT_RADIO_REQ signal */ 634 t_u8 EXT_RADIO_REQ_ip_gpio_polarity; 635 /** Input priority GPIO pin for EXT_RADIO_PRI signal */ 636 t_u8 EXT_RADIO_PRI_ip_gpio_num; 637 /** Input priority GPIO polarity for EXT_RADIO_PRI signal */ 638 t_u8 EXT_RADIO_PRI_ip_gpio_polarity; 639 /** Output grant GPIO pin for WLAN_GRANT signal */ 640 t_u8 WLAN_GRANT_op_gpio_num; 641 /** Output grant GPIO polarity of WLAN_GRANT */ 642 t_u8 WLAN_GRANT_op_gpio_polarity; 643 /** Reserved Bytes */ 644 t_u16 reserved_1; 645 /** Reserved Bytes */ 646 t_u16 reserved_2; 647 } PACK_END wifi_ext_coex_config_t; 648 649 /** Type definition of wifi_ext_coex_stats_t */ 650 typedef PACK_START struct _wifi_ext_coex_stats_t 651 { 652 /** External Radio Request count */ 653 t_u16 ext_radio_req_count; 654 /** External Radio Priority count */ 655 t_u16 ext_radio_pri_count; 656 /** WLAN GRANT count */ 657 t_u16 wlan_grant_count; 658 } PACK_END wifi_ext_coex_stats_t; 659 #endif 660 661 /** Type definition of wifi_antcfg_t */ 662 typedef PACK_START struct _wifi_antcfg_t 663 { 664 /** Antenna Mode */ 665 t_u32 *ant_mode; 666 /** Evaluate Time */ 667 t_u16 *evaluate_time; 668 /** Current antenna*/ 669 t_u16 *current_antenna; 670 #ifdef RW610 671 /** Evaluate mode */ 672 t_u8 *evaluate_mode; 673 #endif 674 } PACK_END wifi_antcfg_t; 675 676 /** CW_MODE_CTRL structure */ 677 typedef PACK_START struct _wifi_cw_mode_ctrl_t 678 { 679 /** Mode of Operation 0:Disable 1: Tx Continuous Packet 2 : Tx 680 Continuous Wave */ 681 t_u8 mode; 682 /** channel */ 683 t_u8 channel; 684 /** channel info */ 685 t_u8 chanInfo; 686 /** Tx Power level in dBm */ 687 t_u16 txPower; 688 /** Packet Length */ 689 t_u16 pktLength; 690 /** bit rate info */ 691 t_u32 rateInfo; 692 } PACK_END wifi_cw_mode_ctrl_t; 693 694 /** TBTT offset structure */ 695 typedef struct 696 { 697 /** Min TBTT offset */ 698 t_u32 min_tbtt_offset; 699 /** Max TBTT offset */ 700 t_u32 max_tbtt_offset; 701 /** AVG TBTT offset */ 702 t_u32 avg_tbtt_offset; 703 } wifi_tbtt_offset_t; 704 705 #ifndef BIT 706 #define BIT(n) (1U << (n)) 707 #endif 708 #define WOWLAN_MAX_PATTERN_LEN 20 709 #define WOWLAN_MAX_OFFSET_LEN 50 710 #define MAX_NUM_FILTERS 10 711 #define MEF_MODE_HOST_SLEEP (1 << 0) 712 #define MEF_MODE_NON_HOST_SLEEP (1 << 1) 713 #define MEF_ACTION_WAKE (1 << 0) 714 #define MEF_ACTION_ALLOW (1 << 1) 715 #define MEF_ACTION_ALLOW_AND_WAKEUP_HOST 3 716 #define MEF_AUTO_ARP 0x10 717 #define MEF_AUTO_PING 0x20 718 #define MEF_NS_RESP 0x40 719 #define MEF_MAGIC_PKT 0x80 720 #define CRITERIA_BROADCAST MBIT(0) 721 #define CRITERIA_UNICAST MBIT(1) 722 #define CRITERIA_MULTICAST MBIT(3) 723 724 #define MAX_NUM_ENTRIES 8 725 #define MAX_NUM_BYTE_SEQ 6 726 #define MAX_NUM_MASK_SEQ 6 727 728 #define OPERAND_DNUM 1 729 #define OPERAND_BYTE_SEQ 2 730 731 #define MAX_OPERAND 0x40 732 #define TYPE_BYTE_EQ (MAX_OPERAND + 1) 733 #define TYPE_DNUM_EQ (MAX_OPERAND + 2) 734 #define TYPE_BIT_EQ (MAX_OPERAND + 3) 735 736 #define RPN_TYPE_AND (MAX_OPERAND + 4) 737 #define RPN_TYPE_OR (MAX_OPERAND + 5) 738 739 #define ICMP_OF_IP_PROTOCOL 0x01 740 #define TCP_OF_IP_PROTOCOL 0x06 741 #define UDP_OF_IP_PROTOCOL 0x11 742 743 #define IPV4_PKT_OFFSET 20 744 #define IP_PROTOCOL_OFFSET 31 745 #define PORT_PROTOCOL_OFFSET 44 746 747 #define FILLING_TYPE MBIT(0) 748 #define FILLING_PATTERN MBIT(1) 749 #define FILLING_OFFSET MBIT(2) 750 #define FILLING_NUM_BYTES MBIT(3) 751 #define FILLING_REPEAT MBIT(4) 752 #define FILLING_BYTE_SEQ MBIT(5) 753 #define FILLING_MASK_SEQ MBIT(6) 754 755 /** Type definition of filter_item 756 * support three match methods: 757 * <1>Byte comparison type=0x41 758 * <2>Decimal comparison type=0x42 759 * <3>Bit comparison type=0x43 760 */ 761 typedef struct _wifi_mef_filter_t 762 { 763 /** flag*/ 764 t_u32 fill_flag; 765 /** BYTE 0X41; Decimal 0X42; Bit 0x43*/ 766 t_u16 type; 767 /** value*/ 768 t_u32 pattern; 769 /** offset*/ 770 t_u16 offset; 771 /** number of bytes*/ 772 t_u16 num_bytes; 773 /** repeat*/ 774 t_u16 repeat; 775 /** byte number*/ 776 t_u8 num_byte_seq; 777 /** array*/ 778 t_u8 byte_seq[MAX_NUM_BYTE_SEQ]; 779 /** mask numbers*/ 780 t_u8 num_mask_seq; 781 /** array*/ 782 t_u8 mask_seq[MAX_NUM_MASK_SEQ]; 783 } wifi_mef_filter_t; 784 785 /** MEF entry struct */ 786 typedef struct _wifi_mef_entry_t 787 { 788 /** mode: bit0--hostsleep mode; bit1--non hostsleep mode */ 789 t_u8 mode; 790 /** action: 0--discard and not wake host; 791 1--discard and wake host; 792 3--allow and wake host;*/ 793 t_u8 action; 794 /** filter number */ 795 t_u8 filter_num; 796 /** filter array*/ 797 wifi_mef_filter_t filter_item[MAX_NUM_FILTERS]; 798 /** rpn array*/ 799 t_u8 rpn[MAX_NUM_FILTERS]; 800 } wifi_mef_entry_t; 801 802 /** Wifi filter config struct */ 803 typedef struct _wifi_flt_cfg 804 { 805 /** Filter Criteria */ 806 t_u32 criteria; 807 /** Number of entries */ 808 t_u16 nentries; 809 /** MEF entry*/ 810 wifi_mef_entry_t mef_entry[MAX_NUM_ENTRIES]; 811 } wifi_flt_cfg_t; 812 813 /* User defined pattern struct */ 814 typedef struct 815 { 816 /** pattern offset of received pattern */ 817 t_u8 pkt_offset; 818 /** pattern length */ 819 t_u8 pattern_len; 820 /** wowlan pattern */ 821 t_u8 pattern[WOWLAN_MAX_PATTERN_LEN]; 822 /** mask */ 823 t_u8 mask[6]; 824 } wifi_wowlan_pattern_t; 825 826 /** Wowlan Pattern config struct */ 827 typedef struct 828 { 829 /** Enable user defined pattern*/ 830 t_u8 enable; 831 /** number of patterns******/ 832 t_u8 n_patterns; 833 /** user define pattern*/ 834 wifi_wowlan_pattern_t patterns[MAX_NUM_FILTERS]; 835 } wifi_wowlan_ptn_cfg_t; 836 837 /** TCP keep alive information */ 838 typedef struct 839 { 840 /** Enable keep alive */ 841 t_u8 enable; 842 /** Reset */ 843 t_u8 reset; 844 /** Keep alive timeout */ 845 t_u32 timeout; 846 /** Keep alive interval */ 847 t_u16 interval; 848 /** Maximum keep alives */ 849 t_u16 max_keep_alives; 850 /** Destination MAC address */ 851 t_u8 dst_mac[MLAN_MAC_ADDR_LENGTH]; 852 /** Destination IP */ 853 t_u32 dst_ip; 854 /** Destination TCP port */ 855 t_u16 dst_tcp_port; 856 /** Source TCP port */ 857 t_u16 src_tcp_port; 858 /** Sequence number */ 859 t_u32 seq_no; 860 } wifi_tcp_keep_alive_t; 861 862 /** TCP nat keep alive information */ 863 typedef struct 864 { 865 /** Keep alive interval */ 866 t_u16 interval; 867 /** Destination MAC address */ 868 t_u8 dst_mac[MLAN_MAC_ADDR_LENGTH]; 869 /** Destination IP */ 870 t_u32 dst_ip; 871 /** Destination port */ 872 t_u16 dst_port; 873 } wifi_nat_keep_alive_t; 874 875 #if CONFIG_CLOUD_KEEP_ALIVE 876 #define MKEEP_ALIVE_IP_PKT_MAX 256 877 /** Cloud keep alive information */ 878 typedef struct 879 { 880 /** Keep alive id */ 881 t_u8 mkeep_alive_id; 882 /** Enable keep alive */ 883 t_u8 enable; 884 /** Enable/Disable tcp reset */ 885 t_u8 reset; 886 /** Saved in driver */ 887 t_u8 cached; 888 /** Period to send keep alive packet(The unit is milliseconds) */ 889 t_u32 send_interval; 890 /** Period to send retry packet(The unit is milliseconds) */ 891 t_u16 retry_interval; 892 /** Count to send retry packet */ 893 t_u16 retry_count; 894 /** Source MAC address */ 895 t_u8 src_mac[MLAN_MAC_ADDR_LENGTH]; 896 /** Destination MAC address */ 897 t_u8 dst_mac[MLAN_MAC_ADDR_LENGTH]; 898 /** Source IP */ 899 t_u32 src_ip; 900 /** Destination IP */ 901 t_u32 dst_ip; 902 /** Source Port */ 903 t_u16 src_port; 904 /** Destination Port */ 905 t_u16 dst_port; 906 /** Packet length */ 907 t_u16 pkt_len; 908 /** Packet buffer */ 909 t_u8 packet[MKEEP_ALIVE_IP_PKT_MAX]; 910 } wifi_cloud_keep_alive_t; 911 #endif 912 913 /** RSSI information */ 914 typedef struct 915 { 916 /** Data RSSI last */ 917 int16_t data_rssi_last; 918 /** Data nf last */ 919 int16_t data_nf_last; 920 /** Data RSSI average */ 921 int16_t data_rssi_avg; 922 /** Data nf average */ 923 int16_t data_nf_avg; 924 /** BCN SNR */ 925 int16_t bcn_snr_last; 926 /** BCN SNR average */ 927 int16_t bcn_snr_avg; 928 /** Data SNR last */ 929 int16_t data_snr_last; 930 /** Data SNR average */ 931 int16_t data_snr_avg; 932 /** BCN RSSI */ 933 int16_t bcn_rssi_last; 934 /** BCN nf */ 935 int16_t bcn_nf_last; 936 /** BCN RSSI average */ 937 int16_t bcn_rssi_avg; 938 /** BCN nf average */ 939 int16_t bcn_nf_avg; 940 } wifi_rssi_info_t; 941 942 /** 943 * Data structure for subband set 944 * 945 * For uAP 11d support 946 */ 947 typedef struct 948 { 949 /** First channel */ 950 t_u8 first_chan; 951 /** Number of channels */ 952 t_u8 no_of_chan; 953 /** Maximum Tx power in dBm */ 954 t_u8 max_tx_pwr; 955 956 } wifi_sub_band_set_t; 957 958 /** 959 * Data structure for Channel attributes 960 * 961 */ 962 typedef PACK_START struct 963 { 964 /** Channel Number */ 965 t_u8 chan_num; 966 /** Channel frequency for this channel */ 967 t_u16 chan_freq; 968 /** Passice Scan or RADAR Detect*/ 969 bool passive_scan_or_radar_detect; 970 } PACK_END wifi_chan_info_t; 971 972 /** 973 * Data structure for Channel List Config 974 * 975 */ 976 typedef PACK_START struct 977 { 978 /** Number of Channels */ 979 t_u8 num_chans; 980 /** Channel Info */ 981 wifi_chan_info_t chan_info[54]; 982 } PACK_END wifi_chanlist_t; 983 984 /** Wifi subband enum */ 985 typedef enum 986 { 987 /** Subband 2.4 GHz */ 988 SubBand_2_4_GHz = 0x00, 989 /** Subband 5 GHz 0 */ 990 SubBand_5_GHz_0 = 0x10, 991 /** Subband 5 GHz 1 */ 992 SubBand_5_GHz_1 = 0x11, 993 /** Subband 5 GHz 2 */ 994 SubBand_5_GHz_2 = 0x12, 995 /** Subband 5 GHz 3 */ 996 SubBand_5_GHz_3 = 0x13, 997 } wifi_SubBand_t; 998 999 /** 1000 * Data structure for Channel descriptor 1001 * 1002 * Set CFG data for Tx power limitation 1003 * 1004 * start_freq: Starting Frequency of the band for this channel\n 1005 * 2407, 2414 or 2400 for 2.4 GHz\n 1006 * 5000\n 1007 * 4000\n 1008 * chan_width: Channel Width\n 1009 * 20\n 1010 * chan_num : Channel Number\n 1011 * 1012 */ 1013 typedef PACK_START struct 1014 { 1015 /** Starting frequency of the band for this channel */ 1016 t_u16 start_freq; 1017 /** Channel width */ 1018 t_u8 chan_width; 1019 /** Channel Number */ 1020 t_u8 chan_num; 1021 } PACK_END wifi_channel_desc_t; 1022 1023 /** 1024 * Data structure for Modulation Group 1025 * 1026 * mod_group : ModulationGroup\n 1027 * 0: CCK (1,2,5.5,11 Mbps)\n 1028 * 1: OFDM (6,9,12,18 Mbps)\n 1029 * 2: OFDM (24,36 Mbps)\n 1030 * 3: OFDM (48,54 Mbps)\n 1031 * 4: HT20 (0,1,2)\n 1032 * 5: HT20 (3,4)\n 1033 * 6: HT20 (5,6,7)\n 1034 * 7: HT40 (0,1,2)\n 1035 * 8: HT40 (3,4)\n 1036 * 9: HT40 (5,6,7)\n 1037 * 10: HT2_20 (8,9,10)\n 1038 * 11: HT2_20 (11,12)\n 1039 * 12: HT2_20 (13,14,15)\n 1040 *tx_power : Power Limit in dBm\n 1041 * 1042 */ 1043 typedef PACK_START struct 1044 { 1045 /** Modulation group */ 1046 t_u8 mod_group; 1047 /** Tx Power */ 1048 t_u8 tx_power; 1049 } PACK_END wifi_txpwrlimit_entry_t; 1050 1051 /** 1052 * Data structure for TRPC config 1053 * 1054 * For TRPC support 1055 */ 1056 typedef PACK_START struct 1057 { 1058 /** Number of modulation groups */ 1059 t_u8 num_mod_grps; 1060 /** Chnannel descriptor */ 1061 wifi_channel_desc_t chan_desc; 1062 /** Channel Modulation groups */ 1063 #if CONFIG_11AX 1064 wifi_txpwrlimit_entry_t txpwrlimit_entry[20]; 1065 #elif (CONFIG_11AC) 1066 wifi_txpwrlimit_entry_t txpwrlimit_entry[16]; 1067 #else 1068 wifi_txpwrlimit_entry_t txpwrlimit_entry[10]; 1069 #endif /* CONFIG_11AX */ 1070 } PACK_END wifi_txpwrlimit_config_t; 1071 1072 /** 1073 * Data structure for Channel TRPC config 1074 * 1075 * For TRPC support 1076 */ 1077 typedef PACK_START struct 1078 { 1079 /** SubBand */ 1080 wifi_SubBand_t subband; 1081 /** Number of Channels */ 1082 t_u8 num_chans; 1083 /** TRPC config */ 1084 #if defined(SD9177) 1085 wifi_txpwrlimit_config_t txpwrlimit_config[43]; 1086 #else 1087 wifi_txpwrlimit_config_t txpwrlimit_config[40]; 1088 #endif 1089 } PACK_END wifi_txpwrlimit_t; 1090 1091 #if CONFIG_11AX 1092 typedef PACK_START struct _wifi_rupwrlimit_config_t 1093 { 1094 /** start freq */ 1095 t_u16 start_freq; 1096 /* channel width */ 1097 t_u8 width; 1098 /** channel number */ 1099 t_u8 chan_num; 1100 /** chan ru Power */ 1101 t_s16 ruPower[MAX_RU_COUNT]; 1102 } PACK_END wifi_rupwrlimit_config_t; 1103 1104 /** 1105 * Data structure for Channel RU PWR config 1106 * 1107 * For RU PWR support 1108 */ 1109 typedef PACK_START struct 1110 { 1111 /** Number of Channels */ 1112 t_u8 num_chans; 1113 /** RU PWR config */ 1114 wifi_rupwrlimit_config_t rupwrlimit_config[MAX_RUTXPWR_NUM]; 1115 } PACK_END wifi_rutxpwrlimit_t; 1116 1117 /** Wi-Fi 11AX Configuration */ 1118 typedef PACK_START struct 1119 { 1120 /** Band */ 1121 t_u8 band; 1122 /** tlv id of he capability */ 1123 t_u16 id; 1124 /** length of the payload */ 1125 t_u16 len; 1126 /** extension id */ 1127 t_u8 ext_id; 1128 /** he mac capability info */ 1129 t_u8 he_mac_cap[6]; 1130 /** he phy capability info */ 1131 t_u8 he_phy_cap[11]; 1132 /** he txrx mcs support for 80MHz */ 1133 t_u8 he_txrx_mcs_support[4]; 1134 /** val for PE thresholds */ 1135 t_u8 val[4]; 1136 } PACK_END wifi_11ax_config_t; 1137 1138 #if CONFIG_11AX_TWT 1139 /** Wi-Fi TWT setup configuration */ 1140 typedef PACK_START struct 1141 { 1142 /** Implicit, 0: TWT session is explicit, 1: Session is implicit */ 1143 t_u8 implicit; 1144 /** Announced, 0: Unannounced, 1: Announced TWT */ 1145 t_u8 announced; 1146 /** Trigger Enabled, 0: Non-Trigger enabled, 1: Trigger enabled TWT */ 1147 t_u8 trigger_enabled; 1148 /** TWT Information Disabled, 0: TWT info enabled, 1: TWT info disabled */ 1149 t_u8 twt_info_disabled; 1150 /** Negotiation Type, 0: Future Individual TWT SP start time, 1: Next 1151 * Wake TBTT time */ 1152 t_u8 negotiation_type; 1153 /** TWT Wakeup Duration, time after which the TWT requesting STA can 1154 * transition to doze state */ 1155 t_u8 twt_wakeup_duration; 1156 /** Flow Identifier. Range: [0-7]*/ 1157 t_u8 flow_identifier; 1158 /** Hard Constraint, 0: FW can tweak the TWT setup parameters if it is 1159 *rejected by AP. 1160 ** 1: Firmware should not tweak any parameters. */ 1161 t_u8 hard_constraint; 1162 /** TWT Exponent, Range: [0-63] */ 1163 t_u8 twt_exponent; 1164 /** TWT Mantissa Range: [0-sizeof(UINT16)] */ 1165 t_u16 twt_mantissa; 1166 /** TWT Request Type, 0: REQUEST_TWT, 1: SUGGEST_TWT*/ 1167 t_u8 twt_request; 1168 /** TWT Setup State. Set to 0 by driver, filled by FW in response*/ 1169 t_u8 twt_setup_state; 1170 /** TWT link lost timeout threshold */ 1171 t_u16 bcnMiss_threshold; 1172 } PACK_END wifi_twt_setup_config_t; 1173 1174 /** Wi-Fi Teardown Configuration */ 1175 typedef PACK_START struct 1176 { 1177 /** TWT Flow Identifier. Range: [0-7] */ 1178 t_u8 flow_identifier; 1179 /** Negotiation Type. 0: Future Individual TWT SP start time, 1: Next 1180 * Wake TBTT time */ 1181 t_u8 negotiation_type; 1182 /** Tear down all TWT. 1: To teardown all TWT, 0 otherwise */ 1183 t_u8 teardown_all_twt; 1184 } PACK_END wifi_twt_teardown_config_t; 1185 1186 /** Wi-Fi BTWT Configuration */ 1187 typedef PACK_START struct 1188 { 1189 /** Only support 1: Set*/ 1190 t_u16 action; 1191 /** Broadcast TWT AP config */ 1192 t_u16 sub_id; 1193 /** Range 64-255 */ 1194 t_u8 nominal_wake; 1195 /** Max STA Support */ 1196 t_u8 max_sta_support; 1197 /** TWT Mantissa */ 1198 t_u16 twt_mantissa; 1199 /** TWT Offset */ 1200 t_u16 twt_offset; 1201 /** TWT Exponent */ 1202 t_u8 twt_exponent; 1203 /** SP Gap */ 1204 t_u8 sp_gap; 1205 } PACK_END wifi_btwt_config_t; 1206 1207 #define WLAN_BTWT_REPORT_LEN 9 1208 #define WLAN_BTWT_REPORT_MAX_NUM 4 1209 /** Wi-Fi TWT Report Configuration */ 1210 typedef PACK_START struct 1211 { 1212 /** TWT report type, 0: BTWT id */ 1213 t_u8 type; 1214 /** TWT report length of value in data */ 1215 t_u8 length; 1216 /** Reserved 2 */ 1217 t_u8 reserve[2]; 1218 /** TWT report buffer */ 1219 t_u8 data[WLAN_BTWT_REPORT_LEN * WLAN_BTWT_REPORT_MAX_NUM]; 1220 } PACK_END wifi_twt_report_t; 1221 1222 typedef PACK_START struct 1223 { 1224 /** TWT Flow Identifier. Range: [0-7] */ 1225 t_u8 flow_identifier; 1226 /** TWT operation suspend duration in milli seconds. */ 1227 t_u32 suspend_duration; 1228 /** TWT information state from FW. */ 1229 t_u8 information_state; 1230 } PACK_END wifi_twt_information_t; 1231 #endif /* CONFIG_11AX_TWT */ 1232 #endif 1233 1234 #if CONFIG_WIFI_CLOCKSYNC 1235 /** Wi-Fi Clock sync configuration */ 1236 typedef PACK_START struct 1237 { 1238 /**clock sync Mode */ 1239 t_u8 clock_sync_mode; 1240 /**clock sync Role */ 1241 t_u8 clock_sync_Role; 1242 /**clock sync GPIO Pin Number */ 1243 t_u8 clock_sync_gpio_pin_number; 1244 /**clock sync GPIO Level or Toggle */ 1245 t_u8 clock_sync_gpio_level_toggle; 1246 /**clock sync GPIO Pulse Width */ 1247 t_u16 clock_sync_gpio_pulse_width; 1248 } PACK_END wifi_clock_sync_gpio_tsf_t; 1249 1250 /** Wi-Fi TSF information */ 1251 typedef PACK_START struct 1252 { 1253 /**get tsf info format */ 1254 t_u16 tsf_format; 1255 /**tsf info */ 1256 t_u16 tsf_info; 1257 /**tsf */ 1258 t_u64 tsf; 1259 /**Positive or negative offset in microsecond from Beacon TSF to GPIO toggle TSF */ 1260 t_s32 tsf_offset; 1261 } PACK_END wifi_tsf_info_t; 1262 #endif /* CONFIG_WIFI_CLOCKSYNC */ 1263 #if CONFIG_WLAN_BRIDGE 1264 /** 1265 * Data structure for Bridge Autolink Configuration 1266 */ 1267 typedef struct 1268 { 1269 /** Auto Link Periodical scan interval */ 1270 uint32_t scan_timer_interval; 1271 /** The condition triggers Auto Link periodical scan 1272 * 0: trigger scan when current link is not good 1273 * 1: trigger scan by host setting(always periodical scan) 1274 */ 1275 uint8_t scan_timer_condition; 1276 /** Auto Link periodical scan channel list: 1277 * 0: only scan with previous In-STA associated channel 1278 * 1: 2.4G all channels 1279 */ 1280 uint8_t scan_channel_list; 1281 } wifi_autolink_cfg_t; 1282 1283 /** 1284 * Data structure for Bridge Configuration 1285 */ 1286 #define ENABLE_AUTOLINK_BIT 1 1287 #define HIDDEN_SSID_BIT 2 1288 typedef struct 1289 { 1290 /** Bit 0: Enable/Disable bridge mode, 1291 * Bit 1: Enable/Disable auto link, 1292 * Bit 2: Enable/Disable hidden ssid 1293 */ 1294 uint8_t enable; 1295 /** Auto Link */ 1296 bool auto_link; 1297 /** Hideen Bridge SSID */ 1298 bool hidden_ssid; 1299 /** EX-AP SSID Length */ 1300 uint8_t ex_ap_ssid_len; 1301 /** EX-AP SSID */ 1302 char ex_ap_ssid[MLAN_MAX_SSID_LENGTH]; 1303 /** EX-AP Passphrase length */ 1304 uint8_t ex_ap_pass_len; 1305 /** EX-AP Passphrase */ 1306 char ex_ap_pass[MLAN_MAX_PASS_LENGTH]; 1307 /** Bridge SSID Length */ 1308 uint8_t bridge_ssid_len; 1309 /** Bridge SSID */ 1310 char bridge_ssid[MLAN_MAX_SSID_LENGTH]; 1311 /** Bridge Passphrase length */ 1312 uint8_t bridge_pass_len; 1313 /** Bridge Passphrase */ 1314 char bridge_pass[MLAN_MAX_PASS_LENGTH]; 1315 /**auto link configuration*/ 1316 wifi_autolink_cfg_t autolink; 1317 } wifi_bridge_cfg_t; 1318 #endif 1319 1320 #if CONFIG_NET_MONITOR 1321 typedef t_u8 wifi_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH]; 1322 1323 /** Network monitor structure */ 1324 typedef PACK_START struct 1325 { 1326 /** Action */ 1327 t_u16 action; 1328 /** Monitor activity */ 1329 t_u16 monitor_activity; 1330 /** Filter flags */ 1331 t_u16 filter_flags; 1332 /** Channel scan parameter : Radio type */ 1333 t_u8 radio_type; 1334 /** Channel number */ 1335 t_u8 chan_number; 1336 /** mac num of filter*/ 1337 t_u8 filter_num; 1338 /** Source address of the packet to receive */ 1339 wifi_802_11_mac_addr mac_addr[MAX_MONIT_MAC_FILTER_NUM]; 1340 } PACK_END wifi_net_monitor_t; 1341 1342 /** Beacon information structure */ 1343 typedef PACK_START struct 1344 { 1345 /** Frame control flags */ 1346 uint8_t frame_ctrl_flags; 1347 uint16_t duration; 1348 /** Destination MAC address */ 1349 char dest[MLAN_MAC_ADDR_LENGTH]; 1350 /** Source MAC address */ 1351 char src[MLAN_MAC_ADDR_LENGTH]; 1352 /** BSSID */ 1353 char bssid[MLAN_MAC_ADDR_LENGTH]; 1354 uint16_t seq_frag_num; 1355 /** Timestamp */ 1356 uint8_t timestamp[8]; 1357 uint16_t beacon_interval; 1358 uint16_t cap_info; 1359 uint8_t ssid_element_id; 1360 /** SSID Length */ 1361 uint8_t ssid_len; 1362 /* SSID */ 1363 char ssid[MLAN_MAX_SSID_LENGTH]; 1364 } PACK_END wifi_beacon_info_t; 1365 1366 /** Wifi data information */ 1367 typedef PACK_START struct 1368 { 1369 /** Frame control flags */ 1370 uint8_t frame_ctrl_flags; 1371 uint16_t duration; 1372 char bssid[MLAN_MAC_ADDR_LENGTH]; 1373 /** Source MAC address */ 1374 char src[MLAN_MAC_ADDR_LENGTH]; 1375 /** Destination MAC address */ 1376 char dest[MLAN_MAC_ADDR_LENGTH]; 1377 uint16_t seq_frag_num; 1378 /** QOS control */ 1379 uint16_t qos_ctrl; 1380 } PACK_END wifi_data_info_t; 1381 #endif 1382 /** Wifi frame types */ 1383 typedef enum 1384 { 1385 /** Assoc request frame */ 1386 ASSOC_REQ_FRAME = 0x00, 1387 /** Assoc response frame */ 1388 ASSOC_RESP_FRAME = 0x10, 1389 /** ReAssoc request frame */ 1390 REASSOC_REQ_FRAME = 0x20, 1391 /** ReAssoc response frame */ 1392 REASSOC_RESP_FRAME = 0x30, 1393 /** Probe request frame */ 1394 PROBE_REQ_FRAME = 0x40, 1395 /** Probe response frame */ 1396 PROBE_RESP_FRAME = 0x50, 1397 /** BEACON frame */ 1398 BEACON_FRAME = 0x80, 1399 /** Dis assoc frame */ 1400 DISASSOC_FRAME = 0xA0, 1401 /** Auth frame */ 1402 AUTH_FRAME = 0xB0, 1403 /** Deauth frame */ 1404 DEAUTH_FRAME = 0xC0, 1405 /** Action frame */ 1406 ACTION_FRAME = 0xD0, 1407 /** Data frame */ 1408 DATA_FRAME = 0x08, 1409 /** QOS frame */ 1410 QOS_DATA_FRAME = 0x88, 1411 } wifi_frame_type_t; 1412 1413 typedef PACK_START struct 1414 { 1415 wifi_frame_type_t frame_type; 1416 #if CONFIG_NET_MONITOR 1417 union 1418 { 1419 wifi_beacon_info_t beacon_info; 1420 wifi_data_info_t data_info; 1421 } frame_data; 1422 #endif 1423 } PACK_END wifi_frame_t; 1424 1425 typedef struct 1426 { 1427 uint8_t mfpc; 1428 uint8_t mfpr; 1429 } wifi_pmf_params_t; 1430 1431 /** Channel scan parameters */ 1432 typedef struct 1433 { 1434 /** channel number */ 1435 t_u8 chan_number; 1436 /** minimum scan time */ 1437 t_u16 min_scan_time; 1438 /** maximum scan time */ 1439 t_u16 max_scan_time; 1440 } wifi_chan_scan_param_set_t; 1441 1442 /** Channel list parameter set */ 1443 typedef struct 1444 { 1445 /** number of channels */ 1446 t_u8 no_of_channels; 1447 /** channel scan array */ 1448 wifi_chan_scan_param_set_t chan_scan_param[1]; 1449 } wifi_chan_list_param_set_t; 1450 1451 /** 802_11_header packet */ 1452 typedef PACK_START struct _wifi_mgmt_frame_t 1453 { 1454 /** Packet Length */ 1455 t_u16 frm_len; 1456 /** Frame Type */ 1457 wifi_frame_type_t frame_type; 1458 /** Frame Control flags */ 1459 t_u8 frame_ctrl_flags; 1460 /** Duration ID */ 1461 t_u16 duration_id; 1462 /** Address 1 */ 1463 t_u8 addr1[MLAN_MAC_ADDR_LENGTH]; 1464 /** Address 2 */ 1465 t_u8 addr2[MLAN_MAC_ADDR_LENGTH]; 1466 /** Address 3 */ 1467 t_u8 addr3[MLAN_MAC_ADDR_LENGTH]; 1468 /** Sequence Control */ 1469 t_u16 seq_ctl; 1470 /** Address 4 */ 1471 t_u8 addr4[MLAN_MAC_ADDR_LENGTH]; 1472 /** Frame payload */ 1473 t_u8 payload[1]; 1474 } PACK_END wifi_mgmt_frame_t; 1475 1476 /** Calibration Data */ 1477 typedef PACK_START struct _wifi_cal_data_t 1478 { 1479 /** Calibration data length */ 1480 t_u16 data_len; 1481 /** Calibration data */ 1482 t_u8 *data; 1483 } PACK_END wifi_cal_data_t; 1484 1485 /** Auto reconnect structure */ 1486 typedef PACK_START struct _wifi_auto_reconnect_config_t 1487 { 1488 /** Reconnect counter */ 1489 t_u8 reconnect_counter; 1490 /** Reconnect interval */ 1491 t_u8 reconnect_interval; 1492 /** Flags */ 1493 t_u16 flags; 1494 } PACK_END wifi_auto_reconnect_config_t; 1495 1496 /** Scan all the channels in specified band */ 1497 #define BAND_SPECIFIED 0x80U 1498 1499 /** Scan channel list */ 1500 typedef PACK_START struct _wifi_scan_channel_list_t 1501 { 1502 /** Channel scan parameter : Radio type */ 1503 t_u8 radio_type; 1504 /** Channel numder */ 1505 t_u8 chan_number; 1506 /** Scan type Active = 1, Passive = 2 */ 1507 mlan_scan_type scan_type; 1508 /** Scan time */ 1509 t_u16 scan_time; 1510 } PACK_END wifi_scan_channel_list_t; 1511 1512 /* Configuration for wireless scanning */ 1513 #if defined(RW610) && (CONFIG_ANT_DETECT) 1514 #define ANT_DETECT_MAX_CHANNEL_LIST 50U 1515 #endif 1516 #define MAX_CHANNEL_LIST 6 1517 #if CONFIG_COMBO_SCAN 1518 #define MAX_NUM_SSID 2 1519 #endif 1520 /** V2 scan parameters */ 1521 typedef PACK_START struct _wifi_scan_params_v2_t 1522 { 1523 #if CONFIG_WPA_SUPP 1524 /** Scan Only */ 1525 t_u8 scan_only; 1526 /** BSSID present */ 1527 t_u8 is_bssid; 1528 /** SSID present */ 1529 t_u8 is_ssid; 1530 #endif 1531 /** BSSID to scan */ 1532 t_u8 bssid[MLAN_MAC_ADDR_LENGTH]; 1533 /** SSID to scan */ 1534 #if CONFIG_COMBO_SCAN 1535 char ssid[MAX_NUM_SSID][MLAN_MAX_SSID_LENGTH + 1]; 1536 #else 1537 char ssid[MLAN_MAX_SSID_LENGTH + 1]; 1538 #endif 1539 /** Number of channels */ 1540 t_u8 num_channels; 1541 /** Channel list with channel information */ 1542 #if defined(RW610) && (CONFIG_ANT_DETECT) 1543 wifi_scan_channel_list_t chan_list[ANT_DETECT_MAX_CHANNEL_LIST]; 1544 #else 1545 wifi_scan_channel_list_t chan_list[MAX_CHANNEL_LIST]; 1546 #endif 1547 /** Number of probes */ 1548 t_u8 num_probes; 1549 #if CONFIG_SCAN_WITH_RSSIFILTER 1550 /** Threshold of rssi */ 1551 t_s16 rssi_threshold; 1552 #endif 1553 #if CONFIG_SCAN_CHANNEL_GAP 1554 /** scan channel gap */ 1555 t_u16 scan_chan_gap; 1556 #endif 1557 /** Callback to be called when scan is completed */ 1558 int (*cb)(unsigned int count); 1559 } PACK_END wifi_scan_params_v2_t; 1560 1561 #if CONFIG_RF_TEST_MODE 1562 /** Configuration for Manufacturing generic command */ 1563 typedef PACK_START struct _wifi_mfg_cmd_generic_cfg 1564 { 1565 /** MFG command code */ 1566 t_u32 mfg_cmd; 1567 /** Action */ 1568 t_u16 action; 1569 /** Device ID */ 1570 t_u16 device_id; 1571 /** MFG Error code */ 1572 t_u32 error; 1573 /** value 1 */ 1574 t_u32 data1; 1575 /** value 2 */ 1576 t_u32 data2; 1577 /** value 3 */ 1578 t_u32 data3; 1579 } PACK_END wifi_mfg_cmd_generic_cfg_t; 1580 1581 /** Configuration for Manufacturing command Tx Frame */ 1582 typedef PACK_START struct _wifi_mfg_cmd_tx_frame 1583 { 1584 /** MFG command code */ 1585 t_u32 mfg_cmd; 1586 /** Action */ 1587 t_u16 action; 1588 /** Device ID */ 1589 t_u16 device_id; 1590 /** MFG Error code */ 1591 t_u32 error; 1592 /** enable */ 1593 t_u32 enable; 1594 /** data_rate */ 1595 t_u32 data_rate; 1596 /** frame pattern */ 1597 t_u32 frame_pattern; 1598 /** frame length */ 1599 t_u32 frame_length; 1600 /** BSSID */ 1601 t_u8 bssid[MLAN_MAC_ADDR_LENGTH]; 1602 /** Adjust burst sifs */ 1603 t_u16 adjust_burst_sifs; 1604 /** Burst sifs in us*/ 1605 t_u32 burst_sifs_in_us; 1606 /** short preamble */ 1607 t_u32 short_preamble; 1608 /** active sub channel */ 1609 t_u32 act_sub_ch; 1610 /** short GI */ 1611 t_u32 short_gi; 1612 /** Adv coding */ 1613 t_u32 adv_coding; 1614 /** Tx beamforming */ 1615 t_u32 tx_bf; 1616 /** HT Greenfield Mode*/ 1617 t_u32 gf_mode; 1618 /** STBC */ 1619 t_u32 stbc; 1620 /** power id */ 1621 t_u32 rsvd[2]; 1622 } PACK_END wifi_mfg_cmd_tx_frame_t; 1623 1624 /** Configuration for Manufacturing command Tx Continuous */ 1625 typedef PACK_START struct _wifi_mfg_cmd_tx_cont 1626 { 1627 /** MFG command code */ 1628 t_u32 mfg_cmd; 1629 /** Action */ 1630 t_u16 action; 1631 /** Device ID */ 1632 t_u16 device_id; 1633 /** MFG Error code */ 1634 t_u32 error; 1635 /** enable Tx*/ 1636 t_u32 enable_tx; 1637 /** Continuous Wave mode */ 1638 t_u32 cw_mode; 1639 /** payload pattern */ 1640 t_u32 payload_pattern; 1641 /** CS Mode */ 1642 t_u32 cs_mode; 1643 /** active sub channel */ 1644 t_u32 act_sub_ch; 1645 /** Tx rate */ 1646 t_u32 tx_rate; 1647 /** power id */ 1648 t_u32 rsvd; 1649 } PACK_END wifi_mfg_cmd_tx_cont_t; 1650 1651 typedef PACK_START struct wifi_mfg_cmd_he_tb_tx 1652 { 1653 /** MFG command code */ 1654 t_u32 mfg_cmd; 1655 /** Action */ 1656 t_u16 action; 1657 /** Device ID */ 1658 t_u16 device_id; 1659 /** MFG Error code */ 1660 t_u32 error; 1661 /** Enable Tx */ 1662 t_u16 enable; 1663 /** Q num */ 1664 t_u16 qnum; 1665 /** AID */ 1666 t_u16 aid; 1667 /** AXQ Mu Timer */ 1668 t_u16 axq_mu_timer; 1669 /** Tx Power */ 1670 t_s16 tx_power; 1671 } PACK_END wifi_mfg_cmd_he_tb_tx_t; 1672 1673 typedef PACK_START struct wifi_mfg_cmd_IEEEtypes_CtlBasicTrigHdr 1674 { 1675 /** MFG command code */ 1676 t_u32 mfg_cmd; 1677 /** Action */ 1678 t_u16 action; 1679 /** Device ID */ 1680 t_u16 device_id; 1681 /** MFG Error code */ 1682 t_u32 error; 1683 /** enable Tx*/ 1684 t_u32 enable_tx; 1685 /** enable Stand Alone HE TB */ 1686 t_u32 standalone_hetb; 1687 /** Frame Control */ 1688 mfg_cmd_IEEEtypes_FrameCtrl_t frmCtl; 1689 /** Duration */ 1690 t_u16 duration; 1691 /** Destination MAC Address */ 1692 t_u8 dest_addr[MLAN_MAC_ADDR_LENGTH]; 1693 /** Source MAC Address */ 1694 t_u8 src_addr[MLAN_MAC_ADDR_LENGTH]; 1695 /** Common Info Field **/ 1696 mfg_cmd_IEEEtypes_HETrigComInfo_t trig_common_field; 1697 /** User Info Field **/ 1698 mfg_cmd_IEEEtypes_HETrigUserInfo_t trig_user_info_field; 1699 /** Trigger Dependent User Info Field **/ 1700 mfg_cmd_IEEETypes_BasicHETrigUserInfo_t basic_trig_user_info; 1701 } PACK_END wifi_mfg_cmd_IEEEtypes_CtlBasicTrigHdr_t; 1702 1703 typedef PACK_START struct wifi_mfg_cmd_otp_mac_addr_rd_wr 1704 { 1705 /** MFG command code */ 1706 t_u32 mfg_cmd; 1707 /** Action */ 1708 t_u16 action; 1709 /** Device ID */ 1710 t_u16 device_id; 1711 /** MFG Error code */ 1712 t_u32 error; 1713 /** Destination MAC Address */ 1714 t_u8 mac_addr[MLAN_MAC_ADDR_LENGTH]; 1715 } PACK_END wifi_mfg_cmd_otp_mac_addr_rd_wr_t; 1716 1717 typedef PACK_START struct wifi_mfg_cmd_otp_cal_data_rd_wr 1718 { 1719 /** MFG command code */ 1720 t_u32 mfg_cmd; 1721 /** Action */ 1722 t_u16 action; 1723 /** Device ID */ 1724 t_u16 device_id; 1725 /** MFG Error code */ 1726 t_u32 error; 1727 /** CAL Data write status */ 1728 t_u32 cal_data_status; 1729 /** CAL Data Length*/ 1730 t_u32 cal_data_len; 1731 /** Destination MAC Address */ 1732 t_u8 cal_data[CAL_DATA_LEN]; 1733 } PACK_END wifi_mfg_cmd_otp_cal_data_rd_wr_t; 1734 #endif 1735 1736 #if CONFIG_HEAP_DEBUG 1737 #define MAX_FUNC_SYMBOL_LEN 64 1738 #define OS_MEM_STAT_TABLE_SIZE 128 1739 1740 typedef struct 1741 { 1742 char name[MAX_FUNC_SYMBOL_LEN]; 1743 t_u32 size; 1744 t_u32 line_num; 1745 1746 t_u32 alloc_cnt; 1747 t_u32 free_cnt; 1748 } wifi_os_mem_info; 1749 #endif 1750 1751 #if CONFIG_MULTI_CHAN 1752 typedef PACK_START struct 1753 { 1754 /** Channel Index*/ 1755 t_u16 chan_idx; 1756 /** Channel time (in TU) for chan_idx */ 1757 t_u8 chantime; 1758 /** Channel switch time (in TU) for chan_idx */ 1759 t_u8 switchtime; 1760 /** Undoze time (in TU) for chan_idx */ 1761 t_u8 undozetime; 1762 /** Rx traffic control scheme when channel switch*/ 1763 /** only valid for GC/STA interface*/ 1764 t_u8 mode; 1765 } PACK_END wifi_drcs_cfg_t; 1766 #endif 1767 1768 #if CONFIG_1AS 1769 #define DOT1AS_TM_ROLE_TRANSMITTER 0 1770 #define DOT1AS_TM_ROLE_RECEIVER 1 1771 1772 #define DOT1AS_TM_STATUS_COMPLETE 0 1773 #define DOT1AS_TM_STATUS_INPROGRESS 1 1774 1775 typedef struct 1776 { 1777 /* host time in nano secs */ 1778 t_u64 time; 1779 /* fw time in nano secs */ 1780 t_u64 fw_time; 1781 } wifi_correlated_time_t; 1782 1783 typedef struct _wifi_dot1as_info_t 1784 { 1785 /* 0 - completed or unstarted, 1 - in progress */ 1786 t_u8 status; 1787 /* 0 - master(transmitter, send TM), 1 - slave(receiver, receive TM) */ 1788 t_u8 role; 1789 /* current number of TM frame, used in master mode */ 1790 t_u8 tm_num; 1791 /* max number of TM frames, used in master mode */ 1792 t_u8 max_tm_num; 1793 /* peer addr */ 1794 t_u8 peer_addr[MLAN_MAC_ADDR_LENGTH]; 1795 /* dialog_token */ 1796 t_u8 dialog_token; 1797 /* prev_dialog_token */ 1798 t_u8 prev_dialog_token; 1799 /* time of TX TM frame depart */ 1800 t_u32 t1; 1801 /* time of TX TM frame acked */ 1802 t_u32 t4; 1803 /* time of RX TM frame receive */ 1804 t_u32 t2; 1805 /* time of RX TM frame ack */ 1806 t_u32 t3; 1807 /* fw status error of t1 in 10ns */ 1808 t_u8 t1_err; 1809 /* fw status error of t4 in 10ns */ 1810 t_u8 t4_err; 1811 /* max error of t1 in 10ns */ 1812 t_u8 max_t1_err; 1813 /* max error of t4 in 10ns */ 1814 t_u8 max_t4_err; 1815 /* error of t2 in 10ns */ 1816 t_u8 t2_err; 1817 /* error of t3 in 10ns */ 1818 t_u8 t3_err; 1819 /* max error of t2 in 10ns */ 1820 t_u8 max_t2_err; 1821 /* max error of t3 in 10ns */ 1822 t_u8 max_t3_err; 1823 /* egress time of TX TM frame */ 1824 t_u64 egress_time; 1825 /* ingress time of RX TM frame */ 1826 t_u64 ingress_time; 1827 } wifi_dot1as_info_t; 1828 1829 #endif 1830 1831 #if CONFIG_SUBSCRIBE_EVENT_SUPPORT 1832 /** Type definition of mlan_ds_subscribe_evt for subscribe events */ 1833 typedef struct _wifi_ds_subscribe_evt 1834 { 1835 /** bitmap for subscribe event */ 1836 t_u16 evt_bitmap; 1837 /** Absolute value of RSSI threshold value (dBm) */ 1838 t_u8 low_rssi; 1839 /** 0--report once, 1--report everytime happend, N -- report only happend > N consecutive times */ 1840 t_u8 low_rssi_freq; 1841 /** SNR threshold value (dB) */ 1842 t_u8 low_snr; 1843 /** 0--report once, 1--report everytime happend, N -- report only happend > N consecutive times */ 1844 t_u8 low_snr_freq; 1845 /** Failure count threshold */ 1846 t_u8 failure_count; 1847 /** 0--report once, 1--report everytime happend, N -- report only happend > N consecutive times */ 1848 t_u8 failure_count_freq; 1849 /** num of missed beacons */ 1850 t_u8 beacon_miss; 1851 /** 0--report once, 1--report everytime happend, N -- report only happend > N consecutive times */ 1852 t_u8 beacon_miss_freq; 1853 /** Absolute value of RSSI threshold value (dBm) */ 1854 t_u8 high_rssi; 1855 /** 0--report once, 1--report everytime happend, N -- report only happend > N consecutive times */ 1856 t_u8 high_rssi_freq; 1857 /** SNR threshold value (dB) */ 1858 t_u8 high_snr; 1859 /** 0--report once, 1--report everytime happend, N -- report only happend > N consecutive times */ 1860 t_u8 high_snr_freq; 1861 /** Absolute value of data RSSI threshold value (dBm) */ 1862 t_u8 data_low_rssi; 1863 /** 0--report once, 1--report everytime happend, N -- report only happend > N consecutive times */ 1864 t_u8 data_low_rssi_freq; 1865 /** Absolute value of data SNR threshold value (dBm) */ 1866 t_u8 data_low_snr; 1867 /** 0--report once, 1--report everytime happend, N -- report only happend > N consecutive times */ 1868 t_u8 data_low_snr_freq; 1869 /** Absolute value of data RSSI threshold value (dBm) */ 1870 t_u8 data_high_rssi; 1871 /** 0--report once, 1--report everytime happend, N -- report only happend > N consecutive times */ 1872 t_u8 data_high_rssi_freq; 1873 /** Absolute value of data SNR threshold value (dBm) */ 1874 t_u8 data_high_snr; 1875 /** 0--report once, 1--report everytime happend, N -- report only happend > N consecutive times */ 1876 t_u8 data_high_snr_freq; 1877 /* Link SNR threshold (dB) */ 1878 t_u16 link_snr; 1879 /* Link SNR frequency */ 1880 t_u16 link_snr_freq; 1881 /* Second minimum rate value as per the rate table below */ 1882 t_u16 link_rate; 1883 /* Second minimum rate frequency */ 1884 t_u16 link_rate_freq; 1885 /* Tx latency value (us) */ 1886 t_u16 link_tx_latency; 1887 /* Tx latency frequency */ 1888 t_u16 link_tx_lantency_freq; 1889 /* Number of pre missed beacons */ 1890 t_u8 pre_beacon_miss; 1891 } wifi_ds_subscribe_evt; 1892 #endif 1893 1894 #if CONFIG_CSI 1895 #define CSI_FILTER_MAX 16 1896 /** Structure of CSI filters */ 1897 typedef PACK_START struct _wifi_csi_filter_t 1898 { 1899 /** Source address of the packet to receive */ 1900 t_u8 mac_addr[MLAN_MAC_ADDR_LENGTH]; 1901 /** Pakcet type of the interested CSI */ 1902 t_u8 pkt_type; 1903 /** Packet subtype of the interested CSI */ 1904 t_u8 subtype; 1905 /** Other filter flags */ 1906 t_u8 flags; 1907 } PACK_END wifi_csi_filter_t; 1908 /** Structure of CSI parameters */ 1909 typedef PACK_START struct _wifi_csi_config_params_t 1910 { 1911 t_u8 bss_type; 1912 /** CSI enable flag. 1: enable, 2: disable */ 1913 t_u16 csi_enable; 1914 /** Header ID*/ 1915 t_u32 head_id; 1916 /** Tail ID */ 1917 t_u32 tail_id; 1918 /** Number of CSI filters */ 1919 t_u8 csi_filter_cnt; 1920 /** Chip ID */ 1921 t_u8 chip_id; 1922 /** band config */ 1923 t_u8 band_config; 1924 /** Channel num */ 1925 t_u8 channel; 1926 /** Enable getting CSI data on special channel */ 1927 t_u8 csi_monitor_enable; 1928 /** CSI data received in cfg channel with mac addr filter, not only RA is us or other*/ 1929 t_u8 ra4us; 1930 /** CSI filters */ 1931 wifi_csi_filter_t csi_filter[CSI_FILTER_MAX]; 1932 } PACK_END wifi_csi_config_params_t; 1933 #endif /* CSI_SUPPORT */ 1934 1935 #if (CONFIG_WIFI_IND_RESET) && (CONFIG_WIFI_IND_DNLD) 1936 /** Wi-Fi independent reset config */ 1937 typedef PACK_START struct 1938 { 1939 /** reset mode enable/ disable */ 1940 t_u8 ir_mode; 1941 /** gpio pin */ 1942 t_u8 gpio_pin; 1943 } PACK_END wifi_indrst_cfg_t; 1944 #endif 1945 1946 #if CONFIG_INACTIVITY_TIMEOUT_EXT 1947 /** Type definition of wifi_inactivity_to 1948 * for MLAN_OID_PM_CFG_INACTIVITY_TO 1949 */ 1950 typedef PACK_START struct 1951 { 1952 /** Timeout unit in microsecond, 0 means 1000us (1ms) */ 1953 t_u32 timeout_unit; 1954 /** Inactivity timeout for unicast data */ 1955 t_u32 unicast_timeout; 1956 /** Inactivity timeout for multicast data */ 1957 t_u32 mcast_timeout; 1958 /** Timeout for additional Rx traffic after Null PM1 packet exchange */ 1959 t_u32 ps_entry_timeout; 1960 /** Inactivity timeout for cmd */ 1961 t_u32 ps_cmd_timeout; 1962 } PACK_END wifi_inactivity_to_t; 1963 #endif 1964 1965 #if CONFIG_AUTO_NULL_TX 1966 /** auto null tx information */ 1967 typedef struct 1968 { 1969 /** 1-start 0-stop */ 1970 t_u8 start; 1971 /** bit15:14 unit: 00-s 01-us 10-ms 11-one_shot bit13-0: interval */ 1972 t_u16 interval; 1973 /** bit7-4: bandwidth. bit3-0: priority, ignored if non-WMM */ 1974 t_u8 priority; 1975 /** Destination MAC address */ 1976 t_u8 dst_mac[MLAN_MAC_ADDR_LENGTH]; 1977 /** Source MAC address */ 1978 t_u8 src_mac[MLAN_MAC_ADDR_LENGTH]; 1979 } wifi_auto_null_tx_t; 1980 #endif 1981 1982 #if defined(RW610) && (CONFIG_ANT_DETECT) 1983 #define NORMAL_DETECT_MODE 0 1984 #define QUICK_DETECT_MODE 1 1985 #define PCB_DETECT_MODE 2 1986 #define PCB_DETECT_MODE_CHECK_DEVICE_COUNT 2 1987 #define ANT_DETECT_MAX_SCAN_ENTRY 5 1988 #define MAX_ANTENNA_PORT_NUM 4 1989 typedef PACK_START struct _scan_result_entry_t 1990 { 1991 char ssid[33]; 1992 unsigned int ssid_len; 1993 char bssid[6]; 1994 unsigned int channel; 1995 unsigned char rssi; 1996 } PACK_END scan_result_entry_t; 1997 1998 typedef PACK_START struct _wlan_ant_info_t 1999 { 2000 uint8_t scan_done; 2001 unsigned char avg_rssi; 2002 uint8_t entry_idx; 2003 scan_result_entry_t scan_entry[ANT_DETECT_MAX_SCAN_ENTRY]; 2004 } PACK_END wlan_ant_scan_info_t; 2005 2006 typedef PACK_START struct _cfg_scan_channel_list_t 2007 { 2008 uint8_t num_channels; 2009 uint8_t chan_number[ANT_DETECT_MAX_CHANNEL_LIST]; 2010 } PACK_END cfg_scan_channel_list_t; 2011 2012 typedef PACK_START struct _wlan_ant_detect_data_t 2013 { 2014 uint8_t detect_mode; 2015 int detect_done; 2016 uint16_t current_ant; 2017 uint8_t ant_port_count; 2018 uint16_t best_ant; 2019 uint16_t next_best_ant; 2020 cfg_scan_channel_list_t *channel_list; 2021 wlan_ant_scan_info_t scan_info[MAX_ANTENNA_PORT_NUM]; 2022 } PACK_END wlan_ant_detect_data_t; 2023 #endif 2024 2025 #endif /* __WIFI_DECL_H__ */ 2026