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