1 /** @file mlan_ieee.h 2 * 3 * @brief This file contains IEEE information element related 4 * definitions used in MLAN and MOAL module. 5 * 6 * Copyright (C) 2008-2017, Marvell International Ltd. 7 * 8 * This software file (the "File") is distributed by Marvell International 9 * Ltd. under the terms of the GNU General Public License Version 2, June 1991 10 * (the "License"). You may use, redistribute and/or modify this File in 11 * accordance with the terms and conditions of the License, a copy of which 12 * is available by writing to the Free Software Foundation, Inc., 13 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the 14 * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. 15 * 16 * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE 17 * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE 18 * ARE EXPRESSLY DISCLAIMED. The License provides additional details about 19 * this warranty disclaimer. 20 */ 21 22 /****************************************************** 23 Change log: 24 11/03/2008: initial version 25 ******************************************************/ 26 27 #ifndef _MLAN_IEEE_H_ 28 #define _MLAN_IEEE_H_ 29 30 /** FIX IES size in beacon buffer */ 31 #define WLAN_802_11_FIXED_IE_SIZE 12 32 /** WLAN supported rates */ 33 #define WLAN_SUPPORTED_RATES 14 34 35 /** WLAN supported rates extension*/ 36 #define WLAN_SUPPORTED_RATES_EXT 32 37 38 /** Enumeration definition*/ 39 /** WLAN_802_11_NETWORK_TYPE */ 40 typedef enum _WLAN_802_11_NETWORK_TYPE { 41 Wlan802_11FH, 42 Wlan802_11DS, 43 /* Defined as upper bound */ 44 Wlan802_11NetworkTypeMax 45 } WLAN_802_11_NETWORK_TYPE; 46 47 #ifdef BIG_ENDIAN_SUPPORT 48 /** Frame control: Type Mgmt frame */ 49 #define IEEE80211_FC_MGMT_FRAME_TYPE_MASK 0x3000 50 /** Frame control: SubType Mgmt frame */ 51 #define IEEE80211_GET_FC_MGMT_FRAME_SUBTYPE(fc) (((fc) & 0xF000) >> 12) 52 #else 53 /** Frame control: Type Mgmt frame */ 54 #define IEEE80211_FC_MGMT_FRAME_TYPE_MASK 0x000C 55 /** Frame control: SubType Mgmt frame */ 56 #define IEEE80211_GET_FC_MGMT_FRAME_SUBTYPE(fc) (((fc) & 0x00F0) >> 4) 57 #endif 58 59 #ifdef PRAGMA_PACK 60 #pragma pack(push, 1) 61 #endif 62 63 /* Reason codes */ 64 #define IEEE_80211_REASONCODE_UNSPECIFIED 1 65 66 /** IEEE Type definitions */ 67 typedef MLAN_PACK_START enum _IEEEtypes_ElementId_e { 68 SSID = 0, 69 SUPPORTED_RATES = 1, 70 71 FH_PARAM_SET = 2, 72 DS_PARAM_SET = 3, 73 CF_PARAM_SET = 4, 74 75 IBSS_PARAM_SET = 6, 76 77 COUNTRY_INFO = 7, 78 79 POWER_CONSTRAINT = 32, 80 POWER_CAPABILITY = 33, 81 TPC_REQUEST = 34, 82 TPC_REPORT = 35, 83 CHANNEL_SWITCH_ANN = 37, 84 EXTEND_CHANNEL_SWITCH_ANN = 60, 85 QUIET = 40, 86 IBSS_DFS = 41, 87 SUPPORTED_CHANNELS = 36, 88 REGULATORY_CLASS = 59, 89 HT_CAPABILITY = 45, 90 QOS_INFO = 46, 91 HT_OPERATION = 61, 92 BSSCO_2040 = 72, 93 OVERLAPBSSSCANPARAM = 74, 94 EXT_CAPABILITY = 127, 95 LINK_ID = 101, 96 /*IEEE802.11r */ 97 MOBILITY_DOMAIN = 54, 98 FAST_BSS_TRANSITION = 55, 99 TIMEOUT_INTERVAL = 56, 100 RIC = 57, 101 QOS_MAPPING = 110, 102 103 ERP_INFO = 42, 104 105 EXTENDED_SUPPORTED_RATES = 50, 106 107 VENDOR_SPECIFIC_221 = 221, 108 WMM_IE = VENDOR_SPECIFIC_221, 109 110 WPS_IE = VENDOR_SPECIFIC_221, 111 112 WPA_IE = VENDOR_SPECIFIC_221, 113 RSN_IE = 48, 114 VS_IE = VENDOR_SPECIFIC_221, 115 WAPI_IE = 68, 116 } MLAN_PACK_END IEEEtypes_ElementId_e; 117 118 /** IEEE IE header */ 119 typedef MLAN_PACK_START struct _IEEEtypes_Header_t { 120 /** Element ID */ 121 t_u8 element_id; 122 /** Length */ 123 t_u8 len; 124 } MLAN_PACK_END IEEEtypes_Header_t, *pIEEEtypes_Header_t; 125 126 /** Vendor specific IE header */ 127 typedef MLAN_PACK_START struct _IEEEtypes_VendorHeader_t { 128 /** Element ID */ 129 t_u8 element_id; 130 /** Length */ 131 t_u8 len; 132 /** OUI */ 133 t_u8 oui[3]; 134 /** OUI type */ 135 t_u8 oui_type; 136 /** OUI subtype */ 137 t_u8 oui_subtype; 138 /** Version */ 139 t_u8 version; 140 } MLAN_PACK_END IEEEtypes_VendorHeader_t, *pIEEEtypes_VendorHeader_t; 141 142 /** Vendor specific IE */ 143 typedef MLAN_PACK_START struct _IEEEtypes_VendorSpecific_t { 144 /** Vendor specific IE header */ 145 IEEEtypes_VendorHeader_t vend_hdr; 146 /** IE Max - size of previous fields */ 147 t_u8 data[IEEE_MAX_IE_SIZE - sizeof(IEEEtypes_VendorHeader_t)]; 148 } MLAN_PACK_END IEEEtypes_VendorSpecific_t, *pIEEEtypes_VendorSpecific_t; 149 150 /** IEEE IE */ 151 typedef MLAN_PACK_START struct _IEEEtypes_Generic_t { 152 /** Generic IE header */ 153 IEEEtypes_Header_t ieee_hdr; 154 /** IE Max - size of previous fields */ 155 t_u8 data[IEEE_MAX_IE_SIZE - sizeof(IEEEtypes_Header_t)]; 156 } MLAN_PACK_END IEEEtypes_Generic_t, *pIEEEtypes_Generic_t; 157 158 /**ft capability policy*/ 159 typedef MLAN_PACK_START struct _IEEEtypes_FtCapPolicy_t { 160 #ifdef BIG_ENDIAN_SUPPORT 161 /** Reserved */ 162 t_u8 reserved:6; 163 /** RIC support */ 164 t_u8 ric:1; 165 /** FT over the DS capable */ 166 t_u8 ft_over_ds:1; 167 #else 168 /** FT over the DS capable */ 169 t_u8 ft_over_ds:1; 170 /** RIC support */ 171 t_u8 ric:1; 172 /** Reserved */ 173 t_u8 reserved:6; 174 #endif 175 } MLAN_PACK_END IEEEtypes_FtCapPolicy_t; 176 177 /** Mobility domain IE */ 178 typedef MLAN_PACK_START struct _IEEEtypes_MobilityDomain_t { 179 /** Generic IE header */ 180 IEEEtypes_Header_t ieee_hdr; 181 /** Mobility Domain ID */ 182 t_u16 mdid; 183 /** FT Capability policy */ 184 t_u8 ft_cap; 185 } MLAN_PACK_END IEEEtypes_MobilityDomain_t; 186 187 /**FT MIC Control*/ 188 typedef MLAN_PACK_START struct _IEEEtypes_FT_MICControl_t { 189 /** reserved */ 190 t_u8 reserved; 191 /** element count */ 192 t_u8 element_count; 193 } MLAN_PACK_END IEEEtypes_FT_MICControl_t; 194 195 /** FTIE MIC LEN */ 196 #define FTIE_MIC_LEN 16 197 198 /**FT IE*/ 199 typedef MLAN_PACK_START struct _IEEEtypes_FastBssTransElement_t { 200 /** Generic IE header */ 201 IEEEtypes_Header_t ieee_hdr; 202 /** mic control */ 203 IEEEtypes_FT_MICControl_t mic_control; 204 /** mic */ 205 t_u8 mic[FTIE_MIC_LEN]; 206 /** ANonce */ 207 t_u8 a_nonce[32]; 208 /** SNonce */ 209 t_u8 s_nonce[32]; 210 /** sub element */ 211 t_u8 sub_element[1]; 212 } MLAN_PACK_END IEEEtypes_FastBssTransElement_t; 213 214 /** auth frame body*/ 215 typedef MLAN_PACK_START struct { 216 /** auth alg */ 217 t_u16 auth_alg; 218 /** auth transaction */ 219 t_u16 auth_transaction; 220 /** status code */ 221 t_u16 status_code; 222 /** variable */ 223 t_u8 variable[0]; 224 } MLAN_PACK_END IEEEtypes_Auth_framebody; 225 226 /*Category for FT*/ 227 #define FT_CATEGORY 6 228 /** FT ACTION request */ 229 #define FT_ACTION_REQUEST 1 230 /** FT ACTION response */ 231 #define FT_ACTION_RESPONSE 2 232 233 /*FT response and FT ack*/ 234 typedef MLAN_PACK_START struct { 235 /** category */ 236 t_u8 category; 237 /** action */ 238 t_u8 action; 239 /** sta address */ 240 t_u8 sta_addr[MLAN_MAC_ADDR_LENGTH]; 241 /** target ap address */ 242 t_u8 target_ap_addr[MLAN_MAC_ADDR_LENGTH]; 243 /** status code */ 244 t_u16 status_code; 245 /** varible */ 246 t_u8 variable[0]; 247 } MLAN_PACK_END IEEEtypes_Ft_action_response; 248 249 /**FT request */ 250 typedef MLAN_PACK_START struct { 251 /** category */ 252 t_u8 category; 253 /** action */ 254 t_u8 action; 255 /** sta address */ 256 t_u8 sta_addr[MLAN_MAC_ADDR_LENGTH]; 257 /** target ap address */ 258 t_u8 target_ap_addr[MLAN_MAC_ADDR_LENGTH]; 259 /** varible */ 260 t_u8 variable[0]; 261 } MLAN_PACK_END IEEEtypes_Ft_action_request; 262 263 /*Mgmt frame*/ 264 typedef MLAN_PACK_START struct { 265 /** frame control */ 266 t_u16 frame_control; 267 /** duration */ 268 t_u16 duration; 269 /** dest address */ 270 t_u8 da[MLAN_MAC_ADDR_LENGTH]; 271 /** source address */ 272 t_u8 sa[MLAN_MAC_ADDR_LENGTH]; 273 /** bssid */ 274 t_u8 bssid[MLAN_MAC_ADDR_LENGTH]; 275 /** seq control */ 276 t_u16 seq_ctrl; 277 /** address 4 */ 278 t_u8 addr4[MLAN_MAC_ADDR_LENGTH]; 279 union { 280 IEEEtypes_Auth_framebody auth; 281 IEEEtypes_Ft_action_response ft_resp; 282 IEEEtypes_Ft_action_request ft_req; 283 } u; 284 } MLAN_PACK_END IEEE80211_MGMT; 285 286 /** TLV header */ 287 typedef MLAN_PACK_START struct _TLV_Generic_t { 288 /** Type */ 289 t_u16 type; 290 /** Length */ 291 t_u16 len; 292 } MLAN_PACK_END TLV_Generic_t, *pTLV_Generic_t; 293 294 /** Capability information mask */ 295 #define CAPINFO_MASK \ 296 (~(MBIT(15) | MBIT(14) | MBIT(11) | MBIT(9))) 297 298 /** Capability Bit Map*/ 299 #ifdef BIG_ENDIAN_SUPPORT 300 typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t { 301 t_u8 rsrvd1:2; 302 t_u8 dsss_ofdm:1; 303 t_u8 radio_measurement:1; 304 t_u8 rsvrd2:1; 305 t_u8 short_slot_time:1; 306 t_u8 rsrvd3:1; 307 t_u8 spectrum_mgmt:1; 308 t_u8 chan_agility:1; 309 t_u8 pbcc:1; 310 t_u8 short_preamble:1; 311 t_u8 privacy:1; 312 t_u8 cf_poll_rqst:1; 313 t_u8 cf_pollable:1; 314 t_u8 ibss:1; 315 t_u8 ess:1; 316 } MLAN_PACK_END IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t; 317 #else 318 typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t { 319 /** Capability Bit Map : ESS */ 320 t_u8 ess:1; 321 /** Capability Bit Map : IBSS */ 322 t_u8 ibss:1; 323 /** Capability Bit Map : CF pollable */ 324 t_u8 cf_pollable:1; 325 /** Capability Bit Map : CF poll request */ 326 t_u8 cf_poll_rqst:1; 327 /** Capability Bit Map : privacy */ 328 t_u8 privacy:1; 329 /** Capability Bit Map : Short preamble */ 330 t_u8 short_preamble:1; 331 /** Capability Bit Map : PBCC */ 332 t_u8 pbcc:1; 333 /** Capability Bit Map : Channel agility */ 334 t_u8 chan_agility:1; 335 /** Capability Bit Map : Spectrum management */ 336 t_u8 spectrum_mgmt:1; 337 /** Capability Bit Map : Reserved */ 338 t_u8 rsrvd3:1; 339 /** Capability Bit Map : Short slot time */ 340 t_u8 short_slot_time:1; 341 /** Capability Bit Map : APSD */ 342 t_u8 Apsd:1; 343 /** Capability Bit Map : Reserved */ 344 t_u8 rsvrd2:1; 345 /** Capability Bit Map : DSS OFDM */ 346 t_u8 dsss_ofdm:1; 347 /** Capability Bit Map : Reserved */ 348 t_u8 rsrvd1:2; 349 } MLAN_PACK_END IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t; 350 #endif /* BIG_ENDIAN_SUPPORT */ 351 352 /** IEEEtypes_CfParamSet_t */ 353 typedef MLAN_PACK_START struct _IEEEtypes_CfParamSet_t { 354 /** CF peremeter : Element ID */ 355 t_u8 element_id; 356 /** CF peremeter : Length */ 357 t_u8 len; 358 /** CF peremeter : Count */ 359 t_u8 cfp_cnt; 360 /** CF peremeter : Period */ 361 t_u8 cfp_period; 362 /** CF peremeter : Maximum duration */ 363 t_u16 cfp_max_duration; 364 /** CF peremeter : Remaining duration */ 365 t_u16 cfp_duration_remaining; 366 } MLAN_PACK_END IEEEtypes_CfParamSet_t, *pIEEEtypes_CfParamSet_t; 367 368 /** IEEEtypes_IbssParamSet_t */ 369 typedef MLAN_PACK_START struct _IEEEtypes_IbssParamSet_t { 370 /** Element ID */ 371 t_u8 element_id; 372 /** Length */ 373 t_u8 len; 374 /** ATIM window value in milliseconds */ 375 t_u16 atim_window; 376 } MLAN_PACK_END IEEEtypes_IbssParamSet_t, *pIEEEtypes_IbssParamSet_t; 377 378 /** IEEEtypes_SsParamSet_t */ 379 typedef MLAN_PACK_START union _IEEEtypes_SsParamSet_t { 380 /** SS parameter : CF parameter set */ 381 IEEEtypes_CfParamSet_t cf_param_set; 382 /** SS parameter : IBSS parameter set */ 383 IEEEtypes_IbssParamSet_t ibss_param_set; 384 } MLAN_PACK_END IEEEtypes_SsParamSet_t, *pIEEEtypes_SsParamSet_t; 385 386 /** IEEEtypes_FhParamSet_t */ 387 typedef MLAN_PACK_START struct _IEEEtypes_FhParamSet_t { 388 /** FH parameter : Element ID */ 389 t_u8 element_id; 390 /** FH parameter : Length */ 391 t_u8 len; 392 /** FH parameter : Dwell time in milliseconds */ 393 t_u16 dwell_time; 394 /** FH parameter : Hop set */ 395 t_u8 hop_set; 396 /** FH parameter : Hop pattern */ 397 t_u8 hop_pattern; 398 /** FH parameter : Hop index */ 399 t_u8 hop_index; 400 } MLAN_PACK_END IEEEtypes_FhParamSet_t, *pIEEEtypes_FhParamSet_t; 401 402 /** IEEEtypes_DsParamSet_t */ 403 typedef MLAN_PACK_START struct _IEEEtypes_DsParamSet_t { 404 /** DS parameter : Element ID */ 405 t_u8 element_id; 406 /** DS parameter : Length */ 407 t_u8 len; 408 /** DS parameter : Current channel */ 409 t_u8 current_chan; 410 } MLAN_PACK_END IEEEtypes_DsParamSet_t, *pIEEEtypes_DsParamSet_t; 411 412 /** IEEEtypes_PhyParamSet_t */ 413 typedef MLAN_PACK_START union _IEEEtypes_PhyParamSet_t { 414 /** FH parameter set */ 415 IEEEtypes_FhParamSet_t fh_param_set; 416 /** DS parameter set */ 417 IEEEtypes_DsParamSet_t ds_param_set; 418 } MLAN_PACK_END IEEEtypes_PhyParamSet_t, *pIEEEtypes_PhyParamSet_t; 419 420 /** IEEEtypes_ERPInfo_t */ 421 typedef MLAN_PACK_START struct _IEEEtypes_ERPInfo_t { 422 /** Element ID */ 423 t_u8 element_id; 424 /** Length */ 425 t_u8 len; 426 /** ERP flags */ 427 t_u8 erp_flags; 428 } MLAN_PACK_END IEEEtypes_ERPInfo_t, *pIEEEtypes_ERPInfo_t; 429 430 /** IEEEtypes_AId_t */ 431 typedef t_u16 IEEEtypes_AId_t; 432 433 /** IEEEtypes_StatusCode_t */ 434 typedef t_u16 IEEEtypes_StatusCode_t; 435 436 /** Fixed size in assoc_resp */ 437 #define ASSOC_RESP_FIXED_SIZE 6 438 /** IEEEtypes_AssocRsp_t */ 439 typedef MLAN_PACK_START struct _IEEEtypes_AssocRsp_t { 440 /** Capability information */ 441 IEEEtypes_CapInfo_t capability; 442 /** Association response status code */ 443 IEEEtypes_StatusCode_t status_code; 444 /** Association ID */ 445 IEEEtypes_AId_t a_id; 446 /** IE data buffer */ 447 t_u8 ie_buffer[1]; 448 } MLAN_PACK_END IEEEtypes_AssocRsp_t, *pIEEEtypes_AssocRsp_t; 449 450 /** 802.11 supported rates */ 451 typedef t_u8 WLAN_802_11_RATES[WLAN_SUPPORTED_RATES]; 452 453 /** cipher TKIP */ 454 #define WPA_CIPHER_TKIP 2 455 /** cipher AES */ 456 #define WPA_CIPHER_AES_CCM 4 457 /** AKM: 8021x */ 458 #define RSN_AKM_8021X 1 459 /** AKM: PSK */ 460 #define RSN_AKM_PSK 2 461 /** AKM: PSK SHA256 */ 462 #define RSN_AKM_PSK_SHA256 6 463 #if defined(STA_SUPPORT) 464 /** Pairwise Cipher Suite length */ 465 #define PAIRWISE_CIPHER_SUITE_LEN 4 466 /** AKM Suite length */ 467 #define AKM_SUITE_LEN 4 468 /** MFPC bit in RSN capability */ 469 #define MFPC_BIT 7 470 /** MFPR bit in RSN capability */ 471 #define MFPR_BIT 6 472 /** PMF ORing mask */ 473 #define PMF_MASK 0x00c0 474 #endif 475 476 /** wpa_suite_t */ 477 typedef MLAN_PACK_START struct _wpa_suite_t { 478 /** OUI */ 479 t_u8 oui[3]; 480 /** tyep */ 481 t_u8 type; 482 } MLAN_PACK_END wpa_suite, wpa_suite_mcast_t; 483 484 /** wpa_suite_ucast_t */ 485 typedef MLAN_PACK_START struct { 486 /* count */ 487 t_u16 count; 488 /** wpa_suite list */ 489 wpa_suite list[1]; 490 } MLAN_PACK_END wpa_suite_ucast_t, wpa_suite_auth_key_mgmt_t; 491 492 /** IEEEtypes_Rsn_t */ 493 typedef MLAN_PACK_START struct _IEEEtypes_Rsn_t { 494 /** Rsn : Element ID */ 495 t_u8 element_id; 496 /** Rsn : Length */ 497 t_u8 len; 498 /** Rsn : version */ 499 t_u16 version; 500 /** Rsn : group cipher */ 501 wpa_suite_mcast_t group_cipher; 502 /** Rsn : pairwise cipher */ 503 wpa_suite_ucast_t pairwise_cipher; 504 } MLAN_PACK_END IEEEtypes_Rsn_t, *pIEEEtypes_Rsn_t; 505 506 /** IEEEtypes_Wpa_t */ 507 typedef MLAN_PACK_START struct _IEEEtypes_Wpa_t { 508 /** Wpa : Element ID */ 509 t_u8 element_id; 510 /** Wpa : Length */ 511 t_u8 len; 512 /** Wpa : oui */ 513 t_u8 oui[4]; 514 /** version */ 515 t_u16 version; 516 /** Wpa : group cipher */ 517 wpa_suite_mcast_t group_cipher; 518 /** Wpa : pairwise cipher */ 519 wpa_suite_ucast_t pairwise_cipher; 520 } MLAN_PACK_END IEEEtypes_Wpa_t, *pIEEEtypes_Wpa_t; 521 522 /** Data structure of WMM QoS information */ 523 typedef MLAN_PACK_START struct _IEEEtypes_WmmQosInfo_t { 524 #ifdef BIG_ENDIAN_SUPPORT 525 /** QoS UAPSD */ 526 t_u8 qos_uapsd:1; 527 /** Reserved */ 528 t_u8 reserved:3; 529 /** Parameter set count */ 530 t_u8 para_set_count:4; 531 #else 532 /** Parameter set count */ 533 t_u8 para_set_count:4; 534 /** Reserved */ 535 t_u8 reserved:3; 536 /** QoS UAPSD */ 537 t_u8 qos_uapsd:1; 538 #endif /* BIG_ENDIAN_SUPPORT */ 539 } MLAN_PACK_END IEEEtypes_WmmQosInfo_t, *pIEEEtypes_WmmQosInfo_t; 540 541 /** Data structure of WMM Aci/Aifsn */ 542 typedef MLAN_PACK_START struct _IEEEtypes_WmmAciAifsn_t { 543 #ifdef BIG_ENDIAN_SUPPORT 544 /** Reserved */ 545 t_u8 reserved:1; 546 /** Aci */ 547 t_u8 aci:2; 548 /** Acm */ 549 t_u8 acm:1; 550 /** Aifsn */ 551 t_u8 aifsn:4; 552 #else 553 /** Aifsn */ 554 t_u8 aifsn:4; 555 /** Acm */ 556 t_u8 acm:1; 557 /** Aci */ 558 t_u8 aci:2; 559 /** Reserved */ 560 t_u8 reserved:1; 561 #endif /* BIG_ENDIAN_SUPPORT */ 562 } MLAN_PACK_END IEEEtypes_WmmAciAifsn_t, *pIEEEtypes_WmmAciAifsn_t; 563 564 /** Data structure of WMM ECW */ 565 typedef MLAN_PACK_START struct _IEEEtypes_WmmEcw_t { 566 #ifdef BIG_ENDIAN_SUPPORT 567 /** Maximum Ecw */ 568 t_u8 ecw_max:4; 569 /** Minimum Ecw */ 570 t_u8 ecw_min:4; 571 #else 572 /** Minimum Ecw */ 573 t_u8 ecw_min:4; 574 /** Maximum Ecw */ 575 t_u8 ecw_max:4; 576 #endif /* BIG_ENDIAN_SUPPORT */ 577 } MLAN_PACK_END IEEEtypes_WmmEcw_t, *pIEEEtypes_WmmEcw_t; 578 579 /** Data structure of WMM AC parameters */ 580 typedef MLAN_PACK_START struct _IEEEtypes_WmmAcParameters_t { 581 IEEEtypes_WmmAciAifsn_t aci_aifsn; /**< AciAifSn */ 582 IEEEtypes_WmmEcw_t ecw; /**< Ecw */ 583 t_u16 tx_op_limit; /**< Tx op limit */ 584 } MLAN_PACK_END IEEEtypes_WmmAcParameters_t, *pIEEEtypes_WmmAcParameters_t; 585 586 /** Data structure of WMM Info IE */ 587 typedef MLAN_PACK_START struct _IEEEtypes_WmmInfo_t { 588 589 /** 590 * WMM Info IE - Vendor Specific Header: 591 * element_id [221/0xdd] 592 * Len [7] 593 * Oui [00:50:f2] 594 * OuiType [2] 595 * OuiSubType [0] 596 * Version [1] 597 */ 598 IEEEtypes_VendorHeader_t vend_hdr; 599 600 /** QoS information */ 601 IEEEtypes_WmmQosInfo_t qos_info; 602 603 } MLAN_PACK_END IEEEtypes_WmmInfo_t, *pIEEEtypes_WmmInfo_t; 604 605 /** Data structure of WMM parameter IE */ 606 typedef MLAN_PACK_START struct _IEEEtypes_WmmParameter_t { 607 /** 608 * WMM Parameter IE - Vendor Specific Header: 609 * element_id [221/0xdd] 610 * Len [24] 611 * Oui [00:50:f2] 612 * OuiType [2] 613 * OuiSubType [1] 614 * Version [1] 615 */ 616 IEEEtypes_VendorHeader_t vend_hdr; 617 618 /** QoS information */ 619 IEEEtypes_WmmQosInfo_t qos_info; 620 /** Reserved */ 621 t_u8 reserved; 622 623 /** AC Parameters Record WMM_AC_BE, WMM_AC_BK, WMM_AC_VI, WMM_AC_VO */ 624 IEEEtypes_WmmAcParameters_t ac_params[MAX_AC_QUEUES]; 625 } MLAN_PACK_END IEEEtypes_WmmParameter_t, *pIEEEtypes_WmmParameter_t; 626 627 /** Enumerator for TSPEC direction */ 628 typedef MLAN_PACK_START enum _IEEEtypes_WMM_TSPEC_TS_Info_Direction_e { 629 630 TSPEC_DIR_UPLINK = 0, 631 TSPEC_DIR_DOWNLINK = 1, 632 /* 2 is a reserved value */ 633 TSPEC_DIR_BIDIRECT = 3, 634 635 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_Info_Direction_e; 636 637 /** Enumerator for TSPEC PSB */ 638 typedef MLAN_PACK_START enum _IEEEtypes_WMM_TSPEC_TS_Info_PSB_e { 639 640 TSPEC_PSB_LEGACY = 0, 641 TSPEC_PSB_TRIG = 1, 642 643 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_Info_PSB_e; 644 645 /** Enumerator for TSPEC Ack Policy */ 646 typedef MLAN_PACK_START enum _IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e { 647 648 TSPEC_ACKPOLICY_NORMAL = 0, 649 TSPEC_ACKPOLICY_NOACK = 1, 650 /* 2 is reserved */ 651 TSPEC_ACKPOLICY_BLOCKACK = 3, 652 653 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e; 654 655 /** Enumerator for TSPEC Trafffice type */ 656 typedef MLAN_PACK_START enum _IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e { 657 658 TSPEC_TRAFFIC_APERIODIC = 0, 659 TSPEC_TRAFFIC_PERIODIC = 1, 660 661 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e; 662 663 /** Data structure of WMM TSPEC information */ 664 typedef MLAN_PACK_START struct { 665 #ifdef BIG_ENDIAN_SUPPORT 666 t_u8 Reserved17_23:7; /* ! Reserved */ 667 t_u8 Schedule:1; 668 IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e AckPolicy:2; 669 t_u8 UserPri:3; /* ! 802.1d User Priority */ 670 IEEEtypes_WMM_TSPEC_TS_Info_PSB_e PowerSaveBehavior:1; /* ! Legacy/Trigg */ 671 t_u8 Aggregation:1; /* ! Reserved */ 672 t_u8 AccessPolicy2:1; /* ! */ 673 t_u8 AccessPolicy1:1; /* ! */ 674 IEEEtypes_WMM_TSPEC_TS_Info_Direction_e Direction:2; 675 t_u8 TID:4; /* ! Unique identifier */ 676 IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e TrafficType:1; 677 #else 678 IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e TrafficType:1; 679 t_u8 TID:4; /* ! Unique identifier */ 680 IEEEtypes_WMM_TSPEC_TS_Info_Direction_e Direction:2; 681 t_u8 AccessPolicy1:1; /* ! */ 682 t_u8 AccessPolicy2:1; /* ! */ 683 t_u8 Aggregation:1; /* ! Reserved */ 684 IEEEtypes_WMM_TSPEC_TS_Info_PSB_e PowerSaveBehavior:1; /* ! Legacy/Trigg */ 685 t_u8 UserPri:3; /* ! 802.1d User Priority */ 686 IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e AckPolicy:2; 687 t_u8 Schedule:1; 688 t_u8 Reserved17_23:7; /* ! Reserved */ 689 #endif 690 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_Info_t; 691 692 /** Data structure of WMM TSPEC Nominal Size */ 693 typedef MLAN_PACK_START struct { 694 #ifdef BIG_ENDIAN_SUPPORT 695 t_u16 Fixed:1; /* ! 1: Fixed size given in Size, 0: Var, size is nominal */ 696 t_u16 Size:15; /* ! Nominal size in octets */ 697 #else 698 t_u16 Size:15; /* ! Nominal size in octets */ 699 t_u16 Fixed:1; /* ! 1: Fixed size given in Size, 0: Var, size is nominal */ 700 #endif 701 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_NomMSDUSize_t; 702 703 /** Data structure of WMM TSPEC SBWA */ 704 typedef MLAN_PACK_START struct { 705 #ifdef BIG_ENDIAN_SUPPORT 706 t_u16 Whole:3; /* ! Whole portion */ 707 t_u16 Fractional:13; /* ! Fractional portion */ 708 #else 709 t_u16 Fractional:13; /* ! Fractional portion */ 710 t_u16 Whole:3; /* ! Whole portion */ 711 #endif 712 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_SBWA; 713 714 /** Data structure of WMM TSPEC Body */ 715 typedef MLAN_PACK_START struct { 716 717 /** TS Information */ 718 IEEEtypes_WMM_TSPEC_TS_Info_t TSInfo; 719 /** NomMSDU size */ 720 IEEEtypes_WMM_TSPEC_NomMSDUSize_t NomMSDUSize; 721 /** MAximum MSDU size */ 722 t_u16 MaximumMSDUSize; 723 /** Minimum Service Interval */ 724 t_u32 MinServiceInterval; 725 /** Maximum Service Interval */ 726 t_u32 MaxServiceInterval; 727 /** Inactivity Interval */ 728 t_u32 InactivityInterval; 729 /** Suspension Interval */ 730 t_u32 SuspensionInterval; 731 /** Service Start Time */ 732 t_u32 ServiceStartTime; 733 /** Minimum Data Rate */ 734 t_u32 MinimumDataRate; 735 /** Mean Data Rate */ 736 t_u32 MeanDataRate; 737 /** Peak Data Rate */ 738 t_u32 PeakDataRate; 739 /** Maximum Burst Size */ 740 t_u32 MaxBurstSize; 741 /** Delay Bound */ 742 t_u32 DelayBound; 743 /** Minimum Phy Rate */ 744 t_u32 MinPHYRate; 745 /** Surplus BA Allowance */ 746 IEEEtypes_WMM_TSPEC_SBWA SurplusBWAllowance; 747 /** Medium Time */ 748 t_u16 MediumTime; 749 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_Body_t; 750 751 /** Data structure of WMM TSPEC all elements */ 752 typedef MLAN_PACK_START struct { 753 /** Element ID */ 754 t_u8 ElementId; 755 /** Length */ 756 t_u8 Len; 757 /** Oui Type */ 758 t_u8 OuiType[4]; /* 00:50:f2:02 */ 759 /** Ouisubtype */ 760 t_u8 OuiSubType; /* 01 */ 761 /** Version */ 762 t_u8 Version; 763 764 /** TspecBody */ 765 IEEEtypes_WMM_TSPEC_Body_t TspecBody; 766 767 } MLAN_PACK_END IEEEtypes_WMM_TSPEC_t; 768 769 /** WMM Action Category values */ 770 typedef MLAN_PACK_START enum _IEEEtypes_ActionCategory_e { 771 772 IEEE_MGMT_ACTION_CATEGORY_SPECTRUM_MGMT = 0, 773 IEEE_MGMT_ACTION_CATEGORY_QOS = 1, 774 IEEE_MGMT_ACTION_CATEGORY_DLS = 2, 775 IEEE_MGMT_ACTION_CATEGORY_BLOCK_ACK = 3, 776 IEEE_MGMT_ACTION_CATEGORY_PUBLIC = 4, 777 IEEE_MGMT_ACTION_CATEGORY_RADIO_RSRC = 5, 778 IEEE_MGMT_ACTION_CATEGORY_FAST_BSS_TRANS = 6, 779 IEEE_MGMT_ACTION_CATEGORY_HT = 7, 780 781 IEEE_MGMT_ACTION_CATEGORY_WNM = 10, 782 IEEE_MGMT_ACTION_CATEGORY_UNPROTECT_WNM = 11, 783 784 IEEE_MGMT_ACTION_CATEGORY_WMM_TSPEC = 17 785 } MLAN_PACK_END IEEEtypes_ActionCategory_e; 786 787 /** WMM TSPEC operations */ 788 typedef MLAN_PACK_START enum _IEEEtypes_WMM_Tspec_Action_e { 789 790 TSPEC_ACTION_CODE_ADDTS_REQ = 0, 791 TSPEC_ACTION_CODE_ADDTS_RSP = 1, 792 TSPEC_ACTION_CODE_DELTS = 2, 793 794 } MLAN_PACK_END IEEEtypes_WMM_Tspec_Action_e; 795 796 /** WMM TSPEC Category Action Base */ 797 typedef MLAN_PACK_START struct { 798 799 /** Category */ 800 IEEEtypes_ActionCategory_e category; 801 /** Action */ 802 IEEEtypes_WMM_Tspec_Action_e action; 803 /** Dialog Token */ 804 t_u8 dialogToken; 805 806 } MLAN_PACK_END IEEEtypes_WMM_Tspec_Action_Base_Tspec_t; 807 808 /** WMM TSPEC AddTS request structure */ 809 typedef MLAN_PACK_START struct { 810 811 /** Tspec action */ 812 IEEEtypes_WMM_Tspec_Action_Base_Tspec_t tspecAct; 813 /** Status Code */ 814 t_u8 statusCode; 815 /** tspecIE */ 816 IEEEtypes_WMM_TSPEC_t tspecIE; 817 818 /* Place holder for additional elements after the TSPEC */ 819 t_u8 subElem[256]; 820 821 } MLAN_PACK_END IEEEtypes_Action_WMM_AddTsReq_t; 822 823 /** WMM TSPEC AddTS response structure */ 824 typedef MLAN_PACK_START struct { 825 IEEEtypes_WMM_Tspec_Action_Base_Tspec_t tspecAct; 826 t_u8 statusCode; 827 IEEEtypes_WMM_TSPEC_t tspecIE; 828 829 /* Place holder for additional elements after the TSPEC */ 830 t_u8 subElem[256]; 831 832 } MLAN_PACK_END IEEEtypes_Action_WMM_AddTsRsp_t; 833 834 /** WMM TSPEC DelTS structure */ 835 typedef MLAN_PACK_START struct { 836 /** tspec Action */ 837 IEEEtypes_WMM_Tspec_Action_Base_Tspec_t tspecAct; 838 /** Reason Code */ 839 t_u8 reasonCode; 840 /** tspecIE */ 841 IEEEtypes_WMM_TSPEC_t tspecIE; 842 843 } MLAN_PACK_END IEEEtypes_Action_WMM_DelTs_t; 844 845 /** union of WMM TSPEC structures */ 846 typedef MLAN_PACK_START union { 847 /** tspec Action */ 848 IEEEtypes_WMM_Tspec_Action_Base_Tspec_t tspecAct; 849 850 /** add TS request */ 851 IEEEtypes_Action_WMM_AddTsReq_t addTsReq; 852 /** add TS response */ 853 IEEEtypes_Action_WMM_AddTsRsp_t addTsRsp; 854 /** Delete TS */ 855 IEEEtypes_Action_WMM_DelTs_t delTs; 856 857 } MLAN_PACK_END IEEEtypes_Action_WMMAC_t; 858 859 /** union of WMM TSPEC & Action category */ 860 typedef MLAN_PACK_START union { 861 /** Category */ 862 IEEEtypes_ActionCategory_e category; 863 864 /** wmmAc */ 865 IEEEtypes_Action_WMMAC_t wmmAc; 866 867 } MLAN_PACK_END IEEEtypes_ActionFrame_t; 868 869 /** Data structure for subband set */ 870 typedef MLAN_PACK_START struct _IEEEtypes_SubbandSet_t { 871 /** First channel */ 872 t_u8 first_chan; 873 /** Number of channels */ 874 t_u8 no_of_chan; 875 /** Maximum Tx power in dBm */ 876 t_u8 max_tx_pwr; 877 } MLAN_PACK_END IEEEtypes_SubbandSet_t, *pIEEEtypes_SubbandSet_t; 878 879 #ifdef STA_SUPPORT 880 /** Data structure for Country IE */ 881 typedef MLAN_PACK_START struct _IEEEtypes_CountryInfoSet_t { 882 /** Element ID */ 883 t_u8 element_id; 884 /** Length */ 885 t_u8 len; 886 /** Country code */ 887 t_u8 country_code[COUNTRY_CODE_LEN]; 888 /** Set of subbands */ 889 IEEEtypes_SubbandSet_t sub_band[1]; 890 } MLAN_PACK_END IEEEtypes_CountryInfoSet_t, *pIEEEtypes_CountryInfoSet_t; 891 892 /** Data structure for Country IE full set */ 893 typedef MLAN_PACK_START struct _IEEEtypes_CountryInfoFullSet_t { 894 /** Element ID */ 895 t_u8 element_id; 896 /** Length */ 897 t_u8 len; 898 /** Country code */ 899 t_u8 country_code[COUNTRY_CODE_LEN]; 900 /** Set of subbands */ 901 IEEEtypes_SubbandSet_t sub_band[MRVDRV_MAX_SUBBAND_802_11D]; 902 } MLAN_PACK_END IEEEtypes_CountryInfoFullSet_t, 903 *pIEEEtypes_CountryInfoFullSet_t; 904 905 #endif /* STA_SUPPORT */ 906 907 /** Data structure for Link ID */ 908 typedef MLAN_PACK_START struct _IEEEtypes_LinkIDElement_t { 909 /** Element ID */ 910 t_u8 element_id; 911 /** Length */ 912 t_u8 len; 913 /** bssid */ 914 t_u8 bssid[MLAN_MAC_ADDR_LENGTH]; 915 /** initial sta address */ 916 t_u8 init_sta[MLAN_MAC_ADDR_LENGTH]; 917 /** respose sta address */ 918 t_u8 resp_sta[MLAN_MAC_ADDR_LENGTH]; 919 } MLAN_PACK_END IEEEtypes_LinkIDElement_t, *pIEEEtypes_LinkIDElement_t; 920 921 /** HT Capabilities Data */ 922 typedef struct MLAN_PACK_START _HTCap_t { 923 /** HT Capabilities Info field */ 924 t_u16 ht_cap_info; 925 /** A-MPDU Parameters field */ 926 t_u8 ampdu_param; 927 /** Supported MCS Set field */ 928 t_u8 supported_mcs_set[16]; 929 /** HT Extended Capabilities field */ 930 t_u16 ht_ext_cap; 931 /** Transmit Beamforming Capabilities field */ 932 t_u32 tx_bf_cap; 933 /** Antenna Selection Capability field */ 934 t_u8 asel; 935 } MLAN_PACK_END HTCap_t, *pHTCap_t; 936 937 /** HT Information Data */ 938 typedef struct MLAN_PACK_START _HTInfo_t { 939 /** Primary channel */ 940 t_u8 pri_chan; 941 /** Field 2 */ 942 t_u8 field2; 943 /** Field 3 */ 944 t_u16 field3; 945 /** Field 4 */ 946 t_u16 field4; 947 /** Bitmap indicating MCSs supported by all HT STAs in the BSS */ 948 t_u8 basic_mcs_set[16]; 949 } MLAN_PACK_END HTInfo_t, *pHTInfo_t; 950 951 /** 20/40 BSS Coexistence Data */ 952 typedef struct MLAN_PACK_START _BSSCo2040_t { 953 /** 20/40 BSS Coexistence value */ 954 t_u8 bss_co_2040_value; 955 } MLAN_PACK_END BSSCo2040_t, *pBSSCo2040_t; 956 957 #define MAX_DSCP_EXCEPTION_NUM 21 958 /** DSCP Range */ 959 typedef struct MLAN_PACK_START _DSCP_Exception_t { 960 /* DSCP value 0 to 63 or ff */ 961 t_u8 dscp_value; 962 /* user priority 0-7 */ 963 t_u8 user_priority; 964 } MLAN_PACK_END DSCP_Exception_t, *pDSCP_Exception_t; 965 966 /** DSCP Range */ 967 typedef struct MLAN_PACK_START _DSCP_Range_t { 968 /* DSCP low value */ 969 t_u8 dscp_low_value; 970 /* DSCP high value */ 971 t_u8 dscp_high_value; 972 } MLAN_PACK_END DSCP_Range_t, *pDSCP_Range_t; 973 974 /** Overlapping BSS Scan Parameters Data */ 975 typedef struct MLAN_PACK_START _OverlapBSSScanParam_t { 976 /** OBSS Scan Passive Dwell in milliseconds */ 977 t_u16 obss_scan_passive_dwell; 978 /** OBSS Scan Active Dwell in milliseconds */ 979 t_u16 obss_scan_active_dwell; 980 /** BSS Channel Width Trigger Scan Interval in seconds */ 981 t_u16 bss_chan_width_trigger_scan_int; 982 /** OBSS Scan Passive Total Per Channel */ 983 t_u16 obss_scan_passive_total; 984 /** OBSS Scan Active Total Per Channel */ 985 t_u16 obss_scan_active_total; 986 /** BSS Width Channel Transition Delay Factor */ 987 t_u16 bss_width_chan_trans_delay; 988 /** OBSS Scan Activity Threshold */ 989 t_u16 obss_scan_active_threshold; 990 } MLAN_PACK_END OBSSScanParam_t, *pOBSSScanParam_t; 991 992 /** HT Capabilities IE */ 993 typedef MLAN_PACK_START struct _IEEEtypes_HTCap_t { 994 /** Generic IE header */ 995 IEEEtypes_Header_t ieee_hdr; 996 /** HTCap struct */ 997 HTCap_t ht_cap; 998 } MLAN_PACK_END IEEEtypes_HTCap_t, *pIEEEtypes_HTCap_t; 999 1000 /** HT Information IE */ 1001 typedef MLAN_PACK_START struct _IEEEtypes_HTInfo_t { 1002 /** Generic IE header */ 1003 IEEEtypes_Header_t ieee_hdr; 1004 /** HTInfo struct */ 1005 HTInfo_t ht_info; 1006 } MLAN_PACK_END IEEEtypes_HTInfo_t, *pIEEEtypes_HTInfo_t; 1007 1008 /** 20/40 BSS Coexistence IE */ 1009 typedef MLAN_PACK_START struct _IEEEtypes_2040BSSCo_t { 1010 /** Generic IE header */ 1011 IEEEtypes_Header_t ieee_hdr; 1012 /** BSSCo2040_t struct */ 1013 BSSCo2040_t bss_co_2040; 1014 } MLAN_PACK_END IEEEtypes_2040BSSCo_t, *pIEEEtypes_2040BSSCo_t; 1015 1016 /** Extended Capabilities IE */ 1017 typedef MLAN_PACK_START struct _IEEEtypes_ExtCap_t { 1018 /** Generic IE header */ 1019 IEEEtypes_Header_t ieee_hdr; 1020 /** ExtCap_t struct */ 1021 ExtCap_t ext_cap; 1022 } MLAN_PACK_END IEEEtypes_ExtCap_t, *pIEEEtypes_ExtCap_t; 1023 1024 /** Overlapping BSS Scan Parameters IE */ 1025 typedef MLAN_PACK_START struct _IEEEtypes_OverlapBSSScanParam_t { 1026 /** Generic IE header */ 1027 IEEEtypes_Header_t ieee_hdr; 1028 /** OBSSScanParam_t struct */ 1029 OBSSScanParam_t obss_scan_param; 1030 } MLAN_PACK_END IEEEtypes_OverlapBSSScanParam_t, 1031 *pIEEEtypes_OverlapBSSScanParam_t; 1032 1033 /** Maximum number of subbands in the IEEEtypes_SupportedChannels_t structure */ 1034 #define WLAN_11H_MAX_SUBBANDS 5 1035 1036 /** Maximum number of DFS channels configured in IEEEtypes_IBSS_DFS_t */ 1037 #define WLAN_11H_MAX_IBSS_DFS_CHANNELS 25 1038 1039 /** IEEE Power Constraint element (7.3.2.15) */ 1040 typedef MLAN_PACK_START struct { 1041 t_u8 element_id; /**< IEEE Element ID = 32 */ 1042 t_u8 len; /**< Element length after id and len */ 1043 t_u8 local_constraint; 1044 /**< Local power constraint applied to 11d 1045 chan info */ 1046 } MLAN_PACK_END IEEEtypes_PowerConstraint_t; 1047 1048 /** IEEE Power Capability element (7.3.2.16) */ 1049 typedef MLAN_PACK_START struct { 1050 t_u8 element_id; /**< IEEE Element ID = 33 */ 1051 t_u8 len; /**< Element length after id and len */ 1052 t_s8 min_tx_power_capability; 1053 /**< Minimum Transmit power (dBm) */ 1054 t_s8 max_tx_power_capability; 1055 /**< Maximum Transmit power (dBm) */ 1056 } MLAN_PACK_END IEEEtypes_PowerCapability_t; 1057 1058 /** IEEE TPC Report element (7.3.2.18) */ 1059 typedef MLAN_PACK_START struct { 1060 t_u8 element_id;/**< IEEE Element ID = 35 */ 1061 t_u8 len; /**< Element length after id and len */ 1062 t_s8 tx_power; /**< Max power used to transmit the TPC Report frame (dBm) */ 1063 t_s8 link_margin; 1064 /**< Link margin when TPC Request received (dB) */ 1065 } MLAN_PACK_END IEEEtypes_TPCReport_t; 1066 1067 /* IEEE Supported Channel sub-band description (7.3.2.19) */ 1068 /** 1069 * Sub-band description used in the supported channels element. 1070 */ 1071 typedef MLAN_PACK_START struct { 1072 t_u8 start_chan;/**< Starting channel in the subband */ 1073 t_u8 num_chans; /**< Number of channels in the subband */ 1074 1075 } MLAN_PACK_END IEEEtypes_SupportChan_Subband_t; 1076 1077 /* IEEE Supported Channel element (7.3.2.19) */ 1078 /** 1079 * Sent in association requests. Details the sub-bands and number 1080 * of channels supported in each subband 1081 */ 1082 typedef MLAN_PACK_START struct { 1083 t_u8 element_id;/**< IEEE Element ID = 36 */ 1084 t_u8 len; /**< Element length after id and len */ 1085 1086 /** Configured sub-bands information in the element */ 1087 IEEEtypes_SupportChan_Subband_t subband[WLAN_11H_MAX_SUBBANDS]; 1088 1089 } MLAN_PACK_END IEEEtypes_SupportedChannels_t; 1090 1091 /* IEEE Channel Switch Announcement Element (7.3.2.20) */ 1092 /** 1093 * Provided in beacons and probe responses. Used to advertise when 1094 * and to which channel it is changing to. Only starting STAs in 1095 * an IBSS and APs are allowed to originate a chan switch element. 1096 */ 1097 typedef MLAN_PACK_START struct { 1098 t_u8 element_id; /**< IEEE Element ID = 37 */ 1099 t_u8 len; /**< Element length after id and len */ 1100 t_u8 chan_switch_mode; /**< STA should not transmit any frames if 1 */ 1101 t_u8 new_channel_num; /**< Channel # that AP/IBSS is moving to */ 1102 t_u8 chan_switch_count; /**< # of TBTTs before channel switch */ 1103 1104 } MLAN_PACK_END IEEEtypes_ChanSwitchAnn_t; 1105 1106 /* IEEE Quiet Period Element (7.3.2.23) */ 1107 /** 1108 * Provided in beacons and probe responses. Indicates times during 1109 * which the STA should not be transmitting data. Only starting STAs in 1110 * an IBSS and APs are allowed to originate a quiet element. 1111 */ 1112 typedef MLAN_PACK_START struct { 1113 t_u8 element_id; /**< IEEE Element ID = 40 */ 1114 t_u8 len; /**< Element length after id and len */ 1115 t_u8 quiet_count; /**< Number of TBTTs until beacon with the quiet period */ 1116 t_u8 quiet_period; /**< Regular quiet period, # of TBTTS between periods */ 1117 t_u16 quiet_duration; 1118 /**< Duration of the quiet period in TUs */ 1119 t_u16 quiet_offset; /**< Offset in TUs from the TBTT for the quiet period */ 1120 1121 } MLAN_PACK_END IEEEtypes_Quiet_t; 1122 1123 /** 1124 *** @brief Map octet of the basic measurement report (7.3.2.22.1) 1125 **/ 1126 typedef MLAN_PACK_START struct { 1127 #ifdef BIG_ENDIAN_SUPPORT 1128 /**< Reserved */ 1129 t_u8 rsvd5_7:3; 1130 /**< Channel is unmeasured */ 1131 t_u8 unmeasured:1; 1132 /**< Radar detected on channel */ 1133 t_u8 radar:1; 1134 /**< Unidentified signal found on channel */ 1135 t_u8 unidentified_sig:1; 1136 /**< OFDM preamble detected on channel */ 1137 t_u8 ofdm_preamble:1; 1138 /**< At least one valid MPDU received on channel */ 1139 t_u8 bss:1; 1140 #else 1141 /**< At least one valid MPDU received on channel */ 1142 t_u8 bss:1; 1143 /**< OFDM preamble detected on channel */ 1144 t_u8 ofdm_preamble:1; 1145 /**< Unidentified signal found on channel */ 1146 t_u8 unidentified_sig:1; 1147 /**< Radar detected on channel */ 1148 t_u8 radar:1; 1149 /**< Channel is unmeasured */ 1150 t_u8 unmeasured:1; 1151 /**< Reserved */ 1152 t_u8 rsvd5_7:3; 1153 #endif /* BIG_ENDIAN_SUPPORT */ 1154 1155 } MLAN_PACK_END MeasRptBasicMap_t; 1156 1157 /* IEEE DFS Channel Map field (7.3.2.24) */ 1158 /** 1159 * Used to list supported channels and provide a octet "map" field which 1160 * contains a basic measurement report for that channel in the 1161 * IEEEtypes_IBSS_DFS_t element 1162 */ 1163 typedef MLAN_PACK_START struct { 1164 t_u8 channel_number; /**< Channel number */ 1165 MeasRptBasicMap_t rpt_map; 1166 /**< Basic measurement report for the channel */ 1167 1168 } MLAN_PACK_END IEEEtypes_ChannelMap_t; 1169 1170 /* IEEE IBSS DFS Element (7.3.2.24) */ 1171 /** 1172 * IBSS DFS element included in ad hoc beacons and probe responses. 1173 * Provides information regarding the IBSS DFS Owner as well as the 1174 * originating STAs supported channels and basic measurement results. 1175 */ 1176 typedef MLAN_PACK_START struct { 1177 t_u8 element_id; /**< IEEE Element ID = 41 */ 1178 t_u8 len; /**< Element length after id and len */ 1179 t_u8 dfs_owner[MLAN_MAC_ADDR_LENGTH]; 1180 /**< DFS Owner STA Address */ 1181 t_u8 dfs_recovery_interval; /**< DFS Recovery time in TBTTs */ 1182 1183 /** Variable length map field, one Map entry for each supported channel */ 1184 IEEEtypes_ChannelMap_t channel_map[WLAN_11H_MAX_IBSS_DFS_CHANNELS]; 1185 1186 } MLAN_PACK_END IEEEtypes_IBSS_DFS_t; 1187 1188 /* 802.11h BSS information kept for each BSSID received in scan results */ 1189 /** 1190 * IEEE BSS information needed from scan results for later processing in 1191 * join commands 1192 */ 1193 typedef struct { 1194 t_u8 sensed_11h; 1195 /**< Capability bit set or 11h IE found in this BSS */ 1196 1197 IEEEtypes_PowerConstraint_t power_constraint; 1198 /**< Power Constraint IE */ 1199 IEEEtypes_PowerCapability_t power_capability; 1200 /**< Power Capability IE */ 1201 IEEEtypes_TPCReport_t tpc_report; /**< TPC Report IE */ 1202 IEEEtypes_ChanSwitchAnn_t chan_switch_ann;/**< Channel Switch Announcement IE */ 1203 IEEEtypes_Quiet_t quiet; /**< Quiet IE */ 1204 IEEEtypes_IBSS_DFS_t ibss_dfs; /**< IBSS DFS Element IE */ 1205 1206 } wlan_11h_bss_info_t; 1207 1208 /** Ethernet packet type for TDLS */ 1209 #define MLAN_ETHER_PKT_TYPE_TDLS_ACTION (0x890D) 1210 1211 /*802.11z TDLS action frame type and strcuct */ 1212 typedef MLAN_PACK_START struct { 1213 /*link indentifier ie =101 */ 1214 t_u8 element_id; 1215 /*len = 18 */ 1216 t_u8 len; 1217 /** bssid */ 1218 t_u8 bssid[MLAN_MAC_ADDR_LENGTH]; 1219 /** init sta mac address */ 1220 t_u8 init_sta[MLAN_MAC_ADDR_LENGTH]; 1221 /** resp sta mac address */ 1222 t_u8 resp_sta[MLAN_MAC_ADDR_LENGTH]; 1223 } MLAN_PACK_END IEEEtypes_tdls_linkie; 1224 1225 /** action code for tdls setup request */ 1226 #define TDLS_SETUP_REQUEST 0 1227 /** action code for tdls setup response */ 1228 #define TDLS_SETUP_RESPONSE 1 1229 /** action code for tdls setup confirm */ 1230 #define TDLS_SETUP_CONFIRM 2 1231 /** action code for tdls tear down */ 1232 #define TDLS_TEARDOWN 3 1233 /** action code for tdls traffic indication */ 1234 #define TDLS_PEER_TRAFFIC_INDICATION 4 1235 /** action code for tdls channel switch request */ 1236 #define TDLS_CHANNEL_SWITCH_REQUEST 5 1237 /** action code for tdls channel switch response */ 1238 #define TDLS_CHANNEL_SWITCH_RESPONSE 6 1239 /** action code for tdls psm request */ 1240 #define TDLS_PEER_PSM_REQUEST 7 1241 /** action code for tdls psm response */ 1242 #define TDLS_PEER_PSM_RESPONSE 8 1243 /** action code for tdls traffic response */ 1244 #define TDLS_PEER_TRAFFIC_RESPONSE 9 1245 /** action code for tdls discovery request */ 1246 #define TDLS_DISCOVERY_REQUEST 10 1247 /** action code for TDLS discovery response */ 1248 #define TDLS_DISCOVERY_RESPONSE 14 1249 /** category public */ 1250 #define CATEGORY_PUBLIC 4 1251 1252 /** action code for 20/40 BSS Coexsitence Management frame */ 1253 #define BSS_20_40_COEX 0 1254 1255 #ifdef STA_SUPPORT 1256 /** Macro for maximum size of scan response buffer */ 1257 #define MAX_SCAN_RSP_BUF (16 * 1024) 1258 1259 /** Maximum number of channels that can be sent in user scan config */ 1260 #define WLAN_USER_SCAN_CHAN_MAX 50 1261 1262 /** Maximum length of SSID list */ 1263 #define MRVDRV_MAX_SSID_LIST_LENGTH 10 1264 1265 /** Scan all the channels in specified band */ 1266 #define BAND_SPECIFIED 0x80 1267 1268 /** 1269 * IOCTL SSID List sub-structure sent in wlan_ioctl_user_scan_cfg 1270 * 1271 * Used to specify SSID specific filters as well as SSID pattern matching 1272 * filters for scan result processing in firmware. 1273 */ 1274 typedef MLAN_PACK_START struct _wlan_user_scan_ssid { 1275 /** SSID */ 1276 t_u8 ssid[MLAN_MAX_SSID_LENGTH + 1]; 1277 /** Maximum length of SSID */ 1278 t_u8 max_len; 1279 } MLAN_PACK_END wlan_user_scan_ssid; 1280 1281 /** 1282 * @brief IOCTL channel sub-structure sent in wlan_ioctl_user_scan_cfg 1283 * 1284 * Multiple instances of this structure are included in the IOCTL command 1285 * to configure a instance of a scan on the specific channel. 1286 */ 1287 typedef MLAN_PACK_START struct _wlan_user_scan_chan { 1288 /** Channel Number to scan */ 1289 t_u8 chan_number; 1290 /** Radio type: 'B/G' Band = 0, 'A' Band = 1 */ 1291 t_u8 radio_type; 1292 /** Scan type: Active = 1, Passive = 2 */ 1293 t_u8 scan_type; 1294 /** Reserved */ 1295 t_u8 reserved; 1296 /** Scan duration in milliseconds; if 0 default used */ 1297 t_u32 scan_time; 1298 } MLAN_PACK_END wlan_user_scan_chan; 1299 1300 /** channel statictics */ 1301 typedef MLAN_PACK_START struct _ChanStatistics_t { 1302 /** channle number */ 1303 t_u8 chan_num; 1304 /** band info */ 1305 Band_Config_t bandcfg; 1306 /** flags */ 1307 t_u8 flags; 1308 /** noise */ 1309 t_s8 noise; 1310 /** total network */ 1311 t_u16 total_networks; 1312 /** scan duration */ 1313 t_u16 cca_scan_duration; 1314 /** busy duration */ 1315 t_u16 cca_busy_duration; 1316 } MLAN_PACK_END ChanStatistics_t; 1317 1318 /** Enhance ext scan type defination */ 1319 typedef enum _MLAN_EXT_SCAN_TYPE { 1320 EXT_SCAN_DEFAULT, 1321 EXT_SCAN_ENHANCE, 1322 EXT_SCAN_CANCEL, 1323 } MLAN_EXT_SCAN_TYPE; 1324 1325 /** 1326 * Input structure to configure an immediate scan cmd to firmware 1327 * 1328 * Specifies a number of parameters to be used in general for the scan 1329 * as well as a channel list (wlan_user_scan_chan) for each scan period 1330 * desired. 1331 */ 1332 typedef MLAN_PACK_START struct { 1333 /** 1334 * Flag set to keep the previous scan table intact 1335 * 1336 * If set, the scan results will accumulate, replacing any previous 1337 * matched entries for a BSS with the new scan data 1338 */ 1339 t_u8 keep_previous_scan; 1340 /** 1341 * BSS mode to be sent in the firmware command 1342 * 1343 * Field can be used to restrict the types of networks returned in the 1344 * scan. Valid settings are: 1345 * 1346 * - MLAN_SCAN_MODE_BSS (infrastructure) 1347 * - MLAN_SCAN_MODE_IBSS (adhoc) 1348 * - MLAN_SCAN_MODE_ANY (unrestricted, adhoc and infrastructure) 1349 */ 1350 t_u8 bss_mode; 1351 /** 1352 * Configure the number of probe requests for active chan scans 1353 */ 1354 t_u8 num_probes; 1355 /** 1356 * @brief ssid filter flag 1357 */ 1358 t_u8 ssid_filter; 1359 /** 1360 * @brief BSSID filter sent in the firmware command to limit the results 1361 */ 1362 t_u8 specific_bssid[MLAN_MAC_ADDR_LENGTH]; 1363 /** 1364 * SSID filter list used in the to limit the scan results 1365 */ 1366 wlan_user_scan_ssid ssid_list[MRVDRV_MAX_SSID_LIST_LENGTH]; 1367 /** 1368 * Variable number (fixed maximum) of channels to scan up 1369 */ 1370 wlan_user_scan_chan chan_list[WLAN_USER_SCAN_CHAN_MAX]; 1371 /** scan channel gap */ 1372 t_u16 scan_chan_gap; 1373 /** scan type: 0 legacy, 1: enhance scan*/ 1374 t_u8 ext_scan_type; 1375 /** flag to filer only probe response */ 1376 t_u8 proberesp_only; 1377 } MLAN_PACK_END wlan_user_scan_cfg; 1378 1379 /** Default scan interval in millisecond*/ 1380 #define DEFAULT_BGSCAN_INTERVAL 30000 1381 1382 /** action get all, except pps/uapsd config */ 1383 #define BG_SCAN_ACT_GET 0x0000 1384 /** action set all, except pps/uapsd config */ 1385 #define BG_SCAN_ACT_SET 0x0001 1386 /** action get pps/uapsd config */ 1387 #define BG_SCAN_ACT_GET_PPS_UAPSD 0x0100 1388 /** action set pps/uapsd config */ 1389 #define BG_SCAN_ACT_SET_PPS_UAPSD 0x0101 1390 /** action set all */ 1391 #define BG_SCAN_ACT_SET_ALL 0xff01 1392 /** ssid match */ 1393 #define BG_SCAN_SSID_MATCH 0x0001 1394 /** ssid match and RSSI exceeded */ 1395 #define BG_SCAN_SSID_RSSI_MATCH 0x0004 1396 /**wait for all channel scan to complete to report scan result*/ 1397 #define BG_SCAN_WAIT_ALL_CHAN_DONE 0x80000000 1398 /** Maximum number of channels that can be sent in bg scan config */ 1399 #define WLAN_BG_SCAN_CHAN_MAX 38 1400 1401 /** 1402 * Input structure to configure bs scan cmd to firmware 1403 */ 1404 typedef MLAN_PACK_START struct { 1405 /** action */ 1406 t_u16 action; 1407 /** enable/disable */ 1408 t_u8 enable; 1409 /** BSS type: 1410 * MLAN_SCAN_MODE_BSS (infrastructure) 1411 * MLAN_SCAN_MODE_IBSS (adhoc) 1412 * MLAN_SCAN_MODE_ANY (unrestricted, adhoc and infrastructure) 1413 */ 1414 t_u8 bss_type; 1415 /** number of channel scanned during each scan */ 1416 t_u8 chan_per_scan; 1417 /** interval between consecutive scan */ 1418 t_u32 scan_interval; 1419 /** bit 0: ssid match bit 1: ssid match and SNR exceeded 1420 * bit 2: ssid match and RSSI exceeded 1421 * bit 31: wait for all channel scan to complete to report scan result 1422 */ 1423 t_u32 report_condition; 1424 /* Configure the number of probe requests for active chan scans */ 1425 t_u8 num_probes; 1426 /** RSSI threshold */ 1427 t_u8 rssi_threshold; 1428 /** SNR threshold */ 1429 t_u8 snr_threshold; 1430 /** repeat count */ 1431 t_u16 repeat_count; 1432 /** start later flag */ 1433 t_u16 start_later; 1434 /** SSID filter list used in the to limit the scan results */ 1435 wlan_user_scan_ssid ssid_list[MRVDRV_MAX_SSID_LIST_LENGTH]; 1436 /** Variable number (fixed maximum) of channels to scan up */ 1437 wlan_user_scan_chan chan_list[WLAN_BG_SCAN_CHAN_MAX]; 1438 /** scan channel gap */ 1439 t_u16 scan_chan_gap; 1440 } MLAN_PACK_END wlan_bgscan_cfg; 1441 #endif /* STA_SUPPORT */ 1442 1443 #ifdef PRAGMA_PACK 1444 #pragma pack(pop) 1445 #endif 1446 1447 /** BSSDescriptor_t 1448 * Structure used to store information for beacon/probe response 1449 */ 1450 typedef struct _BSSDescriptor_t { 1451 /** MAC address */ 1452 mlan_802_11_mac_addr mac_address; 1453 1454 /** SSID */ 1455 mlan_802_11_ssid ssid; 1456 1457 /** WEP encryption requirement */ 1458 t_u32 privacy; 1459 1460 /** Receive signal strength in dBm */ 1461 t_s32 rssi; 1462 1463 /** Channel */ 1464 t_u32 channel; 1465 1466 /** Freq */ 1467 t_u32 freq; 1468 1469 /** Beacon period */ 1470 t_u16 beacon_period; 1471 1472 /** ATIM window */ 1473 t_u32 atim_window; 1474 1475 /** ERP flags */ 1476 t_u8 erp_flags; 1477 1478 /** Type of network in use */ 1479 WLAN_802_11_NETWORK_TYPE network_type_use; 1480 1481 /** Network infrastructure mode */ 1482 t_u32 bss_mode; 1483 1484 /** Network supported rates */ 1485 WLAN_802_11_RATES supported_rates; 1486 1487 /** Supported data rates */ 1488 t_u8 data_rates[WLAN_SUPPORTED_RATES]; 1489 1490 /** Current channel bandwidth 1491 * 0 : 20MHZ 1492 * 1 : 40MHZ 1493 * 2 : 80MHZ 1494 * 3 : 160MHZ 1495 */ 1496 t_u8 curr_bandwidth; 1497 1498 /** Network band. 1499 * BAND_B(0x01): 'b' band 1500 * BAND_G(0x02): 'g' band 1501 * BAND_A(0X04): 'a' band 1502 */ 1503 t_u16 bss_band; 1504 1505 /** TSF timestamp from the current firmware TSF */ 1506 t_u64 network_tsf; 1507 1508 /** TSF value included in the beacon/probe response */ 1509 t_u8 time_stamp[8]; 1510 1511 /** PHY parameter set */ 1512 IEEEtypes_PhyParamSet_t phy_param_set; 1513 1514 /** SS parameter set */ 1515 IEEEtypes_SsParamSet_t ss_param_set; 1516 1517 /** Capability information */ 1518 IEEEtypes_CapInfo_t cap_info; 1519 1520 /** WMM IE */ 1521 IEEEtypes_WmmParameter_t wmm_ie; 1522 1523 /** 802.11h BSS information */ 1524 wlan_11h_bss_info_t wlan_11h_bss_info; 1525 1526 /** Indicate disabling 11n when associate with AP */ 1527 t_u8 disable_11n; 1528 /** 802.11n BSS information */ 1529 /** HT Capabilities IE */ 1530 IEEEtypes_HTCap_t *pht_cap; 1531 /** HT Capabilities Offset */ 1532 t_u16 ht_cap_offset; 1533 /** HT Information IE */ 1534 IEEEtypes_HTInfo_t *pht_info; 1535 /** HT Information Offset */ 1536 t_u16 ht_info_offset; 1537 /** 20/40 BSS Coexistence IE */ 1538 IEEEtypes_2040BSSCo_t *pbss_co_2040; 1539 /** 20/40 BSS Coexistence Offset */ 1540 t_u16 bss_co_2040_offset; 1541 /** Extended Capabilities IE */ 1542 IEEEtypes_ExtCap_t *pext_cap; 1543 /** Extended Capabilities Offset */ 1544 t_u16 ext_cap_offset; 1545 /** Overlapping BSS Scan Parameters IE */ 1546 IEEEtypes_OverlapBSSScanParam_t *poverlap_bss_scan_param; 1547 /** Overlapping BSS Scan Parameters Offset */ 1548 t_u16 overlap_bss_offset; 1549 1550 #ifdef STA_SUPPORT 1551 /** Country information set */ 1552 IEEEtypes_CountryInfoFullSet_t country_info; 1553 #endif /* STA_SUPPORT */ 1554 1555 /** WPA IE */ 1556 IEEEtypes_VendorSpecific_t *pwpa_ie; 1557 /** WPA IE offset in the beacon buffer */ 1558 t_u16 wpa_offset; 1559 /** RSN IE */ 1560 IEEEtypes_Generic_t *prsn_ie; 1561 /** RSN IE offset in the beacon buffer */ 1562 t_u16 rsn_offset; 1563 #ifdef STA_SUPPORT 1564 /** WAPI IE */ 1565 IEEEtypes_Generic_t *pwapi_ie; 1566 /** WAPI IE offset in the beacon buffer */ 1567 t_u16 wapi_offset; 1568 #endif 1569 /* Mobility domain IE */ 1570 IEEEtypes_MobilityDomain_t *pmd_ie; 1571 /** Mobility domain IE offset in the beacon buffer */ 1572 t_u16 md_offset; 1573 1574 /** Pointer to the returned scan response */ 1575 t_u8 *pbeacon_buf; 1576 /** Length of the stored scan response */ 1577 t_u32 beacon_buf_size; 1578 /** Max allocated size for updated scan response */ 1579 t_u32 beacon_buf_size_max; 1580 1581 } BSSDescriptor_t, *pBSSDescriptor_t; 1582 1583 #endif /* !_MLAN_IEEE_H_ */ 1584