Home | History | Annotate | Download | only in common
      1 /*
      2  * IEEE 802.11 Frame type definitions
      3  * Copyright (c) 2002-2009, Jouni Malinen <j (at) w1.fi>
      4  * Copyright (c) 2007-2008 Intel Corporation
      5  *
      6  * This software may be distributed under the terms of the BSD license.
      7  * See README for more details.
      8  */
      9 
     10 #ifndef IEEE802_11_DEFS_H
     11 #define IEEE802_11_DEFS_H
     12 
     13 /* IEEE 802.11 defines */
     14 
     15 #define WLAN_FC_PVER		0x0003
     16 #define WLAN_FC_TODS		0x0100
     17 #define WLAN_FC_FROMDS		0x0200
     18 #define WLAN_FC_MOREFRAG	0x0400
     19 #define WLAN_FC_RETRY		0x0800
     20 #define WLAN_FC_PWRMGT		0x1000
     21 #define WLAN_FC_MOREDATA	0x2000
     22 #define WLAN_FC_ISWEP		0x4000
     23 #define WLAN_FC_ORDER		0x8000
     24 
     25 #define WLAN_FC_GET_TYPE(fc)	(((fc) & 0x000c) >> 2)
     26 #define WLAN_FC_GET_STYPE(fc)	(((fc) & 0x00f0) >> 4)
     27 
     28 #define WLAN_GET_SEQ_FRAG(seq) ((seq) & (BIT(3) | BIT(2) | BIT(1) | BIT(0)))
     29 #define WLAN_GET_SEQ_SEQ(seq) \
     30 	(((seq) & (~(BIT(3) | BIT(2) | BIT(1) | BIT(0)))) >> 4)
     31 
     32 #define WLAN_FC_TYPE_MGMT		0
     33 #define WLAN_FC_TYPE_CTRL		1
     34 #define WLAN_FC_TYPE_DATA		2
     35 
     36 /* management */
     37 #define WLAN_FC_STYPE_ASSOC_REQ		0
     38 #define WLAN_FC_STYPE_ASSOC_RESP	1
     39 #define WLAN_FC_STYPE_REASSOC_REQ	2
     40 #define WLAN_FC_STYPE_REASSOC_RESP	3
     41 #define WLAN_FC_STYPE_PROBE_REQ		4
     42 #define WLAN_FC_STYPE_PROBE_RESP	5
     43 #define WLAN_FC_STYPE_BEACON		8
     44 #define WLAN_FC_STYPE_ATIM		9
     45 #define WLAN_FC_STYPE_DISASSOC		10
     46 #define WLAN_FC_STYPE_AUTH		11
     47 #define WLAN_FC_STYPE_DEAUTH		12
     48 #define WLAN_FC_STYPE_ACTION		13
     49 
     50 /* control */
     51 #define WLAN_FC_STYPE_PSPOLL		10
     52 #define WLAN_FC_STYPE_RTS		11
     53 #define WLAN_FC_STYPE_CTS		12
     54 #define WLAN_FC_STYPE_ACK		13
     55 #define WLAN_FC_STYPE_CFEND		14
     56 #define WLAN_FC_STYPE_CFENDACK		15
     57 
     58 /* data */
     59 #define WLAN_FC_STYPE_DATA		0
     60 #define WLAN_FC_STYPE_DATA_CFACK	1
     61 #define WLAN_FC_STYPE_DATA_CFPOLL	2
     62 #define WLAN_FC_STYPE_DATA_CFACKPOLL	3
     63 #define WLAN_FC_STYPE_NULLFUNC		4
     64 #define WLAN_FC_STYPE_CFACK		5
     65 #define WLAN_FC_STYPE_CFPOLL		6
     66 #define WLAN_FC_STYPE_CFACKPOLL		7
     67 #define WLAN_FC_STYPE_QOS_DATA		8
     68 #define WLAN_FC_STYPE_QOS_DATA_CFACK	9
     69 #define WLAN_FC_STYPE_QOS_DATA_CFPOLL	10
     70 #define WLAN_FC_STYPE_QOS_DATA_CFACKPOLL	11
     71 #define WLAN_FC_STYPE_QOS_NULL		12
     72 #define WLAN_FC_STYPE_QOS_CFPOLL	14
     73 #define WLAN_FC_STYPE_QOS_CFACKPOLL	15
     74 
     75 /* Authentication algorithms */
     76 #define WLAN_AUTH_OPEN			0
     77 #define WLAN_AUTH_SHARED_KEY		1
     78 #define WLAN_AUTH_FT			2
     79 #define WLAN_AUTH_LEAP			128
     80 
     81 #define WLAN_AUTH_CHALLENGE_LEN 128
     82 
     83 #define WLAN_CAPABILITY_ESS BIT(0)
     84 #define WLAN_CAPABILITY_IBSS BIT(1)
     85 #define WLAN_CAPABILITY_CF_POLLABLE BIT(2)
     86 #define WLAN_CAPABILITY_CF_POLL_REQUEST BIT(3)
     87 #define WLAN_CAPABILITY_PRIVACY BIT(4)
     88 #define WLAN_CAPABILITY_SHORT_PREAMBLE BIT(5)
     89 #define WLAN_CAPABILITY_PBCC BIT(6)
     90 #define WLAN_CAPABILITY_CHANNEL_AGILITY BIT(7)
     91 #define WLAN_CAPABILITY_SPECTRUM_MGMT BIT(8)
     92 #define WLAN_CAPABILITY_SHORT_SLOT_TIME BIT(10)
     93 #define WLAN_CAPABILITY_DSSS_OFDM BIT(13)
     94 
     95 /* Status codes (IEEE 802.11-2007, 7.3.1.9, Table 7-23) */
     96 #define WLAN_STATUS_SUCCESS 0
     97 #define WLAN_STATUS_UNSPECIFIED_FAILURE 1
     98 #define WLAN_STATUS_TDLS_WAKEUP_ALTERNATE 2
     99 #define WLAN_STATUS_TDLS_WAKEUP_REJECT 3
    100 #define WLAN_STATUS_SECURITY_DISABLED 5
    101 #define WLAN_STATUS_UNACCEPTABLE_LIFETIME 6
    102 #define WLAN_STATUS_NOT_IN_SAME_BSS 7
    103 #define WLAN_STATUS_CAPS_UNSUPPORTED 10
    104 #define WLAN_STATUS_REASSOC_NO_ASSOC 11
    105 #define WLAN_STATUS_ASSOC_DENIED_UNSPEC 12
    106 #define WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 13
    107 #define WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION 14
    108 #define WLAN_STATUS_CHALLENGE_FAIL 15
    109 #define WLAN_STATUS_AUTH_TIMEOUT 16
    110 #define WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 17
    111 #define WLAN_STATUS_ASSOC_DENIED_RATES 18
    112 /* IEEE 802.11b */
    113 #define WLAN_STATUS_ASSOC_DENIED_NOSHORT 19
    114 #define WLAN_STATUS_ASSOC_DENIED_NOPBCC 20
    115 #define WLAN_STATUS_ASSOC_DENIED_NOAGILITY 21
    116 /* IEEE 802.11h */
    117 #define WLAN_STATUS_SPEC_MGMT_REQUIRED 22
    118 #define WLAN_STATUS_PWR_CAPABILITY_NOT_VALID 23
    119 #define WLAN_STATUS_SUPPORTED_CHANNEL_NOT_VALID 24
    120 /* IEEE 802.11g */
    121 #define WLAN_STATUS_ASSOC_DENIED_NO_SHORT_SLOT_TIME 25
    122 #define WLAN_STATUS_ASSOC_DENIED_NO_DSSS_OFDM 26
    123 #define WLAN_STATUS_ASSOC_DENIED_NO_HT 27
    124 #define WLAN_STATUS_R0KH_UNREACHABLE 28
    125 #define WLAN_STATUS_ASSOC_DENIED_NO_PCO 29
    126 /* IEEE 802.11w */
    127 #define WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY 30
    128 #define WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION 31
    129 #define WLAN_STATUS_UNSPECIFIED_QOS_FAILURE 32
    130 #define WLAN_STATUS_REQUEST_DECLINED 37
    131 #define WLAN_STATUS_INVALID_PARAMETERS 38
    132 /* IEEE 802.11i */
    133 #define WLAN_STATUS_INVALID_IE 40
    134 #define WLAN_STATUS_GROUP_CIPHER_NOT_VALID 41
    135 #define WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID 42
    136 #define WLAN_STATUS_AKMP_NOT_VALID 43
    137 #define WLAN_STATUS_UNSUPPORTED_RSN_IE_VERSION 44
    138 #define WLAN_STATUS_INVALID_RSN_IE_CAPAB 45
    139 #define WLAN_STATUS_CIPHER_REJECTED_PER_POLICY 46
    140 #define WLAN_STATUS_TS_NOT_CREATED 47
    141 #define WLAN_STATUS_DIRECT_LINK_NOT_ALLOWED 48
    142 #define WLAN_STATUS_DEST_STA_NOT_PRESENT 49
    143 #define WLAN_STATUS_DEST_STA_NOT_QOS_STA 50
    144 #define WLAN_STATUS_ASSOC_DENIED_LISTEN_INT_TOO_LARGE 51
    145 /* IEEE 802.11r */
    146 #define WLAN_STATUS_INVALID_FT_ACTION_FRAME_COUNT 52
    147 #define WLAN_STATUS_INVALID_PMKID 53
    148 #define WLAN_STATUS_INVALID_MDIE 54
    149 #define WLAN_STATUS_INVALID_FTIE 55
    150 #define WLAN_STATUS_GAS_ADV_PROTO_NOT_SUPPORTED 59
    151 #define WLAN_STATUS_NO_OUTSTANDING_GAS_REQ 60
    152 #define WLAN_STATUS_GAS_RESP_NOT_RECEIVED 61
    153 #define WLAN_STATUS_STA_TIMED_OUT_WAITING_FOR_GAS_RESP 62
    154 #define WLAN_STATUS_GAS_RESP_LARGER_THAN_LIMIT 63
    155 #define WLAN_STATUS_REQ_REFUSED_HOME 64
    156 #define WLAN_STATUS_ADV_SRV_UNREACHABLE 65
    157 #define WLAN_STATUS_REQ_REFUSED_SSPN 67
    158 #define WLAN_STATUS_REQ_REFUSED_UNAUTH_ACCESS 68
    159 #define WLAN_STATUS_INVALID_RSNIE 72
    160 #define WLAN_STATUS_TRANSMISSION_FAILURE 79
    161 
    162 /* Reason codes (IEEE 802.11-2007, 7.3.1.7, Table 7-22) */
    163 #define WLAN_REASON_UNSPECIFIED 1
    164 #define WLAN_REASON_PREV_AUTH_NOT_VALID 2
    165 #define WLAN_REASON_DEAUTH_LEAVING 3
    166 #define WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4
    167 #define WLAN_REASON_DISASSOC_AP_BUSY 5
    168 #define WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6
    169 #define WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 7
    170 #define WLAN_REASON_DISASSOC_STA_HAS_LEFT 8
    171 #define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9
    172 /* IEEE 802.11h */
    173 #define WLAN_REASON_PWR_CAPABILITY_NOT_VALID 10
    174 #define WLAN_REASON_SUPPORTED_CHANNEL_NOT_VALID 11
    175 /* IEEE 802.11i */
    176 #define WLAN_REASON_INVALID_IE 13
    177 #define WLAN_REASON_MICHAEL_MIC_FAILURE 14
    178 #define WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT 15
    179 #define WLAN_REASON_GROUP_KEY_UPDATE_TIMEOUT 16
    180 #define WLAN_REASON_IE_IN_4WAY_DIFFERS 17
    181 #define WLAN_REASON_GROUP_CIPHER_NOT_VALID 18
    182 #define WLAN_REASON_PAIRWISE_CIPHER_NOT_VALID 19
    183 #define WLAN_REASON_AKMP_NOT_VALID 20
    184 #define WLAN_REASON_UNSUPPORTED_RSN_IE_VERSION 21
    185 #define WLAN_REASON_INVALID_RSN_IE_CAPAB 22
    186 #define WLAN_REASON_IEEE_802_1X_AUTH_FAILED 23
    187 #define WLAN_REASON_CIPHER_SUITE_REJECTED 24
    188 #define WLAN_REASON_TDLS_TEARDOWN_UNREACHABLE 25
    189 #define WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED 26
    190 /* IEEE 802.11e */
    191 #define WLAN_REASON_DISASSOC_LOW_ACK 34
    192 
    193 
    194 /* Information Element IDs */
    195 #define WLAN_EID_SSID 0
    196 #define WLAN_EID_SUPP_RATES 1
    197 #define WLAN_EID_FH_PARAMS 2
    198 #define WLAN_EID_DS_PARAMS 3
    199 #define WLAN_EID_CF_PARAMS 4
    200 #define WLAN_EID_TIM 5
    201 #define WLAN_EID_IBSS_PARAMS 6
    202 #define WLAN_EID_COUNTRY 7
    203 #define WLAN_EID_CHALLENGE 16
    204 /* EIDs defined by IEEE 802.11h - START */
    205 #define WLAN_EID_PWR_CONSTRAINT 32
    206 #define WLAN_EID_PWR_CAPABILITY 33
    207 #define WLAN_EID_TPC_REQUEST 34
    208 #define WLAN_EID_TPC_REPORT 35
    209 #define WLAN_EID_SUPPORTED_CHANNELS 36
    210 #define WLAN_EID_CHANNEL_SWITCH 37
    211 #define WLAN_EID_MEASURE_REQUEST 38
    212 #define WLAN_EID_MEASURE_REPORT 39
    213 #define WLAN_EID_QUITE 40
    214 #define WLAN_EID_IBSS_DFS 41
    215 /* EIDs defined by IEEE 802.11h - END */
    216 #define WLAN_EID_ERP_INFO 42
    217 #define WLAN_EID_HT_CAP 45
    218 #define WLAN_EID_RSN 48
    219 #define WLAN_EID_EXT_SUPP_RATES 50
    220 #define WLAN_EID_MOBILITY_DOMAIN 54
    221 #define WLAN_EID_FAST_BSS_TRANSITION 55
    222 #define WLAN_EID_TIMEOUT_INTERVAL 56
    223 #define WLAN_EID_RIC_DATA 57
    224 #define WLAN_EID_HT_OPERATION 61
    225 #define WLAN_EID_SECONDARY_CHANNEL_OFFSET 62
    226 #define WLAN_EID_TIME_ADVERTISEMENT 69
    227 #define WLAN_EID_20_40_BSS_COEXISTENCE 72
    228 #define WLAN_EID_20_40_BSS_INTOLERANT 73
    229 #define WLAN_EID_OVERLAPPING_BSS_SCAN_PARAMS 74
    230 #define WLAN_EID_MMIE 76
    231 #define WLAN_EID_TIME_ZONE 98
    232 #define WLAN_EID_LINK_ID 101
    233 #define WLAN_EID_INTERWORKING 107
    234 #define WLAN_EID_ADV_PROTO 108
    235 #define WLAN_EID_ROAMING_CONSORTIUM 111
    236 #define WLAN_EID_EXT_CAPAB 127
    237 #define WLAN_EID_VENDOR_SPECIFIC 221
    238 
    239 
    240 /* Action frame categories (IEEE 802.11-2007, 7.3.1.11, Table 7-24) */
    241 #define WLAN_ACTION_SPECTRUM_MGMT 0
    242 #define WLAN_ACTION_QOS 1
    243 #define WLAN_ACTION_DLS 2
    244 #define WLAN_ACTION_BLOCK_ACK 3
    245 #define WLAN_ACTION_PUBLIC 4
    246 #define WLAN_ACTION_RADIO_MEASUREMENT 5
    247 #define WLAN_ACTION_FT 6
    248 #define WLAN_ACTION_HT 7
    249 #define WLAN_ACTION_SA_QUERY 8
    250 #define WLAN_ACTION_WNM 10
    251 #define WLAN_ACTION_UNPROTECTED_WNM 11
    252 #define WLAN_ACTION_TDLS 12
    253 #define WLAN_ACTION_WMM 17 /* WMM Specification 1.1 */
    254 #define WLAN_ACTION_VENDOR_SPECIFIC 127
    255 
    256 /* Public action codes */
    257 #define WLAN_PA_VENDOR_SPECIFIC 9
    258 #define WLAN_PA_GAS_INITIAL_REQ 10
    259 #define WLAN_PA_GAS_INITIAL_RESP 11
    260 #define WLAN_PA_GAS_COMEBACK_REQ 12
    261 #define WLAN_PA_GAS_COMEBACK_RESP 13
    262 #define WLAN_TDLS_DISCOVERY_RESPONSE 14
    263 
    264 /* SA Query Action frame (IEEE 802.11w/D8.0, 7.4.9) */
    265 #define WLAN_SA_QUERY_REQUEST 0
    266 #define WLAN_SA_QUERY_RESPONSE 1
    267 
    268 #define WLAN_SA_QUERY_TR_ID_LEN 2
    269 
    270 /* TDLS action codes */
    271 #define WLAN_TDLS_SETUP_REQUEST 0
    272 #define WLAN_TDLS_SETUP_RESPONSE 1
    273 #define WLAN_TDLS_SETUP_CONFIRM 2
    274 #define WLAN_TDLS_TEARDOWN 3
    275 #define WLAN_TDLS_PEER_TRAFFIC_INDICATION 4
    276 #define WLAN_TDLS_CHANNEL_SWITCH_REQUEST 5
    277 #define WLAN_TDLS_CHANNEL_SWITCH_RESPONSE 6
    278 #define WLAN_TDLS_PEER_PSM_REQUEST 7
    279 #define WLAN_TDLS_PEER_PSM_RESPONSE 8
    280 #define WLAN_TDLS_PEER_TRAFFIC_RESPONSE 9
    281 #define WLAN_TDLS_DISCOVERY_REQUEST 10
    282 
    283 /* Timeout Interval Type */
    284 #define WLAN_TIMEOUT_REASSOC_DEADLINE 1
    285 #define WLAN_TIMEOUT_KEY_LIFETIME 2
    286 #define WLAN_TIMEOUT_ASSOC_COMEBACK 3
    287 
    288 /* Interworking element (IEEE 802.11u) - Access Network Options */
    289 #define INTERWORKING_ANO_ACCESS_NETWORK_MASK 0x0f
    290 #define INTERWORKING_ANO_INTERNET 0x10
    291 #define INTERWORKING_ANO_ASRA 0x20
    292 #define INTERWORKING_ANO_ESR 0x40
    293 #define INTERWORKING_ANO_UESA 0x80
    294 
    295 #define INTERWORKING_ANT_PRIVATE 0
    296 #define INTERWORKING_ANT_PRIVATE_WITH_GUEST 1
    297 #define INTERWORKING_ANT_CHARGEABLE_PUBLIC 2
    298 #define INTERWORKING_ANT_FREE_PUBLIC 3
    299 #define INTERWORKING_ANT_PERSONAL_DEVICE 4
    300 #define INTERWORKING_ANT_EMERGENCY_SERVICES 5
    301 #define INTERWORKING_ANT_TEST 6
    302 #define INTERWORKING_ANT_WILDCARD 15
    303 
    304 /* Advertisement Protocol ID definitions (IEEE Std 802.11u-2011) */
    305 enum adv_proto_id {
    306 	ACCESS_NETWORK_QUERY_PROTOCOL = 0,
    307 	MIH_INFO_SERVICE = 1,
    308 	MIH_CMD_AND_EVENT_DISCOVERY = 2,
    309 	EMERGENCY_ALERT_SYSTEM = 3,
    310 	ADV_PROTO_VENDOR_SPECIFIC = 221
    311 };
    312 
    313 /* Access Network Query Protocol info ID definitions (IEEE Std 802.11u-2011) */
    314 enum anqp_info_id {
    315 	ANQP_QUERY_LIST = 256,
    316 	ANQP_CAPABILITY_LIST = 257,
    317 	ANQP_VENUE_NAME = 258,
    318 	ANQP_EMERGENCY_CALL_NUMBER = 259,
    319 	ANQP_NETWORK_AUTH_TYPE = 260,
    320 	ANQP_ROAMING_CONSORTIUM = 261,
    321 	ANQP_IP_ADDR_TYPE_AVAILABILITY = 262,
    322 	ANQP_NAI_REALM = 263,
    323 	ANQP_3GPP_CELLULAR_NETWORK = 264,
    324 	ANQP_AP_GEOSPATIAL_LOCATION = 265,
    325 	ANQP_AP_CIVIC_LOCATION = 266,
    326 	ANQP_AP_LOCATION_PUBLIC_URI = 267,
    327 	ANQP_DOMAIN_NAME = 268,
    328 	ANQP_EMERGENCY_ALERT_URI = 269,
    329 	ANQP_EMERGENCY_NAI = 271,
    330 	ANQP_VENDOR_SPECIFIC = 56797
    331 };
    332 
    333 /* NAI Realm list - EAP Method subfield - Authentication Parameter ID */
    334 enum nai_realm_eap_auth_param {
    335 	NAI_REALM_EAP_AUTH_EXPANDED_EAP_METHOD = 1,
    336 	NAI_REALM_EAP_AUTH_NON_EAP_INNER_AUTH = 2,
    337 	NAI_REALM_EAP_AUTH_INNER_AUTH_EAP_METHOD = 3,
    338 	NAI_REALM_EAP_AUTH_EXPANDED_INNER_EAP_METHOD = 4,
    339 	NAI_REALM_EAP_AUTH_CRED_TYPE = 5,
    340 	NAI_REALM_EAP_AUTH_TUNNELED_CRED_TYPE = 6,
    341 	NAI_REALM_EAP_AUTH_VENDOR_SPECIFIC = 221
    342 };
    343 
    344 enum nai_realm_eap_auth_inner_non_eap {
    345 	NAI_REALM_INNER_NON_EAP_PAP = 1,
    346 	NAI_REALM_INNER_NON_EAP_CHAP = 2,
    347 	NAI_REALM_INNER_NON_EAP_MSCHAP = 3,
    348 	NAI_REALM_INNER_NON_EAP_MSCHAPV2 = 4
    349 };
    350 
    351 enum nai_realm_eap_cred_type {
    352 	NAI_REALM_CRED_TYPE_SIM = 1,
    353 	NAI_REALM_CRED_TYPE_USIM = 2,
    354 	NAI_REALM_CRED_TYPE_NFC_SECURE_ELEMENT = 3,
    355 	NAI_REALM_CRED_TYPE_HARDWARE_TOKEN = 4,
    356 	NAI_REALM_CRED_TYPE_SOFTOKEN = 5,
    357 	NAI_REALM_CRED_TYPE_CERTIFICATE = 6,
    358 	NAI_REALM_CRED_TYPE_USERNAME_PASSWORD = 7,
    359 	NAI_REALM_CRED_TYPE_NONE = 8,
    360 	NAI_REALM_CRED_TYPE_ANONYMOUS = 9,
    361 	NAI_REALM_CRED_TYPE_VENDOR_SPECIFIC = 10
    362 };
    363 
    364 #ifdef _MSC_VER
    365 #pragma pack(push, 1)
    366 #endif /* _MSC_VER */
    367 
    368 struct ieee80211_hdr {
    369 	le16 frame_control;
    370 	le16 duration_id;
    371 	u8 addr1[6];
    372 	u8 addr2[6];
    373 	u8 addr3[6];
    374 	le16 seq_ctrl;
    375 	/* followed by 'u8 addr4[6];' if ToDS and FromDS is set in data frame
    376 	 */
    377 } STRUCT_PACKED;
    378 
    379 #define IEEE80211_DA_FROMDS addr1
    380 #define IEEE80211_BSSID_FROMDS addr2
    381 #define IEEE80211_SA_FROMDS addr3
    382 
    383 #define IEEE80211_HDRLEN (sizeof(struct ieee80211_hdr))
    384 
    385 #define IEEE80211_FC(type, stype) host_to_le16((type << 2) | (stype << 4))
    386 
    387 struct ieee80211_mgmt {
    388 	le16 frame_control;
    389 	le16 duration;
    390 	u8 da[6];
    391 	u8 sa[6];
    392 	u8 bssid[6];
    393 	le16 seq_ctrl;
    394 	union {
    395 		struct {
    396 			le16 auth_alg;
    397 			le16 auth_transaction;
    398 			le16 status_code;
    399 			/* possibly followed by Challenge text */
    400 			u8 variable[0];
    401 		} STRUCT_PACKED auth;
    402 		struct {
    403 			le16 reason_code;
    404 			u8 variable[0];
    405 		} STRUCT_PACKED deauth;
    406 		struct {
    407 			le16 capab_info;
    408 			le16 listen_interval;
    409 			/* followed by SSID and Supported rates */
    410 			u8 variable[0];
    411 		} STRUCT_PACKED assoc_req;
    412 		struct {
    413 			le16 capab_info;
    414 			le16 status_code;
    415 			le16 aid;
    416 			/* followed by Supported rates */
    417 			u8 variable[0];
    418 		} STRUCT_PACKED assoc_resp, reassoc_resp;
    419 		struct {
    420 			le16 capab_info;
    421 			le16 listen_interval;
    422 			u8 current_ap[6];
    423 			/* followed by SSID and Supported rates */
    424 			u8 variable[0];
    425 		} STRUCT_PACKED reassoc_req;
    426 		struct {
    427 			le16 reason_code;
    428 			u8 variable[0];
    429 		} STRUCT_PACKED disassoc;
    430 		struct {
    431 			u8 timestamp[8];
    432 			le16 beacon_int;
    433 			le16 capab_info;
    434 			/* followed by some of SSID, Supported rates,
    435 			 * FH Params, DS Params, CF Params, IBSS Params, TIM */
    436 			u8 variable[0];
    437 		} STRUCT_PACKED beacon;
    438 		struct {
    439 			/* only variable items: SSID, Supported rates */
    440 			u8 variable[0];
    441 		} STRUCT_PACKED probe_req;
    442 		struct {
    443 			u8 timestamp[8];
    444 			le16 beacon_int;
    445 			le16 capab_info;
    446 			/* followed by some of SSID, Supported rates,
    447 			 * FH Params, DS Params, CF Params, IBSS Params */
    448 			u8 variable[0];
    449 		} STRUCT_PACKED probe_resp;
    450 		struct {
    451 			u8 category;
    452 			union {
    453 				struct {
    454 					u8 action_code;
    455 					u8 dialog_token;
    456 					u8 status_code;
    457 					u8 variable[0];
    458 				} STRUCT_PACKED wmm_action;
    459 				struct{
    460 					u8 action_code;
    461 					u8 element_id;
    462 					u8 length;
    463 					u8 switch_mode;
    464 					u8 new_chan;
    465 					u8 switch_count;
    466 				} STRUCT_PACKED chan_switch;
    467 				struct {
    468 					u8 action;
    469 					u8 sta_addr[ETH_ALEN];
    470 					u8 target_ap_addr[ETH_ALEN];
    471 					u8 variable[0]; /* FT Request */
    472 				} STRUCT_PACKED ft_action_req;
    473 				struct {
    474 					u8 action;
    475 					u8 sta_addr[ETH_ALEN];
    476 					u8 target_ap_addr[ETH_ALEN];
    477 					le16 status_code;
    478 					u8 variable[0]; /* FT Request */
    479 				} STRUCT_PACKED ft_action_resp;
    480 				struct {
    481 					u8 action;
    482 					u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
    483 				} STRUCT_PACKED sa_query_req;
    484 				struct {
    485 					u8 action; /* */
    486 					u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
    487 				} STRUCT_PACKED sa_query_resp;
    488 				struct {
    489 					u8 action;
    490 					u8 variable[0];
    491 				} STRUCT_PACKED public_action;
    492 				struct {
    493 					u8 action; /* 9 */
    494 					u8 oui[3];
    495 					/* Vendor-specific content */
    496 					u8 variable[0];
    497 				} STRUCT_PACKED vs_public_action;
    498 				struct {
    499 					u8 action; /* 7 */
    500 					u8 dialog_token;
    501 					u8 req_mode;
    502 					le16 disassoc_timer;
    503 					u8 validity_interval;
    504 					/* BSS Termination Duration (optional),
    505 					 * Session Information URL (optional),
    506 					 * BSS Transition Candidate List
    507 					 * Entries */
    508 					u8 variable[0];
    509 				} STRUCT_PACKED bss_tm_req;
    510 			} u;
    511 		} STRUCT_PACKED action;
    512 	} u;
    513 } STRUCT_PACKED;
    514 
    515 
    516 /* Rx MCS bitmask is in the first 77 bits of supported_mcs_set */
    517 #define IEEE80211_HT_MCS_MASK_LEN 10
    518 
    519 struct ieee80211_ht_capabilities {
    520 	le16 ht_capabilities_info;
    521 	u8 a_mpdu_params;
    522 	u8 supported_mcs_set[16];
    523 	le16 ht_extended_capabilities;
    524 	le32 tx_bf_capability_info;
    525 	u8 asel_capabilities;
    526 } STRUCT_PACKED;
    527 
    528 
    529 struct ieee80211_ht_operation {
    530 	u8 control_chan;
    531 	u8 ht_param;
    532 	le16 operation_mode;
    533 	le16 stbc_param;
    534 	u8 basic_set[16];
    535 } STRUCT_PACKED;
    536 
    537 #ifdef _MSC_VER
    538 #pragma pack(pop)
    539 #endif /* _MSC_VER */
    540 
    541 #define ERP_INFO_NON_ERP_PRESENT BIT(0)
    542 #define ERP_INFO_USE_PROTECTION BIT(1)
    543 #define ERP_INFO_BARKER_PREAMBLE_MODE BIT(2)
    544 
    545 
    546 #define HT_CAP_INFO_LDPC_CODING_CAP		((u16) BIT(0))
    547 #define HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET	((u16) BIT(1))
    548 #define HT_CAP_INFO_SMPS_MASK			((u16) (BIT(2) | BIT(3)))
    549 #define HT_CAP_INFO_SMPS_STATIC			((u16) 0)
    550 #define HT_CAP_INFO_SMPS_DYNAMIC		((u16) BIT(2))
    551 #define HT_CAP_INFO_SMPS_DISABLED		((u16) (BIT(2) | BIT(3)))
    552 #define HT_CAP_INFO_GREEN_FIELD			((u16) BIT(4))
    553 #define HT_CAP_INFO_SHORT_GI20MHZ		((u16) BIT(5))
    554 #define HT_CAP_INFO_SHORT_GI40MHZ		((u16) BIT(6))
    555 #define HT_CAP_INFO_TX_STBC			((u16) BIT(7))
    556 #define HT_CAP_INFO_RX_STBC_MASK		((u16) (BIT(8) | BIT(9)))
    557 #define HT_CAP_INFO_RX_STBC_1			((u16) BIT(8))
    558 #define HT_CAP_INFO_RX_STBC_12			((u16) BIT(9))
    559 #define HT_CAP_INFO_RX_STBC_123			((u16) (BIT(8) | BIT(9)))
    560 #define HT_CAP_INFO_DELAYED_BA			((u16) BIT(10))
    561 #define HT_CAP_INFO_MAX_AMSDU_SIZE		((u16) BIT(11))
    562 #define HT_CAP_INFO_DSSS_CCK40MHZ		((u16) BIT(12))
    563 #define HT_CAP_INFO_PSMP_SUPP			((u16) BIT(13))
    564 #define HT_CAP_INFO_40MHZ_INTOLERANT		((u16) BIT(14))
    565 #define HT_CAP_INFO_LSIG_TXOP_PROTECT_SUPPORT	((u16) BIT(15))
    566 
    567 
    568 #define EXT_HT_CAP_INFO_PCO			((u16) BIT(0))
    569 #define EXT_HT_CAP_INFO_TRANS_TIME_OFFSET	1
    570 #define EXT_HT_CAP_INFO_MCS_FEEDBACK_OFFSET	8
    571 #define EXT_HT_CAP_INFO_HTC_SUPPORTED		((u16) BIT(10))
    572 #define EXT_HT_CAP_INFO_RD_RESPONDER		((u16) BIT(11))
    573 
    574 
    575 #define TX_BEAMFORM_CAP_TXBF_CAP ((u32) BIT(0))
    576 #define TX_BEAMFORM_CAP_RX_STAGGERED_SOUNDING_CAP ((u32) BIT(1))
    577 #define TX_BEAMFORM_CAP_TX_STAGGERED_SOUNDING_CAP ((u32) BIT(2))
    578 #define TX_BEAMFORM_CAP_RX_ZLF_CAP ((u32) BIT(3))
    579 #define TX_BEAMFORM_CAP_TX_ZLF_CAP ((u32) BIT(4))
    580 #define TX_BEAMFORM_CAP_IMPLICIT_ZLF_CAP ((u32) BIT(5))
    581 #define TX_BEAMFORM_CAP_CALIB_OFFSET 6
    582 #define TX_BEAMFORM_CAP_EXPLICIT_CSI_TXBF_CAP ((u32) BIT(8))
    583 #define TX_BEAMFORM_CAP_EXPLICIT_UNCOMPR_STEERING_MATRIX_CAP ((u32) BIT(9))
    584 #define TX_BEAMFORM_CAP_EXPLICIT_BF_CSI_FEEDBACK_CAP ((u32) BIT(10))
    585 #define TX_BEAMFORM_CAP_EXPLICIT_BF_CSI_FEEDBACK_OFFSET 11
    586 #define TX_BEAMFORM_CAP_EXPLICIT_UNCOMPR_STEERING_MATRIX_FEEDBACK_OFFSET 13
    587 #define TX_BEAMFORM_CAP_EXPLICIT_COMPRESSED_STEERING_MATRIX_FEEDBACK_OFFSET 15
    588 #define TX_BEAMFORM_CAP_MINIMAL_GROUPING_OFFSET 17
    589 #define TX_BEAMFORM_CAP_CSI_NUM_BEAMFORMER_ANT_OFFSET 19
    590 #define TX_BEAMFORM_CAP_UNCOMPRESSED_STEERING_MATRIX_BEAMFORMER_ANT_OFFSET 21
    591 #define TX_BEAMFORM_CAP_COMPRESSED_STEERING_MATRIX_BEAMFORMER_ANT_OFFSET 23
    592 #define TX_BEAMFORM_CAP_SCI_MAX_OF_ROWS_BEANFORMER_SUPPORTED_OFFSET 25
    593 
    594 
    595 #define ASEL_CAPABILITY_ASEL_CAPABLE ((u8) BIT(0))
    596 #define ASEL_CAPABILITY_EXPLICIT_CSI_FEEDBACK_BASED_TX_AS_CAP ((u8) BIT(1))
    597 #define ASEL_CAPABILITY_ANT_INDICES_FEEDBACK_BASED_TX_AS_CAP ((u8) BIT(2))
    598 #define ASEL_CAPABILITY_EXPLICIT_CSI_FEEDBACK_CAP ((u8) BIT(3))
    599 #define ASEL_CAPABILITY_ANT_INDICES_FEEDBACK_CAP ((u8) BIT(4))
    600 #define ASEL_CAPABILITY_RX_AS_CAP ((u8) BIT(5))
    601 #define ASEL_CAPABILITY_TX_SOUND_PPDUS_CAP ((u8) BIT(6))
    602 
    603 #define HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK	((u8) BIT(0) | BIT(1))
    604 #define HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE		((u8) BIT(0))
    605 #define HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW		((u8) BIT(0) | BIT(1))
    606 #define HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH		((u8) BIT(2))
    607 #define HT_INFO_HT_PARAM_RIFS_MODE			((u8) BIT(3))
    608 #define HT_INFO_HT_PARAM_CTRL_ACCESS_ONLY		((u8) BIT(4))
    609 #define HT_INFO_HT_PARAM_SRV_INTERVAL_GRANULARITY	((u8) BIT(5))
    610 
    611 
    612 #define OP_MODE_PURE                    0
    613 #define OP_MODE_MAY_BE_LEGACY_STAS      1
    614 #define OP_MODE_20MHZ_HT_STA_ASSOCED    2
    615 #define OP_MODE_MIXED                   3
    616 
    617 #define HT_INFO_OPERATION_MODE_OP_MODE_MASK	\
    618 		(0x0001 | 0x0002)
    619 #define HT_INFO_OPERATION_MODE_OP_MODE_OFFSET		0
    620 #define HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT	((u8) BIT(2))
    621 #define HT_INFO_OPERATION_MODE_TRANSMIT_BURST_LIMIT	((u8) BIT(3))
    622 #define HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT	((u8) BIT(4))
    623 
    624 #define HT_INFO_STBC_PARAM_DUAL_BEACON			((u16) BIT(6))
    625 #define HT_INFO_STBC_PARAM_DUAL_STBC_PROTECT		((u16) BIT(7))
    626 #define HT_INFO_STBC_PARAM_SECONDARY_BCN		((u16) BIT(8))
    627 #define HT_INFO_STBC_PARAM_LSIG_TXOP_PROTECT_ALLOWED	((u16) BIT(9))
    628 #define HT_INFO_STBC_PARAM_PCO_ACTIVE			((u16) BIT(10))
    629 #define HT_INFO_STBC_PARAM_PCO_PHASE			((u16) BIT(11))
    630 
    631 #define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127
    632 
    633 #define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs)
    634 				* 00:50:F2 */
    635 #define WPA_IE_VENDOR_TYPE 0x0050f201
    636 #define WPS_IE_VENDOR_TYPE 0x0050f204
    637 #define OUI_WFA 0x506f9a
    638 #define P2P_IE_VENDOR_TYPE 0x506f9a09
    639 
    640 #define WMM_OUI_TYPE 2
    641 #define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0
    642 #define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1
    643 #define WMM_OUI_SUBTYPE_TSPEC_ELEMENT 2
    644 #define WMM_VERSION 1
    645 
    646 #define WMM_ACTION_CODE_ADDTS_REQ 0
    647 #define WMM_ACTION_CODE_ADDTS_RESP 1
    648 #define WMM_ACTION_CODE_DELTS 2
    649 
    650 #define WMM_ADDTS_STATUS_ADMISSION_ACCEPTED 0
    651 #define WMM_ADDTS_STATUS_INVALID_PARAMETERS 1
    652 /* 2 - Reserved */
    653 #define WMM_ADDTS_STATUS_REFUSED 3
    654 /* 4-255 - Reserved */
    655 
    656 /* WMM TSPEC Direction Field Values */
    657 #define WMM_TSPEC_DIRECTION_UPLINK 0
    658 #define WMM_TSPEC_DIRECTION_DOWNLINK 1
    659 /* 2 - Reserved */
    660 #define WMM_TSPEC_DIRECTION_BI_DIRECTIONAL 3
    661 
    662 /*
    663  * WMM Information Element (used in (Re)Association Request frames; may also be
    664  * used in Beacon frames)
    665  */
    666 struct wmm_information_element {
    667 	/* Element ID: 221 (0xdd); Length: 7 */
    668 	/* required fields for WMM version 1 */
    669 	u8 oui[3]; /* 00:50:f2 */
    670 	u8 oui_type; /* 2 */
    671 	u8 oui_subtype; /* 0 */
    672 	u8 version; /* 1 for WMM version 1.0 */
    673 	u8 qos_info; /* AP/STA specific QoS info */
    674 
    675 } STRUCT_PACKED;
    676 
    677 #define WMM_QOSINFO_STA_AC_MASK 0x0f
    678 #define WMM_QOSINFO_STA_SP_MASK 0x03
    679 #define WMM_QOSINFO_STA_SP_SHIFT 5
    680 
    681 #define WMM_AC_AIFSN_MASK 0x0f
    682 #define WMM_AC_AIFNS_SHIFT 0
    683 #define WMM_AC_ACM 0x10
    684 #define WMM_AC_ACI_MASK 0x60
    685 #define WMM_AC_ACI_SHIFT 5
    686 
    687 #define WMM_AC_ECWMIN_MASK 0x0f
    688 #define WMM_AC_ECWMIN_SHIFT 0
    689 #define WMM_AC_ECWMAX_MASK 0xf0
    690 #define WMM_AC_ECWMAX_SHIFT 4
    691 
    692 struct wmm_ac_parameter {
    693 	u8 aci_aifsn; /* AIFSN, ACM, ACI */
    694 	u8 cw; /* ECWmin, ECWmax (CW = 2^ECW - 1) */
    695 	le16 txop_limit;
    696 }  STRUCT_PACKED;
    697 
    698 /*
    699  * WMM Parameter Element (used in Beacon, Probe Response, and (Re)Association
    700  * Response frmaes)
    701  */
    702 struct wmm_parameter_element {
    703 	/* Element ID: 221 (0xdd); Length: 24 */
    704 	/* required fields for WMM version 1 */
    705 	u8 oui[3]; /* 00:50:f2 */
    706 	u8 oui_type; /* 2 */
    707 	u8 oui_subtype; /* 1 */
    708 	u8 version; /* 1 for WMM version 1.0 */
    709 	u8 qos_info; /* AP/STA specific QoS info */
    710 	u8 reserved; /* 0 */
    711 	struct wmm_ac_parameter ac[4]; /* AC_BE, AC_BK, AC_VI, AC_VO */
    712 
    713 } STRUCT_PACKED;
    714 
    715 /* WMM TSPEC Element */
    716 struct wmm_tspec_element {
    717 	u8 eid; /* 221 = 0xdd */
    718 	u8 length; /* 6 + 55 = 61 */
    719 	u8 oui[3]; /* 00:50:f2 */
    720 	u8 oui_type; /* 2 */
    721 	u8 oui_subtype; /* 2 */
    722 	u8 version; /* 1 */
    723 	/* WMM TSPEC body (55 octets): */
    724 	u8 ts_info[3];
    725 	le16 nominal_msdu_size;
    726 	le16 maximum_msdu_size;
    727 	le32 minimum_service_interval;
    728 	le32 maximum_service_interval;
    729 	le32 inactivity_interval;
    730 	le32 suspension_interval;
    731 	le32 service_start_time;
    732 	le32 minimum_data_rate;
    733 	le32 mean_data_rate;
    734 	le32 peak_data_rate;
    735 	le32 maximum_burst_size;
    736 	le32 delay_bound;
    737 	le32 minimum_phy_rate;
    738 	le16 surplus_bandwidth_allowance;
    739 	le16 medium_time;
    740 } STRUCT_PACKED;
    741 
    742 
    743 /* Access Categories / ACI to AC coding */
    744 enum {
    745 	WMM_AC_BE = 0 /* Best Effort */,
    746 	WMM_AC_BK = 1 /* Background */,
    747 	WMM_AC_VI = 2 /* Video */,
    748 	WMM_AC_VO = 3 /* Voice */
    749 };
    750 
    751 
    752 /* Wi-Fi Direct (P2P) */
    753 
    754 #define P2P_OUI_TYPE 9
    755 
    756 enum p2p_attr_id {
    757 	P2P_ATTR_STATUS = 0,
    758 	P2P_ATTR_MINOR_REASON_CODE = 1,
    759 	P2P_ATTR_CAPABILITY = 2,
    760 	P2P_ATTR_DEVICE_ID = 3,
    761 	P2P_ATTR_GROUP_OWNER_INTENT = 4,
    762 	P2P_ATTR_CONFIGURATION_TIMEOUT = 5,
    763 	P2P_ATTR_LISTEN_CHANNEL = 6,
    764 	P2P_ATTR_GROUP_BSSID = 7,
    765 	P2P_ATTR_EXT_LISTEN_TIMING = 8,
    766 	P2P_ATTR_INTENDED_INTERFACE_ADDR = 9,
    767 	P2P_ATTR_MANAGEABILITY = 10,
    768 	P2P_ATTR_CHANNEL_LIST = 11,
    769 	P2P_ATTR_NOTICE_OF_ABSENCE = 12,
    770 	P2P_ATTR_DEVICE_INFO = 13,
    771 	P2P_ATTR_GROUP_INFO = 14,
    772 	P2P_ATTR_GROUP_ID = 15,
    773 	P2P_ATTR_INTERFACE = 16,
    774 	P2P_ATTR_OPERATING_CHANNEL = 17,
    775 	P2P_ATTR_INVITATION_FLAGS = 18,
    776 	P2P_ATTR_VENDOR_SPECIFIC = 221
    777 };
    778 
    779 #define P2P_MAX_GO_INTENT 15
    780 
    781 /* P2P Capability - Device Capability bitmap */
    782 #define P2P_DEV_CAPAB_SERVICE_DISCOVERY BIT(0)
    783 #define P2P_DEV_CAPAB_CLIENT_DISCOVERABILITY BIT(1)
    784 #define P2P_DEV_CAPAB_CONCURRENT_OPER BIT(2)
    785 #define P2P_DEV_CAPAB_INFRA_MANAGED BIT(3)
    786 #define P2P_DEV_CAPAB_DEVICE_LIMIT BIT(4)
    787 #define P2P_DEV_CAPAB_INVITATION_PROCEDURE BIT(5)
    788 
    789 /* P2P Capability - Group Capability bitmap */
    790 #define P2P_GROUP_CAPAB_GROUP_OWNER BIT(0)
    791 #define P2P_GROUP_CAPAB_PERSISTENT_GROUP BIT(1)
    792 #define P2P_GROUP_CAPAB_GROUP_LIMIT BIT(2)
    793 #define P2P_GROUP_CAPAB_INTRA_BSS_DIST BIT(3)
    794 #define P2P_GROUP_CAPAB_CROSS_CONN BIT(4)
    795 #define P2P_GROUP_CAPAB_PERSISTENT_RECONN BIT(5)
    796 #define P2P_GROUP_CAPAB_GROUP_FORMATION BIT(6)
    797 
    798 /* Invitation Flags */
    799 #define P2P_INVITATION_FLAGS_TYPE BIT(0)
    800 
    801 /* P2P Manageability */
    802 #define P2P_MAN_DEVICE_MANAGEMENT BIT(0)
    803 #define P2P_MAN_CROSS_CONNECTION_PERMITTED BIT(1)
    804 #define P2P_MAN_COEXISTENCE_OPTIONAL BIT(2)
    805 
    806 enum p2p_status_code {
    807 	P2P_SC_SUCCESS = 0,
    808 	P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE = 1,
    809 	P2P_SC_FAIL_INCOMPATIBLE_PARAMS = 2,
    810 	P2P_SC_FAIL_LIMIT_REACHED = 3,
    811 	P2P_SC_FAIL_INVALID_PARAMS = 4,
    812 	P2P_SC_FAIL_UNABLE_TO_ACCOMMODATE = 5,
    813 	P2P_SC_FAIL_PREV_PROTOCOL_ERROR = 6,
    814 	P2P_SC_FAIL_NO_COMMON_CHANNELS = 7,
    815 	P2P_SC_FAIL_UNKNOWN_GROUP = 8,
    816 	P2P_SC_FAIL_BOTH_GO_INTENT_15 = 9,
    817 	P2P_SC_FAIL_INCOMPATIBLE_PROV_METHOD = 10,
    818 	P2P_SC_FAIL_REJECTED_BY_USER = 11,
    819 };
    820 
    821 #define P2P_WILDCARD_SSID "DIRECT-"
    822 #define P2P_WILDCARD_SSID_LEN 7
    823 
    824 /* P2P action frames */
    825 enum p2p_act_frame_type {
    826 	P2P_NOA = 0,
    827 	P2P_PRESENCE_REQ = 1,
    828 	P2P_PRESENCE_RESP = 2,
    829 	P2P_GO_DISC_REQ = 3
    830 };
    831 
    832 /* P2P public action frames */
    833 enum p2p_action_frame_type {
    834 	P2P_GO_NEG_REQ = 0,
    835 	P2P_GO_NEG_RESP = 1,
    836 	P2P_GO_NEG_CONF = 2,
    837 	P2P_INVITATION_REQ = 3,
    838 	P2P_INVITATION_RESP = 4,
    839 	P2P_DEV_DISC_REQ = 5,
    840 	P2P_DEV_DISC_RESP = 6,
    841 	P2P_PROV_DISC_REQ = 7,
    842 	P2P_PROV_DISC_RESP = 8
    843 };
    844 
    845 enum p2p_service_protocol_type {
    846 	P2P_SERV_ALL_SERVICES = 0,
    847 	P2P_SERV_BONJOUR = 1,
    848 	P2P_SERV_UPNP = 2,
    849 	P2P_SERV_WS_DISCOVERY = 3,
    850 	P2P_SERV_VENDOR_SPECIFIC = 255
    851 };
    852 
    853 enum p2p_sd_status {
    854 	P2P_SD_SUCCESS = 0,
    855 	P2P_SD_PROTO_NOT_AVAILABLE = 1,
    856 	P2P_SD_REQUESTED_INFO_NOT_AVAILABLE = 2,
    857 	P2P_SD_BAD_REQUEST = 3
    858 };
    859 
    860 
    861 #define OUI_BROADCOM 0x00904c /* Broadcom (Epigram) */
    862 
    863 #define VENDOR_HT_CAPAB_OUI_TYPE 0x33 /* 00-90-4c:0x33 */
    864 
    865 /* cipher suite selectors */
    866 #define WLAN_CIPHER_SUITE_USE_GROUP	0x000FAC00
    867 #define WLAN_CIPHER_SUITE_WEP40		0x000FAC01
    868 #define WLAN_CIPHER_SUITE_TKIP		0x000FAC02
    869 /* reserved: 				0x000FAC03 */
    870 #define WLAN_CIPHER_SUITE_CCMP		0x000FAC04
    871 #define WLAN_CIPHER_SUITE_WEP104	0x000FAC05
    872 #define WLAN_CIPHER_SUITE_AES_CMAC	0x000FAC06
    873 
    874 /* AKM suite selectors */
    875 #define WLAN_AKM_SUITE_8021X		0x000FAC01
    876 #define WLAN_AKM_SUITE_PSK		0x000FAC02
    877 
    878 
    879 /* IEEE 802.11v - WNM Action field values */
    880 enum wnm_action {
    881 	WNM_EVENT_REQ = 0,
    882 	WNM_EVENT_REPORT = 1,
    883 	WNM_DIAGNOSTIC_REQ = 2,
    884 	WNM_DIAGNOSTIC_REPORT = 3,
    885 	WNM_LOCATION_CFG_REQ = 4,
    886 	WNM_LOCATION_CFG_RESP = 5,
    887 	WNM_BSS_TRANS_MGMT_QUERY = 6,
    888 	WNM_BSS_TRANS_MGMT_REQ = 7,
    889 	WNM_BSS_TRANS_MGMT_RESP = 8,
    890 	WNM_FMS_REQ = 9,
    891 	WNM_FMS_RESP = 10,
    892 	WNM_COLLOCATED_INTERFERENCE_REQ = 11,
    893 	WNM_COLLOCATED_INTERFERENCE_REPORT = 12,
    894 	WNM_TFS_REQ = 13,
    895 	WNM_TFS_RESP = 14,
    896 	WNM_TFS_NOTIFY = 15,
    897 	WNM_SLEEP_MODE_REQ = 16,
    898 	WNM_SLEEP_MODE_RESP = 17,
    899 	WNM_TIM_BROADCAST_REQ = 18,
    900 	WNM_TIM_BROADCAST_RESP = 19,
    901 	WNM_QOS_TRAFFIC_CAPAB_UPDATE = 20,
    902 	WNM_CHANNEL_USAGE_REQ = 21,
    903 	WNM_CHANNEL_USAGE_RESP = 22,
    904 	WNM_DMS_REQ = 23,
    905 	WNM_DMS_RESP = 24,
    906 	WNM_TIMING_MEASUREMENT_REQ = 25,
    907 	WNM_NOTIFICATION_REQ = 26,
    908 	WNM_NOTIFICATION_RESP = 27
    909 };
    910 
    911 /* IEEE 802.11v - BSS Transition Management Request - Request Mode */
    912 #define WNM_BSS_TM_REQ_PREF_CAND_LIST_INCLUDED BIT(0)
    913 #define WNM_BSS_TM_REQ_ABRIDGED BIT(1)
    914 #define WNM_BSS_TM_REQ_DISASSOC_IMMINENT BIT(2)
    915 #define WNM_BSS_TM_REQ_BSS_TERMINATION_INCLUDED BIT(3)
    916 #define WNM_BSS_TM_REQ_ESS_DISASSOC_IMMINENT BIT(4)
    917 
    918 #endif /* IEEE802_11_DEFS_H */
    919