Disconnect hostapd from building in base
[dragonfly.git] / contrib / hostapd / src / common / ieee802_11_defs.h
CommitLineData
a875087d
JL
1/*
2 * IEEE 802.11 Frame type definitions
4781064b 3 * Copyright (c) 2002-2009, Jouni Malinen <j@w1.fi>
a875087d
JL
4 * Copyright (c) 2007-2008 Intel Corporation
5 *
4781064b
JM
6 * This software may be distributed under the terms of the BSD license.
7 * See README for more details.
a875087d
JL
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
4781064b
JM
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
a875087d
JL
74
75/* Authentication algorithms */
76#define WLAN_AUTH_OPEN 0
77#define WLAN_AUTH_SHARED_KEY 1
78#define WLAN_AUTH_FT 2
4781064b 79#define WLAN_AUTH_SAE 3
a875087d
JL
80#define WLAN_AUTH_LEAP 128
81
82#define WLAN_AUTH_CHALLENGE_LEN 128
83
84#define WLAN_CAPABILITY_ESS BIT(0)
85#define WLAN_CAPABILITY_IBSS BIT(1)
86#define WLAN_CAPABILITY_CF_POLLABLE BIT(2)
87#define WLAN_CAPABILITY_CF_POLL_REQUEST BIT(3)
88#define WLAN_CAPABILITY_PRIVACY BIT(4)
89#define WLAN_CAPABILITY_SHORT_PREAMBLE BIT(5)
90#define WLAN_CAPABILITY_PBCC BIT(6)
91#define WLAN_CAPABILITY_CHANNEL_AGILITY BIT(7)
92#define WLAN_CAPABILITY_SPECTRUM_MGMT BIT(8)
93#define WLAN_CAPABILITY_SHORT_SLOT_TIME BIT(10)
94#define WLAN_CAPABILITY_DSSS_OFDM BIT(13)
95
96/* Status codes (IEEE 802.11-2007, 7.3.1.9, Table 7-23) */
97#define WLAN_STATUS_SUCCESS 0
98#define WLAN_STATUS_UNSPECIFIED_FAILURE 1
4781064b
JM
99#define WLAN_STATUS_TDLS_WAKEUP_ALTERNATE 2
100#define WLAN_STATUS_TDLS_WAKEUP_REJECT 3
101#define WLAN_STATUS_SECURITY_DISABLED 5
102#define WLAN_STATUS_UNACCEPTABLE_LIFETIME 6
103#define WLAN_STATUS_NOT_IN_SAME_BSS 7
a875087d
JL
104#define WLAN_STATUS_CAPS_UNSUPPORTED 10
105#define WLAN_STATUS_REASSOC_NO_ASSOC 11
106#define WLAN_STATUS_ASSOC_DENIED_UNSPEC 12
107#define WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 13
108#define WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION 14
109#define WLAN_STATUS_CHALLENGE_FAIL 15
110#define WLAN_STATUS_AUTH_TIMEOUT 16
111#define WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 17
112#define WLAN_STATUS_ASSOC_DENIED_RATES 18
113/* IEEE 802.11b */
114#define WLAN_STATUS_ASSOC_DENIED_NOSHORT 19
115#define WLAN_STATUS_ASSOC_DENIED_NOPBCC 20
116#define WLAN_STATUS_ASSOC_DENIED_NOAGILITY 21
117/* IEEE 802.11h */
118#define WLAN_STATUS_SPEC_MGMT_REQUIRED 22
119#define WLAN_STATUS_PWR_CAPABILITY_NOT_VALID 23
120#define WLAN_STATUS_SUPPORTED_CHANNEL_NOT_VALID 24
121/* IEEE 802.11g */
122#define WLAN_STATUS_ASSOC_DENIED_NO_SHORT_SLOT_TIME 25
4781064b
JM
123#define WLAN_STATUS_ASSOC_DENIED_NO_DSSS_OFDM 26
124#define WLAN_STATUS_ASSOC_DENIED_NO_HT 27
125#define WLAN_STATUS_R0KH_UNREACHABLE 28
126#define WLAN_STATUS_ASSOC_DENIED_NO_PCO 29
a875087d
JL
127/* IEEE 802.11w */
128#define WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY 30
129#define WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION 31
4781064b
JM
130#define WLAN_STATUS_UNSPECIFIED_QOS_FAILURE 32
131#define WLAN_STATUS_REQUEST_DECLINED 37
132#define WLAN_STATUS_INVALID_PARAMETERS 38
a875087d
JL
133/* IEEE 802.11i */
134#define WLAN_STATUS_INVALID_IE 40
135#define WLAN_STATUS_GROUP_CIPHER_NOT_VALID 41
136#define WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID 42
137#define WLAN_STATUS_AKMP_NOT_VALID 43
138#define WLAN_STATUS_UNSUPPORTED_RSN_IE_VERSION 44
139#define WLAN_STATUS_INVALID_RSN_IE_CAPAB 45
140#define WLAN_STATUS_CIPHER_REJECTED_PER_POLICY 46
141#define WLAN_STATUS_TS_NOT_CREATED 47
142#define WLAN_STATUS_DIRECT_LINK_NOT_ALLOWED 48
143#define WLAN_STATUS_DEST_STA_NOT_PRESENT 49
144#define WLAN_STATUS_DEST_STA_NOT_QOS_STA 50
145#define WLAN_STATUS_ASSOC_DENIED_LISTEN_INT_TOO_LARGE 51
146/* IEEE 802.11r */
147#define WLAN_STATUS_INVALID_FT_ACTION_FRAME_COUNT 52
148#define WLAN_STATUS_INVALID_PMKID 53
149#define WLAN_STATUS_INVALID_MDIE 54
150#define WLAN_STATUS_INVALID_FTIE 55
4781064b
JM
151#define WLAN_STATUS_GAS_ADV_PROTO_NOT_SUPPORTED 59
152#define WLAN_STATUS_NO_OUTSTANDING_GAS_REQ 60
153#define WLAN_STATUS_GAS_RESP_NOT_RECEIVED 61
154#define WLAN_STATUS_STA_TIMED_OUT_WAITING_FOR_GAS_RESP 62
155#define WLAN_STATUS_GAS_RESP_LARGER_THAN_LIMIT 63
156#define WLAN_STATUS_REQ_REFUSED_HOME 64
157#define WLAN_STATUS_ADV_SRV_UNREACHABLE 65
158#define WLAN_STATUS_REQ_REFUSED_SSPN 67
159#define WLAN_STATUS_REQ_REFUSED_UNAUTH_ACCESS 68
160#define WLAN_STATUS_INVALID_RSNIE 72
161#define WLAN_STATUS_ANTI_CLOGGING_TOKEN_REQ 76
162#define WLAN_STATUS_FINITE_CYCLIC_GROUP_NOT_SUPPORTED 77
163#define WLAN_STATUS_TRANSMISSION_FAILURE 79
164#define WLAN_STATUS_ASSOC_DENIED_NO_VHT 104
a875087d
JL
165
166/* Reason codes (IEEE 802.11-2007, 7.3.1.7, Table 7-22) */
167#define WLAN_REASON_UNSPECIFIED 1
168#define WLAN_REASON_PREV_AUTH_NOT_VALID 2
169#define WLAN_REASON_DEAUTH_LEAVING 3
170#define WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4
171#define WLAN_REASON_DISASSOC_AP_BUSY 5
172#define WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6
173#define WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 7
174#define WLAN_REASON_DISASSOC_STA_HAS_LEFT 8
175#define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9
176/* IEEE 802.11h */
177#define WLAN_REASON_PWR_CAPABILITY_NOT_VALID 10
178#define WLAN_REASON_SUPPORTED_CHANNEL_NOT_VALID 11
179/* IEEE 802.11i */
180#define WLAN_REASON_INVALID_IE 13
181#define WLAN_REASON_MICHAEL_MIC_FAILURE 14
182#define WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT 15
183#define WLAN_REASON_GROUP_KEY_UPDATE_TIMEOUT 16
184#define WLAN_REASON_IE_IN_4WAY_DIFFERS 17
185#define WLAN_REASON_GROUP_CIPHER_NOT_VALID 18
186#define WLAN_REASON_PAIRWISE_CIPHER_NOT_VALID 19
187#define WLAN_REASON_AKMP_NOT_VALID 20
188#define WLAN_REASON_UNSUPPORTED_RSN_IE_VERSION 21
189#define WLAN_REASON_INVALID_RSN_IE_CAPAB 22
190#define WLAN_REASON_IEEE_802_1X_AUTH_FAILED 23
191#define WLAN_REASON_CIPHER_SUITE_REJECTED 24
4781064b
JM
192#define WLAN_REASON_TDLS_TEARDOWN_UNREACHABLE 25
193#define WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED 26
194/* IEEE 802.11e */
195#define WLAN_REASON_DISASSOC_LOW_ACK 34
a875087d
JL
196
197
198/* Information Element IDs */
199#define WLAN_EID_SSID 0
200#define WLAN_EID_SUPP_RATES 1
201#define WLAN_EID_FH_PARAMS 2
202#define WLAN_EID_DS_PARAMS 3
203#define WLAN_EID_CF_PARAMS 4
204#define WLAN_EID_TIM 5
205#define WLAN_EID_IBSS_PARAMS 6
206#define WLAN_EID_COUNTRY 7
4781064b 207#define WLAN_EID_BSS_LOAD 11
a875087d
JL
208#define WLAN_EID_CHALLENGE 16
209/* EIDs defined by IEEE 802.11h - START */
210#define WLAN_EID_PWR_CONSTRAINT 32
211#define WLAN_EID_PWR_CAPABILITY 33
212#define WLAN_EID_TPC_REQUEST 34
213#define WLAN_EID_TPC_REPORT 35
214#define WLAN_EID_SUPPORTED_CHANNELS 36
215#define WLAN_EID_CHANNEL_SWITCH 37
216#define WLAN_EID_MEASURE_REQUEST 38
217#define WLAN_EID_MEASURE_REPORT 39
218#define WLAN_EID_QUITE 40
219#define WLAN_EID_IBSS_DFS 41
220/* EIDs defined by IEEE 802.11h - END */
221#define WLAN_EID_ERP_INFO 42
222#define WLAN_EID_HT_CAP 45
4781064b 223#define WLAN_EID_QOS 46
a875087d
JL
224#define WLAN_EID_RSN 48
225#define WLAN_EID_EXT_SUPP_RATES 50
226#define WLAN_EID_MOBILITY_DOMAIN 54
227#define WLAN_EID_FAST_BSS_TRANSITION 55
228#define WLAN_EID_TIMEOUT_INTERVAL 56
229#define WLAN_EID_RIC_DATA 57
4781064b 230#define WLAN_EID_SUPPORTED_OPERATING_CLASSES 59
a875087d
JL
231#define WLAN_EID_HT_OPERATION 61
232#define WLAN_EID_SECONDARY_CHANNEL_OFFSET 62
4781064b
JM
233#define WLAN_EID_WAPI 68
234#define WLAN_EID_TIME_ADVERTISEMENT 69
a875087d
JL
235#define WLAN_EID_20_40_BSS_COEXISTENCE 72
236#define WLAN_EID_20_40_BSS_INTOLERANT 73
237#define WLAN_EID_OVERLAPPING_BSS_SCAN_PARAMS 74
238#define WLAN_EID_MMIE 76
4781064b
JM
239#define WLAN_EID_SSID_LIST 84
240#define WLAN_EID_BSS_MAX_IDLE_PERIOD 90
241#define WLAN_EID_TFS_REQ 91
242#define WLAN_EID_TFS_RESP 92
243#define WLAN_EID_WNMSLEEP 93
244#define WLAN_EID_TIME_ZONE 98
245#define WLAN_EID_LINK_ID 101
246#define WLAN_EID_INTERWORKING 107
247#define WLAN_EID_ADV_PROTO 108
248#define WLAN_EID_QOS_MAP_SET 110
249#define WLAN_EID_ROAMING_CONSORTIUM 111
250#define WLAN_EID_EXT_CAPAB 127
251#define WLAN_EID_CCKM 156
252#define WLAN_EID_VHT_CAP 191
253#define WLAN_EID_VHT_OPERATION 192
254#define WLAN_EID_VHT_EXTENDED_BSS_LOAD 193
255#define WLAN_EID_VHT_WIDE_BW_CHSWITCH 194
256#define WLAN_EID_VHT_TRANSMIT_POWER_ENVELOPE 195
257#define WLAN_EID_VHT_CHANNEL_SWITCH_WRAPPER 196
258#define WLAN_EID_VHT_AID 197
259#define WLAN_EID_VHT_QUIET_CHANNEL 198
260#define WLAN_EID_VHT_OPERATING_MODE_NOTIFICATION 199
a875087d
JL
261#define WLAN_EID_VENDOR_SPECIFIC 221
262
263
264/* Action frame categories (IEEE 802.11-2007, 7.3.1.11, Table 7-24) */
265#define WLAN_ACTION_SPECTRUM_MGMT 0
266#define WLAN_ACTION_QOS 1
267#define WLAN_ACTION_DLS 2
268#define WLAN_ACTION_BLOCK_ACK 3
269#define WLAN_ACTION_PUBLIC 4
270#define WLAN_ACTION_RADIO_MEASUREMENT 5
271#define WLAN_ACTION_FT 6
272#define WLAN_ACTION_HT 7
273#define WLAN_ACTION_SA_QUERY 8
4781064b
JM
274#define WLAN_ACTION_PROTECTED_DUAL 9
275#define WLAN_ACTION_WNM 10
276#define WLAN_ACTION_UNPROTECTED_WNM 11
277#define WLAN_ACTION_TDLS 12
a875087d 278#define WLAN_ACTION_WMM 17 /* WMM Specification 1.1 */
4781064b
JM
279#define WLAN_ACTION_VENDOR_SPECIFIC 127
280
281/* Public action codes */
282#define WLAN_PA_20_40_BSS_COEX 0
283#define WLAN_PA_VENDOR_SPECIFIC 9
284#define WLAN_PA_GAS_INITIAL_REQ 10
285#define WLAN_PA_GAS_INITIAL_RESP 11
286#define WLAN_PA_GAS_COMEBACK_REQ 12
287#define WLAN_PA_GAS_COMEBACK_RESP 13
288#define WLAN_TDLS_DISCOVERY_RESPONSE 14
289
290/* Protected Dual of Public Action frames */
291#define WLAN_PROT_DSE_ENABLEMENT 1
292#define WLAN_PROT_DSE_DEENABLEMENT 2
293#define WLAN_PROT_EXT_CSA 4
294#define WLAN_PROT_MEASUREMENT_REQ 5
295#define WLAN_PROT_MEASUREMENT_REPORT 6
296#define WLAN_PROT_DSE_POWER_CONSTRAINT 8
297#define WLAN_PROT_VENDOR_SPECIFIC 9
298#define WLAN_PROT_GAS_INITIAL_REQ 10
299#define WLAN_PROT_GAS_INITIAL_RESP 11
300#define WLAN_PROT_GAS_COMEBACK_REQ 12
301#define WLAN_PROT_GAS_COMEBACK_RESP 13
a875087d
JL
302
303/* SA Query Action frame (IEEE 802.11w/D8.0, 7.4.9) */
304#define WLAN_SA_QUERY_REQUEST 0
305#define WLAN_SA_QUERY_RESPONSE 1
306
307#define WLAN_SA_QUERY_TR_ID_LEN 2
308
4781064b
JM
309/* TDLS action codes */
310#define WLAN_TDLS_SETUP_REQUEST 0
311#define WLAN_TDLS_SETUP_RESPONSE 1
312#define WLAN_TDLS_SETUP_CONFIRM 2
313#define WLAN_TDLS_TEARDOWN 3
314#define WLAN_TDLS_PEER_TRAFFIC_INDICATION 4
315#define WLAN_TDLS_CHANNEL_SWITCH_REQUEST 5
316#define WLAN_TDLS_CHANNEL_SWITCH_RESPONSE 6
317#define WLAN_TDLS_PEER_PSM_REQUEST 7
318#define WLAN_TDLS_PEER_PSM_RESPONSE 8
319#define WLAN_TDLS_PEER_TRAFFIC_RESPONSE 9
320#define WLAN_TDLS_DISCOVERY_REQUEST 10
321
a875087d
JL
322/* Timeout Interval Type */
323#define WLAN_TIMEOUT_REASSOC_DEADLINE 1
324#define WLAN_TIMEOUT_KEY_LIFETIME 2
325#define WLAN_TIMEOUT_ASSOC_COMEBACK 3
326
4781064b
JM
327/* Interworking element (IEEE 802.11u) - Access Network Options */
328#define INTERWORKING_ANO_ACCESS_NETWORK_MASK 0x0f
329#define INTERWORKING_ANO_INTERNET 0x10
330#define INTERWORKING_ANO_ASRA 0x20
331#define INTERWORKING_ANO_ESR 0x40
332#define INTERWORKING_ANO_UESA 0x80
333
334#define INTERWORKING_ANT_PRIVATE 0
335#define INTERWORKING_ANT_PRIVATE_WITH_GUEST 1
336#define INTERWORKING_ANT_CHARGEABLE_PUBLIC 2
337#define INTERWORKING_ANT_FREE_PUBLIC 3
338#define INTERWORKING_ANT_PERSONAL_DEVICE 4
339#define INTERWORKING_ANT_EMERGENCY_SERVICES 5
340#define INTERWORKING_ANT_TEST 6
341#define INTERWORKING_ANT_WILDCARD 15
342
343/* Advertisement Protocol ID definitions (IEEE Std 802.11u-2011) */
344enum adv_proto_id {
345 ACCESS_NETWORK_QUERY_PROTOCOL = 0,
346 MIH_INFO_SERVICE = 1,
347 MIH_CMD_AND_EVENT_DISCOVERY = 2,
348 EMERGENCY_ALERT_SYSTEM = 3,
349 ADV_PROTO_VENDOR_SPECIFIC = 221
350};
351
352/* Access Network Query Protocol info ID definitions (IEEE Std 802.11u-2011) */
353enum anqp_info_id {
354 ANQP_QUERY_LIST = 256,
355 ANQP_CAPABILITY_LIST = 257,
356 ANQP_VENUE_NAME = 258,
357 ANQP_EMERGENCY_CALL_NUMBER = 259,
358 ANQP_NETWORK_AUTH_TYPE = 260,
359 ANQP_ROAMING_CONSORTIUM = 261,
360 ANQP_IP_ADDR_TYPE_AVAILABILITY = 262,
361 ANQP_NAI_REALM = 263,
362 ANQP_3GPP_CELLULAR_NETWORK = 264,
363 ANQP_AP_GEOSPATIAL_LOCATION = 265,
364 ANQP_AP_CIVIC_LOCATION = 266,
365 ANQP_AP_LOCATION_PUBLIC_URI = 267,
366 ANQP_DOMAIN_NAME = 268,
367 ANQP_EMERGENCY_ALERT_URI = 269,
368 ANQP_EMERGENCY_NAI = 271,
369 ANQP_VENDOR_SPECIFIC = 56797
370};
371
372/* NAI Realm list - EAP Method subfield - Authentication Parameter ID */
373enum nai_realm_eap_auth_param {
374 NAI_REALM_EAP_AUTH_EXPANDED_EAP_METHOD = 1,
375 NAI_REALM_EAP_AUTH_NON_EAP_INNER_AUTH = 2,
376 NAI_REALM_EAP_AUTH_INNER_AUTH_EAP_METHOD = 3,
377 NAI_REALM_EAP_AUTH_EXPANDED_INNER_EAP_METHOD = 4,
378 NAI_REALM_EAP_AUTH_CRED_TYPE = 5,
379 NAI_REALM_EAP_AUTH_TUNNELED_CRED_TYPE = 6,
380 NAI_REALM_EAP_AUTH_VENDOR_SPECIFIC = 221
381};
382
383enum nai_realm_eap_auth_inner_non_eap {
384 NAI_REALM_INNER_NON_EAP_PAP = 1,
385 NAI_REALM_INNER_NON_EAP_CHAP = 2,
386 NAI_REALM_INNER_NON_EAP_MSCHAP = 3,
387 NAI_REALM_INNER_NON_EAP_MSCHAPV2 = 4
388};
389
390enum nai_realm_eap_cred_type {
391 NAI_REALM_CRED_TYPE_SIM = 1,
392 NAI_REALM_CRED_TYPE_USIM = 2,
393 NAI_REALM_CRED_TYPE_NFC_SECURE_ELEMENT = 3,
394 NAI_REALM_CRED_TYPE_HARDWARE_TOKEN = 4,
395 NAI_REALM_CRED_TYPE_SOFTOKEN = 5,
396 NAI_REALM_CRED_TYPE_CERTIFICATE = 6,
397 NAI_REALM_CRED_TYPE_USERNAME_PASSWORD = 7,
398 NAI_REALM_CRED_TYPE_NONE = 8,
399 NAI_REALM_CRED_TYPE_ANONYMOUS = 9,
400 NAI_REALM_CRED_TYPE_VENDOR_SPECIFIC = 10
401};
a875087d
JL
402
403#ifdef _MSC_VER
404#pragma pack(push, 1)
405#endif /* _MSC_VER */
406
4781064b
JM
407struct ieee80211_hdr {
408 le16 frame_control;
409 le16 duration_id;
410 u8 addr1[6];
411 u8 addr2[6];
412 u8 addr3[6];
413 le16 seq_ctrl;
414 /* followed by 'u8 addr4[6];' if ToDS and FromDS is set in data frame
415 */
416} STRUCT_PACKED;
417
418#define IEEE80211_DA_FROMDS addr1
419#define IEEE80211_BSSID_FROMDS addr2
420#define IEEE80211_SA_FROMDS addr3
421
422#define IEEE80211_HDRLEN (sizeof(struct ieee80211_hdr))
423
424#define IEEE80211_FC(type, stype) host_to_le16((type << 2) | (stype << 4))
425
a875087d
JL
426struct ieee80211_mgmt {
427 le16 frame_control;
428 le16 duration;
429 u8 da[6];
430 u8 sa[6];
431 u8 bssid[6];
432 le16 seq_ctrl;
433 union {
434 struct {
435 le16 auth_alg;
436 le16 auth_transaction;
437 le16 status_code;
438 /* possibly followed by Challenge text */
439 u8 variable[0];
440 } STRUCT_PACKED auth;
441 struct {
442 le16 reason_code;
4781064b 443 u8 variable[0];
a875087d
JL
444 } STRUCT_PACKED deauth;
445 struct {
446 le16 capab_info;
447 le16 listen_interval;
448 /* followed by SSID and Supported rates */
449 u8 variable[0];
450 } STRUCT_PACKED assoc_req;
451 struct {
452 le16 capab_info;
453 le16 status_code;
454 le16 aid;
455 /* followed by Supported rates */
456 u8 variable[0];
457 } STRUCT_PACKED assoc_resp, reassoc_resp;
458 struct {
459 le16 capab_info;
460 le16 listen_interval;
461 u8 current_ap[6];
462 /* followed by SSID and Supported rates */
463 u8 variable[0];
464 } STRUCT_PACKED reassoc_req;
465 struct {
466 le16 reason_code;
4781064b 467 u8 variable[0];
a875087d
JL
468 } STRUCT_PACKED disassoc;
469 struct {
470 u8 timestamp[8];
471 le16 beacon_int;
472 le16 capab_info;
473 /* followed by some of SSID, Supported rates,
474 * FH Params, DS Params, CF Params, IBSS Params, TIM */
475 u8 variable[0];
476 } STRUCT_PACKED beacon;
477 struct {
478 /* only variable items: SSID, Supported rates */
479 u8 variable[0];
480 } STRUCT_PACKED probe_req;
481 struct {
482 u8 timestamp[8];
483 le16 beacon_int;
484 le16 capab_info;
485 /* followed by some of SSID, Supported rates,
486 * FH Params, DS Params, CF Params, IBSS Params */
487 u8 variable[0];
488 } STRUCT_PACKED probe_resp;
489 struct {
490 u8 category;
491 union {
492 struct {
493 u8 action_code;
494 u8 dialog_token;
495 u8 status_code;
496 u8 variable[0];
497 } STRUCT_PACKED wmm_action;
498 struct{
499 u8 action_code;
500 u8 element_id;
501 u8 length;
502 u8 switch_mode;
503 u8 new_chan;
504 u8 switch_count;
505 } STRUCT_PACKED chan_switch;
506 struct {
507 u8 action;
508 u8 sta_addr[ETH_ALEN];
509 u8 target_ap_addr[ETH_ALEN];
510 u8 variable[0]; /* FT Request */
511 } STRUCT_PACKED ft_action_req;
512 struct {
513 u8 action;
514 u8 sta_addr[ETH_ALEN];
515 u8 target_ap_addr[ETH_ALEN];
516 le16 status_code;
517 u8 variable[0]; /* FT Request */
518 } STRUCT_PACKED ft_action_resp;
519 struct {
520 u8 action;
521 u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
522 } STRUCT_PACKED sa_query_req;
523 struct {
524 u8 action; /* */
525 u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
526 } STRUCT_PACKED sa_query_resp;
4781064b
JM
527 struct {
528 u8 action;
529 u8 dialogtoken;
530 u8 variable[0];
531 } STRUCT_PACKED wnm_sleep_req;
532 struct {
533 u8 action;
534 u8 dialogtoken;
535 le16 keydata_len;
536 u8 variable[0];
537 } STRUCT_PACKED wnm_sleep_resp;
538 struct {
539 u8 action;
540 u8 variable[0];
541 } STRUCT_PACKED public_action;
542 struct {
543 u8 action; /* 9 */
544 u8 oui[3];
545 /* Vendor-specific content */
546 u8 variable[0];
547 } STRUCT_PACKED vs_public_action;
548 struct {
549 u8 action; /* 7 */
550 u8 dialog_token;
551 u8 req_mode;
552 le16 disassoc_timer;
553 u8 validity_interval;
554 /* BSS Termination Duration (optional),
555 * Session Information URL (optional),
556 * BSS Transition Candidate List
557 * Entries */
558 u8 variable[0];
559 } STRUCT_PACKED bss_tm_req;
560 struct {
561 u8 action; /* 8 */
562 u8 dialog_token;
563 u8 status_code;
564 u8 bss_termination_delay;
565 /* Target BSSID (optional),
566 * BSS Transition Candidate List
567 * Entries (optional) */
568 u8 variable[0];
569 } STRUCT_PACKED bss_tm_resp;
570 struct {
571 u8 action; /* 6 */
572 u8 dialog_token;
573 u8 query_reason;
574 /* BSS Transition Candidate List
575 * Entries (optional) */
576 u8 variable[0];
577 } STRUCT_PACKED bss_tm_query;
a875087d
JL
578 } u;
579 } STRUCT_PACKED action;
580 } u;
581} STRUCT_PACKED;
582
a875087d 583
4781064b
JM
584/* Rx MCS bitmask is in the first 77 bits of supported_mcs_set */
585#define IEEE80211_HT_MCS_MASK_LEN 10
a875087d 586
4781064b
JM
587struct ieee80211_ht_capabilities {
588 le16 ht_capabilities_info;
589 u8 a_mpdu_params;
a875087d 590 u8 supported_mcs_set[16];
4781064b
JM
591 le16 ht_extended_capabilities;
592 le32 tx_bf_capability_info;
593 u8 asel_capabilities;
a875087d
JL
594} STRUCT_PACKED;
595
596
597struct ieee80211_ht_operation {
598 u8 control_chan;
599 u8 ht_param;
600 le16 operation_mode;
601 le16 stbc_param;
602 u8 basic_set[16];
603} STRUCT_PACKED;
604
a875087d 605
4781064b
JM
606struct ieee80211_obss_scan_parameters {
607 le16 scan_passive_dwell;
608 le16 scan_active_dwell;
609 le16 width_trigger_scan_interval;
610 le16 scan_passive_total_per_channel;
611 le16 scan_active_total_per_channel;
612 le16 channel_transition_delay_factor;
613 le16 scan_activity_threshold;
614} STRUCT_PACKED;
a875087d 615
a875087d 616
4781064b
JM
617struct ieee80211_vht_capabilities {
618 le32 vht_capabilities_info;
619 struct {
620 le16 rx_map;
621 le16 rx_highest;
622 le16 tx_map;
623 le16 tx_highest;
624 } vht_supported_mcs_set;
625} STRUCT_PACKED;
a875087d 626
4781064b
JM
627struct ieee80211_vht_operation {
628 u8 vht_op_info_chwidth;
629 u8 vht_op_info_chan_center_freq_seg0_idx;
630 u8 vht_op_info_chan_center_freq_seg1_idx;
631 le16 vht_basic_mcs_set;
632} STRUCT_PACKED;
a875087d 633
4781064b
JM
634#ifdef _MSC_VER
635#pragma pack(pop)
636#endif /* _MSC_VER */
a875087d 637
4781064b
JM
638#define ERP_INFO_NON_ERP_PRESENT BIT(0)
639#define ERP_INFO_USE_PROTECTION BIT(1)
640#define ERP_INFO_BARKER_PREAMBLE_MODE BIT(2)
a875087d
JL
641
642
643#define HT_CAP_INFO_LDPC_CODING_CAP ((u16) BIT(0))
644#define HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET ((u16) BIT(1))
645#define HT_CAP_INFO_SMPS_MASK ((u16) (BIT(2) | BIT(3)))
646#define HT_CAP_INFO_SMPS_STATIC ((u16) 0)
647#define HT_CAP_INFO_SMPS_DYNAMIC ((u16) BIT(2))
648#define HT_CAP_INFO_SMPS_DISABLED ((u16) (BIT(2) | BIT(3)))
649#define HT_CAP_INFO_GREEN_FIELD ((u16) BIT(4))
650#define HT_CAP_INFO_SHORT_GI20MHZ ((u16) BIT(5))
651#define HT_CAP_INFO_SHORT_GI40MHZ ((u16) BIT(6))
652#define HT_CAP_INFO_TX_STBC ((u16) BIT(7))
653#define HT_CAP_INFO_RX_STBC_MASK ((u16) (BIT(8) | BIT(9)))
654#define HT_CAP_INFO_RX_STBC_1 ((u16) BIT(8))
655#define HT_CAP_INFO_RX_STBC_12 ((u16) BIT(9))
656#define HT_CAP_INFO_RX_STBC_123 ((u16) (BIT(8) | BIT(9)))
657#define HT_CAP_INFO_DELAYED_BA ((u16) BIT(10))
658#define HT_CAP_INFO_MAX_AMSDU_SIZE ((u16) BIT(11))
659#define HT_CAP_INFO_DSSS_CCK40MHZ ((u16) BIT(12))
660#define HT_CAP_INFO_PSMP_SUPP ((u16) BIT(13))
661#define HT_CAP_INFO_40MHZ_INTOLERANT ((u16) BIT(14))
662#define HT_CAP_INFO_LSIG_TXOP_PROTECT_SUPPORT ((u16) BIT(15))
663
664
a875087d
JL
665#define EXT_HT_CAP_INFO_PCO ((u16) BIT(0))
666#define EXT_HT_CAP_INFO_TRANS_TIME_OFFSET 1
667#define EXT_HT_CAP_INFO_MCS_FEEDBACK_OFFSET 8
668#define EXT_HT_CAP_INFO_HTC_SUPPORTED ((u16) BIT(10))
669#define EXT_HT_CAP_INFO_RD_RESPONDER ((u16) BIT(11))
670
671
672#define TX_BEAMFORM_CAP_TXBF_CAP ((u32) BIT(0))
673#define TX_BEAMFORM_CAP_RX_STAGGERED_SOUNDING_CAP ((u32) BIT(1))
674#define TX_BEAMFORM_CAP_TX_STAGGERED_SOUNDING_CAP ((u32) BIT(2))
675#define TX_BEAMFORM_CAP_RX_ZLF_CAP ((u32) BIT(3))
676#define TX_BEAMFORM_CAP_TX_ZLF_CAP ((u32) BIT(4))
677#define TX_BEAMFORM_CAP_IMPLICIT_ZLF_CAP ((u32) BIT(5))
678#define TX_BEAMFORM_CAP_CALIB_OFFSET 6
679#define TX_BEAMFORM_CAP_EXPLICIT_CSI_TXBF_CAP ((u32) BIT(8))
680#define TX_BEAMFORM_CAP_EXPLICIT_UNCOMPR_STEERING_MATRIX_CAP ((u32) BIT(9))
681#define TX_BEAMFORM_CAP_EXPLICIT_BF_CSI_FEEDBACK_CAP ((u32) BIT(10))
682#define TX_BEAMFORM_CAP_EXPLICIT_BF_CSI_FEEDBACK_OFFSET 11
683#define TX_BEAMFORM_CAP_EXPLICIT_UNCOMPR_STEERING_MATRIX_FEEDBACK_OFFSET 13
684#define TX_BEAMFORM_CAP_EXPLICIT_COMPRESSED_STEERING_MATRIX_FEEDBACK_OFFSET 15
685#define TX_BEAMFORM_CAP_MINIMAL_GROUPING_OFFSET 17
686#define TX_BEAMFORM_CAP_CSI_NUM_BEAMFORMER_ANT_OFFSET 19
687#define TX_BEAMFORM_CAP_UNCOMPRESSED_STEERING_MATRIX_BEAMFORMER_ANT_OFFSET 21
688#define TX_BEAMFORM_CAP_COMPRESSED_STEERING_MATRIX_BEAMFORMER_ANT_OFFSET 23
689#define TX_BEAMFORM_CAP_SCI_MAX_OF_ROWS_BEANFORMER_SUPPORTED_OFFSET 25
690
691
692#define ASEL_CAPABILITY_ASEL_CAPABLE ((u8) BIT(0))
693#define ASEL_CAPABILITY_EXPLICIT_CSI_FEEDBACK_BASED_TX_AS_CAP ((u8) BIT(1))
694#define ASEL_CAPABILITY_ANT_INDICES_FEEDBACK_BASED_TX_AS_CAP ((u8) BIT(2))
695#define ASEL_CAPABILITY_EXPLICIT_CSI_FEEDBACK_CAP ((u8) BIT(3))
696#define ASEL_CAPABILITY_ANT_INDICES_FEEDBACK_CAP ((u8) BIT(4))
697#define ASEL_CAPABILITY_RX_AS_CAP ((u8) BIT(5))
698#define ASEL_CAPABILITY_TX_SOUND_PPDUS_CAP ((u8) BIT(6))
699
a875087d
JL
700#define HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK ((u8) BIT(0) | BIT(1))
701#define HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE ((u8) BIT(0))
702#define HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW ((u8) BIT(0) | BIT(1))
703#define HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH ((u8) BIT(2))
704#define HT_INFO_HT_PARAM_RIFS_MODE ((u8) BIT(3))
705#define HT_INFO_HT_PARAM_CTRL_ACCESS_ONLY ((u8) BIT(4))
706#define HT_INFO_HT_PARAM_SRV_INTERVAL_GRANULARITY ((u8) BIT(5))
707
4781064b
JM
708
709#define OP_MODE_PURE 0
710#define OP_MODE_MAY_BE_LEGACY_STAS 1
711#define OP_MODE_20MHZ_HT_STA_ASSOCED 2
712#define OP_MODE_MIXED 3
713
a875087d 714#define HT_INFO_OPERATION_MODE_OP_MODE_MASK \
4781064b 715 (0x0001 | 0x0002)
a875087d
JL
716#define HT_INFO_OPERATION_MODE_OP_MODE_OFFSET 0
717#define HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT ((u8) BIT(2))
718#define HT_INFO_OPERATION_MODE_TRANSMIT_BURST_LIMIT ((u8) BIT(3))
719#define HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT ((u8) BIT(4))
720
721#define HT_INFO_STBC_PARAM_DUAL_BEACON ((u16) BIT(6))
722#define HT_INFO_STBC_PARAM_DUAL_STBC_PROTECT ((u16) BIT(7))
723#define HT_INFO_STBC_PARAM_SECONDARY_BCN ((u16) BIT(8))
724#define HT_INFO_STBC_PARAM_LSIG_TXOP_PROTECT_ALLOWED ((u16) BIT(9))
725#define HT_INFO_STBC_PARAM_PCO_ACTIVE ((u16) BIT(10))
726#define HT_INFO_STBC_PARAM_PCO_PHASE ((u16) BIT(11))
727
4781064b
JM
728#define BSS_MEMBERSHIP_SELECTOR_VHT_PHY 126
729#define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127
730
731/* VHT Defines */
732#define VHT_CAP_MAX_MPDU_LENGTH_7991 ((u32) BIT(0))
733#define VHT_CAP_MAX_MPDU_LENGTH_11454 ((u32) BIT(1))
734#define VHT_CAP_MAX_MPDU_LENGTH_MASK ((u32) BIT(0) | BIT(1))
735#define VHT_CAP_SUPP_CHAN_WIDTH_160MHZ ((u32) BIT(2))
736#define VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ ((u32) BIT(3))
737#define VHT_CAP_SUPP_CHAN_WIDTH_MASK ((u32) BIT(2) | BIT(3))
738#define VHT_CAP_RXLDPC ((u32) BIT(4))
739#define VHT_CAP_SHORT_GI_80 ((u32) BIT(5))
740#define VHT_CAP_SHORT_GI_160 ((u32) BIT(6))
741#define VHT_CAP_TXSTBC ((u32) BIT(7))
742#define VHT_CAP_RXSTBC_1 ((u32) BIT(8))
743#define VHT_CAP_RXSTBC_2 ((u32) BIT(9))
744#define VHT_CAP_RXSTBC_3 ((u32) BIT(8) | BIT(9))
745#define VHT_CAP_RXSTBC_4 ((u32) BIT(10))
746#define VHT_CAP_RXSTBC_MASK ((u32) BIT(8) | BIT(9) | \
747 BIT(10))
748#define VHT_CAP_SU_BEAMFORMER_CAPABLE ((u32) BIT(11))
749#define VHT_CAP_SU_BEAMFORMEE_CAPABLE ((u32) BIT(12))
750#define VHT_CAP_BEAMFORMEE_STS_MAX ((u32) BIT(13) | \
751 BIT(14) | BIT(15))
752#define VHT_CAP_BEAMFORMEE_STS_OFFSET 13
753#define VHT_CAP_SOUNDING_DIMENSION_MAX ((u32) BIT(16) | \
754 BIT(17) | BIT(18))
755#define VHT_CAP_SOUNDING_DIMENSION_OFFSET 16
756#define VHT_CAP_MU_BEAMFORMER_CAPABLE ((u32) BIT(19))
757#define VHT_CAP_MU_BEAMFORMEE_CAPABLE ((u32) BIT(20))
758#define VHT_CAP_VHT_TXOP_PS ((u32) BIT(21))
759#define VHT_CAP_HTC_VHT ((u32) BIT(22))
760#define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT ((u32) BIT(23) | \
761 BIT(24) | BIT(25))
762#define VHT_CAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB ((u32) BIT(27))
763#define VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB ((u32) BIT(26) | BIT(27))
764#define VHT_CAP_RX_ANTENNA_PATTERN ((u32) BIT(28))
765#define VHT_CAP_TX_ANTENNA_PATTERN ((u32) BIT(29))
766
767/* VHT channel widths */
768#define VHT_CHANWIDTH_USE_HT 0
769#define VHT_CHANWIDTH_80MHZ 1
770#define VHT_CHANWIDTH_160MHZ 2
771#define VHT_CHANWIDTH_80P80MHZ 3
a875087d
JL
772
773#define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs)
774 * 00:50:F2 */
4781064b
JM
775#define WPA_IE_VENDOR_TYPE 0x0050f201
776#define WPS_IE_VENDOR_TYPE 0x0050f204
777#define OUI_WFA 0x506f9a
778#define P2P_IE_VENDOR_TYPE 0x506f9a09
779#define WFD_IE_VENDOR_TYPE 0x506f9a0a
780#define WFD_OUI_TYPE 10
781#define HS20_IE_VENDOR_TYPE 0x506f9a10
a875087d
JL
782
783#define WMM_OUI_TYPE 2
784#define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0
785#define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1
786#define WMM_OUI_SUBTYPE_TSPEC_ELEMENT 2
787#define WMM_VERSION 1
788
789#define WMM_ACTION_CODE_ADDTS_REQ 0
790#define WMM_ACTION_CODE_ADDTS_RESP 1
791#define WMM_ACTION_CODE_DELTS 2
792
793#define WMM_ADDTS_STATUS_ADMISSION_ACCEPTED 0
794#define WMM_ADDTS_STATUS_INVALID_PARAMETERS 1
795/* 2 - Reserved */
796#define WMM_ADDTS_STATUS_REFUSED 3
797/* 4-255 - Reserved */
798
799/* WMM TSPEC Direction Field Values */
800#define WMM_TSPEC_DIRECTION_UPLINK 0
801#define WMM_TSPEC_DIRECTION_DOWNLINK 1
802/* 2 - Reserved */
803#define WMM_TSPEC_DIRECTION_BI_DIRECTIONAL 3
804
4781064b
JM
805/*
806 * WMM Information Element (used in (Re)Association Request frames; may also be
807 * used in Beacon frames)
808 */
809struct wmm_information_element {
810 /* Element ID: 221 (0xdd); Length: 7 */
811 /* required fields for WMM version 1 */
812 u8 oui[3]; /* 00:50:f2 */
813 u8 oui_type; /* 2 */
814 u8 oui_subtype; /* 0 */
815 u8 version; /* 1 for WMM version 1.0 */
816 u8 qos_info; /* AP/STA specific QoS info */
817
818} STRUCT_PACKED;
819
820#define WMM_QOSINFO_STA_AC_MASK 0x0f
821#define WMM_QOSINFO_STA_SP_MASK 0x03
822#define WMM_QOSINFO_STA_SP_SHIFT 5
823
824#define WMM_AC_AIFSN_MASK 0x0f
825#define WMM_AC_AIFNS_SHIFT 0
826#define WMM_AC_ACM 0x10
827#define WMM_AC_ACI_MASK 0x60
828#define WMM_AC_ACI_SHIFT 5
829
830#define WMM_AC_ECWMIN_MASK 0x0f
831#define WMM_AC_ECWMIN_SHIFT 0
832#define WMM_AC_ECWMAX_MASK 0xf0
833#define WMM_AC_ECWMAX_SHIFT 4
834
835struct wmm_ac_parameter {
836 u8 aci_aifsn; /* AIFSN, ACM, ACI */
837 u8 cw; /* ECWmin, ECWmax (CW = 2^ECW - 1) */
838 le16 txop_limit;
839} STRUCT_PACKED;
840
841/*
842 * WMM Parameter Element (used in Beacon, Probe Response, and (Re)Association
843 * Response frmaes)
844 */
845struct wmm_parameter_element {
846 /* Element ID: 221 (0xdd); Length: 24 */
847 /* required fields for WMM version 1 */
848 u8 oui[3]; /* 00:50:f2 */
849 u8 oui_type; /* 2 */
850 u8 oui_subtype; /* 1 */
851 u8 version; /* 1 for WMM version 1.0 */
852 u8 qos_info; /* AP/STA specific QoS info */
853 u8 reserved; /* 0 */
854 struct wmm_ac_parameter ac[4]; /* AC_BE, AC_BK, AC_VI, AC_VO */
855
856} STRUCT_PACKED;
857
858/* WMM TSPEC Element */
859struct wmm_tspec_element {
860 u8 eid; /* 221 = 0xdd */
861 u8 length; /* 6 + 55 = 61 */
862 u8 oui[3]; /* 00:50:f2 */
863 u8 oui_type; /* 2 */
864 u8 oui_subtype; /* 2 */
865 u8 version; /* 1 */
866 /* WMM TSPEC body (55 octets): */
867 u8 ts_info[3];
868 le16 nominal_msdu_size;
869 le16 maximum_msdu_size;
870 le32 minimum_service_interval;
871 le32 maximum_service_interval;
872 le32 inactivity_interval;
873 le32 suspension_interval;
874 le32 service_start_time;
875 le32 minimum_data_rate;
876 le32 mean_data_rate;
877 le32 peak_data_rate;
878 le32 maximum_burst_size;
879 le32 delay_bound;
880 le32 minimum_phy_rate;
881 le16 surplus_bandwidth_allowance;
882 le16 medium_time;
883} STRUCT_PACKED;
884
885
886/* Access Categories / ACI to AC coding */
887enum {
888 WMM_AC_BE = 0 /* Best Effort */,
889 WMM_AC_BK = 1 /* Background */,
890 WMM_AC_VI = 2 /* Video */,
891 WMM_AC_VO = 3 /* Voice */
892};
893
894
895#define HS20_INDICATION_OUI_TYPE 16
896#define HS20_ANQP_OUI_TYPE 17
897#define HS20_STYPE_QUERY_LIST 1
898#define HS20_STYPE_CAPABILITY_LIST 2
899#define HS20_STYPE_OPERATOR_FRIENDLY_NAME 3
900#define HS20_STYPE_WAN_METRICS 4
901#define HS20_STYPE_CONNECTION_CAPABILITY 5
902#define HS20_STYPE_NAI_HOME_REALM_QUERY 6
903#define HS20_STYPE_OPERATING_CLASS 7
904
905/* Wi-Fi Direct (P2P) */
906
907#define P2P_OUI_TYPE 9
908
909enum p2p_attr_id {
910 P2P_ATTR_STATUS = 0,
911 P2P_ATTR_MINOR_REASON_CODE = 1,
912 P2P_ATTR_CAPABILITY = 2,
913 P2P_ATTR_DEVICE_ID = 3,
914 P2P_ATTR_GROUP_OWNER_INTENT = 4,
915 P2P_ATTR_CONFIGURATION_TIMEOUT = 5,
916 P2P_ATTR_LISTEN_CHANNEL = 6,
917 P2P_ATTR_GROUP_BSSID = 7,
918 P2P_ATTR_EXT_LISTEN_TIMING = 8,
919 P2P_ATTR_INTENDED_INTERFACE_ADDR = 9,
920 P2P_ATTR_MANAGEABILITY = 10,
921 P2P_ATTR_CHANNEL_LIST = 11,
922 P2P_ATTR_NOTICE_OF_ABSENCE = 12,
923 P2P_ATTR_DEVICE_INFO = 13,
924 P2P_ATTR_GROUP_INFO = 14,
925 P2P_ATTR_GROUP_ID = 15,
926 P2P_ATTR_INTERFACE = 16,
927 P2P_ATTR_OPERATING_CHANNEL = 17,
928 P2P_ATTR_INVITATION_FLAGS = 18,
929 P2P_ATTR_OOB_GO_NEG_CHANNEL = 19,
930 P2P_ATTR_VENDOR_SPECIFIC = 221
931};
932
933#define P2P_MAX_GO_INTENT 15
934
935/* P2P Capability - Device Capability bitmap */
936#define P2P_DEV_CAPAB_SERVICE_DISCOVERY BIT(0)
937#define P2P_DEV_CAPAB_CLIENT_DISCOVERABILITY BIT(1)
938#define P2P_DEV_CAPAB_CONCURRENT_OPER BIT(2)
939#define P2P_DEV_CAPAB_INFRA_MANAGED BIT(3)
940#define P2P_DEV_CAPAB_DEVICE_LIMIT BIT(4)
941#define P2P_DEV_CAPAB_INVITATION_PROCEDURE BIT(5)
942
943/* P2P Capability - Group Capability bitmap */
944#define P2P_GROUP_CAPAB_GROUP_OWNER BIT(0)
945#define P2P_GROUP_CAPAB_PERSISTENT_GROUP BIT(1)
946#define P2P_GROUP_CAPAB_GROUP_LIMIT BIT(2)
947#define P2P_GROUP_CAPAB_INTRA_BSS_DIST BIT(3)
948#define P2P_GROUP_CAPAB_CROSS_CONN BIT(4)
949#define P2P_GROUP_CAPAB_PERSISTENT_RECONN BIT(5)
950#define P2P_GROUP_CAPAB_GROUP_FORMATION BIT(6)
951#define P2P_GROUP_CAPAB_IP_ADDR_ALLOCATION BIT(7)
952
953/* Invitation Flags */
954#define P2P_INVITATION_FLAGS_TYPE BIT(0)
955
956/* P2P Manageability */
957#define P2P_MAN_DEVICE_MANAGEMENT BIT(0)
958#define P2P_MAN_CROSS_CONNECTION_PERMITTED BIT(1)
959#define P2P_MAN_COEXISTENCE_OPTIONAL BIT(2)
960
961enum p2p_status_code {
962 P2P_SC_SUCCESS = 0,
963 P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE = 1,
964 P2P_SC_FAIL_INCOMPATIBLE_PARAMS = 2,
965 P2P_SC_FAIL_LIMIT_REACHED = 3,
966 P2P_SC_FAIL_INVALID_PARAMS = 4,
967 P2P_SC_FAIL_UNABLE_TO_ACCOMMODATE = 5,
968 P2P_SC_FAIL_PREV_PROTOCOL_ERROR = 6,
969 P2P_SC_FAIL_NO_COMMON_CHANNELS = 7,
970 P2P_SC_FAIL_UNKNOWN_GROUP = 8,
971 P2P_SC_FAIL_BOTH_GO_INTENT_15 = 9,
972 P2P_SC_FAIL_INCOMPATIBLE_PROV_METHOD = 10,
973 P2P_SC_FAIL_REJECTED_BY_USER = 11,
974};
975
976enum p2p_role_indication {
977 P2P_DEVICE_NOT_IN_GROUP = 0x00,
978 P2P_CLIENT_IN_A_GROUP = 0x01,
979 P2P_GO_IN_A_GROUP = 0x02,
980};
981
982#define P2P_WILDCARD_SSID "DIRECT-"
983#define P2P_WILDCARD_SSID_LEN 7
984
985/* P2P action frames */
986enum p2p_act_frame_type {
987 P2P_NOA = 0,
988 P2P_PRESENCE_REQ = 1,
989 P2P_PRESENCE_RESP = 2,
990 P2P_GO_DISC_REQ = 3
991};
992
993/* P2P public action frames */
994enum p2p_action_frame_type {
995 P2P_GO_NEG_REQ = 0,
996 P2P_GO_NEG_RESP = 1,
997 P2P_GO_NEG_CONF = 2,
998 P2P_INVITATION_REQ = 3,
999 P2P_INVITATION_RESP = 4,
1000 P2P_DEV_DISC_REQ = 5,
1001 P2P_DEV_DISC_RESP = 6,
1002 P2P_PROV_DISC_REQ = 7,
1003 P2P_PROV_DISC_RESP = 8
1004};
1005
1006enum p2p_service_protocol_type {
1007 P2P_SERV_ALL_SERVICES = 0,
1008 P2P_SERV_BONJOUR = 1,
1009 P2P_SERV_UPNP = 2,
1010 P2P_SERV_WS_DISCOVERY = 3,
1011 P2P_SERV_WIFI_DISPLAY = 4,
1012 P2P_SERV_VENDOR_SPECIFIC = 255
1013};
1014
1015enum p2p_sd_status {
1016 P2P_SD_SUCCESS = 0,
1017 P2P_SD_PROTO_NOT_AVAILABLE = 1,
1018 P2P_SD_REQUESTED_INFO_NOT_AVAILABLE = 2,
1019 P2P_SD_BAD_REQUEST = 3
1020};
1021
1022
1023enum wifi_display_subelem {
1024 WFD_SUBELEM_DEVICE_INFO = 0,
1025 WFD_SUBELEM_ASSOCIATED_BSSID = 1,
1026 WFD_SUBELEM_AUDIO_FORMATS = 2,
1027 WFD_SUBELEM_VIDEO_FORMATS = 3,
1028 WFD_SUBELEM_3D_VIDEO_FORMATS = 4,
1029 WFD_SUBELEM_CONTENT_PROTECTION = 5,
1030 WFD_SUBELEM_COUPLED_SINK = 6,
1031 WFD_SUBELEM_EXT_CAPAB = 7,
1032 WFD_SUBELEM_LOCAL_IP_ADDRESS = 8,
1033 WFD_SUBELEM_SESSION_INFO = 9
1034};
1035
a875087d
JL
1036
1037#define OUI_BROADCOM 0x00904c /* Broadcom (Epigram) */
1038
1039#define VENDOR_HT_CAPAB_OUI_TYPE 0x33 /* 00-90-4c:0x33 */
1040
4781064b
JM
1041/* cipher suite selectors */
1042#define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00
1043#define WLAN_CIPHER_SUITE_WEP40 0x000FAC01
1044#define WLAN_CIPHER_SUITE_TKIP 0x000FAC02
1045/* reserved: 0x000FAC03 */
1046#define WLAN_CIPHER_SUITE_CCMP 0x000FAC04
1047#define WLAN_CIPHER_SUITE_WEP104 0x000FAC05
1048#define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06
1049#define WLAN_CIPHER_SUITE_NO_GROUP_ADDR 0x000FAC07
1050#define WLAN_CIPHER_SUITE_GCMP 0x000FAC08
1051#define WLAN_CIPHER_SUITE_GCMP_256 0x000FAC09
1052#define WLAN_CIPHER_SUITE_CCMP_256 0x000FAC0A
1053#define WLAN_CIPHER_SUITE_BIP_GMAC_128 0x000FAC0B
1054#define WLAN_CIPHER_SUITE_BIP_GMAC_256 0x000FAC0C
1055#define WLAN_CIPHER_SUITE_BIP_CMAC_256 0x000FAC0D
1056
1057#define WLAN_CIPHER_SUITE_SMS4 0x00147201
1058
1059#define WLAN_CIPHER_SUITE_CKIP 0x00409600
1060#define WLAN_CIPHER_SUITE_CKIP_CMIC 0x00409601
1061#define WLAN_CIPHER_SUITE_CMIC 0x00409602
1062#define WLAN_CIPHER_SUITE_KRK 0x004096FF /* for nl80211 use only */
1063
1064/* AKM suite selectors */
1065#define WLAN_AKM_SUITE_8021X 0x000FAC01
1066#define WLAN_AKM_SUITE_PSK 0x000FAC02
1067#define WLAN_AKM_SUITE_FT_8021X 0x000FAC03
1068#define WLAN_AKM_SUITE_FT_PSK 0x000FAC04
1069#define WLAN_AKM_SUITE_CCKM 0x00409600
1070
1071
1072/* IEEE 802.11v - WNM Action field values */
1073enum wnm_action {
1074 WNM_EVENT_REQ = 0,
1075 WNM_EVENT_REPORT = 1,
1076 WNM_DIAGNOSTIC_REQ = 2,
1077 WNM_DIAGNOSTIC_REPORT = 3,
1078 WNM_LOCATION_CFG_REQ = 4,
1079 WNM_LOCATION_CFG_RESP = 5,
1080 WNM_BSS_TRANS_MGMT_QUERY = 6,
1081 WNM_BSS_TRANS_MGMT_REQ = 7,
1082 WNM_BSS_TRANS_MGMT_RESP = 8,
1083 WNM_FMS_REQ = 9,
1084 WNM_FMS_RESP = 10,
1085 WNM_COLLOCATED_INTERFERENCE_REQ = 11,
1086 WNM_COLLOCATED_INTERFERENCE_REPORT = 12,
1087 WNM_TFS_REQ = 13,
1088 WNM_TFS_RESP = 14,
1089 WNM_TFS_NOTIFY = 15,
1090 WNM_SLEEP_MODE_REQ = 16,
1091 WNM_SLEEP_MODE_RESP = 17,
1092 WNM_TIM_BROADCAST_REQ = 18,
1093 WNM_TIM_BROADCAST_RESP = 19,
1094 WNM_QOS_TRAFFIC_CAPAB_UPDATE = 20,
1095 WNM_CHANNEL_USAGE_REQ = 21,
1096 WNM_CHANNEL_USAGE_RESP = 22,
1097 WNM_DMS_REQ = 23,
1098 WNM_DMS_RESP = 24,
1099 WNM_TIMING_MEASUREMENT_REQ = 25,
1100 WNM_NOTIFICATION_REQ = 26,
1101 WNM_NOTIFICATION_RESP = 27
1102};
1103
1104/* IEEE 802.11v - BSS Transition Management Request - Request Mode */
1105#define WNM_BSS_TM_REQ_PREF_CAND_LIST_INCLUDED BIT(0)
1106#define WNM_BSS_TM_REQ_ABRIDGED BIT(1)
1107#define WNM_BSS_TM_REQ_DISASSOC_IMMINENT BIT(2)
1108#define WNM_BSS_TM_REQ_BSS_TERMINATION_INCLUDED BIT(3)
1109#define WNM_BSS_TM_REQ_ESS_DISASSOC_IMMINENT BIT(4)
1110
1111/* IEEE Std 802.11-2012 - Table 8-253 */
1112enum bss_trans_mgmt_status_code {
1113 WNM_BSS_TM_ACCEPT = 0,
1114 WNM_BSS_TM_REJECT_UNSPECIFIED = 1,
1115 WNM_BSS_TM_REJECT_INSUFFICIENT_BEACON = 2,
1116 WNM_BSS_TM_REJECT_INSUFFICIENT_CAPABITY = 3,
1117 WNM_BSS_TM_REJECT_UNDESIRED = 4,
1118 WNM_BSS_TM_REJECT_DELAY_REQUEST = 5,
1119 WNM_BSS_TM_REJECT_STA_CANDIDATE_LIST_PROVIDED = 6,
1120 WNM_BSS_TM_REJECT_NO_SUITABLE_CANDIDATES = 7,
1121 WNM_BSS_TM_REJECT_LEAVING_ESS = 8
1122};
1123
1124#define WNM_NEIGHBOR_TSF 1
1125#define WNM_NEIGHBOR_CONDENSED_COUNTRY_STRING 2
1126#define WNM_NEIGHBOR_BSS_TRANSITION_CANDIDATE 3
1127#define WNM_NEIGHBOR_BSS_TERMINATION_DURATION 4
1128#define WNM_NEIGHBOR_BEARING 5
1129#define WNM_NEIGHBOR_MEASUREMENT_PILOT 66
1130#define WNM_NEIGHBOR_RRM_ENABLED_CAPABILITIES 70
1131#define WNM_NEIGHBOR_MULTIPLE_BSSID 71
1132
1133/* QoS action */
1134enum qos_action {
1135 QOS_ADDTS_REQ = 0,
1136 QOS_ADDTS_RESP = 1,
1137 QOS_DELTS = 2,
1138 QOS_SCHEDULE = 3,
1139 QOS_QOS_MAP_CONFIG = 4,
1140};
1141
1142/* IEEE Std 802.11-2012, 8.4.2.62 20/40 BSS Coexistence element */
1143#define WLAN_20_40_BSS_COEX_INFO_REQ BIT(0)
1144#define WLAN_20_40_BSS_COEX_40MHZ_INTOL BIT(1)
1145#define WLAN_20_40_BSS_COEX_20MHZ_WIDTH_REQ BIT(2)
1146#define WLAN_20_40_BSS_COEX_OBSS_EXEMPT_REQ BIT(3)
1147#define WLAN_20_40_BSS_COEX_OBSS_EXEMPT_GRNT BIT(4)
1148
1149struct ieee80211_2040_bss_coex_ie {
1150 u8 element_id;
1151 u8 length;
1152 u8 coex_param;
1153} STRUCT_PACKED;
1154
1155struct ieee80211_2040_intol_chan_report {
1156 u8 element_id;
1157 u8 length;
1158 u8 op_class;
1159 u8 variable[0]; /* Channel List */
1160} STRUCT_PACKED;
1161
1162/* IEEE 802.11v - WNM-Sleep Mode element */
1163struct wnm_sleep_element {
1164 u8 eid; /* WLAN_EID_WNMSLEEP */
1165 u8 len;
1166 u8 action_type; /* WNM_SLEEP_ENTER/WNM_SLEEP_MODE_EXIT */
1167 u8 status;
1168 le16 intval;
1169} STRUCT_PACKED;
1170
1171#define WNM_SLEEP_MODE_ENTER 0
1172#define WNM_SLEEP_MODE_EXIT 1
1173
1174enum wnm_sleep_mode_response_status {
1175 WNM_STATUS_SLEEP_ACCEPT = 0,
1176 WNM_STATUS_SLEEP_EXIT_ACCEPT_GTK_UPDATE = 1,
1177 WNM_STATUS_DENIED_ACTION = 2,
1178 WNM_STATUS_DENIED_TMP = 3,
1179 WNM_STATUS_DENIED_KEY = 4,
1180 WNM_STATUS_DENIED_OTHER_WNM_SERVICE = 5
1181};
1182
1183/* WNM-Sleep Mode subelement IDs */
1184enum wnm_sleep_mode_subelement_id {
1185 WNM_SLEEP_SUBELEM_GTK = 0,
1186 WNM_SLEEP_SUBELEM_IGTK = 1
1187};
1188
1189/* Channel Switch modes (802.11h) */
1190#define CHAN_SWITCH_MODE_ALLOW_TX 0
1191#define CHAN_SWITCH_MODE_BLOCK_TX 1
1192
a875087d 1193#endif /* IEEE802_11_DEFS_H */