• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * IEEE 802.11 Frame type definitions
3  * Copyright (c) 2002-2015, Jouni Malinen <j@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 #include <utils/common.h>
14 
15 /* IEEE 802.11 defines */
16 
17 #define WLAN_FC_PVER		0x0003
18 #define WLAN_FC_TODS		0x0100
19 #define WLAN_FC_FROMDS		0x0200
20 #define WLAN_FC_MOREFRAG	0x0400
21 #define WLAN_FC_RETRY		0x0800
22 #define WLAN_FC_PWRMGT		0x1000
23 #define WLAN_FC_MOREDATA	0x2000
24 #define WLAN_FC_ISWEP		0x4000
25 #define WLAN_FC_ORDER		0x8000
26 
27 #define WLAN_FC_GET_TYPE(fc)	(((fc) & 0x000c) >> 2)
28 #define WLAN_FC_GET_STYPE(fc)	(((fc) & 0x00f0) >> 4)
29 
30 #define WLAN_INVALID_MGMT_SEQ   0xFFFF
31 
32 #define WLAN_GET_SEQ_FRAG(seq) ((seq) & (BIT(3) | BIT(2) | BIT(1) | BIT(0)))
33 #define WLAN_GET_SEQ_SEQ(seq) \
34 	(((seq) & (~(BIT(3) | BIT(2) | BIT(1) | BIT(0)))) >> 4)
35 
36 #define WLAN_FC_TYPE_MGMT		0
37 #define WLAN_FC_TYPE_CTRL		1
38 #define WLAN_FC_TYPE_DATA		2
39 
40 /* management */
41 #define WLAN_FC_STYPE_ASSOC_REQ		0
42 #define WLAN_FC_STYPE_ASSOC_RESP	1
43 #define WLAN_FC_STYPE_REASSOC_REQ	2
44 #define WLAN_FC_STYPE_REASSOC_RESP	3
45 #define WLAN_FC_STYPE_PROBE_REQ		4
46 #define WLAN_FC_STYPE_PROBE_RESP	5
47 #define WLAN_FC_STYPE_BEACON		8
48 #define WLAN_FC_STYPE_ATIM		9
49 #define WLAN_FC_STYPE_DISASSOC		10
50 #define WLAN_FC_STYPE_AUTH		11
51 #define WLAN_FC_STYPE_DEAUTH		12
52 #define WLAN_FC_STYPE_ACTION		13
53 
54 /* control */
55 #define WLAN_FC_STYPE_PSPOLL		10
56 #define WLAN_FC_STYPE_RTS		11
57 #define WLAN_FC_STYPE_CTS		12
58 #define WLAN_FC_STYPE_ACK		13
59 #define WLAN_FC_STYPE_CFEND		14
60 #define WLAN_FC_STYPE_CFENDACK		15
61 
62 /* data */
63 #define WLAN_FC_STYPE_DATA		0
64 #define WLAN_FC_STYPE_DATA_CFACK	1
65 #define WLAN_FC_STYPE_DATA_CFPOLL	2
66 #define WLAN_FC_STYPE_DATA_CFACKPOLL	3
67 #define WLAN_FC_STYPE_NULLFUNC		4
68 #define WLAN_FC_STYPE_CFACK		5
69 #define WLAN_FC_STYPE_CFPOLL		6
70 #define WLAN_FC_STYPE_CFACKPOLL		7
71 #define WLAN_FC_STYPE_QOS_DATA		8
72 #define WLAN_FC_STYPE_QOS_DATA_CFACK	9
73 #define WLAN_FC_STYPE_QOS_DATA_CFPOLL	10
74 #define WLAN_FC_STYPE_QOS_DATA_CFACKPOLL	11
75 #define WLAN_FC_STYPE_QOS_NULL		12
76 #define WLAN_FC_STYPE_QOS_CFPOLL	14
77 #define WLAN_FC_STYPE_QOS_CFACKPOLL	15
78 
79 /* Authentication algorithms */
80 #define WLAN_AUTH_OPEN			0
81 #define WLAN_AUTH_SHARED_KEY		1
82 #define WLAN_AUTH_FT			2
83 #define WLAN_AUTH_SAE			3
84 #define WLAN_AUTH_FILS_SK		4
85 #define WLAN_AUTH_FILS_SK_PFS		5
86 #define WLAN_AUTH_FILS_PK		6
87 #define WLAN_AUTH_LEAP			128
88 
89 #define WLAN_AUTH_CHALLENGE_LEN 128
90 
91 #define WLAN_CAPABILITY_ESS BIT(0)
92 #define WLAN_CAPABILITY_IBSS BIT(1)
93 #define WLAN_CAPABILITY_CF_POLLABLE BIT(2)
94 #define WLAN_CAPABILITY_CF_POLL_REQUEST BIT(3)
95 #define WLAN_CAPABILITY_PRIVACY BIT(4)
96 #define WLAN_CAPABILITY_SHORT_PREAMBLE BIT(5)
97 #define WLAN_CAPABILITY_PBCC BIT(6)
98 #define WLAN_CAPABILITY_CHANNEL_AGILITY BIT(7)
99 #define WLAN_CAPABILITY_SPECTRUM_MGMT BIT(8)
100 #define WLAN_CAPABILITY_QOS BIT(9)
101 #define WLAN_CAPABILITY_SHORT_SLOT_TIME BIT(10)
102 #define WLAN_CAPABILITY_APSD BIT(11)
103 #define WLAN_CAPABILITY_RADIO_MEASUREMENT BIT(12)
104 #define WLAN_CAPABILITY_DSSS_OFDM BIT(13)
105 #define WLAN_CAPABILITY_DELAYED_BLOCK_ACK BIT(14)
106 #define WLAN_CAPABILITY_IMM_BLOCK_ACK BIT(15)
107 
108 /* Status codes (IEEE Std 802.11-2016, 9.4.1.9, Table 9-46) */
109 #define WLAN_STATUS_SUCCESS 0
110 #define WLAN_STATUS_UNSPECIFIED_FAILURE 1
111 #define WLAN_STATUS_TDLS_WAKEUP_ALTERNATE 2
112 #define WLAN_STATUS_TDLS_WAKEUP_REJECT 3
113 #define WLAN_STATUS_SECURITY_DISABLED 5
114 #define WLAN_STATUS_UNACCEPTABLE_LIFETIME 6
115 #define WLAN_STATUS_NOT_IN_SAME_BSS 7
116 #define WLAN_STATUS_CAPS_UNSUPPORTED 10
117 #define WLAN_STATUS_REASSOC_NO_ASSOC 11
118 #define WLAN_STATUS_ASSOC_DENIED_UNSPEC 12
119 #define WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 13
120 #define WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION 14
121 #define WLAN_STATUS_CHALLENGE_FAIL 15
122 #define WLAN_STATUS_AUTH_TIMEOUT 16
123 #define WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 17
124 #define WLAN_STATUS_ASSOC_DENIED_RATES 18
125 #define WLAN_STATUS_ASSOC_DENIED_NOSHORT 19
126 #define WLAN_STATUS_SPEC_MGMT_REQUIRED 22
127 #define WLAN_STATUS_PWR_CAPABILITY_NOT_VALID 23
128 #define WLAN_STATUS_SUPPORTED_CHANNEL_NOT_VALID 24
129 #define WLAN_STATUS_ASSOC_DENIED_NO_SHORT_SLOT_TIME 25
130 #define WLAN_STATUS_ASSOC_DENIED_NO_HT 27
131 #define WLAN_STATUS_R0KH_UNREACHABLE 28
132 #define WLAN_STATUS_ASSOC_DENIED_NO_PCO 29
133 #define WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY 30
134 #define WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION 31
135 #define WLAN_STATUS_UNSPECIFIED_QOS_FAILURE 32
136 #define WLAN_STATUS_DENIED_INSUFFICIENT_BANDWIDTH 33
137 #define WLAN_STATUS_DENIED_POOR_CHANNEL_CONDITIONS 34
138 #define WLAN_STATUS_DENIED_QOS_NOT_SUPPORTED 35
139 #define WLAN_STATUS_REQUEST_DECLINED 37
140 #define WLAN_STATUS_INVALID_PARAMETERS 38
141 #define WLAN_STATUS_REJECTED_WITH_SUGGESTED_CHANGES 39
142 #define WLAN_STATUS_INVALID_IE 40
143 #define WLAN_STATUS_GROUP_CIPHER_NOT_VALID 41
144 #define WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID 42
145 #define WLAN_STATUS_AKMP_NOT_VALID 43
146 #define WLAN_STATUS_UNSUPPORTED_RSN_IE_VERSION 44
147 #define WLAN_STATUS_INVALID_RSN_IE_CAPAB 45
148 #define WLAN_STATUS_CIPHER_REJECTED_PER_POLICY 46
149 #define WLAN_STATUS_TS_NOT_CREATED 47
150 #define WLAN_STATUS_DIRECT_LINK_NOT_ALLOWED 48
151 #define WLAN_STATUS_DEST_STA_NOT_PRESENT 49
152 #define WLAN_STATUS_DEST_STA_NOT_QOS_STA 50
153 #define WLAN_STATUS_ASSOC_DENIED_LISTEN_INT_TOO_LARGE 51
154 #define WLAN_STATUS_INVALID_FT_ACTION_FRAME_COUNT 52
155 #define WLAN_STATUS_INVALID_PMKID 53
156 #define WLAN_STATUS_INVALID_MDIE 54
157 #define WLAN_STATUS_INVALID_FTIE 55
158 #define WLAN_STATUS_REQUESTED_TCLAS_NOT_SUPPORTED 56
159 #define WLAN_STATUS_INSUFFICIENT_TCLAS_PROCESSING_RESOURCES 57
160 #define WLAN_STATUS_TRY_ANOTHER_BSS 58
161 #define WLAN_STATUS_GAS_ADV_PROTO_NOT_SUPPORTED 59
162 #define WLAN_STATUS_NO_OUTSTANDING_GAS_REQ 60
163 #define WLAN_STATUS_GAS_RESP_NOT_RECEIVED 61
164 #define WLAN_STATUS_STA_TIMED_OUT_WAITING_FOR_GAS_RESP 62
165 #define WLAN_STATUS_GAS_RESP_LARGER_THAN_LIMIT 63
166 #define WLAN_STATUS_REQ_REFUSED_HOME 64
167 #define WLAN_STATUS_ADV_SRV_UNREACHABLE 65
168 #define WLAN_STATUS_REQ_REFUSED_SSPN 67
169 #define WLAN_STATUS_REQ_REFUSED_UNAUTH_ACCESS 68
170 #define WLAN_STATUS_INVALID_RSNIE 72
171 #define WLAN_STATUS_U_APSD_COEX_NOT_SUPPORTED 73
172 #define WLAN_STATUS_U_APSD_COEX_MODE_NOT_SUPPORTED 74
173 #define WLAN_STATUS_BAD_INTERVAL_WITH_U_APSD_COEX 75
174 #define WLAN_STATUS_ANTI_CLOGGING_TOKEN_REQ 76
175 #define WLAN_STATUS_FINITE_CYCLIC_GROUP_NOT_SUPPORTED 77
176 #define WLAN_STATUS_CANNOT_FIND_ALT_TBTT 78
177 #define WLAN_STATUS_TRANSMISSION_FAILURE 79
178 #define WLAN_STATUS_REQ_TCLAS_NOT_SUPPORTED 80
179 #define WLAN_STATUS_TCLAS_RESOURCES_EXCHAUSTED 81
180 #define WLAN_STATUS_REJECTED_WITH_SUGGESTED_BSS_TRANSITION 82
181 #define WLAN_STATUS_REJECT_WITH_SCHEDULE 83
182 #define WLAN_STATUS_REJECT_NO_WAKEUP_SPECIFIED 84
183 #define WLAN_STATUS_SUCCESS_POWER_SAVE_MODE 85
184 #define WLAN_STATUS_PENDING_ADMITTING_FST_SESSION 86
185 #define WLAN_STATUS_PERFORMING_FST_NOW 87
186 #define WLAN_STATUS_PENDING_GAP_IN_BA_WINDOW 88
187 #define WLAN_STATUS_REJECT_U_PID_SETTING 89
188 #define WLAN_STATUS_REFUSED_EXTERNAL_REASON 92
189 #define WLAN_STATUS_REFUSED_AP_OUT_OF_MEMORY 93
190 #define WLAN_STATUS_REJECTED_EMERGENCY_SERVICE_NOT_SUPPORTED 94
191 #define WLAN_STATUS_QUERY_RESP_OUTSTANDING 95
192 #define WLAN_STATUS_REJECT_DSE_BAND 96
193 #define WLAN_STATUS_TCLAS_PROCESSING_TERMINATED 97
194 #define WLAN_STATUS_TS_SCHEDULE_CONFLICT 98
195 #define WLAN_STATUS_DENIED_WITH_SUGGESTED_BAND_AND_CHANNEL 99
196 #define WLAN_STATUS_MCCAOP_RESERVATION_CONFLICT 100
197 #define WLAN_STATUS_MAF_LIMIT_EXCEEDED 101
198 #define WLAN_STATUS_MCCA_TRACK_LIMIT_EXCEEDED 102
199 #define WLAN_STATUS_DENIED_DUE_TO_SPECTRUM_MANAGEMENT 103
200 #define WLAN_STATUS_ASSOC_DENIED_NO_VHT 104
201 #define WLAN_STATUS_ENABLEMENT_DENIED 105
202 #define WLAN_STATUS_RESTRICTION_FROM_AUTHORIZED_GDB 106
203 #define WLAN_STATUS_AUTHORIZATION_DEENABLED 107
204 #define WLAN_STATUS_FILS_AUTHENTICATION_FAILURE 112
205 #define WLAN_STATUS_UNKNOWN_AUTHENTICATION_SERVER 113
206 
207 /* Reason codes (IEEE Std 802.11-2016, 9.4.1.7, Table 9-45) */
208 #define WLAN_REASON_UNSPECIFIED 1
209 #define WLAN_REASON_PREV_AUTH_NOT_VALID 2
210 #define WLAN_REASON_DEAUTH_LEAVING 3
211 #define WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4
212 #define WLAN_REASON_DISASSOC_AP_BUSY 5
213 #define WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6
214 #define WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 7
215 #define WLAN_REASON_DISASSOC_STA_HAS_LEFT 8
216 #define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9
217 #define WLAN_REASON_PWR_CAPABILITY_NOT_VALID 10
218 #define WLAN_REASON_SUPPORTED_CHANNEL_NOT_VALID 11
219 #define WLAN_REASON_BSS_TRANSITION_DISASSOC 12
220 #define WLAN_REASON_INVALID_IE 13
221 #define WLAN_REASON_MICHAEL_MIC_FAILURE 14
222 #define WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT 15
223 #define WLAN_REASON_GROUP_KEY_UPDATE_TIMEOUT 16
224 #define WLAN_REASON_IE_IN_4WAY_DIFFERS 17
225 #define WLAN_REASON_GROUP_CIPHER_NOT_VALID 18
226 #define WLAN_REASON_PAIRWISE_CIPHER_NOT_VALID 19
227 #define WLAN_REASON_AKMP_NOT_VALID 20
228 #define WLAN_REASON_UNSUPPORTED_RSN_IE_VERSION 21
229 #define WLAN_REASON_INVALID_RSN_IE_CAPAB 22
230 #define WLAN_REASON_IEEE_802_1X_AUTH_FAILED 23
231 #define WLAN_REASON_CIPHER_SUITE_REJECTED 24
232 #define WLAN_REASON_TDLS_TEARDOWN_UNREACHABLE 25
233 #define WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED 26
234 #define WLAN_REASON_SSP_REQUESTED_DISASSOC 27
235 #define WLAN_REASON_NO_SSP_ROAMING_AGREEMENT 28
236 #define WLAN_REASON_BAD_CIPHER_OR_AKM 29
237 #define WLAN_REASON_NOT_AUTHORIZED_THIS_LOCATION 30
238 #define WLAN_REASON_SERVICE_CHANGE_PRECLUDES_TS 31
239 #define WLAN_REASON_UNSPECIFIED_QOS_REASON 32
240 #define WLAN_REASON_NOT_ENOUGH_BANDWIDTH 33
241 #define WLAN_REASON_DISASSOC_LOW_ACK 34
242 #define WLAN_REASON_EXCEEDED_TXOP 35
243 #define WLAN_REASON_STA_LEAVING 36
244 #define WLAN_REASON_END_TS_BA_DLS 37
245 #define WLAN_REASON_UNKNOWN_TS_BA 38
246 #define WLAN_REASON_TIMEOUT 39
247 #define WLAN_REASON_PEERKEY_MISMATCH 45
248 #define WLAN_REASON_AUTHORIZED_ACCESS_LIMIT_REACHED 46
249 #define WLAN_REASON_EXTERNAL_SERVICE_REQUIREMENTS 47
250 #define WLAN_REASON_INVALID_FT_ACTION_FRAME_COUNT 48
251 #define WLAN_REASON_INVALID_PMKID 49
252 #define WLAN_REASON_INVALID_MDE 50
253 #define WLAN_REASON_INVALID_FTE 51
254 #define WLAN_REASON_MESH_PEERING_CANCELLED 52
255 #define WLAN_REASON_MESH_MAX_PEERS 53
256 #define WLAN_REASON_MESH_CONFIG_POLICY_VIOLATION 54
257 #define WLAN_REASON_MESH_CLOSE_RCVD 55
258 #define WLAN_REASON_MESH_MAX_RETRIES 56
259 #define WLAN_REASON_MESH_CONFIRM_TIMEOUT 57
260 #define WLAN_REASON_MESH_INVALID_GTK 58
261 #define WLAN_REASON_MESH_INCONSISTENT_PARAMS 59
262 #define WLAN_REASON_MESH_INVALID_SECURITY_CAP 60
263 #define WLAN_REASON_MESH_PATH_ERROR_NO_PROXY_INFO 61
264 #define WLAN_REASON_MESH_PATH_ERROR_NO_FORWARDING_INFO 62
265 #define WLAN_REASON_MESH_PATH_ERROR_DEST_UNREACHABLE 63
266 #define WLAN_REASON_MAC_ADDRESS_ALREADY_EXISTS_IN_MBSS 64
267 #define WLAN_REASON_MESH_CHANNEL_SWITCH_REGULATORY_REQ 65
268 #define WLAN_REASON_MESH_CHANNEL_SWITCH_UNSPECIFIED 66
269 
270 
271 /* Information Element IDs (IEEE Std 802.11-2016, 9.4.2.1, Table 9-77) */
272 #define WLAN_EID_SSID 0
273 #define WLAN_EID_SUPP_RATES 1
274 #define WLAN_EID_DS_PARAMS 3
275 #define WLAN_EID_CF_PARAMS 4
276 #define WLAN_EID_TIM 5
277 #define WLAN_EID_IBSS_PARAMS 6
278 #define WLAN_EID_COUNTRY 7
279 #define WLAN_EID_REQUEST 10
280 #define WLAN_EID_BSS_LOAD 11
281 #define WLAN_EID_EDCA_PARAM_SET 12
282 #define WLAN_EID_TSPEC 13
283 #define WLAN_EID_TCLAS 14
284 #define WLAN_EID_SCHEDULE 15
285 #define WLAN_EID_CHALLENGE 16
286 #define WLAN_EID_PWR_CONSTRAINT 32
287 #define WLAN_EID_PWR_CAPABILITY 33
288 #define WLAN_EID_TPC_REQUEST 34
289 #define WLAN_EID_TPC_REPORT 35
290 #define WLAN_EID_SUPPORTED_CHANNELS 36
291 #define WLAN_EID_CHANNEL_SWITCH 37
292 #define WLAN_EID_MEASURE_REQUEST 38
293 #define WLAN_EID_MEASURE_REPORT 39
294 #define WLAN_EID_QUIET 40
295 #define WLAN_EID_IBSS_DFS 41
296 #define WLAN_EID_ERP_INFO 42
297 #define WLAN_EID_TS_DELAY 43
298 #define WLAN_EID_TCLAS_PROCESSING 44
299 #define WLAN_EID_HT_CAP 45
300 #define WLAN_EID_QOS 46
301 #define WLAN_EID_RSN 48
302 #define WLAN_EID_EXT_SUPP_RATES 50
303 #define WLAN_EID_AP_CHANNEL_REPORT 51
304 #define WLAN_EID_NEIGHBOR_REPORT 52
305 #define WLAN_EID_RCPI 53
306 #define WLAN_EID_MOBILITY_DOMAIN 54
307 #define WLAN_EID_FAST_BSS_TRANSITION 55
308 #define WLAN_EID_TIMEOUT_INTERVAL 56
309 #define WLAN_EID_RIC_DATA 57
310 #define WLAN_EID_DSE_REGISTERED_LOCATION 58
311 #define WLAN_EID_SUPPORTED_OPERATING_CLASSES 59
312 #define WLAN_EID_EXT_CHANSWITCH_ANN 60
313 #define WLAN_EID_HT_OPERATION 61
314 #define WLAN_EID_SECONDARY_CHANNEL_OFFSET 62
315 #define WLAN_EID_BSS_AVERAGE_ACCESS_DELAY 63
316 #define WLAN_EID_ANTENNA 64
317 #define WLAN_EID_RSNI 65
318 #define WLAN_EID_MEASUREMENT_PILOT_TRANSMISSION 66
319 #define WLAN_EID_BSS_AVAILABLE_ADM_CAPA 67
320 #define WLAN_EID_BSS_AC_ACCESS_DELAY 68 /* note: also used by WAPI */
321 #define WLAN_EID_TIME_ADVERTISEMENT 69
322 #define WLAN_EID_RRM_ENABLED_CAPABILITIES 70
323 #define WLAN_EID_MULTIPLE_BSSID 71
324 #define WLAN_EID_20_40_BSS_COEXISTENCE 72
325 #define WLAN_EID_20_40_BSS_INTOLERANT 73
326 #define WLAN_EID_OVERLAPPING_BSS_SCAN_PARAMS 74
327 #define WLAN_EID_RIC_DESCRIPTOR 75
328 #define WLAN_EID_MMIE 76
329 #define WLAN_EID_EVENT_REQUEST 78
330 #define WLAN_EID_EVENT_REPORT 79
331 #define WLAN_EID_DIAGNOSTIC_REQUEST 80
332 #define WLAN_EID_DIAGNOSTIC_REPORT 81
333 #define WLAN_EID_LOCATION_PARAMETERS 82
334 #define WLAN_EID_NONTRANSMITTED_BSSID_CAPA 83
335 #define WLAN_EID_SSID_LIST 84
336 #define WLAN_EID_MLTIPLE_BSSID_INDEX 85
337 #define WLAN_EID_FMS_DESCRIPTOR 86
338 #define WLAN_EID_FMS_REQUEST 87
339 #define WLAN_EID_FMS_RESPONSE 88
340 #define WLAN_EID_QOS_TRAFFIC_CAPABILITY 89
341 #define WLAN_EID_BSS_MAX_IDLE_PERIOD 90
342 #define WLAN_EID_TFS_REQ 91
343 #define WLAN_EID_TFS_RESP 92
344 #define WLAN_EID_WNMSLEEP 93
345 #define WLAN_EID_TIM_BROADCAST_REQUEST 94
346 #define WLAN_EID_TIM_BROADCAST_RESPONSE 95
347 #define WLAN_EID_COLLOCATED_INTERFERENCE_REPORT 96
348 #define WLAN_EID_CHANNEL_USAGE 97
349 #define WLAN_EID_TIME_ZONE 98
350 #define WLAN_EID_DMS_REQUEST 99
351 #define WLAN_EID_DMS_RESPONSE 100
352 #define WLAN_EID_LINK_ID 101
353 #define WLAN_EID_WAKEUP_SCHEDULE 102
354 #define WLAN_EID_CHANNEL_SWITCH_TIMING 104
355 #define WLAN_EID_PTI_CONTROL 105
356 #define WLAN_EID_TPU_BUFFER_STATUS 106
357 #define WLAN_EID_INTERWORKING 107
358 #define WLAN_EID_ADV_PROTO 108
359 #define WLAN_EID_EXPEDITED_BANDWIDTH_REQ 109
360 #define WLAN_EID_QOS_MAP_SET 110
361 #define WLAN_EID_ROAMING_CONSORTIUM 111
362 #define WLAN_EID_EMERGENCY_ALERT_ID 112
363 #define WLAN_EID_MESH_CONFIG 113
364 #define WLAN_EID_MESH_ID 114
365 #define WLAN_EID_MESH_LINK_METRIC_REPORT 115
366 #define WLAN_EID_CONGESTION_NOTIFICATION 116
367 #define WLAN_EID_PEER_MGMT 117
368 #define WLAN_EID_MESH_CHANNEL_SWITCH_PARAMETERS 118
369 #define WLAN_EID_MESH_AWAKE_WINDOW 119
370 #define WLAN_EID_BEACON_TIMING 120
371 #define WLAN_EID_MCCAOP_SETUP_REQUEST 121
372 #define WLAN_EID_MCCAOP_SETUP_REPLY 122
373 #define WLAN_EID_MCCAOP_ADVERTISEMENT 123
374 #define WLAN_EID_MCCAOP_TEARDOWN 124
375 #define WLAN_EID_GANN 125
376 #define WLAN_EID_RANN 126
377 #define WLAN_EID_EXT_CAPAB 127
378 #define WLAN_EID_PREQ 130
379 #define WLAN_EID_PREP 131
380 #define WLAN_EID_PERR 132
381 #define WLAN_EID_PXU 137
382 #define WLAN_EID_PXUC 138
383 #define WLAN_EID_AMPE 139
384 #define WLAN_EID_MIC 140
385 #define WLAN_EID_DESTINATION_URI 141
386 #define WLAN_EID_U_APSD_COEX 142
387 #define WLAN_EID_DMG_WAKEUP_SCHEDULE 143
388 #define WLAN_EID_EXTENDED_SCHEDULE 144
389 #define WLAN_EID_STA_AVAILABILITY 145
390 #define WLAN_EID_DMG_TSPEC 146
391 #define WLAN_EID_NEXT_DMG_ATI 147
392 #define WLAN_EID_DMG_CAPABILITIES 148
393 #define WLAN_EID_DMG_OPERATION 151
394 #define WLAN_EID_DMG_BSS_PARAMETER_CHANGE 152
395 #define WLAN_EID_DMG_BEAM_REFINEMENT 153
396 #define WLAN_EID_CHANNEL_MEASUREMENT_FEEDBACK 154
397 #define WLAN_EID_CCKM 156
398 #define WLAN_EID_AWAKE_WINDOW 157
399 #define WLAN_EID_MULTI_BAND 158
400 #define WLAN_EID_ADDBA_EXTENSION 159
401 #define WLAN_EID_NEXTPCP_LIST 160
402 #define WLAN_EID_PCP_HANDOVER 161
403 #define WLAN_EID_DMG_LINK_MARGIN 162
404 #define WLAN_EID_SWITCHING_STREAM 163
405 #define WLAN_EID_SESSION_TRANSITION 164
406 #define WLAN_EID_DYNAMIC_TONE_PAIRING_REPORT 165
407 #define WLAN_EID_CLUSTER_REPORT 166
408 #define WLAN_EID_REPLAY_CAPABILITIES 167
409 #define WLAN_EID_RELAY_TRANSFER_PARAM_SET 168
410 #define WLAN_EID_BEAMLINK_MAINTENANCE 169
411 #define WLAN_EID_MULTIPLE_MAC_SUBLAYERS 170
412 #define WLAN_EID_U_PID 171
413 #define WLAN_EID_DMG_LINK_ADAPTATION_ACK 172
414 #define WLAN_EID_MCCAOP_ADVERTISEMENT_OVERVIEW 174
415 #define WLAN_EID_QUIET_PERIOD_REQUEST 175
416 #define WLAN_EID_QUIET_PERIOD_RESPONSE 177
417 #define WLAN_EID_QMF_POLICY 181
418 #define WLAN_EID_ECAPC_POLICY 182
419 #define WLAN_EID_CLUSTER_TIME_OFFSET 183
420 #define WLAN_EID_INTRA_ACCESS_CATEGORY_PRIORITY 184
421 #define WLAN_EID_SCS_DESCRIPTOR 185
422 #define WLAN_EID_QLOAD_REPORT 186
423 #define WLAN_EID_HCCA_TXOP_UPDATE_COUNT 187
424 #define WLAN_EID_HIGHER_LAYER_STREAM_ID 188
425 #define WLAN_EID_GCR_GROUP_ADDRESS 189
426 #define WLAN_EID_ANTENNA_SECTOR_ID_PATTERN 190
427 #define WLAN_EID_VHT_CAP 191
428 #define WLAN_EID_VHT_OPERATION 192
429 #define WLAN_EID_VHT_EXTENDED_BSS_LOAD 193
430 #define WLAN_EID_VHT_WIDE_BW_CHSWITCH  194
431 #define WLAN_EID_VHT_TRANSMIT_POWER_ENVELOPE 195
432 #define WLAN_EID_VHT_CHANNEL_SWITCH_WRAPPER 196
433 #define WLAN_EID_VHT_AID 197
434 #define WLAN_EID_VHT_QUIET_CHANNEL 198
435 #define WLAN_EID_VHT_OPERATING_MODE_NOTIFICATION 199
436 #define WLAN_EID_UPSIM 200
437 #define WLAN_EID_REDUCED_NEIGHBOR_REPORT 201
438 #define WLAN_EID_TVHT_OPERATION 202
439 #define WLAN_EID_DEVICE_LOCATION 204
440 #define WLAN_EID_WHITE_SPACE_MAP 205
441 #define WLAN_EID_FTM_PARAMETERS 206
442 #define WLAN_EID_VENDOR_SPECIFIC 221
443 #define WLAN_EID_CAG_NUMBER 237
444 #define WLAN_EID_AP_CSN 239
445 #define WLAN_EID_FILS_INDICATION 240
446 #define WLAN_EID_DILS 241
447 #define WLAN_EID_FRAGMENT 242
448 #define WLAN_EID_EXTENSION 255
449 
450 /* Element ID Extension (EID 255) values */
451 #define WLAN_EID_EXT_ASSOC_DELAY_INFO 1
452 #define WLAN_EID_EXT_FILS_REQ_PARAMS 2
453 #define WLAN_EID_EXT_FILS_KEY_CONFIRM 3
454 #define WLAN_EID_EXT_FILS_SESSION 4
455 #define WLAN_EID_EXT_FILS_HLP_CONTAINER 5
456 #define WLAN_EID_EXT_FILS_IP_ADDR_ASSIGN 6
457 #define WLAN_EID_EXT_KEY_DELIVERY 7
458 #define WLAN_EID_EXT_FILS_WRAPPED_DATA 8
459 #define WLAN_EID_EXT_FTM_SYNC_INFO 9
460 #define WLAN_EID_EXT_EXTENDED_REQUEST 10
461 #define WLAN_EID_EXT_ESTIMATED_SERVICE_PARAMS 11
462 #define WLAN_EID_EXT_FILS_PUBLIC_KEY 12
463 #define WLAN_EID_EXT_FILS_NONCE 13
464 #define WLAN_EID_EXT_FUTURE_CHANNEL_GUIDANCE 14
465 
466 
467 /* Action frame categories (IEEE Std 802.11-2016, 9.4.1.11, Table 9-76) */
468 #define WLAN_ACTION_SPECTRUM_MGMT 0
469 #define WLAN_ACTION_QOS 1
470 #define WLAN_ACTION_DLS 2
471 #define WLAN_ACTION_BLOCK_ACK 3
472 #define WLAN_ACTION_PUBLIC 4
473 #define WLAN_ACTION_RADIO_MEASUREMENT 5
474 #define WLAN_ACTION_FT 6
475 #define WLAN_ACTION_HT 7
476 #define WLAN_ACTION_SA_QUERY 8
477 #define WLAN_ACTION_PROTECTED_DUAL 9
478 #define WLAN_ACTION_WNM 10
479 #define WLAN_ACTION_UNPROTECTED_WNM 11
480 #define WLAN_ACTION_TDLS 12
481 #define WLAN_ACTION_MESH 13
482 #define WLAN_ACTION_MULTIHOP 14
483 #define WLAN_ACTION_SELF_PROTECTED 15
484 #define WLAN_ACTION_DMG 16
485 #define WLAN_ACTION_WMM 17 /* WMM Specification 1.1 */
486 #define WLAN_ACTION_FST 18
487 #define WLAN_ACTION_ROBUST_AV_STREAMING 19
488 #define WLAN_ACTION_UNPROTECTED_DMG 20
489 #define WLAN_ACTION_VHT 21
490 #define WLAN_ACTION_FILS 26
491 #define WLAN_ACTION_VENDOR_SPECIFIC_PROTECTED 126
492 #define WLAN_ACTION_VENDOR_SPECIFIC 127
493 /* Note: 128-255 used to report errors by setting category | 0x80 */
494 
495 /* Public action codes (IEEE Std 802.11-2016, 9.6.8.1, Table 9-307) */
496 #define WLAN_PA_20_40_BSS_COEX 0
497 #define WLAN_PA_DSE_ENABLEMENT 1
498 #define WLAN_PA_DSE_DEENABLEMENT 2
499 #define WLAN_PA_DSE_REG_LOCATION_ANNOUNCE 3
500 #define WLAN_PA_EXT_CHANNEL_SWITCH_ANNOUNCE 4
501 #define WLAN_PA_DSE_MEASUREMENT_REQ 5
502 #define WLAN_PA_DSE_MEASUREMENT_RESP 6
503 #define WLAN_PA_MEASUREMENT_PILOT 7
504 #define WLAN_PA_DSE_POWER_CONSTRAINT 8
505 #define WLAN_PA_VENDOR_SPECIFIC 9
506 #define WLAN_PA_GAS_INITIAL_REQ 10
507 #define WLAN_PA_GAS_INITIAL_RESP 11
508 #define WLAN_PA_GAS_COMEBACK_REQ 12
509 #define WLAN_PA_GAS_COMEBACK_RESP 13
510 #define WLAN_TDLS_DISCOVERY_RESPONSE 14
511 #define WLAN_PA_LOCATION_TRACK_NOTIFICATION 15
512 #define WLAN_PA_QAB_REQUEST_FRAME 16
513 #define WLAN_PA_QAB_RESPONSE_FRAME 17
514 #define WLAN_PA_QMF_POLICY 18
515 #define WLAN_PA_QMF_POLICY_CHANGE 19
516 #define WLAN_PA_QLOAD_REQUEST 20
517 #define WLAN_PA_QLOAD_REPORT 21
518 #define WLAN_PA_HCCA_TXOP_ADVERTISEMENT 22
519 #define WLAN_PA_HCCA_TXOP_RESPONSE 23
520 #define WLAN_PA_PUBLIC_KEY 24
521 #define WLAN_PA_CHANNEL_AVAILABILITY_QUERY 25
522 #define WLAN_PA_CHANNEL_SCHEDULE_MANAGEMENT 26
523 #define WLAN_PA_CONTACT_VERIFICATION_SIGNAL 27
524 #define WLAN_PA_GDD_ENABLEMENT_REQ 28
525 #define WLAN_PA_GDD_ENABLEMENT_RESP 29
526 #define WLAN_PA_NETWORK_CHANNEL_CONTROL 30
527 #define WLAN_PA_WHITE_SPACE_MAP_ANNOUNCEMENT 31
528 #define WLAN_PA_FTM_REQUEST 32
529 #define WLAN_PA_FTM 33
530 #define WLAN_PA_FILS_DISCOVERY 34
531 
532 /* Protected Dual of Public Action frames (IEEE Std 802.11-2016, 9.6.11,
533  * Table 9-332) */
534 #define WLAN_PROT_DSE_ENABLEMENT 1
535 #define WLAN_PROT_DSE_DEENABLEMENT 2
536 #define WLAN_PROT_EXT_CSA 4
537 #define WLAN_PROT_MEASUREMENT_REQ 5
538 #define WLAN_PROT_MEASUREMENT_REPORT 6
539 #define WLAN_PROT_DSE_POWER_CONSTRAINT 8
540 #define WLAN_PROT_VENDOR_SPECIFIC 9
541 #define WLAN_PROT_GAS_INITIAL_REQ 10
542 #define WLAN_PROT_GAS_INITIAL_RESP 11
543 #define WLAN_PROT_GAS_COMEBACK_REQ 12
544 #define WLAN_PROT_GAS_COMEBACK_RESP 13
545 #define WLAN_PROT_QAB_REQUEST_FRAME 16
546 #define WLAN_PROT_QAB_RESPONSE_FRAME 17
547 #define WLAN_PROT_QMF_POLICY 18
548 #define WLAN_PROT_QMF_POLICY_CHANGE 19
549 #define WLAN_PROT_QLOAD_REQUEST 20
550 #define WLAN_PROT_QLOAD_REPORT 21
551 #define WLAN_PROT_HCCA_TXOP_ADVERTISEMENT 22
552 #define WLAN_PROT_HCCA_TXOP_RESPONSE 23
553 #define WLAN_PROT_CHANNEL_AVAILABILITY_QUERY 25
554 #define WLAN_PROT_CHANNEL_SCHEDULE_MANAGEMENT 26
555 #define WLAN_PROT_CONTACT_VERIFICATION_SIGNAL 27
556 #define WLAN_PROT_GDD_ENABLEMENT_REQ 28
557 #define WLAN_PROT_GDD_ENABLEMENT_RESP 29
558 #define WLAN_PROT_NETWORK_CHANNEL_CONTROL 30
559 #define WLAN_PROT_WHITE_SPACE_MAP_ANNOUNCEMENT 31
560 
561 /* SA Query Action frame (IEEE 802.11w/D8.0, 7.4.9) */
562 #define WLAN_SA_QUERY_REQUEST 0
563 #define WLAN_SA_QUERY_RESPONSE 1
564 
565 #define WLAN_SA_QUERY_TR_ID_LEN 2
566 
567 /* TDLS action codes */
568 #define WLAN_TDLS_SETUP_REQUEST 0
569 #define WLAN_TDLS_SETUP_RESPONSE 1
570 #define WLAN_TDLS_SETUP_CONFIRM 2
571 #define WLAN_TDLS_TEARDOWN 3
572 #define WLAN_TDLS_PEER_TRAFFIC_INDICATION 4
573 #define WLAN_TDLS_CHANNEL_SWITCH_REQUEST 5
574 #define WLAN_TDLS_CHANNEL_SWITCH_RESPONSE 6
575 #define WLAN_TDLS_PEER_PSM_REQUEST 7
576 #define WLAN_TDLS_PEER_PSM_RESPONSE 8
577 #define WLAN_TDLS_PEER_TRAFFIC_RESPONSE 9
578 #define WLAN_TDLS_DISCOVERY_REQUEST 10
579 
580 /* Radio Measurement Action codes */
581 #define WLAN_RRM_RADIO_MEASUREMENT_REQUEST 0
582 #define WLAN_RRM_RADIO_MEASUREMENT_REPORT 1
583 #define WLAN_RRM_LINK_MEASUREMENT_REQUEST 2
584 #define WLAN_RRM_LINK_MEASUREMENT_REPORT 3
585 #define WLAN_RRM_NEIGHBOR_REPORT_REQUEST 4
586 #define WLAN_RRM_NEIGHBOR_REPORT_RESPONSE 5
587 
588 /* Radio Measurement capabilities (from RM Enabled Capabilities element)
589  * IEEE Std 802.11-2016, 9.4.2.45, Table 9-157 */
590 /* byte 1 (out of 5) */
591 #define WLAN_RRM_CAPS_LINK_MEASUREMENT BIT(0)
592 #define WLAN_RRM_CAPS_NEIGHBOR_REPORT BIT(1)
593 #define WLAN_RRM_CAPS_BEACON_REPORT_PASSIVE BIT(4)
594 #define WLAN_RRM_CAPS_BEACON_REPORT_ACTIVE BIT(5)
595 #define WLAN_RRM_CAPS_BEACON_REPORT_TABLE BIT(6)
596 /* byte 2 (out of 5) */
597 #define WLAN_RRM_CAPS_LCI_MEASUREMENT BIT(4)
598 /* byte 5 (out of 5) */
599 #define WLAN_RRM_CAPS_FTM_RANGE_REPORT BIT(2)
600 
601 /*
602  * IEEE P802.11-REVmc/D5.0, 9.4.2.21.19 (Fine Timing Measurement Range
603  * request) - Minimum AP count
604  */
605 #define WLAN_RRM_RANGE_REQ_MAX_MIN_AP 15
606 
607 /* Timeout Interval Type */
608 #define WLAN_TIMEOUT_REASSOC_DEADLINE 1
609 #define WLAN_TIMEOUT_KEY_LIFETIME 2
610 #define WLAN_TIMEOUT_ASSOC_COMEBACK 3
611 
612 /* Interworking element (IEEE 802.11u) - Access Network Options */
613 #define INTERWORKING_ANO_ACCESS_NETWORK_MASK 0x0f
614 #define INTERWORKING_ANO_INTERNET 0x10
615 #define INTERWORKING_ANO_ASRA 0x20
616 #define INTERWORKING_ANO_ESR 0x40
617 #define INTERWORKING_ANO_UESA 0x80
618 
619 #define INTERWORKING_ANT_PRIVATE 0
620 #define INTERWORKING_ANT_PRIVATE_WITH_GUEST 1
621 #define INTERWORKING_ANT_CHARGEABLE_PUBLIC 2
622 #define INTERWORKING_ANT_FREE_PUBLIC 3
623 #define INTERWORKING_ANT_PERSONAL_DEVICE 4
624 #define INTERWORKING_ANT_EMERGENCY_SERVICES 5
625 #define INTERWORKING_ANT_TEST 6
626 #define INTERWORKING_ANT_WILDCARD 15
627 
628 /* Advertisement Protocol ID definitions (IEEE Std 802.11-2016, Table 9-215) */
629 enum adv_proto_id {
630 	ACCESS_NETWORK_QUERY_PROTOCOL = 0,
631 	MIH_INFO_SERVICE = 1,
632 	MIH_CMD_AND_EVENT_DISCOVERY = 2,
633 	EMERGENCY_ALERT_SYSTEM = 3,
634 	REGISTERED_LOCATION_QUERY_PROTO = 4,
635 	ADV_PROTO_VENDOR_SPECIFIC = 221
636 };
637 
638 /* Access Network Query Protocol info ID definitions (IEEE Std 802.11-2016,
639  * Table 9-271; P802.11ai) */
640 enum anqp_info_id {
641 	ANQP_QUERY_LIST = 256,
642 	ANQP_CAPABILITY_LIST = 257,
643 	ANQP_VENUE_NAME = 258,
644 	ANQP_EMERGENCY_CALL_NUMBER = 259,
645 	ANQP_NETWORK_AUTH_TYPE = 260,
646 	ANQP_ROAMING_CONSORTIUM = 261,
647 	ANQP_IP_ADDR_TYPE_AVAILABILITY = 262,
648 	ANQP_NAI_REALM = 263,
649 	ANQP_3GPP_CELLULAR_NETWORK = 264,
650 	ANQP_AP_GEOSPATIAL_LOCATION = 265,
651 	ANQP_AP_CIVIC_LOCATION = 266,
652 	ANQP_AP_LOCATION_PUBLIC_URI = 267,
653 	ANQP_DOMAIN_NAME = 268,
654 	ANQP_EMERGENCY_ALERT_URI = 269,
655 	ANQP_TDLS_CAPABILITY = 270,
656 	ANQP_EMERGENCY_NAI = 271,
657 	ANQP_NEIGHBOR_REPORT = 272,
658 	ANQP_QUERY_AP_LIST = 273,
659 	ANQP_AP_LIST_RESPONSE = 274,
660 	ANQP_FILS_REALM_INFO = 275,
661 	ANQP_CAG = 276,
662 	ANQP_VENUE_URL = 277,
663 	ANQP_ADVICE_OF_CHARGE = 278,
664 	ANQP_LOCAL_CONTENT = 279,
665 	ANQP_NETWORK_AUTH_TYPE_TIMESTAMP = 280,
666 	ANQP_VENDOR_SPECIFIC = 56797
667 };
668 
669 /* NAI Realm list - EAP Method subfield - Authentication Parameter ID */
670 enum nai_realm_eap_auth_param {
671 	NAI_REALM_EAP_AUTH_EXPANDED_EAP_METHOD = 1,
672 	NAI_REALM_EAP_AUTH_NON_EAP_INNER_AUTH = 2,
673 	NAI_REALM_EAP_AUTH_INNER_AUTH_EAP_METHOD = 3,
674 	NAI_REALM_EAP_AUTH_EXPANDED_INNER_EAP_METHOD = 4,
675 	NAI_REALM_EAP_AUTH_CRED_TYPE = 5,
676 	NAI_REALM_EAP_AUTH_TUNNELED_CRED_TYPE = 6,
677 	NAI_REALM_EAP_AUTH_VENDOR_SPECIFIC = 221
678 };
679 
680 enum nai_realm_eap_auth_inner_non_eap {
681 	NAI_REALM_INNER_NON_EAP_PAP = 1,
682 	NAI_REALM_INNER_NON_EAP_CHAP = 2,
683 	NAI_REALM_INNER_NON_EAP_MSCHAP = 3,
684 	NAI_REALM_INNER_NON_EAP_MSCHAPV2 = 4
685 };
686 
687 enum nai_realm_eap_cred_type {
688 	NAI_REALM_CRED_TYPE_SIM = 1,
689 	NAI_REALM_CRED_TYPE_USIM = 2,
690 	NAI_REALM_CRED_TYPE_NFC_SECURE_ELEMENT = 3,
691 	NAI_REALM_CRED_TYPE_HARDWARE_TOKEN = 4,
692 	NAI_REALM_CRED_TYPE_SOFTOKEN = 5,
693 	NAI_REALM_CRED_TYPE_CERTIFICATE = 6,
694 	NAI_REALM_CRED_TYPE_USERNAME_PASSWORD = 7,
695 	NAI_REALM_CRED_TYPE_NONE = 8,
696 	NAI_REALM_CRED_TYPE_ANONYMOUS = 9,
697 	NAI_REALM_CRED_TYPE_VENDOR_SPECIFIC = 10
698 };
699 
700 /*
701  * IEEE P802.11-REVmc/D5.0 Table 9-81 - Measurement type definitions for
702  * measurement requests
703  */
704 enum measure_type {
705 	MEASURE_TYPE_BASIC = 0,
706 	MEASURE_TYPE_CCA = 1,
707 	MEASURE_TYPE_RPI_HIST = 2,
708 	MEASURE_TYPE_CHANNEL_LOAD = 3,
709 	MEASURE_TYPE_NOISE_HIST = 4,
710 	MEASURE_TYPE_BEACON = 5,
711 	MEASURE_TYPE_FRAME = 6,
712 	MEASURE_TYPE_STA_STATISTICS = 7,
713 	MEASURE_TYPE_LCI = 8,
714 	MEASURE_TYPE_TRANSMIT_STREAM = 9,
715 	MEASURE_TYPE_MULTICAST_DIAG = 10,
716 	MEASURE_TYPE_LOCATION_CIVIC = 11,
717 	MEASURE_TYPE_LOCATION_ID = 12,
718 	MEASURE_TYPE_DIRECTIONAL_CHAN_QUALITY = 13,
719 	MEASURE_TYPE_DIRECTIONAL_MEASURE = 14,
720 	MEASURE_TYPE_DIRECTIONAL_STATS = 15,
721 	MEASURE_TYPE_FTM_RANGE = 16,
722 	MEASURE_TYPE_MEASURE_PAUSE = 255,
723 };
724 
725 /* IEEE Std 802.11-2012 Table 8-71 - Location subject definition */
726 enum location_subject {
727 	LOCATION_SUBJECT_LOCAL = 0,
728 	LOCATION_SUBJECT_REMOTE = 1,
729 	LOCATION_SUBJECT_3RD_PARTY = 2,
730 };
731 
732 /*
733  * IEEE P802.11-REVmc/D5.0 Table 9-94 - Optional subelement IDs for LCI request
734  */
735 enum lci_req_subelem {
736 	LCI_REQ_SUBELEM_AZIMUTH_REQ = 1,
737 	LCI_REQ_SUBELEM_ORIGINATOR_MAC_ADDR = 2,
738 	LCI_REQ_SUBELEM_TARGET_MAC_ADDR = 3,
739 	LCI_REQ_SUBELEM_MAX_AGE = 4,
740 };
741 
742 #define FILS_NONCE_LEN 16
743 #define FILS_SESSION_LEN 8
744 #define FILS_CACHE_ID_LEN 2
745 #define FILS_MAX_KEY_AUTH_LEN 48
746 
747 #ifdef _MSC_VER
748 #pragma pack(push, 1)
749 #endif /* _MSC_VER */
750 
751 struct ieee80211_hdr {
752 	le16 frame_control;
753 	le16 duration_id;
754 	u8 addr1[6];
755 	u8 addr2[6];
756 	u8 addr3[6];
757 	le16 seq_ctrl;
758 	/* followed by 'u8 addr4[6];' if ToDS and FromDS is set in data frame
759 	 */
760 } STRUCT_PACKED;
761 
762 #define IEEE80211_DA_FROMDS addr1
763 #define IEEE80211_BSSID_FROMDS addr2
764 #define IEEE80211_SA_FROMDS addr3
765 
766 #define IEEE80211_HDRLEN (sizeof(struct ieee80211_hdr))
767 
768 #define IEEE80211_FC(type, stype) host_to_le16((type << 2) | (stype << 4))
769 
770 struct ieee80211_mgmt {
771 	le16 frame_control;
772 	le16 duration;
773 	u8 da[6];
774 	u8 sa[6];
775 	u8 bssid[6];
776 	le16 seq_ctrl;
777 	union {
778 		struct {
779 			le16 auth_alg;
780 			le16 auth_transaction;
781 			le16 status_code;
782 			/* possibly followed by Challenge text */
783 			u8 variable[];
784 		} STRUCT_PACKED auth;
785 		struct {
786 			le16 reason_code;
787 			u8 variable[];
788 		} STRUCT_PACKED deauth;
789 		struct {
790 			le16 capab_info;
791 			le16 listen_interval;
792 			/* followed by SSID and Supported rates */
793 			u8 variable[];
794 		} STRUCT_PACKED assoc_req;
795 		struct {
796 			le16 capab_info;
797 			le16 status_code;
798 			le16 aid;
799 			/* followed by Supported rates */
800 			u8 variable[];
801 		} STRUCT_PACKED assoc_resp, reassoc_resp;
802 		struct {
803 			le16 capab_info;
804 			le16 listen_interval;
805 			u8 current_ap[6];
806 			/* followed by SSID and Supported rates */
807 			u8 variable[];
808 		} STRUCT_PACKED reassoc_req;
809 		struct {
810 			le16 reason_code;
811 			u8 variable[];
812 		} STRUCT_PACKED disassoc;
813 		struct {
814 			u8 timestamp[8];
815 			le16 beacon_int;
816 			le16 capab_info;
817 			/* followed by some of SSID, Supported rates,
818 			 * FH Params, DS Params, CF Params, IBSS Params, TIM */
819 			u8 variable[];
820 		} STRUCT_PACKED beacon;
821 		/* probe_req: only variable items: SSID, Supported rates */
822 		struct {
823 			u8 timestamp[8];
824 			le16 beacon_int;
825 			le16 capab_info;
826 			/* followed by some of SSID, Supported rates,
827 			 * FH Params, DS Params, CF Params, IBSS Params */
828 			u8 variable[];
829 		} STRUCT_PACKED probe_resp;
830 		struct {
831 			u8 category;
832 			union {
833 				struct {
834 					u8 action_code;
835 					u8 dialog_token;
836 					u8 status_code;
837 					u8 variable[];
838 				} STRUCT_PACKED wmm_action;
839 				struct{
840 					u8 action_code;
841 					u8 element_id;
842 					u8 length;
843 					u8 switch_mode;
844 					u8 new_chan;
845 					u8 switch_count;
846 				} STRUCT_PACKED chan_switch;
847 				struct {
848 					u8 action;
849 					u8 sta_addr[ETH_ALEN];
850 					u8 target_ap_addr[ETH_ALEN];
851 					u8 variable[]; /* FT Request */
852 				} STRUCT_PACKED ft_action_req;
853 				struct {
854 					u8 action;
855 					u8 sta_addr[ETH_ALEN];
856 					u8 target_ap_addr[ETH_ALEN];
857 					le16 status_code;
858 					u8 variable[]; /* FT Request */
859 				} STRUCT_PACKED ft_action_resp;
860 				struct {
861 					u8 action;
862 					u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
863 				} STRUCT_PACKED sa_query_req;
864 				struct {
865 					u8 action; /* */
866 					u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
867 				} STRUCT_PACKED sa_query_resp;
868 				struct {
869 					u8 action;
870 					u8 dialogtoken;
871 					u8 variable[];
872 				} STRUCT_PACKED wnm_sleep_req;
873 				struct {
874 					u8 action;
875 					u8 dialogtoken;
876 					le16 keydata_len;
877 					u8 variable[];
878 				} STRUCT_PACKED wnm_sleep_resp;
879 				struct {
880 					u8 action;
881 					u8 variable[];
882 				} STRUCT_PACKED public_action;
883 				struct {
884 					u8 action; /* 9 */
885 					u8 oui[3];
886 					/* Vendor-specific content */
887 					u8 variable[];
888 				} STRUCT_PACKED vs_public_action;
889 				struct {
890 					u8 action; /* 7 */
891 					u8 dialog_token;
892 					u8 req_mode;
893 					le16 disassoc_timer;
894 					u8 validity_interval;
895 					/* BSS Termination Duration (optional),
896 					 * Session Information URL (optional),
897 					 * BSS Transition Candidate List
898 					 * Entries */
899 					u8 variable[];
900 				} STRUCT_PACKED bss_tm_req;
901 				struct {
902 					u8 action; /* 8 */
903 					u8 dialog_token;
904 					u8 status_code;
905 					u8 bss_termination_delay;
906 					/* Target BSSID (optional),
907 					 * BSS Transition Candidate List
908 					 * Entries (optional) */
909 					u8 variable[];
910 				} STRUCT_PACKED bss_tm_resp;
911 				struct {
912 					u8 action; /* 6 */
913 					u8 dialog_token;
914 					u8 query_reason;
915 					/* BSS Transition Candidate List
916 					 * Entries (optional) */
917 					u8 variable[];
918 				} STRUCT_PACKED bss_tm_query;
919 				struct {
920 					u8 action; /* 15 */
921 					u8 variable[];
922 				} STRUCT_PACKED slf_prot_action;
923 				struct {
924 					u8 action;
925 					u8 variable[];
926 				} STRUCT_PACKED fst_action;
927 				struct {
928 					u8 action;
929 					u8 dialog_token;
930 					u8 variable[];
931 				} STRUCT_PACKED rrm;
932 			} u;
933 		} STRUCT_PACKED action;
934 	} u;
935 } STRUCT_PACKED;
936 
937 
938 #define IEEE80211_MAX_MMPDU_SIZE 2304
939 
940 /* Rx MCS bitmask is in the first 77 bits of supported_mcs_set */
941 #define IEEE80211_HT_MCS_MASK_LEN 10
942 
943 /* HT Capabilities element */
944 struct ieee80211_ht_capabilities {
945 	le16 ht_capabilities_info;
946 	u8 a_mpdu_params; /* Maximum A-MPDU Length Exponent B0..B1
947 			   * Minimum MPDU Start Spacing B2..B4
948 			   * Reserved B5..B7 */
949 	u8 supported_mcs_set[16];
950 	le16 ht_extended_capabilities;
951 	le32 tx_bf_capability_info;
952 	u8 asel_capabilities;
953 } STRUCT_PACKED;
954 
955 
956 /* HT Operation element */
957 struct ieee80211_ht_operation {
958 	u8 primary_chan;
959 	/* Five octets of HT Operation Information */
960 	u8 ht_param; /* B0..B7 */
961 	le16 operation_mode; /* B8..B23 */
962 	le16 param; /* B24..B39 */
963 	u8 basic_mcs_set[16];
964 } STRUCT_PACKED;
965 
966 
967 struct ieee80211_obss_scan_parameters {
968 	le16 scan_passive_dwell;
969 	le16 scan_active_dwell;
970 	le16 width_trigger_scan_interval;
971 	le16 scan_passive_total_per_channel;
972 	le16 scan_active_total_per_channel;
973 	le16 channel_transition_delay_factor;
974 	le16 scan_activity_threshold;
975 } STRUCT_PACKED;
976 
977 
978 struct ieee80211_vht_capabilities {
979 	le32 vht_capabilities_info;
980 	struct {
981 		le16 rx_map;
982 		le16 rx_highest;
983 		le16 tx_map;
984 		le16 tx_highest;
985 	} vht_supported_mcs_set;
986 } STRUCT_PACKED;
987 
988 struct ieee80211_vht_operation {
989 	u8 vht_op_info_chwidth;
990 	u8 vht_op_info_chan_center_freq_seg0_idx;
991 	u8 vht_op_info_chan_center_freq_seg1_idx;
992 	le16 vht_basic_mcs_set;
993 } STRUCT_PACKED;
994 
995 struct ieee80211_ampe_ie {
996 	u8 selected_pairwise_suite[4];
997 	u8 local_nonce[32];
998 	u8 peer_nonce[32];
999 	/* Followed by
1000 	 * Key Replay Counter[8] (optional)
1001 	 *	(only in Mesh Group Key Inform/Acknowledge frames)
1002 	 * GTKdata[variable] (optional)
1003 	 *	(MGTK[variable] || Key RSC[8] || GTKExpirationTime[4])
1004 	 * IGTKdata[variable] (optional)
1005 	 *	(Key ID[2], IPN[6], IGTK[variable] in IGTK KDE format)
1006 	 */
1007 } STRUCT_PACKED;
1008 
1009 #ifdef _MSC_VER
1010 #pragma pack(pop)
1011 #endif /* _MSC_VER */
1012 
1013 #define ERP_INFO_NON_ERP_PRESENT BIT(0)
1014 #define ERP_INFO_USE_PROTECTION BIT(1)
1015 #define ERP_INFO_BARKER_PREAMBLE_MODE BIT(2)
1016 
1017 #define OVERLAPPING_BSS_TRANS_DELAY_FACTOR 5
1018 
1019 /* HT Capabilities Info field within HT Capabilities element */
1020 #define HT_CAP_INFO_LDPC_CODING_CAP		((u16) BIT(0))
1021 #define HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET	((u16) BIT(1))
1022 #define HT_CAP_INFO_SMPS_MASK			((u16) (BIT(2) | BIT(3)))
1023 #define HT_CAP_INFO_SMPS_STATIC			((u16) 0)
1024 #define HT_CAP_INFO_SMPS_DYNAMIC		((u16) BIT(2))
1025 #define HT_CAP_INFO_SMPS_DISABLED		((u16) (BIT(2) | BIT(3)))
1026 #define HT_CAP_INFO_GREEN_FIELD			((u16) BIT(4))
1027 #define HT_CAP_INFO_SHORT_GI20MHZ		((u16) BIT(5))
1028 #define HT_CAP_INFO_SHORT_GI40MHZ		((u16) BIT(6))
1029 #define HT_CAP_INFO_TX_STBC			((u16) BIT(7))
1030 #define HT_CAP_INFO_RX_STBC_MASK		((u16) (BIT(8) | BIT(9)))
1031 #define HT_CAP_INFO_RX_STBC_1			((u16) BIT(8))
1032 #define HT_CAP_INFO_RX_STBC_12			((u16) BIT(9))
1033 #define HT_CAP_INFO_RX_STBC_123			((u16) (BIT(8) | BIT(9)))
1034 #define HT_CAP_INFO_DELAYED_BA			((u16) BIT(10))
1035 #define HT_CAP_INFO_MAX_AMSDU_SIZE		((u16) BIT(11))
1036 #define HT_CAP_INFO_DSSS_CCK40MHZ		((u16) BIT(12))
1037 /* B13 - Reserved (was PSMP support during P802.11n development) */
1038 #define HT_CAP_INFO_40MHZ_INTOLERANT		((u16) BIT(14))
1039 #define HT_CAP_INFO_LSIG_TXOP_PROTECT_SUPPORT	((u16) BIT(15))
1040 
1041 /* HT Extended Capabilities field within HT Capabilities element */
1042 #define EXT_HT_CAP_INFO_PCO			((u16) BIT(0))
1043 #define EXT_HT_CAP_INFO_PCO_TRANS_TIME_MASK	((u16) (BIT(1) | BIT(2)))
1044 #define EXT_HT_CAP_INFO_TRANS_TIME_OFFSET	1
1045 /* B3..B7 - Reserved */
1046 #define EXT_HT_CAP_INFO_MCS_FEEDBACK_MASK	((u16) (BIT(8) | BIT(9)))
1047 #define EXT_HT_CAP_INFO_MCS_FEEDBACK_OFFSET	8
1048 #define EXT_HT_CAP_INFO_HTC_SUPPORT		((u16) BIT(10))
1049 #define EXT_HT_CAP_INFO_RD_RESPONDER		((u16) BIT(11))
1050 /* B12..B15 - Reserved */
1051 
1052 /* Transmit Beanforming Capabilities within HT Capabilities element */
1053 #define TX_BF_CAP_IMPLICIT_TXBF_RX_CAP ((u32) BIT(0))
1054 #define TX_BF_CAP_RX_STAGGERED_SOUNDING_CAP ((u32) BIT(1))
1055 #define TX_BF_CAP_TX_STAGGERED_SOUNDING_CAP ((u32) BIT(2))
1056 #define TX_BF_CAP_RX_NDP_CAP ((u32) BIT(3))
1057 #define TX_BF_CAP_TX_NDP_CAP ((u32) BIT(4))
1058 #define TX_BF_CAP_IMPLICIT_TX_BF_CAP ((u32) BIT(5))
1059 #define TX_BF_CAP_CALIBRATION_MASK ((u32) (BIT(6) | BIT(7))
1060 #define TX_BF_CAP_CALIB_OFFSET 6
1061 #define TX_BF_CAP_EXPLICIT_CSI_TXBF_CAP ((u32) BIT(8))
1062 #define TX_BF_CAP_EXPLICIT_NONCOMPR_STEERING_CAP ((u32) BIT(9))
1063 #define TX_BF_CAP_EXPLICIT_COMPR_STEERING_CAP ((u32) BIT(10))
1064 #define TX_BF_CAP_EXPLICIT_TX_BF_CSI_FEEDBACK_MASK ((u32) (BIT(10) | BIT(11)))
1065 #define TX_BF_CAP_EXPLICIT_BF_CSI_FEEDBACK_OFFSET 11
1066 #define TX_BF_CAP_EXPLICIT_UNCOMPR_STEERING_MATRIX_FEEDBACK_OFFSET 13
1067 #define TX_BF_CAP_EXPLICIT_COMPRESSED_STEERING_MATRIX_FEEDBACK_OFFSET 15
1068 #define TX_BF_CAP_MINIMAL_GROUPING_OFFSET 17
1069 #define TX_BF_CAP_CSI_NUM_BEAMFORMER_ANT_OFFSET 19
1070 #define TX_BF_CAP_UNCOMPRESSED_STEERING_MATRIX_BEAMFORMER_ANT_OFFSET 21
1071 #define TX_BF_CAP_COMPRESSED_STEERING_MATRIX_BEAMFORMER_ANT_OFFSET 23
1072 #define TX_BF_CAP_SCI_MAX_OF_ROWS_BEANFORMER_SUPPORTED_OFFSET 25
1073 #define TX_BF_CAP_CHANNEL_ESTIMATION_CAP_MASK ((u32) (BIT(27) | BIT(28)))
1074 #define TX_BF_CAP_CHANNEL_ESTIMATION_CAP_OFFSET 27
1075 /* B29..B31 - Reserved */
1076 
1077 /* ASEL Capability field within HT Capabilities element */
1078 #define ASEL_CAP_ASEL_CAPABLE ((u8) BIT(0))
1079 #define ASEL_CAP_EXPLICIT_CSI_FEEDBACK_BASED_TX_AS_CAP ((u8) BIT(1))
1080 #define ASEL_CAP_ANT_INDICES_FEEDBACK_BASED_TX_AS_CAP ((u8) BIT(2))
1081 #define ASEL_CAP_EXPLICIT_CSI_FEEDBACK_CAP ((u8) BIT(3))
1082 #define ASEL_CAP_ANT_INDICES_FEEDBACK_CAP ((u8) BIT(4))
1083 #define ASEL_CAP_RX_AS_CAP ((u8) BIT(5))
1084 #define ASEL_CAP_TX_SOUNDING_PPDUS_CAP ((u8) BIT(6))
1085 /* B7 - Reserved */
1086 
1087 /* First octet of HT Operation Information within HT Operation element */
1088 #define HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK	((u8) BIT(0) | BIT(1))
1089 #define HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE		((u8) BIT(0))
1090 #define HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW		((u8) BIT(0) | BIT(1))
1091 #define HT_INFO_HT_PARAM_STA_CHNL_WIDTH			((u8) BIT(2))
1092 #define HT_INFO_HT_PARAM_RIFS_MODE			((u8) BIT(3))
1093 /* B4..B7 - Reserved */
1094 
1095 /* HT Protection (B8..B9 of HT Operation Information) */
1096 #define HT_PROT_NO_PROTECTION           0
1097 #define HT_PROT_NONMEMBER_PROTECTION    1
1098 #define HT_PROT_20MHZ_PROTECTION        2
1099 #define HT_PROT_NON_HT_MIXED            3
1100 /* Bits within ieee80211_ht_operation::operation_mode (BIT(0) maps to B8 in
1101  * HT Operation Information) */
1102 #define HT_OPER_OP_MODE_HT_PROT_MASK ((u16) (BIT(0) | BIT(1))) /* B8..B9 */
1103 #define HT_OPER_OP_MODE_NON_GF_HT_STAS_PRESENT	((u16) BIT(2)) /* B10 */
1104 /* BIT(3), i.e., B11 in HT Operation Information field - Reserved */
1105 #define HT_OPER_OP_MODE_OBSS_NON_HT_STAS_PRESENT	((u16) BIT(4)) /* B12 */
1106 /* BIT(5)..BIT(15), i.e., B13..B23 - Reserved */
1107 
1108 /* Last two octets of HT Operation Information (BIT(0) = B24) */
1109 /* B24..B29 - Reserved */
1110 #define HT_OPER_PARAM_DUAL_BEACON			((u16) BIT(6))
1111 #define HT_OPER_PARAM_DUAL_CTS_PROTECTION		((u16) BIT(7))
1112 #define HT_OPER_PARAM_STBC_BEACON			((u16) BIT(8))
1113 #define HT_OPER_PARAM_LSIG_TXOP_PROT_FULL_SUPP		((u16) BIT(9))
1114 #define HT_OPER_PARAM_PCO_ACTIVE			((u16) BIT(10))
1115 #define HT_OPER_PARAM_PCO_PHASE				((u16) BIT(11))
1116 /* B36..B39 - Reserved */
1117 
1118 #define BSS_MEMBERSHIP_SELECTOR_VHT_PHY 126
1119 #define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127
1120 
1121 /* VHT Defines */
1122 #define VHT_CAP_MAX_MPDU_LENGTH_7991                ((u32) BIT(0))
1123 #define VHT_CAP_MAX_MPDU_LENGTH_11454               ((u32) BIT(1))
1124 #define VHT_CAP_MAX_MPDU_LENGTH_MASK                ((u32) BIT(0) | BIT(1))
1125 #define VHT_CAP_MAX_MPDU_LENGTH_MASK_SHIFT          0
1126 #define VHT_CAP_SUPP_CHAN_WIDTH_160MHZ              ((u32) BIT(2))
1127 #define VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ     ((u32) BIT(3))
1128 #define VHT_CAP_SUPP_CHAN_WIDTH_MASK                ((u32) BIT(2) | BIT(3))
1129 #define VHT_CAP_RXLDPC                              ((u32) BIT(4))
1130 #define VHT_CAP_SHORT_GI_80                         ((u32) BIT(5))
1131 #define VHT_CAP_SHORT_GI_160                        ((u32) BIT(6))
1132 #define VHT_CAP_TXSTBC                              ((u32) BIT(7))
1133 #define VHT_CAP_RXSTBC_1                            ((u32) BIT(8))
1134 #define VHT_CAP_RXSTBC_2                            ((u32) BIT(9))
1135 #define VHT_CAP_RXSTBC_3                            ((u32) BIT(8) | BIT(9))
1136 #define VHT_CAP_RXSTBC_4                            ((u32) BIT(10))
1137 #define VHT_CAP_RXSTBC_MASK                         ((u32) BIT(8) | BIT(9) | \
1138 							   BIT(10))
1139 #define VHT_CAP_RXSTBC_MASK_SHIFT                   8
1140 #define VHT_CAP_SU_BEAMFORMER_CAPABLE               ((u32) BIT(11))
1141 #define VHT_CAP_SU_BEAMFORMEE_CAPABLE               ((u32) BIT(12))
1142 #define VHT_CAP_BEAMFORMEE_STS_MAX                  ((u32) BIT(13) | \
1143 							   BIT(14) | BIT(15))
1144 #define VHT_CAP_BEAMFORMEE_STS_MAX_SHIFT            13
1145 #define VHT_CAP_BEAMFORMEE_STS_OFFSET               13
1146 #define VHT_CAP_SOUNDING_DIMENSION_MAX              ((u32) BIT(16) | \
1147 							   BIT(17) | BIT(18))
1148 #define VHT_CAP_SOUNDING_DIMENSION_MAX_SHIFT        16
1149 #define VHT_CAP_SOUNDING_DIMENSION_OFFSET           16
1150 #define VHT_CAP_MU_BEAMFORMER_CAPABLE               ((u32) BIT(19))
1151 #define VHT_CAP_MU_BEAMFORMEE_CAPABLE               ((u32) BIT(20))
1152 #define VHT_CAP_VHT_TXOP_PS                         ((u32) BIT(21))
1153 #define VHT_CAP_HTC_VHT                             ((u32) BIT(22))
1154 
1155 #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_1        ((u32) BIT(23))
1156 #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_2        ((u32) BIT(24))
1157 #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_3        ((u32) BIT(23) | BIT(24))
1158 #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_4        ((u32) BIT(25))
1159 #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_5        ((u32) BIT(23) | BIT(25))
1160 #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_6        ((u32) BIT(24) | BIT(25))
1161 #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MAX      ((u32) BIT(23) | \
1162 							   BIT(24) | BIT(25))
1163 #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MAX_SHIFT 23
1164 #define VHT_CAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB   ((u32) BIT(27))
1165 #define VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB     ((u32) BIT(26) | BIT(27))
1166 #define VHT_CAP_RX_ANTENNA_PATTERN                  ((u32) BIT(28))
1167 #define VHT_CAP_TX_ANTENNA_PATTERN                  ((u32) BIT(29))
1168 
1169 #define VHT_OPMODE_CHANNEL_WIDTH_MASK		    ((u8) BIT(0) | BIT(1))
1170 #define VHT_OPMODE_CHANNEL_RxNSS_MASK		    ((u8) BIT(4) | BIT(5) | \
1171 						     BIT(6))
1172 #define VHT_OPMODE_NOTIF_RX_NSS_SHIFT		    4
1173 
1174 #define VHT_RX_NSS_MAX_STREAMS			    8
1175 
1176 /* VHT channel widths */
1177 #define VHT_CHANWIDTH_USE_HT	0
1178 #define VHT_CHANWIDTH_80MHZ	1
1179 #define VHT_CHANWIDTH_160MHZ	2
1180 #define VHT_CHANWIDTH_80P80MHZ	3
1181 
1182 #define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs)
1183 				* 00:50:F2 */
1184 #define WPA_IE_VENDOR_TYPE 0x0050f201
1185 #define WMM_IE_VENDOR_TYPE 0x0050f202
1186 #define WPS_IE_VENDOR_TYPE 0x0050f204
1187 #define OUI_WFA 0x506f9a
1188 #define P2P_IE_VENDOR_TYPE 0x506f9a09
1189 #define WFD_IE_VENDOR_TYPE 0x506f9a0a
1190 #define WFD_OUI_TYPE 10
1191 #define HS20_IE_VENDOR_TYPE 0x506f9a10
1192 #define OSEN_IE_VENDOR_TYPE 0x506f9a12
1193 #define MBO_IE_VENDOR_TYPE 0x506f9a16
1194 #define MBO_OUI_TYPE 22
1195 
1196 #define WMM_OUI_TYPE 2
1197 #define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0
1198 #define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1
1199 #define WMM_OUI_SUBTYPE_TSPEC_ELEMENT 2
1200 #define WMM_VERSION 1
1201 
1202 #define WMM_ACTION_CODE_ADDTS_REQ 0
1203 #define WMM_ACTION_CODE_ADDTS_RESP 1
1204 #define WMM_ACTION_CODE_DELTS 2
1205 
1206 #define WMM_ADDTS_STATUS_ADMISSION_ACCEPTED 0
1207 #define WMM_ADDTS_STATUS_INVALID_PARAMETERS 1
1208 /* 2 - Reserved */
1209 #define WMM_ADDTS_STATUS_REFUSED 3
1210 /* 4-255 - Reserved */
1211 
1212 /* WMM TSPEC Direction Field Values */
1213 #define WMM_TSPEC_DIRECTION_UPLINK 0
1214 #define WMM_TSPEC_DIRECTION_DOWNLINK 1
1215 /* 2 - Reserved */
1216 #define WMM_TSPEC_DIRECTION_BI_DIRECTIONAL 3
1217 
1218 /*
1219  * WMM Information Element (used in (Re)Association Request frames; may also be
1220  * used in Beacon frames)
1221  */
1222 struct wmm_information_element {
1223 	/* Element ID: 221 (0xdd); Length: 7 */
1224 	/* required fields for WMM version 1 */
1225 	u8 oui[3]; /* 00:50:f2 */
1226 	u8 oui_type; /* 2 */
1227 	u8 oui_subtype; /* 0 */
1228 	u8 version; /* 1 for WMM version 1.0 */
1229 	u8 qos_info; /* AP/STA specific QoS info */
1230 
1231 } STRUCT_PACKED;
1232 
1233 #define WMM_QOSINFO_AP_UAPSD 0x80
1234 
1235 #define WMM_QOSINFO_STA_AC_MASK 0x0f
1236 #define WMM_QOSINFO_STA_SP_MASK 0x03
1237 #define WMM_QOSINFO_STA_SP_SHIFT 5
1238 
1239 #define WMM_AC_AIFSN_MASK 0x0f
1240 #define WMM_AC_AIFNS_SHIFT 0
1241 #define WMM_AC_ACM 0x10
1242 #define WMM_AC_ACI_MASK 0x60
1243 #define WMM_AC_ACI_SHIFT 5
1244 
1245 #define WMM_AC_ECWMIN_MASK 0x0f
1246 #define WMM_AC_ECWMIN_SHIFT 0
1247 #define WMM_AC_ECWMAX_MASK 0xf0
1248 #define WMM_AC_ECWMAX_SHIFT 4
1249 
1250 struct wmm_ac_parameter {
1251 	u8 aci_aifsn; /* AIFSN, ACM, ACI */
1252 	u8 cw; /* ECWmin, ECWmax (CW = 2^ECW - 1) */
1253 	le16 txop_limit;
1254 }  STRUCT_PACKED;
1255 
1256 /*
1257  * WMM Parameter Element (used in Beacon, Probe Response, and (Re)Association
1258  * Response frmaes)
1259  */
1260 struct wmm_parameter_element {
1261 	/* Element ID: 221 (0xdd); Length: 24 */
1262 	/* required fields for WMM version 1 */
1263 	u8 oui[3]; /* 00:50:f2 */
1264 	u8 oui_type; /* 2 */
1265 	u8 oui_subtype; /* 1 */
1266 	u8 version; /* 1 for WMM version 1.0 */
1267 	u8 qos_info; /* AP/STA specific QoS info */
1268 	u8 reserved; /* 0 */
1269 	struct wmm_ac_parameter ac[4]; /* AC_BE, AC_BK, AC_VI, AC_VO */
1270 
1271 } STRUCT_PACKED;
1272 
1273 /* WMM TSPEC Element */
1274 struct wmm_tspec_element {
1275 	u8 eid; /* 221 = 0xdd */
1276 	u8 length; /* 6 + 55 = 61 */
1277 	u8 oui[3]; /* 00:50:f2 */
1278 	u8 oui_type; /* 2 */
1279 	u8 oui_subtype; /* 2 */
1280 	u8 version; /* 1 */
1281 	/* WMM TSPEC body (55 octets): */
1282 	u8 ts_info[3];
1283 	le16 nominal_msdu_size;
1284 	le16 maximum_msdu_size;
1285 	le32 minimum_service_interval;
1286 	le32 maximum_service_interval;
1287 	le32 inactivity_interval;
1288 	le32 suspension_interval;
1289 	le32 service_start_time;
1290 	le32 minimum_data_rate;
1291 	le32 mean_data_rate;
1292 	le32 peak_data_rate;
1293 	le32 maximum_burst_size;
1294 	le32 delay_bound;
1295 	le32 minimum_phy_rate;
1296 	le16 surplus_bandwidth_allowance;
1297 	le16 medium_time;
1298 } STRUCT_PACKED;
1299 
1300 
1301 /* Access Categories / ACI to AC coding */
1302 enum wmm_ac {
1303 	WMM_AC_BE = 0 /* Best Effort */,
1304 	WMM_AC_BK = 1 /* Background */,
1305 	WMM_AC_VI = 2 /* Video */,
1306 	WMM_AC_VO = 3 /* Voice */,
1307 	WMM_AC_NUM = 4
1308 };
1309 
1310 
1311 #define HS20_INDICATION_OUI_TYPE 16
1312 #define HS20_ANQP_OUI_TYPE 17
1313 #define HS20_OSEN_OUI_TYPE 18
1314 #define HS20_STYPE_QUERY_LIST 1
1315 #define HS20_STYPE_CAPABILITY_LIST 2
1316 #define HS20_STYPE_OPERATOR_FRIENDLY_NAME 3
1317 #define HS20_STYPE_WAN_METRICS 4
1318 #define HS20_STYPE_CONNECTION_CAPABILITY 5
1319 #define HS20_STYPE_NAI_HOME_REALM_QUERY 6
1320 #define HS20_STYPE_OPERATING_CLASS 7
1321 #define HS20_STYPE_OSU_PROVIDERS_LIST 8
1322 #define HS20_STYPE_ICON_REQUEST 10
1323 #define HS20_STYPE_ICON_BINARY_FILE 11
1324 
1325 #define HS20_DGAF_DISABLED 0x01
1326 #define HS20_PPS_MO_ID_PRESENT 0x02
1327 #define HS20_ANQP_DOMAIN_ID_PRESENT 0x04
1328 #define HS20_VERSION 0x10 /* Release 2 */
1329 
1330 /* WNM-Notification WFA vendors specific subtypes */
1331 #define HS20_WNM_SUB_REM_NEEDED 0
1332 #define HS20_WNM_DEAUTH_IMMINENT_NOTICE 1
1333 
1334 #define HS20_DEAUTH_REASON_CODE_BSS 0
1335 #define HS20_DEAUTH_REASON_CODE_ESS 1
1336 
1337 /* MBO v0.0_r19, 4.2: MBO Attributes */
1338 /* Table 4-5: MBO Attributes */
1339 enum mbo_attr_id {
1340 	MBO_ATTR_ID_AP_CAPA_IND = 1,
1341 	MBO_ATTR_ID_NON_PREF_CHAN_REPORT = 2,
1342 	MBO_ATTR_ID_CELL_DATA_CAPA = 3,
1343 	MBO_ATTR_ID_ASSOC_DISALLOW = 4,
1344 	MBO_ATTR_ID_CELL_DATA_PREF = 5,
1345 	MBO_ATTR_ID_TRANSITION_REASON = 6,
1346 	MBO_ATTR_ID_TRANSITION_REJECT_REASON = 7,
1347 	MBO_ATTR_ID_ASSOC_RETRY_DELAY = 8,
1348 };
1349 
1350 /* MBO v0.0_r19, 4.2.1: MBO AP Capability Indication Attribute */
1351 /* Table 4-7: MBO AP Capability Indication Field Values */
1352 #define MBO_AP_CAPA_CELL_AWARE BIT(6)
1353 
1354 /* MBO v0.0_r19, 4.2.2: Non-preferred Channel Report Attribute */
1355 /* Table 4-10: Reason Code Field Values */
1356 enum mbo_non_pref_chan_reason {
1357 	MBO_NON_PREF_CHAN_REASON_UNSPECIFIED = 0,
1358 	MBO_NON_PREF_CHAN_REASON_RSSI = 1,
1359 	MBO_NON_PREF_CHAN_REASON_EXT_INTERFERENCE = 2,
1360 	MBO_NON_PREF_CHAN_REASON_INT_INTERFERENCE = 3,
1361 };
1362 
1363 /* MBO v0.0_r19, 4.2.3: Cellular Data Capabilities Attribute */
1364 /* Table 4-13: Cellular Data Connectivity Field */
1365 enum mbo_cellular_capa {
1366 	MBO_CELL_CAPA_AVAILABLE = 1,
1367 	MBO_CELL_CAPA_NOT_AVAILABLE = 2,
1368 	MBO_CELL_CAPA_NOT_SUPPORTED = 3,
1369 };
1370 
1371 /* MBO v0.0_r19, 4.2.4: Association Disallowed Attribute */
1372 /* Table 4-15: Reason Code Field Values */
1373 enum mbo_assoc_disallow_reason {
1374 	MBO_ASSOC_DISALLOW_REASON_UNSPECIFIED = 1,
1375 	MBO_ASSOC_DISALLOW_REASON_MAX_STA = 2,
1376 	MBO_ASSOC_DISALLOW_REASON_AIR_INTERFERENCE = 3,
1377 	MBO_ASSOC_DISALLOW_REASON_AUTH_SERVER_OVERLOAD = 4,
1378 	MBO_ASSOC_DISALLOW_REASON_LOW_RSSI = 5,
1379 };
1380 
1381 /* MBO v0.0_r19, 4.2.5: Cellular Data Connection Preference Attribute */
1382 /* Table 4-17: Cellular Preference Field Values */
1383 enum mbo_cell_pref {
1384 	MBO_CELL_PREF_EXCLUDED = 0,
1385 	MBO_CELL_PREF_NO_USE = 1,
1386 	MBO_CELL_PREF_USE = 255
1387 };
1388 
1389 /* MBO v0.0_r19, 4.2.6: Transition Reason Code Attribute */
1390 /* Table 4-19: Transition Reason Code Field Values */
1391 enum mbo_transition_reason {
1392 	MBO_TRANSITION_REASON_UNSPECIFIED = 0,
1393 	MBO_TRANSITION_REASON_FRAME_LOSS = 1,
1394 	MBO_TRANSITION_REASON_DELAY = 2,
1395 	MBO_TRANSITION_REASON_BANDWIDTH = 3,
1396 	MBO_TRANSITION_REASON_LOAD_BALANCE = 4,
1397 	MBO_TRANSITION_REASON_RSSI = 5,
1398 	MBO_TRANSITION_REASON_RETRANSMISSIONS = 6,
1399 	MBO_TRANSITION_REASON_INTERFERENCE = 7,
1400 	MBO_TRANSITION_REASON_GRAY_ZONE = 8,
1401 	MBO_TRANSITION_REASON_PREMIUM_AP = 9,
1402 };
1403 
1404 /* MBO v0.0_r19, 4.2.7: Transition Rejection Reason Code Attribute */
1405 /* Table 4-21: Transition Rejection Reason Code Field Values */
1406 enum mbo_transition_reject_reason {
1407 	MBO_TRANSITION_REJECT_REASON_UNSPECIFIED = 0,
1408 	MBO_TRANSITION_REJECT_REASON_FRAME_LOSS = 1,
1409 	MBO_TRANSITION_REJECT_REASON_DELAY = 2,
1410 	MBO_TRANSITION_REJECT_REASON_QOS_CAPACITY = 3,
1411 	MBO_TRANSITION_REJECT_REASON_RSSI = 4,
1412 	MBO_TRANSITION_REJECT_REASON_INTERFERENCE = 5,
1413 	MBO_TRANSITION_REJECT_REASON_SERVICES = 6,
1414 };
1415 
1416 /* MBO v0.0_r19, 4.4: WNM-Notification vendor subelements */
1417 enum wfa_wnm_notif_subelem_id {
1418 	WFA_WNM_NOTIF_SUBELEM_NON_PREF_CHAN_REPORT = 2,
1419 	WFA_WNM_NOTIF_SUBELEM_CELL_DATA_CAPA = 3,
1420 };
1421 
1422 /* MBO v0.0_r25, 4.3: MBO ANQP-elements */
1423 #define MBO_ANQP_OUI_TYPE 0x12
1424 #define MBO_ANQP_SUBTYPE_CELL_CONN_PREF 1
1425 
1426 /* Wi-Fi Direct (P2P) */
1427 
1428 #define P2P_OUI_TYPE 9
1429 
1430 enum p2p_attr_id {
1431 	P2P_ATTR_STATUS = 0,
1432 	P2P_ATTR_MINOR_REASON_CODE = 1,
1433 	P2P_ATTR_CAPABILITY = 2,
1434 	P2P_ATTR_DEVICE_ID = 3,
1435 	P2P_ATTR_GROUP_OWNER_INTENT = 4,
1436 	P2P_ATTR_CONFIGURATION_TIMEOUT = 5,
1437 	P2P_ATTR_LISTEN_CHANNEL = 6,
1438 	P2P_ATTR_GROUP_BSSID = 7,
1439 	P2P_ATTR_EXT_LISTEN_TIMING = 8,
1440 	P2P_ATTR_INTENDED_INTERFACE_ADDR = 9,
1441 	P2P_ATTR_MANAGEABILITY = 10,
1442 	P2P_ATTR_CHANNEL_LIST = 11,
1443 	P2P_ATTR_NOTICE_OF_ABSENCE = 12,
1444 	P2P_ATTR_DEVICE_INFO = 13,
1445 	P2P_ATTR_GROUP_INFO = 14,
1446 	P2P_ATTR_GROUP_ID = 15,
1447 	P2P_ATTR_INTERFACE = 16,
1448 	P2P_ATTR_OPERATING_CHANNEL = 17,
1449 	P2P_ATTR_INVITATION_FLAGS = 18,
1450 	P2P_ATTR_OOB_GO_NEG_CHANNEL = 19,
1451 	P2P_ATTR_SERVICE_HASH = 21,
1452 	P2P_ATTR_SESSION_INFORMATION_DATA = 22,
1453 	P2P_ATTR_CONNECTION_CAPABILITY = 23,
1454 	P2P_ATTR_ADVERTISEMENT_ID = 24,
1455 	P2P_ATTR_ADVERTISED_SERVICE = 25,
1456 	P2P_ATTR_SESSION_ID = 26,
1457 	P2P_ATTR_FEATURE_CAPABILITY = 27,
1458 	P2P_ATTR_PERSISTENT_GROUP = 28,
1459 	P2P_ATTR_VENDOR_SPECIFIC = 221
1460 };
1461 
1462 #define P2P_MAX_GO_INTENT 15
1463 
1464 /* P2P Capability - Device Capability bitmap */
1465 #define P2P_DEV_CAPAB_SERVICE_DISCOVERY BIT(0)
1466 #define P2P_DEV_CAPAB_CLIENT_DISCOVERABILITY BIT(1)
1467 #define P2P_DEV_CAPAB_CONCURRENT_OPER BIT(2)
1468 #define P2P_DEV_CAPAB_INFRA_MANAGED BIT(3)
1469 #define P2P_DEV_CAPAB_DEVICE_LIMIT BIT(4)
1470 #define P2P_DEV_CAPAB_INVITATION_PROCEDURE BIT(5)
1471 
1472 /* P2P Capability - Group Capability bitmap */
1473 #define P2P_GROUP_CAPAB_GROUP_OWNER BIT(0)
1474 #define P2P_GROUP_CAPAB_PERSISTENT_GROUP BIT(1)
1475 #define P2P_GROUP_CAPAB_GROUP_LIMIT BIT(2)
1476 #define P2P_GROUP_CAPAB_INTRA_BSS_DIST BIT(3)
1477 #define P2P_GROUP_CAPAB_CROSS_CONN BIT(4)
1478 #define P2P_GROUP_CAPAB_PERSISTENT_RECONN BIT(5)
1479 #define P2P_GROUP_CAPAB_GROUP_FORMATION BIT(6)
1480 #define P2P_GROUP_CAPAB_IP_ADDR_ALLOCATION BIT(7)
1481 
1482 /* P2PS Coordination Protocol Transport Bitmap */
1483 #define P2PS_FEATURE_CAPAB_UDP_TRANSPORT BIT(0)
1484 #define P2PS_FEATURE_CAPAB_MAC_TRANSPORT BIT(1)
1485 
1486 struct p2ps_feature_capab {
1487 	u8 cpt;
1488 	u8 reserved;
1489 } STRUCT_PACKED;
1490 
1491 /* Invitation Flags */
1492 #define P2P_INVITATION_FLAGS_TYPE BIT(0)
1493 
1494 /* P2P Manageability */
1495 #define P2P_MAN_DEVICE_MANAGEMENT BIT(0)
1496 #define P2P_MAN_CROSS_CONNECTION_PERMITTED BIT(1)
1497 #define P2P_MAN_COEXISTENCE_OPTIONAL BIT(2)
1498 
1499 enum p2p_status_code {
1500 	P2P_SC_SUCCESS = 0,
1501 	P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE = 1,
1502 	P2P_SC_FAIL_INCOMPATIBLE_PARAMS = 2,
1503 	P2P_SC_FAIL_LIMIT_REACHED = 3,
1504 	P2P_SC_FAIL_INVALID_PARAMS = 4,
1505 	P2P_SC_FAIL_UNABLE_TO_ACCOMMODATE = 5,
1506 	P2P_SC_FAIL_PREV_PROTOCOL_ERROR = 6,
1507 	P2P_SC_FAIL_NO_COMMON_CHANNELS = 7,
1508 	P2P_SC_FAIL_UNKNOWN_GROUP = 8,
1509 	P2P_SC_FAIL_BOTH_GO_INTENT_15 = 9,
1510 	P2P_SC_FAIL_INCOMPATIBLE_PROV_METHOD = 10,
1511 	P2P_SC_FAIL_REJECTED_BY_USER = 11,
1512 	P2P_SC_SUCCESS_DEFERRED = 12,
1513 };
1514 
1515 enum p2p_role_indication {
1516 	P2P_DEVICE_NOT_IN_GROUP = 0x00,
1517 	P2P_CLIENT_IN_A_GROUP = 0x01,
1518 	P2P_GO_IN_A_GROUP = 0x02,
1519 };
1520 
1521 #define P2P_WILDCARD_SSID "DIRECT-"
1522 #define P2P_WILDCARD_SSID_LEN 7
1523 
1524 /* P2P action frames */
1525 enum p2p_act_frame_type {
1526 	P2P_NOA = 0,
1527 	P2P_PRESENCE_REQ = 1,
1528 	P2P_PRESENCE_RESP = 2,
1529 	P2P_GO_DISC_REQ = 3
1530 };
1531 
1532 /* P2P public action frames */
1533 enum p2p_action_frame_type {
1534 	P2P_GO_NEG_REQ = 0,
1535 	P2P_GO_NEG_RESP = 1,
1536 	P2P_GO_NEG_CONF = 2,
1537 	P2P_INVITATION_REQ = 3,
1538 	P2P_INVITATION_RESP = 4,
1539 	P2P_DEV_DISC_REQ = 5,
1540 	P2P_DEV_DISC_RESP = 6,
1541 	P2P_PROV_DISC_REQ = 7,
1542 	P2P_PROV_DISC_RESP = 8
1543 };
1544 
1545 enum p2p_service_protocol_type {
1546 	P2P_SERV_ALL_SERVICES = 0,
1547 	P2P_SERV_BONJOUR = 1,
1548 	P2P_SERV_UPNP = 2,
1549 	P2P_SERV_WS_DISCOVERY = 3,
1550 	P2P_SERV_WIFI_DISPLAY = 4,
1551 	P2P_SERV_P2PS = 11,
1552 	P2P_SERV_VENDOR_SPECIFIC = 255
1553 };
1554 
1555 enum p2p_sd_status {
1556 	P2P_SD_SUCCESS = 0,
1557 	P2P_SD_PROTO_NOT_AVAILABLE = 1,
1558 	P2P_SD_REQUESTED_INFO_NOT_AVAILABLE = 2,
1559 	P2P_SD_BAD_REQUEST = 3
1560 };
1561 
1562 
1563 enum wifi_display_subelem {
1564 	WFD_SUBELEM_DEVICE_INFO = 0,
1565 	WFD_SUBELEM_ASSOCIATED_BSSID = 1,
1566 	WFD_SUBELEM_AUDIO_FORMATS = 2,
1567 	WFD_SUBELEM_VIDEO_FORMATS = 3,
1568 	WFD_SUBELEM_3D_VIDEO_FORMATS = 4,
1569 	WFD_SUBELEM_CONTENT_PROTECTION = 5,
1570 	WFD_SUBELEM_COUPLED_SINK = 6,
1571 	WFD_SUBELEM_EXT_CAPAB = 7,
1572 	WFD_SUBELEM_LOCAL_IP_ADDRESS = 8,
1573 	WFD_SUBELEM_SESSION_INFO = 9
1574 };
1575 
1576 /* 802.11s */
1577 #define MESH_SYNC_METHOD_NEIGHBOR_OFFSET 1
1578 #define MESH_SYNC_METHOD_VENDOR		255
1579 #define MESH_PATH_PROTOCOL_HWMP		1
1580 #define MESH_PATH_PROTOCOL_VENDOR	255
1581 #define MESH_PATH_METRIC_AIRTIME	1
1582 #define MESH_PATH_METRIC_VENDOR		255
1583 /* IEEE 802.11s - Mesh Capability */
1584 #define MESH_CAP_ACCEPT_ADDITIONAL_PEER	BIT(0)
1585 #define MESH_CAP_MCCA_SUPPORTED		BIT(1)
1586 #define MESH_CAP_MCCA_ENABLED		BIT(2)
1587 #define MESH_CAP_FORWARDING		BIT(3)
1588 #define MESH_CAP_MBCA_ENABLED		BIT(4)
1589 #define MESH_CAP_TBTT_ADJUSTING		BIT(5)
1590 #define MESH_CAP_MESH_PS_LEVEL		BIT(6)
1591 
1592 enum plink_action_field {
1593 	PLINK_OPEN = 1,
1594 	PLINK_CONFIRM,
1595 	PLINK_CLOSE
1596 };
1597 
1598 #define OUI_BROADCOM 0x00904c /* Broadcom (Epigram) */
1599 #define VENDOR_VHT_TYPE		0x04
1600 #define VENDOR_VHT_SUBTYPE	0x08
1601 #define VENDOR_VHT_SUBTYPE2	0x00
1602 
1603 #define VENDOR_HT_CAPAB_OUI_TYPE 0x33 /* 00-90-4c:0x33 */
1604 
1605 
1606 /* IEEE 802.11v - WNM Action field values */
1607 enum wnm_action {
1608 	WNM_EVENT_REQ = 0,
1609 	WNM_EVENT_REPORT = 1,
1610 	WNM_DIAGNOSTIC_REQ = 2,
1611 	WNM_DIAGNOSTIC_REPORT = 3,
1612 	WNM_LOCATION_CFG_REQ = 4,
1613 	WNM_LOCATION_CFG_RESP = 5,
1614 	WNM_BSS_TRANS_MGMT_QUERY = 6,
1615 	WNM_BSS_TRANS_MGMT_REQ = 7,
1616 	WNM_BSS_TRANS_MGMT_RESP = 8,
1617 	WNM_FMS_REQ = 9,
1618 	WNM_FMS_RESP = 10,
1619 	WNM_COLLOCATED_INTERFERENCE_REQ = 11,
1620 	WNM_COLLOCATED_INTERFERENCE_REPORT = 12,
1621 	WNM_TFS_REQ = 13,
1622 	WNM_TFS_RESP = 14,
1623 	WNM_TFS_NOTIFY = 15,
1624 	WNM_SLEEP_MODE_REQ = 16,
1625 	WNM_SLEEP_MODE_RESP = 17,
1626 	WNM_TIM_BROADCAST_REQ = 18,
1627 	WNM_TIM_BROADCAST_RESP = 19,
1628 	WNM_QOS_TRAFFIC_CAPAB_UPDATE = 20,
1629 	WNM_CHANNEL_USAGE_REQ = 21,
1630 	WNM_CHANNEL_USAGE_RESP = 22,
1631 	WNM_DMS_REQ = 23,
1632 	WNM_DMS_RESP = 24,
1633 	WNM_TIMING_MEASUREMENT_REQ = 25,
1634 	WNM_NOTIFICATION_REQ = 26,
1635 	WNM_NOTIFICATION_RESP = 27
1636 };
1637 
1638 /* IEEE 802.11v - BSS Transition Management Request - Request Mode */
1639 #define WNM_BSS_TM_REQ_PREF_CAND_LIST_INCLUDED BIT(0)
1640 #define WNM_BSS_TM_REQ_ABRIDGED BIT(1)
1641 #define WNM_BSS_TM_REQ_DISASSOC_IMMINENT BIT(2)
1642 #define WNM_BSS_TM_REQ_BSS_TERMINATION_INCLUDED BIT(3)
1643 #define WNM_BSS_TM_REQ_ESS_DISASSOC_IMMINENT BIT(4)
1644 
1645 /* IEEE Std 802.11-2012 - Table 8-253 */
1646 enum bss_trans_mgmt_status_code {
1647 	WNM_BSS_TM_ACCEPT = 0,
1648 	WNM_BSS_TM_REJECT_UNSPECIFIED = 1,
1649 	WNM_BSS_TM_REJECT_INSUFFICIENT_BEACON = 2,
1650 	WNM_BSS_TM_REJECT_INSUFFICIENT_CAPABITY = 3,
1651 	WNM_BSS_TM_REJECT_UNDESIRED = 4,
1652 	WNM_BSS_TM_REJECT_DELAY_REQUEST = 5,
1653 	WNM_BSS_TM_REJECT_STA_CANDIDATE_LIST_PROVIDED = 6,
1654 	WNM_BSS_TM_REJECT_NO_SUITABLE_CANDIDATES = 7,
1655 	WNM_BSS_TM_REJECT_LEAVING_ESS = 8
1656 };
1657 
1658 /*
1659  * IEEE P802.11-REVmc/D5.0 Table 9-150 - Optional subelement IDs for
1660  * neighbor report
1661  */
1662 #define WNM_NEIGHBOR_TSF                         1
1663 #define WNM_NEIGHBOR_CONDENSED_COUNTRY_STRING    2
1664 #define WNM_NEIGHBOR_BSS_TRANSITION_CANDIDATE    3
1665 #define WNM_NEIGHBOR_BSS_TERMINATION_DURATION    4
1666 #define WNM_NEIGHBOR_BEARING                     5
1667 #define WNM_NEIGHBOR_WIDE_BW_CHAN                6
1668 #define WNM_NEIGHBOR_MEASUREMENT_REPORT         39
1669 #define WNM_NEIGHBOR_HT_CAPAB                   45
1670 #define WNM_NEIGHBOR_HT_OPER                    61
1671 #define WNM_NEIGHBOR_SEC_CHAN_OFFSET            62
1672 #define WNM_NEIGHBOR_MEASUREMENT_PILOT          66
1673 #define WNM_NEIGHBOR_RRM_ENABLED_CAPABILITIES   70
1674 #define WNM_NEIGHBOR_MULTIPLE_BSSID             71
1675 #define WNM_NEIGHBOR_VHT_CAPAB                 191
1676 #define WNM_NEIGHBOR_VHT_OPER                  192
1677 
1678 /* QoS action */
1679 enum qos_action {
1680 	QOS_ADDTS_REQ = 0,
1681 	QOS_ADDTS_RESP = 1,
1682 	QOS_DELTS = 2,
1683 	QOS_SCHEDULE = 3,
1684 	QOS_QOS_MAP_CONFIG = 4,
1685 };
1686 
1687 /* IEEE Std 802.11-2012, 8.4.2.62 20/40 BSS Coexistence element */
1688 #define WLAN_20_40_BSS_COEX_INFO_REQ            BIT(0)
1689 #define WLAN_20_40_BSS_COEX_40MHZ_INTOL         BIT(1)
1690 #define WLAN_20_40_BSS_COEX_20MHZ_WIDTH_REQ     BIT(2)
1691 #define WLAN_20_40_BSS_COEX_OBSS_EXEMPT_REQ     BIT(3)
1692 #define WLAN_20_40_BSS_COEX_OBSS_EXEMPT_GRNT    BIT(4)
1693 
1694 struct ieee80211_2040_bss_coex_ie {
1695 	u8 element_id;
1696 	u8 length;
1697 	u8 coex_param;
1698 } STRUCT_PACKED;
1699 
1700 struct ieee80211_2040_intol_chan_report {
1701 	u8 element_id;
1702 	u8 length;
1703 	u8 op_class;
1704 	u8 variable[0];	/* Channel List */
1705 } STRUCT_PACKED;
1706 
1707 /* IEEE 802.11v - WNM-Sleep Mode element */
1708 struct wnm_sleep_element {
1709 	u8 eid;     /* WLAN_EID_WNMSLEEP */
1710 	u8 len;
1711 	u8 action_type; /* WNM_SLEEP_ENTER/WNM_SLEEP_MODE_EXIT */
1712 	u8 status;
1713 	le16 intval;
1714 } STRUCT_PACKED;
1715 
1716 #define WNM_SLEEP_MODE_ENTER 0
1717 #define WNM_SLEEP_MODE_EXIT 1
1718 
1719 enum wnm_sleep_mode_response_status {
1720 	WNM_STATUS_SLEEP_ACCEPT = 0,
1721 	WNM_STATUS_SLEEP_EXIT_ACCEPT_GTK_UPDATE = 1,
1722 	WNM_STATUS_DENIED_ACTION = 2,
1723 	WNM_STATUS_DENIED_TMP = 3,
1724 	WNM_STATUS_DENIED_KEY = 4,
1725 	WNM_STATUS_DENIED_OTHER_WNM_SERVICE = 5
1726 };
1727 
1728 /* WNM-Sleep Mode subelement IDs */
1729 enum wnm_sleep_mode_subelement_id {
1730 	WNM_SLEEP_SUBELEM_GTK = 0,
1731 	WNM_SLEEP_SUBELEM_IGTK = 1
1732 };
1733 
1734 /* Channel Switch modes (802.11h) */
1735 #define CHAN_SWITCH_MODE_ALLOW_TX	0
1736 #define CHAN_SWITCH_MODE_BLOCK_TX	1
1737 
1738 struct tpc_report {
1739 	u8 eid;
1740 	u8 len;
1741 	u8 tx_power;
1742 	u8 link_margin;
1743 } STRUCT_PACKED;
1744 
1745 #define RRM_CAPABILITIES_IE_LEN 5
1746 
1747 /* IEEE Std 802.11-2012, 8.5.7.4 - Link Measurement Request frame format */
1748 struct rrm_link_measurement_request {
1749 	u8 dialog_token;
1750 	s8 tx_power;
1751 	s8 max_tp;
1752 	u8 variable[0];
1753 } STRUCT_PACKED;
1754 
1755 /* IEEE Std 802.11-2012, 8.5.7.5 - Link Measurement Report frame format */
1756 struct rrm_link_measurement_report {
1757 	u8 dialog_token;
1758 	struct tpc_report tpc;
1759 	u8 rx_ant_id;
1760 	u8 tx_ant_id;
1761 	u8 rcpi;
1762 	u8 rsni;
1763 	u8 variable[0];
1764 } STRUCT_PACKED;
1765 
1766 /* IEEE Std 802.11-2016, 9.4.2.21 - Measurement Request element */
1767 struct rrm_measurement_request_element {
1768 	u8 eid; /* Element ID */
1769 	u8 len; /* Length */
1770 	u8 token; /* Measurement Token */
1771 	u8 mode; /* Measurement Request Mode */
1772 	u8 type; /* Measurement Type */
1773 	u8 variable[0]; /* Measurement Request */
1774 } STRUCT_PACKED;
1775 
1776 /* IEEE Std 802.11-2016, Figure 9-148 - Measurement Request Mode field */
1777 #define MEASUREMENT_REQUEST_MODE_PARALLEL BIT(0)
1778 #define MEASUREMENT_REQUEST_MODE_ENABLE BIT(1)
1779 #define MEASUREMENT_REQUEST_MODE_REQUEST BIT(2)
1780 #define MEASUREMENT_REQUEST_MODE_REPORT BIT(3)
1781 #define MEASUREMENT_REQUEST_MODE_DURATION_MANDATORY BIT(4)
1782 
1783 /* IEEE Std 802.11-2016, 9.4.2.21.7 - Beacon request */
1784 struct rrm_measurement_beacon_request {
1785 	u8 oper_class; /* Operating Class */
1786 	u8 channel; /* Channel Number */
1787 	le16 rand_interval; /* Randomization Interval (in TUs) */
1788 	le16 duration; /* Measurement Duration (in TUs) */
1789 	u8 mode; /* Measurement Mode */
1790 	u8 bssid[ETH_ALEN]; /* BSSID */
1791 	u8 variable[0]; /* Optional Subelements */
1792 } STRUCT_PACKED;
1793 
1794 /*
1795  * IEEE Std 802.11-2016, Table 9-87 - Measurement Mode definitions for Beacon
1796  * request
1797  */
1798 enum beacon_report_mode {
1799 	BEACON_REPORT_MODE_PASSIVE = 0,
1800 	BEACON_REPORT_MODE_ACTIVE = 1,
1801 	BEACON_REPORT_MODE_TABLE = 2,
1802 };
1803 
1804 /* IEEE Std 802.11-2016, Table 9-88 - Beacon Request subelement IDs */
1805 #define WLAN_BEACON_REQUEST_SUBELEM_SSID	0
1806 #define WLAN_BEACON_REQUEST_SUBELEM_INFO	1 /* Beacon Reporting */
1807 #define WLAN_BEACON_REQUEST_SUBELEM_DETAIL	2 /* Reporting Detail */
1808 #define WLAN_BEACON_REQUEST_SUBELEM_REQUEST	10
1809 #define WLAN_BEACON_REQUEST_SUBELEM_AP_CHANNEL	51 /* AP Channel Report */
1810 #define WLAN_BEACON_REQUEST_SUBELEM_VENDOR	221
1811 
1812 /*
1813  * IEEE Std 802.11-2016, Table 9-90 - Reporting Detail values
1814  */
1815 enum beacon_report_detail {
1816 	/* No fixed-length fields or elements */
1817 	BEACON_REPORT_DETAIL_NONE = 0,
1818 	/* All fixed-length fields and any requested elements in the Request
1819 	 * element if present */
1820 	BEACON_REPORT_DETAIL_REQUESTED_ONLY = 1,
1821 	/* All fixed-length fields and elements (default, used when Reporting
1822 	 * Detail subelement is not included in a Beacon request) */
1823 	BEACON_REPORT_DETAIL_ALL_FIELDS_AND_ELEMENTS = 2,
1824 };
1825 
1826 /* IEEE Std 802.11-2016, 9.4.2.22 - Measurement Report element */
1827 struct rrm_measurement_report_element {
1828 	u8 eid; /* Element ID */
1829 	u8 len; /* Length */
1830 	u8 token; /* Measurement Token */
1831 	u8 mode; /* Measurement Report Mode */
1832 	u8 type; /* Measurement Type */
1833 	u8 variable[0]; /* Measurement Report */
1834 } STRUCT_PACKED;
1835 
1836 /* IEEE Std 802.11-2016, Figure 9-192 - Measurement Report Mode field */
1837 #define MEASUREMENT_REPORT_MODE_ACCEPT 0
1838 #define MEASUREMENT_REPORT_MODE_REJECT_LATE BIT(0)
1839 #define MEASUREMENT_REPORT_MODE_REJECT_INCAPABLE BIT(1)
1840 #define MEASUREMENT_REPORT_MODE_REJECT_REFUSED BIT(2)
1841 
1842 /* IEEE Std 802.11-2016, 9.4.2.22.7 - Beacon report */
1843 struct rrm_measurement_beacon_report {
1844 	u8 op_class; /* Operating Class */
1845 	u8 channel; /* Channel Number */
1846 	le64 start_time; /* Actual Measurement Start Time
1847 			  * (in TSF of the BSS requesting the measurement) */
1848 	le16 duration; /* in TUs */
1849 	u8 report_info; /* Reported Frame Information */
1850 	u8 rcpi; /* RCPI */
1851 	u8 rsni; /* RSNI */
1852 	u8 bssid[ETH_ALEN]; /* BSSID */
1853 	u8 antenna_id; /* Antenna ID */
1854 	le32 parent_tsf; /* Parent TSF */
1855 	u8 variable[0]; /* Optional Subelements */
1856 } STRUCT_PACKED;
1857 
1858 /* IEEE Std 802.11-2016, Table 9-112 - Beacon report Subelement IDs */
1859 #define WLAN_BEACON_REPORT_SUBELEM_FRAME_BODY	1
1860 #define WLAN_BEACON_REPORT_SUBELEM_VENDOR	221
1861 
1862 /* IEEE Std 802.11ad-2012 - Multi-band element */
1863 struct multi_band_ie {
1864 	u8 eid; /* WLAN_EID_MULTI_BAND */
1865 	u8 len;
1866 	u8 mb_ctrl;
1867 	u8 band_id;
1868 	u8 op_class;
1869 	u8 chan;
1870 	u8 bssid[ETH_ALEN];
1871 	le16 beacon_int;
1872 	u8 tsf_offs[8];
1873 	u8 mb_connection_capability;
1874 	u8 fst_session_tmout;
1875 	/* Optional:
1876 	 *   STA MAC Address
1877 	 *   Pairwise Cipher Suite Count
1878 	 *   Pairwise Cipher Suite List
1879 	 */
1880 	u8 variable[0];
1881 } STRUCT_PACKED;
1882 
1883 enum mb_ctrl_sta_role {
1884 	MB_STA_ROLE_AP = 0,
1885 	MB_STA_ROLE_TDLS_STA = 1,
1886 	MB_STA_ROLE_IBSS_STA = 2,
1887 	MB_STA_ROLE_PCP = 3,
1888 	MB_STA_ROLE_NON_PCP_NON_AP = 4
1889 };
1890 
1891 #define MB_CTRL_ROLE_MASK (BIT(0) | BIT(1) | BIT(2))
1892 #define MB_CTRL_ROLE(ctrl) ((u8) ((ctrl) & MB_CTRL_ROLE_MASK))
1893 #define MB_CTRL_STA_MAC_PRESENT ((u8) (BIT(3)))
1894 #define MB_CTRL_PAIRWISE_CIPHER_SUITE_PRESENT ((u8) (BIT(4)))
1895 
1896 enum mb_band_id {
1897 	MB_BAND_ID_WIFI_2_4GHZ = 2, /* 2.4 GHz */
1898 	MB_BAND_ID_WIFI_5GHZ = 4, /* 4.9 and 5 GHz */
1899 	MB_BAND_ID_WIFI_60GHZ = 5, /* 60 GHz */
1900 };
1901 
1902 #define MB_CONNECTION_CAPABILITY_AP ((u8) (BIT(0)))
1903 #define MB_CONNECTION_CAPABILITY_PCP ((u8) (BIT(1)))
1904 #define MB_CONNECTION_CAPABILITY_DLS ((u8) (BIT(2)))
1905 #define MB_CONNECTION_CAPABILITY_TDLS ((u8) (BIT(3)))
1906 #define MB_CONNECTION_CAPABILITY_IBSS ((u8) (BIT(4)))
1907 
1908 /* IEEE Std 802.11ad-2014 - FST Action field */
1909 enum fst_action {
1910 	FST_ACTION_SETUP_REQUEST = 0,
1911 	FST_ACTION_SETUP_RESPONSE = 1,
1912 	FST_ACTION_TEAR_DOWN = 2,
1913 	FST_ACTION_ACK_REQUEST = 3,
1914 	FST_ACTION_ACK_RESPONSE = 4,
1915 	FST_ACTION_ON_CHANNEL_TUNNEL = 5,
1916 };
1917 
1918 /* IEEE Std 802.11ac-2013, Annex C - dot11PHYType */
1919 enum phy_type {
1920 	PHY_TYPE_UNSPECIFIED = 0,
1921 	PHY_TYPE_FHSS = 1,
1922 	PHY_TYPE_DSSS = 2,
1923 	PHY_TYPE_IRBASEBAND = 3,
1924 	PHY_TYPE_OFDM = 4,
1925 	PHY_TYPE_HRDSSS = 5,
1926 	PHY_TYPE_ERP = 6,
1927 	PHY_TYPE_HT = 7,
1928 	PHY_TYPE_DMG = 8,
1929 	PHY_TYPE_VHT = 9,
1930 };
1931 
1932 /* IEEE P802.11-REVmc/D5.0, 9.4.2.37 - Neighbor Report element */
1933 /* BSSID Information Field */
1934 #define NEI_REP_BSSID_INFO_AP_NOT_REACH BIT(0)
1935 #define NEI_REP_BSSID_INFO_AP_UNKNOWN_REACH BIT(1)
1936 #define NEI_REP_BSSID_INFO_AP_REACHABLE (BIT(0) | BIT(1))
1937 #define NEI_REP_BSSID_INFO_SECURITY BIT(2)
1938 #define NEI_REP_BSSID_INFO_KEY_SCOPE BIT(3)
1939 #define NEI_REP_BSSID_INFO_SPECTRUM_MGMT BIT(4)
1940 #define NEI_REP_BSSID_INFO_QOS BIT(5)
1941 #define NEI_REP_BSSID_INFO_APSD BIT(6)
1942 #define NEI_REP_BSSID_INFO_RM BIT(7)
1943 #define NEI_REP_BSSID_INFO_DELAYED_BA BIT(8)
1944 #define NEI_REP_BSSID_INFO_IMM_BA BIT(9)
1945 #define NEI_REP_BSSID_INFO_MOBILITY_DOMAIN BIT(10)
1946 #define NEI_REP_BSSID_INFO_HT BIT(11)
1947 #define NEI_REP_BSSID_INFO_VHT BIT(12)
1948 #define NEI_REP_BSSID_INFO_FTM BIT(13)
1949 
1950 /*
1951  * IEEE P802.11-REVmc/D5.0 Table 9-152 - HT/VHT Operation Information
1952  * subfields.
1953  * Note: These definitions are not the same as other VHT_CHANWIDTH_*.
1954  */
1955 enum nr_chan_width {
1956 	NR_CHAN_WIDTH_20 = 0,
1957 	NR_CHAN_WIDTH_40 = 1,
1958 	NR_CHAN_WIDTH_80 = 2,
1959 	NR_CHAN_WIDTH_160 = 3,
1960 	NR_CHAN_WIDTH_80P80 = 4,
1961 };
1962 
1963 struct ieee80211_he_capabilities {
1964 	u8 he_mac_capab_info[5];
1965 	u8 he_phy_capab_info[9];
1966 	u16 he_txrx_mcs_support;
1967 	/* possibly followed by Tx Rx MCS NSS descriptor */
1968 	u8 variable[];
1969 	/* PPE Thresholds (optional) */
1970 } STRUCT_PACKED;
1971 
1972 struct ieee80211_he_operation {
1973 	u32 he_oper_params;
1974 	u8 he_mcs_nss_set[3];
1975 	u8 vht_op_info_chwidth;
1976 	u8 vht_op_info_chan_center_freq_seg0_idx;
1977 	u8 vht_op_info_chan_center_freq_seg1_idx;
1978 } STRUCT_PACKED;
1979 
1980 /* HE Capabilities Information defines */
1981 #define HE_PHYCAP_SU_BEAMFORMER_CAPAB_IDX	3
1982 #define HE_PHYCAP_SU_BEAMFORMER_CAPAB		((u8) BIT(7))
1983 #define HE_PHYCAP_SU_BEAMFORMEE_CAPAB_IDX	4
1984 #define HE_PHYCAP_SU_BEAMFORMEE_CAPAB		((u8) BIT(0))
1985 #define HE_PHYCAP_MU_BEAMFORMER_CAPAB_IDX	4
1986 #define HE_PHYCAP_MU_BEAMFORMER_CAPAB		((u8) BIT(1))
1987 
1988 /* HE Operation defines */
1989 #define HE_OPERATION_BSS_COLOR_MASK		((u32) (BIT(0) | BIT(1) | \
1990 							BIT(2) | BIT(3) | \
1991 							BIT(4) | BIT(5)))
1992 #define HE_OPERATION_DFLT_PE_DURATION_MASK	((u32) (BIT(6) | BIT(7) | \
1993 							BIT(8)))
1994 #define HE_OPERATION_DFLT_PE_DURATION_OFFSET	6
1995 #define HE_OPERATION_TWT_REQUIRED		((u32) BIT(9))
1996 #define HE_OPERATION_RTS_THRESHOLD_MASK	((u32) (BIT(10) | BIT(11) | \
1997 						BIT(12) | BIT(13) | \
1998 						BIT(14) | BIT(15) | \
1999 						BIT(16) | BIT(17) | \
2000 						BIT(18) | BIT(19)))
2001 #define HE_OPERATION_RTS_THRESHOLD_OFFSET	10
2002 #define HE_OPERATION_PARTIAL_BSS_COLOR		((u32) BIT(20))
2003 #define HE_OPERATION_MAX_BSSID_INDICATOR_MASK	((u32) (BIT(21) | BIT(22) | \
2004 							BIT(23) | BIT(24) | \
2005 							BIT(25) | BIT(26) | \
2006 							BIT(27) | BIT(28)))
2007 #define HE_OPERATION_MAX_BSSID_INDICATOR_OFFSET 21
2008 #define HE_OPERATION_TX_BSSID_INDICATOR		((u32) BIT(29))
2009 #define HE_OPERATION_BSS_COLOR_DISABLED		((u32) BIT(30))
2010 #define HE_OPERATION_BSS_DUAL_BEACON		((u32) BIT(31))
2011 
2012 #endif /* IEEE802_11_DEFS_H */
2013