Coverage Report

Created: 2025-10-10 06:31

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/hostap/src/common/ieee802_11_defs.h
Line
Count
Source
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
0
#define WLAN_FC_TODS    0x0100
19
0
#define WLAN_FC_FROMDS    0x0200
20
#define WLAN_FC_MOREFRAG  0x0400
21
0
#define WLAN_FC_RETRY   0x0800
22
#define WLAN_FC_PWRMGT    0x1000
23
#define WLAN_FC_MOREDATA  0x2000
24
0
#define WLAN_FC_ISWEP   0x4000
25
#define WLAN_FC_HTC   0x8000
26
27
#define WLAN_FC_S1G_BEACON_NEXT_TBTT  0x0100
28
#define WLAN_FC_S1G_BEACON_COMP_SSID  0x0200
29
#define WLAN_FC_S1G_BEACON_ANO    0x0400
30
#define WLAN_FC_S1G_BEACON_BSS_BW 0x3800
31
#define WLAN_FC_S1G_BEACON_SECURITY 0x4000
32
#define WLAN_FC_S1G_BEACON_AP_PM  0x8000
33
34
2.72k
#define WLAN_FC_GET_TYPE(fc)  (((fc) & 0x000c) >> 2)
35
17.4k
#define WLAN_FC_GET_STYPE(fc) (((fc) & 0x00f0) >> 4)
36
37
2.17k
#define WLAN_INVALID_MGMT_SEQ   0xFFFF
38
39
#define WLAN_GET_SEQ_FRAG(seq) ((seq) & (BIT(3) | BIT(2) | BIT(1) | BIT(0)))
40
#define WLAN_GET_SEQ_SEQ(seq) \
41
  (((seq) & (~(BIT(3) | BIT(2) | BIT(1) | BIT(0)))) >> 4)
42
43
5.45k
#define WLAN_FC_TYPE_MGMT   0
44
0
#define WLAN_FC_TYPE_CTRL   1
45
0
#define WLAN_FC_TYPE_DATA   2
46
#define WLAN_FC_TYPE_EXT    3
47
48
/* management */
49
0
#define WLAN_FC_STYPE_ASSOC_REQ   0
50
0
#define WLAN_FC_STYPE_ASSOC_RESP  1
51
0
#define WLAN_FC_STYPE_REASSOC_REQ 2
52
0
#define WLAN_FC_STYPE_REASSOC_RESP  3
53
0
#define WLAN_FC_STYPE_PROBE_REQ   4
54
0
#define WLAN_FC_STYPE_PROBE_RESP  5
55
13.6k
#define WLAN_FC_STYPE_BEACON    8
56
#define WLAN_FC_STYPE_ATIM    9
57
0
#define WLAN_FC_STYPE_DISASSOC    10
58
2.72k
#define WLAN_FC_STYPE_AUTH    11
59
0
#define WLAN_FC_STYPE_DEAUTH    12
60
0
#define WLAN_FC_STYPE_ACTION    13
61
#define WLAN_FC_STYPE_ACTION_NO_ACK 14
62
63
/* control */
64
0
#define WLAN_FC_STYPE_PSPOLL    10
65
#define WLAN_FC_STYPE_RTS   11
66
#define WLAN_FC_STYPE_CTS   12
67
#define WLAN_FC_STYPE_ACK   13
68
#define WLAN_FC_STYPE_CFEND   14
69
#define WLAN_FC_STYPE_CFENDACK    15
70
71
/* data */
72
#define WLAN_FC_STYPE_DATA    0
73
#define WLAN_FC_STYPE_DATA_CFACK  1
74
#define WLAN_FC_STYPE_DATA_CFPOLL 2
75
#define WLAN_FC_STYPE_DATA_CFACKPOLL  3
76
#define WLAN_FC_STYPE_NULLFUNC    4
77
#define WLAN_FC_STYPE_CFACK   5
78
#define WLAN_FC_STYPE_CFPOLL    6
79
#define WLAN_FC_STYPE_CFACKPOLL   7
80
#define WLAN_FC_STYPE_QOS_DATA    8
81
#define WLAN_FC_STYPE_QOS_DATA_CFACK  9
82
#define WLAN_FC_STYPE_QOS_DATA_CFPOLL 10
83
#define WLAN_FC_STYPE_QOS_DATA_CFACKPOLL  11
84
#define WLAN_FC_STYPE_QOS_NULL    12
85
#define WLAN_FC_STYPE_QOS_CFPOLL  14
86
#define WLAN_FC_STYPE_QOS_CFACKPOLL 15
87
88
/* extension */
89
#define WLAN_FC_STYPE_DMG_BEACON  0
90
#define WLAN_FC_STYPE_S1G_BEACON  1
91
92
/* Authentication algorithms */
93
0
#define WLAN_AUTH_OPEN      0
94
0
#define WLAN_AUTH_SHARED_KEY    1
95
0
#define WLAN_AUTH_FT      2
96
0
#define WLAN_AUTH_SAE     3
97
0
#define WLAN_AUTH_FILS_SK   4
98
0
#define WLAN_AUTH_FILS_SK_PFS   5
99
0
#define WLAN_AUTH_FILS_PK   6
100
0
#define WLAN_AUTH_PASN      7
101
#define WLAN_AUTH_LEAP      128
102
103
0
#define WLAN_AUTH_CHALLENGE_LEN 128
104
105
/* IEEE Std 802.11-2024, 9.4.1.4 (Capability Information field) */
106
0
#define WLAN_CAPABILITY_ESS BIT(0)
107
#define WLAN_CAPABILITY_IBSS BIT(1)
108
/* bit 2 is reserved (was WLAN_CAPABILITY_CF_POLLABLE) */
109
/* bit 3 is reserved (was WLAN_CAPABILITY_CF_POLL_REQUEST) */
110
0
#define WLAN_CAPABILITY_PRIVACY BIT(4)
111
0
#define WLAN_CAPABILITY_SHORT_PREAMBLE BIT(5)
112
/* bit 6 is reserved (was WLAN_CAPABILITY_PBCC) */
113
/* bit 7 is reserved (was WLAN_CAPABILITY_CHANNEL_AGILITY) */
114
0
#define WLAN_CAPABILITY_SPECTRUM_MGMT BIT(8)
115
0
#define WLAN_CAPABILITY_QOS BIT(9)
116
0
#define WLAN_CAPABILITY_SHORT_SLOT_TIME BIT(10)
117
0
#define WLAN_CAPABILITY_APSD BIT(11)
118
0
#define WLAN_CAPABILITY_RADIO_MEASUREMENT BIT(12)
119
#define WLAN_CAPABILITY_EPD BIT(13)
120
/* bit 14 is reserved (was WLAN_CAPABILITY_DELAYED_BLOCK_ACK) */
121
/* bit 15 is reserved (was WLAN_CAPABILITY_IMM_BLOCK_ACK) */
122
123
/* Status codes (IEEE Std 802.11-2020, 9.4.1.9, Table 9-50) */
124
30.9k
#define WLAN_STATUS_SUCCESS 0
125
5.93k
#define WLAN_STATUS_UNSPECIFIED_FAILURE 1
126
0
#define WLAN_STATUS_TDLS_WAKEUP_ALTERNATE 2
127
0
#define WLAN_STATUS_TDLS_WAKEUP_REJECT 3
128
0
#define WLAN_STATUS_SECURITY_DISABLED 5
129
0
#define WLAN_STATUS_UNACCEPTABLE_LIFETIME 6
130
0
#define WLAN_STATUS_NOT_IN_SAME_BSS 7
131
0
#define WLAN_STATUS_CAPS_UNSUPPORTED 10
132
0
#define WLAN_STATUS_REASSOC_NO_ASSOC 11
133
0
#define WLAN_STATUS_ASSOC_DENIED_UNSPEC 12
134
0
#define WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 13
135
0
#define WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION 14
136
0
#define WLAN_STATUS_CHALLENGE_FAIL 15
137
0
#define WLAN_STATUS_AUTH_TIMEOUT 16
138
0
#define WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 17
139
0
#define WLAN_STATUS_ASSOC_DENIED_RATES 18
140
0
#define WLAN_STATUS_ASSOC_DENIED_NOSHORT 19
141
0
#define WLAN_STATUS_SPEC_MGMT_REQUIRED 22
142
0
#define WLAN_STATUS_PWR_CAPABILITY_NOT_VALID 23
143
0
#define WLAN_STATUS_SUPPORTED_CHANNEL_NOT_VALID 24
144
0
#define WLAN_STATUS_ASSOC_DENIED_NO_SHORT_SLOT_TIME 25
145
0
#define WLAN_STATUS_ASSOC_DENIED_NO_HT 27
146
0
#define WLAN_STATUS_R0KH_UNREACHABLE 28
147
0
#define WLAN_STATUS_ASSOC_DENIED_NO_PCO 29
148
973
#define WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY 30
149
0
#define WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION 31
150
0
#define WLAN_STATUS_UNSPECIFIED_QOS_FAILURE 32
151
0
#define WLAN_STATUS_DENIED_INSUFFICIENT_BANDWIDTH 33
152
0
#define WLAN_STATUS_DENIED_POOR_CHANNEL_CONDITIONS 34
153
0
#define WLAN_STATUS_DENIED_QOS_NOT_SUPPORTED 35
154
0
#define WLAN_STATUS_REQUEST_DECLINED 37
155
51
#define WLAN_STATUS_INVALID_PARAMETERS 38
156
0
#define WLAN_STATUS_REJECTED_WITH_SUGGESTED_CHANGES 39
157
0
#define WLAN_STATUS_INVALID_IE 40
158
0
#define WLAN_STATUS_GROUP_CIPHER_NOT_VALID 41
159
0
#define WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID 42
160
0
#define WLAN_STATUS_AKMP_NOT_VALID 43
161
0
#define WLAN_STATUS_UNSUPPORTED_RSN_IE_VERSION 44
162
0
#define WLAN_STATUS_INVALID_RSN_IE_CAPAB 45
163
0
#define WLAN_STATUS_CIPHER_REJECTED_PER_POLICY 46
164
0
#define WLAN_STATUS_TS_NOT_CREATED 47
165
0
#define WLAN_STATUS_DIRECT_LINK_NOT_ALLOWED 48
166
0
#define WLAN_STATUS_DEST_STA_NOT_PRESENT 49
167
0
#define WLAN_STATUS_DEST_STA_NOT_QOS_STA 50
168
0
#define WLAN_STATUS_ASSOC_DENIED_LISTEN_INT_TOO_LARGE 51
169
0
#define WLAN_STATUS_INVALID_FT_ACTION_FRAME_COUNT 52
170
0
#define WLAN_STATUS_INVALID_PMKID 53
171
0
#define WLAN_STATUS_INVALID_MDIE 54
172
0
#define WLAN_STATUS_INVALID_FTIE 55
173
0
#define WLAN_STATUS_REQUESTED_TCLAS_NOT_SUPPORTED 56
174
0
#define WLAN_STATUS_INSUFFICIENT_TCLAS_PROCESSING_RESOURCES 57
175
0
#define WLAN_STATUS_TRY_ANOTHER_BSS 58
176
0
#define WLAN_STATUS_GAS_ADV_PROTO_NOT_SUPPORTED 59
177
0
#define WLAN_STATUS_NO_OUTSTANDING_GAS_REQ 60
178
0
#define WLAN_STATUS_GAS_RESP_NOT_RECEIVED 61
179
0
#define WLAN_STATUS_STA_TIMED_OUT_WAITING_FOR_GAS_RESP 62
180
0
#define WLAN_STATUS_GAS_RESP_LARGER_THAN_LIMIT 63
181
0
#define WLAN_STATUS_REQ_REFUSED_HOME 64
182
0
#define WLAN_STATUS_ADV_SRV_UNREACHABLE 65
183
0
#define WLAN_STATUS_REQ_REFUSED_SSPN 67
184
0
#define WLAN_STATUS_REQ_REFUSED_UNAUTH_ACCESS 68
185
2.58k
#define WLAN_STATUS_INVALID_RSNIE 72
186
0
#define WLAN_STATUS_U_APSD_COEX_NOT_SUPPORTED 73
187
0
#define WLAN_STATUS_U_APSD_COEX_MODE_NOT_SUPPORTED 74
188
0
#define WLAN_STATUS_BAD_INTERVAL_WITH_U_APSD_COEX 75
189
0
#define WLAN_STATUS_ANTI_CLOGGING_TOKEN_REQ 76
190
84
#define WLAN_STATUS_FINITE_CYCLIC_GROUP_NOT_SUPPORTED 77
191
0
#define WLAN_STATUS_CANNOT_FIND_ALT_TBTT 78
192
0
#define WLAN_STATUS_TRANSMISSION_FAILURE 79
193
0
#define WLAN_STATUS_REQ_TCLAS_NOT_SUPPORTED 80
194
0
#define WLAN_STATUS_TCLAS_RESOURCES_EXCHAUSTED 81
195
0
#define WLAN_STATUS_REJECTED_WITH_SUGGESTED_BSS_TRANSITION 82
196
0
#define WLAN_STATUS_REJECT_WITH_SCHEDULE 83
197
0
#define WLAN_STATUS_REJECT_NO_WAKEUP_SPECIFIED 84
198
0
#define WLAN_STATUS_SUCCESS_POWER_SAVE_MODE 85
199
0
#define WLAN_STATUS_PENDING_ADMITTING_FST_SESSION 86
200
0
#define WLAN_STATUS_PERFORMING_FST_NOW 87
201
0
#define WLAN_STATUS_PENDING_GAP_IN_BA_WINDOW 88
202
0
#define WLAN_STATUS_REJECT_U_PID_SETTING 89
203
0
#define WLAN_STATUS_REFUSED_EXTERNAL_REASON 92
204
0
#define WLAN_STATUS_REFUSED_AP_OUT_OF_MEMORY 93
205
0
#define WLAN_STATUS_REJECTED_EMERGENCY_SERVICE_NOT_SUPPORTED 94
206
0
#define WLAN_STATUS_QUERY_RESP_OUTSTANDING 95
207
0
#define WLAN_STATUS_REJECT_DSE_BAND 96
208
0
#define WLAN_STATUS_TCLAS_PROCESSING_TERMINATED 97
209
0
#define WLAN_STATUS_TS_SCHEDULE_CONFLICT 98
210
0
#define WLAN_STATUS_DENIED_WITH_SUGGESTED_BAND_AND_CHANNEL 99
211
0
#define WLAN_STATUS_MCCAOP_RESERVATION_CONFLICT 100
212
0
#define WLAN_STATUS_MAF_LIMIT_EXCEEDED 101
213
0
#define WLAN_STATUS_MCCA_TRACK_LIMIT_EXCEEDED 102
214
0
#define WLAN_STATUS_DENIED_DUE_TO_SPECTRUM_MANAGEMENT 103
215
0
#define WLAN_STATUS_ASSOC_DENIED_NO_VHT 104
216
0
#define WLAN_STATUS_ENABLEMENT_DENIED 105
217
0
#define WLAN_STATUS_RESTRICTION_FROM_AUTHORIZED_GDB 106
218
0
#define WLAN_STATUS_AUTHORIZATION_DEENABLED 107
219
0
#define WLAN_STATUS_FILS_AUTHENTICATION_FAILURE 112
220
0
#define WLAN_STATUS_UNKNOWN_AUTHENTICATION_SERVER 113
221
12
#define WLAN_STATUS_UNKNOWN_PASSWORD_IDENTIFIER 123
222
0
#define WLAN_STATUS_DENIED_HE_NOT_SUPPORTED 124
223
0
#define WLAN_STATUS_SAE_HASH_TO_ELEMENT 126
224
0
#define WLAN_STATUS_SAE_PK 127
225
#define WLAN_STATUS_DENIED_STA_AFF_WITH_MLD_WITH_EXISTING_ASSOC 130
226
#define WLAN_STATUS_EPCS_DENIED_UNAUTHORIZED 131
227
#define WLAN_STATUS_EPCS_DENIED 132
228
#define WLAN_STATUS_DENIED_TID_TO_LINK_MAPPING 133
229
#define WLAN_STATUS_PREFERRED_TID_TO_LINK_MAPPING_SUGGESTED 134
230
#define WLAN_STATUS_DENIED_EHT_NOT_SUPPORTED 135
231
15
#define WLAN_STATUS_INVALID_PUBLIC_KEY 136
232
0
#define WLAN_STATUS_PASN_BASE_AKMP_FAILED 137
233
0
#define WLAN_STATUS_OCI_MISMATCH 138
234
0
#define WLAN_STATUS_DENIED_TX_LINK_NOT_ACCEPTED 139
235
#define WLAN_STATUS_EPCS_DENIED_VERIFICATION_FAILURE 140
236
#define WLAN_STATUS_DENIED_OPERATION_PARAMETER_UPDATE 141
237
238
/* Reason codes (IEEE Std 802.11-2020, 9.4.1.7, Table 9-90) */
239
2.21k
#define WLAN_REASON_UNSPECIFIED 1
240
0
#define WLAN_REASON_PREV_AUTH_NOT_VALID 2
241
0
#define WLAN_REASON_DEAUTH_LEAVING 3
242
0
#define WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4
243
0
#define WLAN_REASON_DISASSOC_AP_BUSY 5
244
0
#define WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6
245
0
#define WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 7
246
0
#define WLAN_REASON_DISASSOC_STA_HAS_LEFT 8
247
0
#define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9
248
0
#define WLAN_REASON_PWR_CAPABILITY_NOT_VALID 10
249
0
#define WLAN_REASON_SUPPORTED_CHANNEL_NOT_VALID 11
250
0
#define WLAN_REASON_BSS_TRANSITION_DISASSOC 12
251
0
#define WLAN_REASON_INVALID_IE 13
252
0
#define WLAN_REASON_MICHAEL_MIC_FAILURE 14
253
105
#define WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT 15
254
0
#define WLAN_REASON_GROUP_KEY_UPDATE_TIMEOUT 16
255
109
#define WLAN_REASON_IE_IN_4WAY_DIFFERS 17
256
0
#define WLAN_REASON_GROUP_CIPHER_NOT_VALID 18
257
0
#define WLAN_REASON_PAIRWISE_CIPHER_NOT_VALID 19
258
0
#define WLAN_REASON_AKMP_NOT_VALID 20
259
0
#define WLAN_REASON_UNSUPPORTED_RSN_IE_VERSION 21
260
0
#define WLAN_REASON_INVALID_RSN_IE_CAPAB 22
261
0
#define WLAN_REASON_IEEE_802_1X_AUTH_FAILED 23
262
0
#define WLAN_REASON_CIPHER_SUITE_REJECTED 24
263
0
#define WLAN_REASON_TDLS_TEARDOWN_UNREACHABLE 25
264
0
#define WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED 26
265
0
#define WLAN_REASON_SSP_REQUESTED_DISASSOC 27
266
0
#define WLAN_REASON_NO_SSP_ROAMING_AGREEMENT 28
267
0
#define WLAN_REASON_BAD_CIPHER_OR_AKM 29
268
0
#define WLAN_REASON_NOT_AUTHORIZED_THIS_LOCATION 30
269
0
#define WLAN_REASON_SERVICE_CHANGE_PRECLUDES_TS 31
270
0
#define WLAN_REASON_UNSPECIFIED_QOS_REASON 32
271
0
#define WLAN_REASON_NOT_ENOUGH_BANDWIDTH 33
272
0
#define WLAN_REASON_DISASSOC_LOW_ACK 34
273
0
#define WLAN_REASON_EXCEEDED_TXOP 35
274
0
#define WLAN_REASON_STA_LEAVING 36
275
0
#define WLAN_REASON_END_TS_BA_DLS 37
276
0
#define WLAN_REASON_UNKNOWN_TS_BA 38
277
0
#define WLAN_REASON_TIMEOUT 39
278
0
#define WLAN_REASON_PEERKEY_MISMATCH 45
279
0
#define WLAN_REASON_AUTHORIZED_ACCESS_LIMIT_REACHED 46
280
0
#define WLAN_REASON_EXTERNAL_SERVICE_REQUIREMENTS 47
281
0
#define WLAN_REASON_INVALID_FT_ACTION_FRAME_COUNT 48
282
0
#define WLAN_REASON_INVALID_PMKID 49
283
0
#define WLAN_REASON_INVALID_MDE 50
284
0
#define WLAN_REASON_INVALID_FTE 51
285
0
#define WLAN_REASON_MESH_PEERING_CANCELLED 52
286
0
#define WLAN_REASON_MESH_MAX_PEERS 53
287
0
#define WLAN_REASON_MESH_CONFIG_POLICY_VIOLATION 54
288
0
#define WLAN_REASON_MESH_CLOSE_RCVD 55
289
0
#define WLAN_REASON_MESH_MAX_RETRIES 56
290
0
#define WLAN_REASON_MESH_CONFIRM_TIMEOUT 57
291
0
#define WLAN_REASON_MESH_INVALID_GTK 58
292
0
#define WLAN_REASON_MESH_INCONSISTENT_PARAMS 59
293
0
#define WLAN_REASON_MESH_INVALID_SECURITY_CAP 60
294
0
#define WLAN_REASON_MESH_PATH_ERROR_NO_PROXY_INFO 61
295
0
#define WLAN_REASON_MESH_PATH_ERROR_NO_FORWARDING_INFO 62
296
0
#define WLAN_REASON_MESH_PATH_ERROR_DEST_UNREACHABLE 63
297
0
#define WLAN_REASON_MAC_ADDRESS_ALREADY_EXISTS_IN_MBSS 64
298
0
#define WLAN_REASON_MESH_CHANNEL_SWITCH_REGULATORY_REQ 65
299
0
#define WLAN_REASON_MESH_CHANNEL_SWITCH_UNSPECIFIED 66
300
301
302
/* Element IDs (IEEE Std 802.11-2020, 9.4.2.1, Table 9-92) */
303
26.5M
#define WLAN_EID_SSID 0
304
497k
#define WLAN_EID_SUPP_RATES 1
305
298k
#define WLAN_EID_DS_PARAMS 3
306
49.4k
#define WLAN_EID_CF_PARAMS 4
307
103k
#define WLAN_EID_TIM 5
308
#define WLAN_EID_IBSS_PARAMS 6
309
2.81k
#define WLAN_EID_COUNTRY 7
310
#define WLAN_EID_REQUEST 10
311
0
#define WLAN_EID_BSS_LOAD 11
312
#define WLAN_EID_EDCA_PARAM_SET 12
313
#define WLAN_EID_TSPEC 13
314
0
#define WLAN_EID_TCLAS 14
315
#define WLAN_EID_SCHEDULE 15
316
41.5k
#define WLAN_EID_CHALLENGE 16
317
0
#define WLAN_EID_PWR_CONSTRAINT 32
318
49.2k
#define WLAN_EID_PWR_CAPABILITY 33
319
#define WLAN_EID_TPC_REQUEST 34
320
0
#define WLAN_EID_TPC_REPORT 35
321
135k
#define WLAN_EID_SUPPORTED_CHANNELS 36
322
0
#define WLAN_EID_CHANNEL_SWITCH 37
323
0
#define WLAN_EID_MEASURE_REQUEST 38
324
0
#define WLAN_EID_MEASURE_REPORT 39
325
#define WLAN_EID_QUIET 40
326
#define WLAN_EID_IBSS_DFS 41
327
18.0k
#define WLAN_EID_ERP_INFO 42
328
#define WLAN_EID_TS_DELAY 43
329
0
#define WLAN_EID_TCLAS_PROCESSING 44
330
294k
#define WLAN_EID_HT_CAP 45
331
258k
#define WLAN_EID_QOS 46
332
207k
#define WLAN_EID_RSN 48
333
174k
#define WLAN_EID_EXT_SUPP_RATES 50
334
#define WLAN_EID_AP_CHANNEL_REPORT 51
335
6.07M
#define WLAN_EID_NEIGHBOR_REPORT 52
336
#define WLAN_EID_RCPI 53
337
167k
#define WLAN_EID_MOBILITY_DOMAIN 54
338
182k
#define WLAN_EID_FAST_BSS_TRANSITION 55
339
302k
#define WLAN_EID_TIMEOUT_INTERVAL 56
340
0
#define WLAN_EID_RIC_DATA 57
341
#define WLAN_EID_DSE_REGISTERED_LOCATION 58
342
140k
#define WLAN_EID_SUPPORTED_OPERATING_CLASSES 59
343
0
#define WLAN_EID_EXT_CHANSWITCH_ANN 60
344
13.3k
#define WLAN_EID_HT_OPERATION 61
345
#define WLAN_EID_SECONDARY_CHANNEL_OFFSET 62
346
#define WLAN_EID_BSS_AVERAGE_ACCESS_DELAY 63
347
#define WLAN_EID_ANTENNA 64
348
#define WLAN_EID_RSNI 65
349
#define WLAN_EID_MEASUREMENT_PILOT_TRANSMISSION 66
350
#define WLAN_EID_BSS_AVAILABLE_ADM_CAPA 67
351
#define WLAN_EID_BSS_AC_ACCESS_DELAY 68 /* note: also used by WAPI */
352
0
#define WLAN_EID_TIME_ADVERTISEMENT 69
353
11.1k
#define WLAN_EID_RRM_ENABLED_CAPABILITIES 70
354
11.3k
#define WLAN_EID_MULTIPLE_BSSID 71
355
0
#define WLAN_EID_20_40_BSS_COEXISTENCE 72
356
0
#define WLAN_EID_20_40_BSS_INTOLERANT 73
357
0
#define WLAN_EID_OVERLAPPING_BSS_SCAN_PARAMS 74
358
#define WLAN_EID_RIC_DESCRIPTOR 75
359
#define WLAN_EID_MMIE 76
360
#define WLAN_EID_EVENT_REQUEST 78
361
#define WLAN_EID_EVENT_REPORT 79
362
#define WLAN_EID_DIAGNOSTIC_REQUEST 80
363
#define WLAN_EID_DIAGNOSTIC_REPORT 81
364
#define WLAN_EID_LOCATION_PARAMETERS 82
365
0
#define WLAN_EID_NONTRANSMITTED_BSSID_CAPA 83
366
7.69k
#define WLAN_EID_SSID_LIST 84
367
0
#define WLAN_EID_MULTIPLE_BSSID_INDEX 85
368
#define WLAN_EID_FMS_DESCRIPTOR 86
369
#define WLAN_EID_FMS_REQUEST 87
370
#define WLAN_EID_FMS_RESPONSE 88
371
#define WLAN_EID_QOS_TRAFFIC_CAPABILITY 89
372
14.7k
#define WLAN_EID_BSS_MAX_IDLE_PERIOD 90
373
#define WLAN_EID_TFS_REQ 91
374
0
#define WLAN_EID_TFS_RESP 92
375
0
#define WLAN_EID_WNMSLEEP 93
376
#define WLAN_EID_TIM_BROADCAST_REQUEST 94
377
#define WLAN_EID_TIM_BROADCAST_RESPONSE 95
378
#define WLAN_EID_COLLOCATED_INTERFERENCE_REPORT 96
379
#define WLAN_EID_CHANNEL_USAGE 97
380
0
#define WLAN_EID_TIME_ZONE 98
381
#define WLAN_EID_DMS_REQUEST 99
382
#define WLAN_EID_DMS_RESPONSE 100
383
177k
#define WLAN_EID_LINK_ID 101
384
#define WLAN_EID_WAKEUP_SCHEDULE 102
385
#define WLAN_EID_CHANNEL_SWITCH_TIMING 104
386
#define WLAN_EID_PTI_CONTROL 105
387
#define WLAN_EID_TPU_BUFFER_STATUS 106
388
6.23k
#define WLAN_EID_INTERWORKING 107
389
0
#define WLAN_EID_ADV_PROTO 108
390
#define WLAN_EID_EXPEDITED_BANDWIDTH_REQ 109
391
20.9k
#define WLAN_EID_QOS_MAP_SET 110
392
0
#define WLAN_EID_ROAMING_CONSORTIUM 111
393
#define WLAN_EID_EMERGENCY_ALERT_ID 112
394
13.6k
#define WLAN_EID_MESH_CONFIG 113
395
16.4k
#define WLAN_EID_MESH_ID 114
396
#define WLAN_EID_MESH_LINK_METRIC_REPORT 115
397
#define WLAN_EID_CONGESTION_NOTIFICATION 116
398
20.2k
#define WLAN_EID_PEER_MGMT 117
399
#define WLAN_EID_MESH_CHANNEL_SWITCH_PARAMETERS 118
400
#define WLAN_EID_MESH_AWAKE_WINDOW 119
401
#define WLAN_EID_BEACON_TIMING 120
402
#define WLAN_EID_MCCAOP_SETUP_REQUEST 121
403
#define WLAN_EID_MCCAOP_SETUP_REPLY 122
404
#define WLAN_EID_MCCAOP_ADVERTISEMENT 123
405
#define WLAN_EID_MCCAOP_TEARDOWN 124
406
#define WLAN_EID_GANN 125
407
#define WLAN_EID_RANN 126
408
148k
#define WLAN_EID_EXT_CAPAB 127
409
#define WLAN_EID_PREQ 130
410
#define WLAN_EID_PREP 131
411
#define WLAN_EID_PERR 132
412
#define WLAN_EID_PXU 137
413
#define WLAN_EID_PXUC 138
414
3.38k
#define WLAN_EID_AMPE 139
415
5.23k
#define WLAN_EID_MIC 140
416
#define WLAN_EID_DESTINATION_URI 141
417
#define WLAN_EID_U_APSD_COEX 142
418
#define WLAN_EID_DMG_WAKEUP_SCHEDULE 143
419
#define WLAN_EID_EXTENDED_SCHEDULE 144
420
#define WLAN_EID_STA_AVAILABILITY 145
421
#define WLAN_EID_DMG_TSPEC 146
422
#define WLAN_EID_NEXT_DMG_ATI 147
423
#define WLAN_EID_DMG_CAPABILITIES 148
424
#define WLAN_EID_DMG_OPERATION 151
425
#define WLAN_EID_DMG_BSS_PARAMETER_CHANGE 152
426
#define WLAN_EID_DMG_BEAM_REFINEMENT 153
427
#define WLAN_EID_CHANNEL_MEASUREMENT_FEEDBACK 154
428
#define WLAN_EID_CCKM 156
429
#define WLAN_EID_AWAKE_WINDOW 157
430
6.91k
#define WLAN_EID_MULTI_BAND 158
431
#define WLAN_EID_ADDBA_EXTENSION 159
432
#define WLAN_EID_NEXTPCP_LIST 160
433
#define WLAN_EID_PCP_HANDOVER 161
434
#define WLAN_EID_DMG_LINK_MARGIN 162
435
#define WLAN_EID_SWITCHING_STREAM 163
436
#define WLAN_EID_SESSION_TRANSITION 164
437
#define WLAN_EID_DYNAMIC_TONE_PAIRING_REPORT 165
438
#define WLAN_EID_CLUSTER_REPORT 166
439
#define WLAN_EID_REPLAY_CAPABILITIES 167
440
#define WLAN_EID_RELAY_TRANSFER_PARAM_SET 168
441
#define WLAN_EID_BEAMLINK_MAINTENANCE 169
442
#define WLAN_EID_MULTIPLE_MAC_SUBLAYERS 170
443
#define WLAN_EID_U_PID 171
444
#define WLAN_EID_DMG_LINK_ADAPTATION_ACK 172
445
#define WLAN_EID_MCCAOP_ADVERTISEMENT_OVERVIEW 174
446
#define WLAN_EID_QUIET_PERIOD_REQUEST 175
447
#define WLAN_EID_QUIET_PERIOD_RESPONSE 177
448
#define WLAN_EID_QMF_POLICY 181
449
#define WLAN_EID_ECAPC_POLICY 182
450
#define WLAN_EID_CLUSTER_TIME_OFFSET 183
451
0
#define WLAN_EID_INTRA_ACCESS_CATEGORY_PRIORITY 184
452
0
#define WLAN_EID_SCS_DESCRIPTOR 185
453
#define WLAN_EID_QLOAD_REPORT 186
454
#define WLAN_EID_HCCA_TXOP_UPDATE_COUNT 187
455
#define WLAN_EID_HIGHER_LAYER_STREAM_ID 188
456
#define WLAN_EID_GCR_GROUP_ADDRESS 189
457
#define WLAN_EID_ANTENNA_SECTOR_ID_PATTERN 190
458
273k
#define WLAN_EID_VHT_CAP 191
459
8.34k
#define WLAN_EID_VHT_OPERATION 192
460
#define WLAN_EID_EXTENDED_BSS_LOAD 193
461
0
#define WLAN_EID_WIDE_BW_CHSWITCH  194
462
0
#define WLAN_EID_TRANSMIT_POWER_ENVELOPE 195
463
0
#define WLAN_EID_CHANNEL_SWITCH_WRAPPER 196
464
134k
#define WLAN_EID_AID 197
465
#define WLAN_EID_QUIET_CHANNEL 198
466
10.5k
#define WLAN_EID_OPERATING_MODE_NOTIFICATION 199
467
#define WLAN_EID_UPSIM 200
468
0
#define WLAN_EID_REDUCED_NEIGHBOR_REPORT 201
469
#define WLAN_EID_TVHT_OPERATION 202
470
#define WLAN_EID_DEVICE_LOCATION 204
471
#define WLAN_EID_WHITE_SPACE_MAP 205
472
#define WLAN_EID_FTM_PARAMETERS 206
473
#define WLAN_EID_S1G_BCN_COMPAT 213
474
#define WLAN_EID_TWT 216
475
25.0k
#define WLAN_EID_S1G_CAPABILITIES 217
476
13.6M
#define WLAN_EID_VENDOR_SPECIFIC 221
477
#define WLAN_EID_S1G_OPERATION 232
478
2.81k
#define WLAN_EID_CAG_NUMBER 237
479
14.4k
#define WLAN_EID_AP_CSN 239
480
23.8k
#define WLAN_EID_FILS_INDICATION 240
481
12.0k
#define WLAN_EID_DILS 241
482
101M
#define WLAN_EID_FRAGMENT 242
483
153k
#define WLAN_EID_RSNX 244
484
1.17M
#define WLAN_EID_EXTENSION 255
485
486
/* Element ID Extension (EID 255) values */
487
21.0k
#define WLAN_EID_EXT_ASSOC_DELAY_INFO 1
488
13.1k
#define WLAN_EID_EXT_FILS_REQ_PARAMS 2
489
10.8k
#define WLAN_EID_EXT_FILS_KEY_CONFIRM 3
490
29.5k
#define WLAN_EID_EXT_FILS_SESSION 4
491
13.8k
#define WLAN_EID_EXT_FILS_HLP_CONTAINER 5
492
9.67k
#define WLAN_EID_EXT_FILS_IP_ADDR_ASSIGN 6
493
13.3k
#define WLAN_EID_EXT_KEY_DELIVERY 7
494
5.75k
#define WLAN_EID_EXT_WRAPPED_DATA 8
495
#define WLAN_EID_EXT_FTM_SYNC_INFO 9
496
#define WLAN_EID_EXT_EXTENDED_REQUEST 10
497
#define WLAN_EID_EXT_ESTIMATED_SERVICE_PARAMS 11
498
12.6k
#define WLAN_EID_EXT_FILS_PUBLIC_KEY 12
499
14.3k
#define WLAN_EID_EXT_FILS_NONCE 13
500
#define WLAN_EID_EXT_FUTURE_CHANNEL_GUIDANCE 14
501
9.87k
#define WLAN_EID_EXT_OWE_DH_PARAM 32
502
5.94k
#define WLAN_EID_EXT_PASSWORD_IDENTIFIER 33
503
4.00k
#define WLAN_EID_EXT_HE_CAPABILITIES 35
504
9.77k
#define WLAN_EID_EXT_HE_OPERATION 36
505
#define WLAN_EID_EXT_HE_MU_EDCA_PARAMS 38
506
#define WLAN_EID_EXT_SPATIAL_REUSE 39
507
#define WLAN_EID_EXT_COLOR_CHANGE_ANNOUNCEMENT 42
508
#define WLAN_EID_EXT_MAX_CHANNEL_SWITCH_TIME 52
509
12.5k
#define WLAN_EID_EXT_OCV_OCI 54
510
0
#define WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION 55
511
0
#define WLAN_EID_EXT_NON_INHERITANCE 56
512
2.03k
#define WLAN_EID_EXT_KNOWN_BSSID 57
513
10.6k
#define WLAN_EID_EXT_SHORT_SSID_LIST 58
514
15.4k
#define WLAN_EID_EXT_HE_6GHZ_BAND_CAP 59
515
#define WLAN_EID_EXT_EDMG_CAPABILITIES 61
516
0
#define WLAN_EID_EXT_EDMG_OPERATION 62
517
0
#define WLAN_EID_EXT_MSCS_DESCRIPTOR 88
518
0
#define WLAN_EID_EXT_TCLAS_MASK 89
519
266
#define WLAN_EID_EXT_REJECTED_GROUPS 92
520
248
#define WLAN_EID_EXT_ANTI_CLOGGING_TOKEN 93
521
12.6k
#define WLAN_EID_EXT_PASN_PARAMS 100
522
14.8k
#define WLAN_EID_EXT_EHT_OPERATION 106
523
39.0k
#define WLAN_EID_EXT_MULTI_LINK 107
524
7.44k
#define WLAN_EID_EXT_EHT_CAPABILITIES 108
525
#define WLAN_EID_EXT_TID_TO_LINK_MAPPING 109
526
#define WLAN_EID_EXT_MULTI_LINK_TRAFFIC_INDICATION 110
527
0
#define WLAN_EID_EXT_QOS_CHARACTERISTICS 113
528
190
#define WLAN_EID_EXT_AKM_SUITE_SELECTOR 114
529
#define WLAN_EID_EXT_BANDWIDTH_INDICATION 135
530
0
#define WLAN_EID_EXT_KNOWN_STA_IDENTIFICATION 136
531
1.78k
#define WLAN_EID_EXT_PASN_ENCRYPTED_DATA 140
532
533
/* Extended Capabilities field */
534
#define WLAN_EXT_CAPAB_20_40_COEX 0
535
#define WLAN_EXT_CAPAB_GLK 1
536
#define WLAN_EXT_CAPAB_EXT_CHAN_SWITCH 2
537
#define WLAN_EXT_CAPAB_GLK_GCR 3
538
#define WLAN_EXT_CAPAB_PSMP 4
539
/* 5 - Reserved */
540
#define WLAN_EXT_CAPAB_S_PSMP 6
541
#define WLAN_EXT_CAPAB_EVENT 7
542
#define WLAN_EXT_CAPAB_DIAGNOSTICS 8
543
#define WLAN_EXT_CAPAB_MULTICAST_DIAGNOSTICS 9
544
#define WLAN_EXT_CAPAB_LOCATION_TRACKING 10
545
#define WLAN_EXT_CAPAB_FMS 11
546
0
#define WLAN_EXT_CAPAB_PROXY_ARP 12
547
#define WLAN_EXT_CAPAB_COLL_INTERF_REP 13
548
#define WLAN_EXT_CAPAB_CIVIC_LOCATION 14
549
#define WLAN_EXT_CAPAB_GEOSPATIAL_LOCATION 15
550
#define WLAN_EXT_CAPAB_TFS 16
551
#define WLAN_EXT_CAPAB_WNM_SLEEP_MODE 17
552
#define WLAN_EXT_CAPAB_TIM_BROADCAST 18
553
#define WLAN_EXT_CAPAB_BSS_TRANSITION 19
554
#define WLAN_EXT_CAPAB_QOS_TRAFFIC 20
555
#define WLAN_EXT_CAPAB_AC_STA_COUNT 21
556
#define WLAN_EXT_CAPAB_MULTIPLE_BSSID 22
557
#define WLAN_EXT_CAPAB_TIMING_MEASUREMENT 23
558
#define WLAN_EXT_CAPAB_CHANNEL_USAGE 24
559
#define WLAN_EXT_CAPAB_SSID_LIST 25
560
#define WLAN_EXT_CAPAB_DMS 26
561
#define WLAN_EXT_CAPAB_UTF_TSF_OFFSET 27
562
#define WLAN_EXT_CAPAB_TPU_BUFFER_STA 28
563
#define WLAN_EXT_CAPAB_TDLS_PEER_PSM 29
564
#define WLAN_EXT_CAPAB_TDLS_CHANNEL_SWITCH 30
565
0
#define WLAN_EXT_CAPAB_INTERWORKING 31
566
#define WLAN_EXT_CAPAB_QOS_MAP 32
567
#define WLAN_EXT_CAPAB_EBR 33
568
#define WLAN_EXT_CAPAB_SSPN_INTERFACE 34
569
/* 35 - Reserved */
570
#define WLAN_EXT_CAPAB_MSGCF 36
571
#define WLAN_EXT_CAPAB_TDLS 37
572
#define WLAN_EXT_CAPAB_TDLS_PROHIBITED 38
573
#define WLAN_EXT_CAPAB_TDLS_CHANNEL_SWITCH_PROHIBITED 39
574
#define WLAN_EXT_CAPAB_REJECT_UNADMITTED_FRAME 40
575
/* 41-43 - Service Interval Granularity */
576
#define WLAN_EXT_CAPAB_IDENTIFIER_LOCATION 44
577
#define WLAN_EXT_CAPAB_U_APSD_COEX 45
578
#define WLAN_EXT_CAPAB_WNM_NOTIFCATION 46
579
#define WLAN_EXT_CAPAB_QAB 47
580
#define WLAN_EXT_CAPAB_UTF_8_SSID 48
581
#define WLAN_EXT_CAPAB_QMF 49
582
#define WLAN_EXT_CAPAB_QMF_RECONFIG 50
583
#define WLAN_EXT_CAPAB_ROBUST_AV_STREAMING 51
584
#define WLAN_EXT_CAPAB_ADVANCED_GCR 52
585
#define WLAN_EXT_CAPAB_MESH_GCR 53
586
0
#define WLAN_EXT_CAPAB_SCS 54
587
#define WLAN_EXT_CAPAB_QLOAD_REPORT 55
588
#define WLAN_EXT_CAPAB_ALT_EDCA 56
589
#define WLAN_EXT_CAPAB_UNPROT_TXOP_NEG 57
590
#define WLAN_EXT_CAPAB_PROT_TXOP_NEG 58
591
/* 59 - Reserved */
592
#define WLAN_EXT_CAPAB_PROT_QLOAD_REPORT 60
593
#define WLAN_EXT_CAPAB_TDLS_WIDER_BW 61
594
#define WLAN_EXT_CAPAB_OPMODE_NOTIF 62
595
/* 63-64 - Max Number of MSDUs In A-MSDU */
596
#define WLAN_EXT_CAPAB_CHANNEL_SCHEDULE_MGMT 65
597
#define WLAN_EXT_CAPAB_GEODB_INBAND_ENABLING_SIGNAL 66
598
#define WLAN_EXT_CAPAB_NETWORK_CHANNEL_CTRL 67
599
#define WLAN_EXT_CAPAB_WHITE_SPACE_MAP 68
600
#define WLAN_EXT_CAPAB_CHANNEL_AVAIL_QUERY 69
601
0
#define WLAN_EXT_CAPAB_FTM_RESPONDER 70
602
#define WLAN_EXT_CAPAB_FTM_INITIATOR 71
603
#define WLAN_EXT_CAPAB_FILS 72
604
#define WLAN_EXT_CAPAB_EXT_SPECTRUM_MGMT 73
605
#define WLAN_EXT_CAPAB_FUTURE_CHANNEL_GUIDANCE 74
606
#define WLAN_EXT_CAPAB_PAD 75
607
/* 76-79 - Reserved */
608
#define WLAN_EXT_CAPAB_COMPLETE_NON_TX_BSSID_PROFILE 80
609
#define WLAN_EXT_CAPAB_SAE_PW_ID 81
610
#define WLAN_EXT_CAPAB_SAE_PW_ID_EXCLUSIVELY 82
611
#define WLAN_EXT_CAPAB_BEACON_PROTECTION 84
612
0
#define WLAN_EXT_CAPAB_MSCS 85
613
#define WLAN_EXT_CAPAB_SAE_PK_EXCLUSIVELY 88
614
#define WLAN_EXT_CAPAB_KNOWN_STA_IDENTIFICATION 102
615
616
/* Extended RSN Capabilities */
617
/* bits 0-3: Field length (n-1) */
618
#define WLAN_RSNX_CAPAB_PROTECTED_TWT 4
619
0
#define WLAN_RSNX_CAPAB_SAE_H2E 5
620
#define WLAN_RSNX_CAPAB_SAE_PK 6
621
0
#define WLAN_RSNX_CAPAB_SECURE_LTF 8
622
#define WLAN_RSNX_CAPAB_SECURE_RTT 9
623
#define WLAN_RSNX_CAPAB_URNM_MFPR_X20 10
624
0
#define WLAN_RSNX_CAPAB_SPP_A_MSDU 14
625
#define WLAN_RSNX_CAPAB_URNM_MFPR 15
626
103
#define WLAN_RSNX_CAPAB_KEK_IN_PASN 18
627
0
#define WLAN_RSNX_CAPAB_SSID_PROTECTION 21
628
629
/* Multiple BSSID element subelements */
630
0
#define WLAN_MBSSID_SUBELEMENT_NONTRANSMITTED_BSSID_PROFILE 0
631
632
/* Action frame categories (IEEE Std 802.11-2020, 9.4.1.11, Table 9-51) */
633
#define WLAN_ACTION_SPECTRUM_MGMT 0
634
0
#define WLAN_ACTION_QOS 1
635
#define WLAN_ACTION_DLS 2
636
#define WLAN_ACTION_BLOCK_ACK 3
637
5.88k
#define WLAN_ACTION_PUBLIC 4
638
0
#define WLAN_ACTION_RADIO_MEASUREMENT 5
639
0
#define WLAN_ACTION_FT 6
640
0
#define WLAN_ACTION_HT 7
641
0
#define WLAN_ACTION_SA_QUERY 8
642
0
#define WLAN_ACTION_PROTECTED_DUAL 9
643
15
#define WLAN_ACTION_WNM 10
644
0
#define WLAN_ACTION_UNPROTECTED_WNM 11
645
0
#define WLAN_ACTION_TDLS 12
646
#define WLAN_ACTION_MESH 13
647
#define WLAN_ACTION_MULTIHOP 14
648
0
#define WLAN_ACTION_SELF_PROTECTED 15
649
#define WLAN_ACTION_DMG 16
650
0
#define WLAN_ACTION_WMM 17 /* WMM Specification 1.1 */
651
#define WLAN_ACTION_FST 18
652
0
#define WLAN_ACTION_ROBUST_AV_STREAMING 19
653
0
#define WLAN_ACTION_UNPROTECTED_DMG 20
654
0
#define WLAN_ACTION_VHT 21
655
0
#define WLAN_ACTION_UNPROTECTED_S1G 22
656
#define WLAN_ACTION_S1G 23
657
#define WLAN_ACTION_FLOW_CONTROL 24
658
#define WLAN_ACTION_CTRL_RESP_MCS_NEG 25
659
#define WLAN_ACTION_FILS 26
660
#define WLAN_ACTION_CDMG 27
661
#define WLAN_ACTION_CMMG 28
662
#define WLAN_ACTION_GLK 29
663
0
#define WLAN_ACTION_HE 30
664
#define WLAN_ACTION_PROTECTED_HE 31
665
#define WLAN_ACTION_WUR 32
666
#define WLAN_ACTION_PROTECTED_FTM 34
667
0
#define WLAN_ACTION_EHT 36
668
#define WLAN_ACTION_PROTECTED_EHT 37
669
0
#define WLAN_ACTION_VENDOR_SPECIFIC_PROTECTED 126
670
2.23k
#define WLAN_ACTION_VENDOR_SPECIFIC 127
671
/* Note: 128-255 used to report errors by setting category | 0x80 */
672
673
/* Public action codes (IEEE Std 802.11-2020, 9.6.7.1, Table 9-364) */
674
0
#define WLAN_PA_20_40_BSS_COEX 0
675
#define WLAN_PA_DSE_ENABLEMENT 1
676
#define WLAN_PA_DSE_DEENABLEMENT 2
677
#define WLAN_PA_DSE_REG_LOCATION_ANNOUNCE 3
678
#define WLAN_PA_EXT_CHANNEL_SWITCH_ANNOUNCE 4
679
#define WLAN_PA_DSE_MEASUREMENT_REQ 5
680
#define WLAN_PA_DSE_MEASUREMENT_RESP 6
681
#define WLAN_PA_MEASUREMENT_PILOT 7
682
#define WLAN_PA_DSE_POWER_CONSTRAINT 8
683
3.58k
#define WLAN_PA_VENDOR_SPECIFIC 9
684
1
#define WLAN_PA_GAS_INITIAL_REQ 10
685
1
#define WLAN_PA_GAS_INITIAL_RESP 11
686
32
#define WLAN_PA_GAS_COMEBACK_REQ 12
687
1
#define WLAN_PA_GAS_COMEBACK_RESP 13
688
0
#define WLAN_TDLS_DISCOVERY_RESPONSE 14
689
#define WLAN_PA_LOCATION_TRACK_NOTIFICATION 15
690
#define WLAN_PA_QAB_REQUEST_FRAME 16
691
#define WLAN_PA_QAB_RESPONSE_FRAME 17
692
#define WLAN_PA_QMF_POLICY 18
693
#define WLAN_PA_QMF_POLICY_CHANGE 19
694
#define WLAN_PA_QLOAD_REQUEST 20
695
#define WLAN_PA_QLOAD_REPORT 21
696
#define WLAN_PA_HCCA_TXOP_ADVERTISEMENT 22
697
#define WLAN_PA_HCCA_TXOP_RESPONSE 23
698
#define WLAN_PA_PUBLIC_KEY 24
699
#define WLAN_PA_CHANNEL_AVAILABILITY_QUERY 25
700
#define WLAN_PA_CHANNEL_SCHEDULE_MANAGEMENT 26
701
#define WLAN_PA_CONTACT_VERIFICATION_SIGNAL 27
702
#define WLAN_PA_GDD_ENABLEMENT_REQ 28
703
#define WLAN_PA_GDD_ENABLEMENT_RESP 29
704
#define WLAN_PA_NETWORK_CHANNEL_CONTROL 30
705
#define WLAN_PA_WHITE_SPACE_MAP_ANNOUNCEMENT 31
706
#define WLAN_PA_FTM_REQUEST 32
707
#define WLAN_PA_FTM 33
708
#define WLAN_PA_FILS_DISCOVERY 34
709
#define WLAN_PA_LOCATION_MEASUREMENT_REPORT 47
710
711
/* HT Action field values (IEEE Std 802.11-2024, 9.6.11.1, Table 9-517) */
712
#define WLAN_HT_ACTION_NOTIFY_CHANWIDTH 0
713
#define WLAN_HT_ACTION_SMPS 1
714
#define WLAN_HT_ACTION_CSI 4
715
#define WLAN_HT_ACTION_NONCOMPRESSED_BF 5
716
#define WLAN_HT_ACTION_COMPRESSED_BF 6
717
#define WLAN_HT_ACTION_ASEL_IDX_FEEDBACK 7
718
719
/* VHT Action field values (IEEE Std 802.11-2024, 9.6.22.1, Table 9-605) */
720
#define WLAN_VHT_ACTION_COMPRESSED_BF 0
721
#define WLAN_VHT_ACTION_GROUP_ID_MGMT 1
722
#define WLAN_VHT_ACTION_OPMODE_NOTIF 2
723
724
/* Protected Dual of Public Action frames (IEEE Std 802.11-2020, 9.6.10,
725
 * Table 9-404) */
726
#define WLAN_PROT_DSE_ENABLEMENT 1
727
#define WLAN_PROT_DSE_DEENABLEMENT 2
728
#define WLAN_PROT_EXT_CSA 4
729
#define WLAN_PROT_MEASUREMENT_REQ 5
730
#define WLAN_PROT_MEASUREMENT_REPORT 6
731
#define WLAN_PROT_DSE_POWER_CONSTRAINT 8
732
#define WLAN_PROT_VENDOR_SPECIFIC 9
733
#define WLAN_PROT_GAS_INITIAL_REQ 10
734
#define WLAN_PROT_GAS_INITIAL_RESP 11
735
#define WLAN_PROT_GAS_COMEBACK_REQ 12
736
#define WLAN_PROT_GAS_COMEBACK_RESP 13
737
#define WLAN_PROT_QAB_REQUEST_FRAME 16
738
#define WLAN_PROT_QAB_RESPONSE_FRAME 17
739
#define WLAN_PROT_QMF_POLICY 18
740
#define WLAN_PROT_QMF_POLICY_CHANGE 19
741
#define WLAN_PROT_QLOAD_REQUEST 20
742
#define WLAN_PROT_QLOAD_REPORT 21
743
#define WLAN_PROT_HCCA_TXOP_ADVERTISEMENT 22
744
#define WLAN_PROT_HCCA_TXOP_RESPONSE 23
745
#define WLAN_PROT_CHANNEL_AVAILABILITY_QUERY 25
746
#define WLAN_PROT_CHANNEL_SCHEDULE_MANAGEMENT 26
747
#define WLAN_PROT_CONTACT_VERIFICATION_SIGNAL 27
748
#define WLAN_PROT_GDD_ENABLEMENT_REQ 28
749
#define WLAN_PROT_GDD_ENABLEMENT_RESP 29
750
#define WLAN_PROT_NETWORK_CHANNEL_CONTROL 30
751
#define WLAN_PROT_WHITE_SPACE_MAP_ANNOUNCEMENT 31
752
753
/* SA Query Action frame (IEEE Std 802.11-2020, 9.6.9) */
754
0
#define WLAN_SA_QUERY_REQUEST 0
755
0
#define WLAN_SA_QUERY_RESPONSE 1
756
757
0
#define WLAN_SA_QUERY_TR_ID_LEN 2
758
759
/* TDLS action codes */
760
0
#define WLAN_TDLS_SETUP_REQUEST 0
761
0
#define WLAN_TDLS_SETUP_RESPONSE 1
762
0
#define WLAN_TDLS_SETUP_CONFIRM 2
763
0
#define WLAN_TDLS_TEARDOWN 3
764
#define WLAN_TDLS_PEER_TRAFFIC_INDICATION 4
765
#define WLAN_TDLS_CHANNEL_SWITCH_REQUEST 5
766
#define WLAN_TDLS_CHANNEL_SWITCH_RESPONSE 6
767
#define WLAN_TDLS_PEER_PSM_REQUEST 7
768
#define WLAN_TDLS_PEER_PSM_RESPONSE 8
769
#define WLAN_TDLS_PEER_TRAFFIC_RESPONSE 9
770
0
#define WLAN_TDLS_DISCOVERY_REQUEST 10
771
772
/* Radio Measurement Action codes */
773
0
#define WLAN_RRM_RADIO_MEASUREMENT_REQUEST 0
774
0
#define WLAN_RRM_RADIO_MEASUREMENT_REPORT 1
775
0
#define WLAN_RRM_LINK_MEASUREMENT_REQUEST 2
776
0
#define WLAN_RRM_LINK_MEASUREMENT_REPORT 3
777
0
#define WLAN_RRM_NEIGHBOR_REPORT_REQUEST 4
778
0
#define WLAN_RRM_NEIGHBOR_REPORT_RESPONSE 5
779
780
/* Protected Fine Timing Frame Action Field value */
781
#define WLAN_PROT_FTM_REQUEST 1
782
#define WLAN_PROT_FTM 2
783
#define WLAN_PROT_FTM_REPORT 3
784
785
/* Protected EHT Action field values */
786
#define WLAN_PROT_EHT_T2L_MAPPING_REQUEST 0
787
#define WLAN_PROT_EHT_T2L_MAPPING_RESPONSE 1
788
#define WLAN_PROT_EHT_T2L_MAPPING_TEARDOWN 2
789
#define WLAN_PROT_EHT_EPCS_ENABLE_REQUEST 3
790
#define WLAN_PROT_EHT_EPCS_ENABLE_RESPONSE 4
791
#define WLAN_PROT_EHT_EPCS_ENABLE_TEARDOWN 5
792
#define WLAN_PROT_EHT_EML_OPMODE_NOTIF 6
793
#define WLAN_PROT_EHT_LINK_RECOMMENDATION 7
794
#define WLAN_PROT_EHT_MLO_UPDATE_REQUEST 8
795
#define WLAN_PROT_EHT_MLO_UPDATE_RESPONSE 9
796
#define WLAN_PROT_EHT_LINK_RECONFIG_NOTIFY 10
797
#define WLAN_PROT_EHT_LINK_RECONFIG_REQUEST 11
798
#define WLAN_PROT_EHT_LINK_RECONFIG_RESPONSE 12
799
800
/* Radio Measurement capabilities (from RM Enabled Capabilities element)
801
 * IEEE Std 802.11-2020, 9.4.2.44, Table 9-179 */
802
/* byte 1 (out of 5) */
803
0
#define WLAN_RRM_CAPS_LINK_MEASUREMENT BIT(0)
804
0
#define WLAN_RRM_CAPS_NEIGHBOR_REPORT BIT(1)
805
0
#define WLAN_RRM_CAPS_BEACON_REPORT_PASSIVE BIT(4)
806
0
#define WLAN_RRM_CAPS_BEACON_REPORT_ACTIVE BIT(5)
807
0
#define WLAN_RRM_CAPS_BEACON_REPORT_TABLE BIT(6)
808
/* byte 2 (out of 5) */
809
0
#define WLAN_RRM_CAPS_LCI_MEASUREMENT BIT(4)
810
/* byte 5 (out of 5) */
811
0
#define WLAN_RRM_CAPS_FTM_RANGE_REPORT BIT(2)
812
0
#define WLAN_RRM_CAPS_CIVIC_LOCATION_MEASUREMENT BIT(3)
813
814
/*
815
 * IEEE Std 802.11-2020, 9.4.2.20.19 (Fine Timing Measurement Range
816
 * request) - Minimum AP Count
817
 */
818
#define WLAN_RRM_RANGE_REQ_MAX_MIN_AP 15
819
820
/* Timeout Interval Type */
821
2.41k
#define WLAN_TIMEOUT_REASSOC_DEADLINE 1
822
1.77k
#define WLAN_TIMEOUT_KEY_LIFETIME 2
823
0
#define WLAN_TIMEOUT_ASSOC_COMEBACK 3
824
825
/* Interworking element (IEEE Std 802.11-2020, 9.4.2.91) -
826
 * Access Network Options */
827
#define INTERWORKING_ANO_ACCESS_NETWORK_MASK 0x0f
828
0
#define INTERWORKING_ANO_INTERNET 0x10
829
0
#define INTERWORKING_ANO_ASRA 0x20
830
0
#define INTERWORKING_ANO_ESR 0x40
831
0
#define INTERWORKING_ANO_UESA 0x80
832
833
#define INTERWORKING_ANT_PRIVATE 0
834
#define INTERWORKING_ANT_PRIVATE_WITH_GUEST 1
835
#define INTERWORKING_ANT_CHARGEABLE_PUBLIC 2
836
#define INTERWORKING_ANT_FREE_PUBLIC 3
837
#define INTERWORKING_ANT_PERSONAL_DEVICE 4
838
#define INTERWORKING_ANT_EMERGENCY_SERVICES 5
839
#define INTERWORKING_ANT_TEST 6
840
0
#define INTERWORKING_ANT_WILDCARD 15
841
842
/* Advertisement Protocol ID definitions (IEEE Std 802.11-2020, Table 9-237) */
843
enum adv_proto_id {
844
  ACCESS_NETWORK_QUERY_PROTOCOL = 0,
845
  MIH_INFO_SERVICE = 1,
846
  MIH_CMD_AND_EVENT_DISCOVERY = 2,
847
  EMERGENCY_ALERT_SYSTEM = 3,
848
  REGISTERED_LOCATION_QUERY_PROTO = 4,
849
  ADV_PROTO_VENDOR_SPECIFIC = 221
850
};
851
852
/* ANQP-element definitions (IEEE Std 802.11-2020, Table 9-331) */
853
enum anqp_info_id {
854
  ANQP_QUERY_LIST = 256,
855
  ANQP_CAPABILITY_LIST = 257,
856
  ANQP_VENUE_NAME = 258,
857
  ANQP_EMERGENCY_CALL_NUMBER = 259,
858
  ANQP_NETWORK_AUTH_TYPE = 260,
859
  ANQP_ROAMING_CONSORTIUM = 261,
860
  ANQP_IP_ADDR_TYPE_AVAILABILITY = 262,
861
  ANQP_NAI_REALM = 263,
862
  ANQP_3GPP_CELLULAR_NETWORK = 264,
863
  ANQP_AP_GEOSPATIAL_LOCATION = 265,
864
  ANQP_AP_CIVIC_LOCATION = 266,
865
  ANQP_AP_LOCATION_PUBLIC_URI = 267,
866
  ANQP_DOMAIN_NAME = 268,
867
  ANQP_EMERGENCY_ALERT_URI = 269,
868
  ANQP_TDLS_CAPABILITY = 270,
869
  ANQP_EMERGENCY_NAI = 271,
870
  ANQP_NEIGHBOR_REPORT = 272,
871
  ANQP_QUERY_AP_LIST = 273,
872
  ANQP_AP_LIST_RESPONSE = 274,
873
  ANQP_FILS_REALM_INFO = 275,
874
  ANQP_CAG = 276,
875
  ANQP_VENUE_URL = 277,
876
  ANQP_ADVICE_OF_CHARGE = 278,
877
  ANQP_LOCAL_CONTENT = 279,
878
  ANQP_NETWORK_AUTH_TYPE_TIMESTAMP = 280,
879
  ANQP_VENDOR_SPECIFIC = 56797
880
};
881
882
/* NAI Realm list - EAP Method subfield - Authentication Parameter ID */
883
enum nai_realm_eap_auth_param {
884
  NAI_REALM_EAP_AUTH_EXPANDED_EAP_METHOD = 1,
885
  NAI_REALM_EAP_AUTH_NON_EAP_INNER_AUTH = 2,
886
  NAI_REALM_EAP_AUTH_INNER_AUTH_EAP_METHOD = 3,
887
  NAI_REALM_EAP_AUTH_EXPANDED_INNER_EAP_METHOD = 4,
888
  NAI_REALM_EAP_AUTH_CRED_TYPE = 5,
889
  NAI_REALM_EAP_AUTH_TUNNELED_CRED_TYPE = 6,
890
  NAI_REALM_EAP_AUTH_VENDOR_SPECIFIC = 221
891
};
892
893
enum nai_realm_eap_auth_inner_non_eap {
894
  NAI_REALM_INNER_NON_EAP_PAP = 1,
895
  NAI_REALM_INNER_NON_EAP_CHAP = 2,
896
  NAI_REALM_INNER_NON_EAP_MSCHAP = 3,
897
  NAI_REALM_INNER_NON_EAP_MSCHAPV2 = 4
898
};
899
900
enum nai_realm_eap_cred_type {
901
  NAI_REALM_CRED_TYPE_SIM = 1,
902
  NAI_REALM_CRED_TYPE_USIM = 2,
903
  NAI_REALM_CRED_TYPE_NFC_SECURE_ELEMENT = 3,
904
  NAI_REALM_CRED_TYPE_HARDWARE_TOKEN = 4,
905
  NAI_REALM_CRED_TYPE_SOFTOKEN = 5,
906
  NAI_REALM_CRED_TYPE_CERTIFICATE = 6,
907
  NAI_REALM_CRED_TYPE_USERNAME_PASSWORD = 7,
908
  NAI_REALM_CRED_TYPE_NONE = 8,
909
  NAI_REALM_CRED_TYPE_ANONYMOUS = 9,
910
  NAI_REALM_CRED_TYPE_VENDOR_SPECIFIC = 10
911
};
912
913
/* Unprotected S1G Action field values for WLAN_ACTION_S1G */
914
#define S1G_ACT_AID_SWITCH_REQUEST   0
915
#define S1G_ACT_AID_SWITCH_RESPONSE  1
916
#define S1G_ACT_SYNC_CONTROL         2
917
#define S1G_ACT_STA_INFO_ANNOUNCE    3
918
#define S1G_ACT_EDCA_PARAM_SET       4
919
#define S1G_ACT_EL_OPERATION         5
920
#define S1G_ACT_TWT_SETUP            6
921
#define S1G_ACT_TWT_TEARDOWN         7
922
#define S1G_ACT_SECT_GROUP_ID_LIST   8
923
#define S1G_ACT_SECT_ID_FEEDBACK     9
924
#define S1G_ACT_TWT_INFORMATION      11
925
926
/*
927
 * IEEE Std 802.11-2020, Table 9-98 - Measurement type definitions for
928
 * measurement requests
929
 */
930
enum measure_type {
931
  MEASURE_TYPE_BASIC = 0,
932
  MEASURE_TYPE_CCA = 1,
933
  MEASURE_TYPE_RPI_HIST = 2,
934
  MEASURE_TYPE_CHANNEL_LOAD = 3,
935
  MEASURE_TYPE_NOISE_HIST = 4,
936
  MEASURE_TYPE_BEACON = 5,
937
  MEASURE_TYPE_FRAME = 6,
938
  MEASURE_TYPE_STA_STATISTICS = 7,
939
  MEASURE_TYPE_LCI = 8,
940
  MEASURE_TYPE_TRANSMIT_STREAM = 9,
941
  MEASURE_TYPE_MULTICAST_DIAG = 10,
942
  MEASURE_TYPE_LOCATION_CIVIC = 11,
943
  MEASURE_TYPE_LOCATION_ID = 12,
944
  MEASURE_TYPE_DIRECTIONAL_CHAN_QUALITY = 13,
945
  MEASURE_TYPE_DIRECTIONAL_MEASURE = 14,
946
  MEASURE_TYPE_DIRECTIONAL_STATS = 15,
947
  MEASURE_TYPE_FTM_RANGE = 16,
948
  MEASURE_TYPE_MEASURE_PAUSE = 255,
949
};
950
951
/* IEEE Std 802.11-2020, Table 9-110 - Location Subject field definition */
952
enum location_subject {
953
  LOCATION_SUBJECT_LOCAL = 0,
954
  LOCATION_SUBJECT_REMOTE = 1,
955
  LOCATION_SUBJECT_3RD_PARTY = 2,
956
};
957
958
/*
959
 * IEEE Std 802.11-2020, Table 9-111 - Optional subelement IDs for LCI request
960
 */
961
enum lci_req_subelem {
962
  LCI_REQ_SUBELEM_AZIMUTH_REQ = 1,
963
  LCI_REQ_SUBELEM_ORIGINATOR_MAC_ADDR = 2,
964
  LCI_REQ_SUBELEM_TARGET_MAC_ADDR = 3,
965
  LCI_REQ_SUBELEM_MAX_AGE = 4,
966
};
967
968
14.3k
#define FILS_NONCE_LEN 16
969
29.5k
#define FILS_SESSION_LEN 8
970
#define FILS_CACHE_ID_LEN 2
971
#define FILS_MAX_KEY_AUTH_LEN 48
972
973
#ifdef _MSC_VER
974
#pragma pack(push, 1)
975
#endif /* _MSC_VER */
976
977
struct ieee80211_hdr {
978
  le16 frame_control;
979
  le16 duration_id;
980
  u8 addr1[6];
981
  u8 addr2[6];
982
  u8 addr3[6];
983
  le16 seq_ctrl;
984
  /* followed by 'u8 addr4[6];' if ToDS and FromDS is set in data frame
985
   */
986
} STRUCT_PACKED;
987
988
#define IEEE80211_DA_FROMDS addr1
989
#define IEEE80211_BSSID_FROMDS addr2
990
#define IEEE80211_SA_FROMDS addr3
991
992
48.8k
#define IEEE80211_HDRLEN (sizeof(struct ieee80211_hdr))
993
994
struct ieee80211_hdr_s1g_beacon {
995
  le16 frame_control;
996
  le16 duration_id;
997
  u8 sa[6];
998
  u8 timestamp[4];
999
  u8 change_seq[1];
1000
  /* followed by:
1001
   *   'u8 next_tbtt[3];' if the Next TBTT Present field in the
1002
   *      Frame Control field is 1
1003
   *   'u8 compressed_ssid[4];' if the Compressed SSID Present field in
1004
   *      the Frame Control is 1
1005
   *   'u8 ano[1];' if the ANO field in the Frame Control field is 1
1006
   */
1007
} STRUCT_PACKED;
1008
1009
#define IEEE80211_HDRLEN_S1G_BEACON (sizeof(struct ieee80211_hdr_s1g_beacon))
1010
1011
0
#define IEEE80211_FC(type, stype) host_to_le16((type << 2) | (stype << 4))
1012
1013
struct ieee80211_mgmt {
1014
  le16 frame_control;
1015
  le16 duration;
1016
  u8 da[6];
1017
  u8 sa[6];
1018
  u8 bssid[6];
1019
  le16 seq_ctrl;
1020
  union {
1021
    struct {
1022
      le16 auth_alg;
1023
      le16 auth_transaction;
1024
      le16 status_code;
1025
      /* possibly followed by Challenge text */
1026
      u8 variable[];
1027
    } STRUCT_PACKED auth;
1028
    struct {
1029
      le16 reason_code;
1030
      u8 variable[];
1031
    } STRUCT_PACKED deauth;
1032
    struct {
1033
      le16 capab_info;
1034
      le16 listen_interval;
1035
      /* followed by SSID and Supported rates */
1036
      u8 variable[];
1037
    } STRUCT_PACKED assoc_req;
1038
    struct {
1039
      le16 capab_info;
1040
      le16 status_code;
1041
      le16 aid;
1042
      /* followed by Supported rates */
1043
      u8 variable[];
1044
    } STRUCT_PACKED assoc_resp, reassoc_resp;
1045
    struct {
1046
      le16 capab_info;
1047
      le16 listen_interval;
1048
      u8 current_ap[6];
1049
      /* followed by SSID and Supported rates */
1050
      u8 variable[];
1051
    } STRUCT_PACKED reassoc_req;
1052
    struct {
1053
      le16 reason_code;
1054
      u8 variable[];
1055
    } STRUCT_PACKED disassoc;
1056
    struct {
1057
      u8 timestamp[8];
1058
      le16 beacon_int;
1059
      le16 capab_info;
1060
      /* followed by some of SSID, Supported rates,
1061
       * FH Params, DS Params, CF Params, IBSS Params, TIM */
1062
      u8 variable[];
1063
    } STRUCT_PACKED beacon;
1064
    /* probe_req: only variable items: SSID, Supported rates */
1065
    struct {
1066
      u8 timestamp[8];
1067
      le16 beacon_int;
1068
      le16 capab_info;
1069
      /* followed by some of SSID, Supported rates,
1070
       * FH Params, DS Params, CF Params, IBSS Params */
1071
      u8 variable[];
1072
    } STRUCT_PACKED probe_resp;
1073
    struct {
1074
      u8 category;
1075
      union {
1076
        struct {
1077
          u8 action_code;
1078
          u8 dialog_token;
1079
          u8 status_code;
1080
          u8 variable[];
1081
        } STRUCT_PACKED wmm_action;
1082
        struct{
1083
          u8 action_code;
1084
          u8 element_id;
1085
          u8 length;
1086
          u8 switch_mode;
1087
          u8 new_chan;
1088
          u8 switch_count;
1089
        } STRUCT_PACKED chan_switch;
1090
        struct {
1091
          u8 action;
1092
          u8 sta_addr[ETH_ALEN];
1093
          u8 target_ap_addr[ETH_ALEN];
1094
          u8 variable[]; /* FT Request */
1095
        } STRUCT_PACKED ft_action_req;
1096
        struct {
1097
          u8 action;
1098
          u8 sta_addr[ETH_ALEN];
1099
          u8 target_ap_addr[ETH_ALEN];
1100
          le16 status_code;
1101
          u8 variable[]; /* FT Request */
1102
        } STRUCT_PACKED ft_action_resp;
1103
        struct {
1104
          u8 action;
1105
          u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
1106
          u8 variable[]; /* OCI element */
1107
        } STRUCT_PACKED sa_query_req;
1108
        struct {
1109
          u8 action; /* */
1110
          u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
1111
          u8 variable[]; /* OCI element */
1112
        } STRUCT_PACKED sa_query_resp;
1113
        struct {
1114
          u8 action;
1115
          u8 dialogtoken;
1116
          u8 variable[];
1117
        } STRUCT_PACKED wnm_sleep_req;
1118
        struct {
1119
          u8 action;
1120
          u8 dialogtoken;
1121
          le16 keydata_len;
1122
          u8 variable[];
1123
        } STRUCT_PACKED wnm_sleep_resp;
1124
        struct {
1125
          u8 action;
1126
          u8 variable[];
1127
        } STRUCT_PACKED public_action;
1128
        struct {
1129
          u8 action; /* 9 */
1130
          u8 oui[3];
1131
          /* Vendor-specific content */
1132
          u8 variable[];
1133
        } STRUCT_PACKED vs_public_action;
1134
        struct {
1135
          u8 action; /* 7 */
1136
          u8 dialog_token;
1137
          u8 req_mode;
1138
          le16 disassoc_timer;
1139
          u8 validity_interval;
1140
          /* BSS Termination Duration (optional),
1141
           * Session Information URL (optional),
1142
           * BSS Transition Candidate List
1143
           * Entries */
1144
          u8 variable[];
1145
        } STRUCT_PACKED bss_tm_req;
1146
        struct {
1147
          u8 action; /* 8 */
1148
          u8 dialog_token;
1149
          u8 status_code;
1150
          u8 bss_termination_delay;
1151
          /* Target BSSID (optional),
1152
           * BSS Transition Candidate List
1153
           * Entries (optional) */
1154
          u8 variable[];
1155
        } STRUCT_PACKED bss_tm_resp;
1156
        struct {
1157
          u8 action; /* 6 */
1158
          u8 dialog_token;
1159
          u8 query_reason;
1160
          /* BSS Transition Candidate List
1161
           * Entries (optional) */
1162
          u8 variable[];
1163
        } STRUCT_PACKED bss_tm_query;
1164
        struct {
1165
          u8 action; /* 11 */
1166
          u8 dialog_token;
1167
          u8 req_info;
1168
        } STRUCT_PACKED coloc_intf_req;
1169
        struct {
1170
          u8 action; /* 12 */
1171
          u8 dialog_token;
1172
          u8 variable[];
1173
        } STRUCT_PACKED coloc_intf_report;
1174
        struct {
1175
          u8 action; /* 15 */
1176
          u8 variable[];
1177
        } STRUCT_PACKED slf_prot_action;
1178
        struct {
1179
          u8 action;
1180
          u8 variable[];
1181
        } STRUCT_PACKED fst_action;
1182
        struct {
1183
          u8 action;
1184
          u8 dialog_token;
1185
          u8 variable[];
1186
        } STRUCT_PACKED rrm;
1187
        struct {
1188
          u8 action; /* Protected EHT - 11 */
1189
          u8 dialog_token;
1190
          /* Reconfiguration Multi-Link element,
1191
          * OCI element (optional) */
1192
          u8 variable[];
1193
        } STRUCT_PACKED link_reconf_req;
1194
        struct {
1195
          u8 action; /* Protected EHT - 12 */
1196
          u8 dialog_token;
1197
          u8 count;
1198
          /* Reconfiguration status list,
1199
           * Group Key Data (optional),
1200
           * OCI element (optional),
1201
           * Basic Multi-Link element (optional) */
1202
          u8 variable[];
1203
        } STRUCT_PACKED link_reconf_resp;
1204
      } u;
1205
    } STRUCT_PACKED action;
1206
  } u;
1207
} STRUCT_PACKED;
1208
1209
1210
0
#define IEEE80211_MAX_MMPDU_SIZE 2304
1211
1212
/* Rx MCS bitmask is in the first 77 bits of supported_mcs_set */
1213
#define IEEE80211_HT_MCS_MASK_LEN 10
1214
1215
/* HT Capabilities element */
1216
struct ieee80211_ht_capabilities {
1217
  le16 ht_capabilities_info;
1218
  u8 a_mpdu_params; /* Maximum A-MPDU Length Exponent B0..B1
1219
         * Minimum MPDU Start Spacing B2..B4
1220
         * Reserved B5..B7 */
1221
  u8 supported_mcs_set[16];
1222
  le16 ht_extended_capabilities;
1223
  le32 tx_bf_capability_info;
1224
  u8 asel_capabilities;
1225
} STRUCT_PACKED;
1226
1227
1228
/* HT Operation element */
1229
struct ieee80211_ht_operation {
1230
  u8 primary_chan;
1231
  /* Five octets of HT Operation Information */
1232
  u8 ht_param; /* B0..B7 */
1233
  le16 operation_mode; /* B8..B23 */
1234
  le16 param; /* B24..B39 */
1235
  u8 basic_mcs_set[16];
1236
} STRUCT_PACKED;
1237
1238
1239
struct ieee80211_obss_scan_parameters {
1240
  le16 scan_passive_dwell;
1241
  le16 scan_active_dwell;
1242
  le16 width_trigger_scan_interval;
1243
  le16 scan_passive_total_per_channel;
1244
  le16 scan_active_total_per_channel;
1245
  le16 channel_transition_delay_factor;
1246
  le16 scan_activity_threshold;
1247
} STRUCT_PACKED;
1248
1249
1250
struct ieee80211_vht_capabilities {
1251
  le32 vht_capabilities_info;
1252
  struct {
1253
    le16 rx_map;
1254
    le16 rx_highest;
1255
    le16 tx_map;
1256
    le16 tx_highest;
1257
  } vht_supported_mcs_set;
1258
} STRUCT_PACKED;
1259
1260
struct ieee80211_vht_operation {
1261
  u8 vht_op_info_chwidth;
1262
  u8 vht_op_info_chan_center_freq_seg0_idx;
1263
  u8 vht_op_info_chan_center_freq_seg1_idx;
1264
  le16 vht_basic_mcs_set;
1265
} STRUCT_PACKED;
1266
1267
struct ieee80211_ampe_ie {
1268
  u8 selected_pairwise_suite[4];
1269
  u8 local_nonce[32];
1270
  u8 peer_nonce[32];
1271
  /* Followed by
1272
   * Key Replay Counter[8] (optional)
1273
   *  (only in Mesh Group Key Inform/Acknowledge frames)
1274
   * GTKdata[variable] (optional)
1275
   *  (MGTK[variable] || Key RSC[8] || GTKExpirationTime[4])
1276
   * IGTKdata[variable] (optional)
1277
   *  (Key ID[2], IPN[6], IGTK[variable] in IGTK KDE format)
1278
   */
1279
} STRUCT_PACKED;
1280
1281
1282
211
#define ERP_INFO_NON_ERP_PRESENT BIT(0)
1283
0
#define ERP_INFO_USE_PROTECTION BIT(1)
1284
0
#define ERP_INFO_BARKER_PREAMBLE_MODE BIT(2)
1285
1286
0
#define OVERLAPPING_BSS_TRANS_DELAY_FACTOR 5
1287
1288
/* HT Capabilities Info field within HT Capabilities element */
1289
0
#define HT_CAP_INFO_LDPC_CODING_CAP   ((u16) BIT(0))
1290
0
#define HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET  ((u16) BIT(1))
1291
0
#define HT_CAP_INFO_SMPS_MASK     ((u16) (BIT(2) | BIT(3)))
1292
#define HT_CAP_INFO_SMPS_STATIC     ((u16) 0)
1293
#define HT_CAP_INFO_SMPS_DYNAMIC    ((u16) BIT(2))
1294
2.17k
#define HT_CAP_INFO_SMPS_DISABLED   ((u16) (BIT(2) | BIT(3)))
1295
0
#define HT_CAP_INFO_GREEN_FIELD     ((u16) BIT(4))
1296
0
#define HT_CAP_INFO_SHORT_GI20MHZ   ((u16) BIT(5))
1297
0
#define HT_CAP_INFO_SHORT_GI40MHZ   ((u16) BIT(6))
1298
0
#define HT_CAP_INFO_TX_STBC     ((u16) BIT(7))
1299
0
#define HT_CAP_INFO_RX_STBC_MASK    ((u16) (BIT(8) | BIT(9)))
1300
#define HT_CAP_INFO_RX_STBC_1     ((u16) BIT(8))
1301
#define HT_CAP_INFO_RX_STBC_12      ((u16) BIT(9))
1302
#define HT_CAP_INFO_RX_STBC_123     ((u16) (BIT(8) | BIT(9)))
1303
0
#define HT_CAP_INFO_DELAYED_BA      ((u16) BIT(10))
1304
0
#define HT_CAP_INFO_MAX_AMSDU_SIZE    ((u16) BIT(11))
1305
0
#define HT_CAP_INFO_DSSS_CCK40MHZ   ((u16) BIT(12))
1306
/* B13 - Reserved (was PSMP support during P802.11n development) */
1307
0
#define HT_CAP_INFO_40MHZ_INTOLERANT    ((u16) BIT(14))
1308
0
#define HT_CAP_INFO_LSIG_TXOP_PROTECT_SUPPORT ((u16) BIT(15))
1309
1310
/* HT Extended Capabilities field within HT Capabilities element */
1311
#define EXT_HT_CAP_INFO_PCO     ((u16) BIT(0))
1312
#define EXT_HT_CAP_INFO_PCO_TRANS_TIME_MASK ((u16) (BIT(1) | BIT(2)))
1313
#define EXT_HT_CAP_INFO_TRANS_TIME_OFFSET 1
1314
/* B3..B7 - Reserved */
1315
#define EXT_HT_CAP_INFO_MCS_FEEDBACK_MASK ((u16) (BIT(8) | BIT(9)))
1316
#define EXT_HT_CAP_INFO_MCS_FEEDBACK_OFFSET 8
1317
#define EXT_HT_CAP_INFO_HTC_SUPPORT   ((u16) BIT(10))
1318
#define EXT_HT_CAP_INFO_RD_RESPONDER    ((u16) BIT(11))
1319
/* B12..B15 - Reserved */
1320
1321
/* Transmit Beanforming Capabilities within HT Capabilities element */
1322
#define TX_BF_CAP_IMPLICIT_TXBF_RX_CAP ((u32) BIT(0))
1323
#define TX_BF_CAP_RX_STAGGERED_SOUNDING_CAP ((u32) BIT(1))
1324
#define TX_BF_CAP_TX_STAGGERED_SOUNDING_CAP ((u32) BIT(2))
1325
#define TX_BF_CAP_RX_NDP_CAP ((u32) BIT(3))
1326
#define TX_BF_CAP_TX_NDP_CAP ((u32) BIT(4))
1327
#define TX_BF_CAP_IMPLICIT_TX_BF_CAP ((u32) BIT(5))
1328
#define TX_BF_CAP_CALIBRATION_MASK ((u32) (BIT(6) | BIT(7))
1329
#define TX_BF_CAP_CALIB_OFFSET 6
1330
#define TX_BF_CAP_EXPLICIT_CSI_TXBF_CAP ((u32) BIT(8))
1331
#define TX_BF_CAP_EXPLICIT_NONCOMPR_STEERING_CAP ((u32) BIT(9))
1332
#define TX_BF_CAP_EXPLICIT_COMPR_STEERING_CAP ((u32) BIT(10))
1333
#define TX_BF_CAP_EXPLICIT_TX_BF_CSI_FEEDBACK_MASK ((u32) (BIT(10) | BIT(11)))
1334
#define TX_BF_CAP_EXPLICIT_BF_CSI_FEEDBACK_OFFSET 11
1335
#define TX_BF_CAP_EXPLICIT_UNCOMPR_STEERING_MATRIX_FEEDBACK_OFFSET 13
1336
#define TX_BF_CAP_EXPLICIT_COMPRESSED_STEERING_MATRIX_FEEDBACK_OFFSET 15
1337
#define TX_BF_CAP_MINIMAL_GROUPING_OFFSET 17
1338
#define TX_BF_CAP_CSI_NUM_BEAMFORMER_ANT_OFFSET 19
1339
#define TX_BF_CAP_UNCOMPRESSED_STEERING_MATRIX_BEAMFORMER_ANT_OFFSET 21
1340
#define TX_BF_CAP_COMPRESSED_STEERING_MATRIX_BEAMFORMER_ANT_OFFSET 23
1341
#define TX_BF_CAP_SCI_MAX_OF_ROWS_BEANFORMER_SUPPORTED_OFFSET 25
1342
#define TX_BF_CAP_CHANNEL_ESTIMATION_CAP_MASK ((u32) (BIT(27) | BIT(28)))
1343
#define TX_BF_CAP_CHANNEL_ESTIMATION_CAP_OFFSET 27
1344
/* B29..B31 - Reserved */
1345
1346
/* ASEL Capability field within HT Capabilities element */
1347
#define ASEL_CAP_ASEL_CAPABLE ((u8) BIT(0))
1348
#define ASEL_CAP_EXPLICIT_CSI_FEEDBACK_BASED_TX_AS_CAP ((u8) BIT(1))
1349
#define ASEL_CAP_ANT_INDICES_FEEDBACK_BASED_TX_AS_CAP ((u8) BIT(2))
1350
#define ASEL_CAP_EXPLICIT_CSI_FEEDBACK_CAP ((u8) BIT(3))
1351
#define ASEL_CAP_ANT_INDICES_FEEDBACK_CAP ((u8) BIT(4))
1352
#define ASEL_CAP_RX_AS_CAP ((u8) BIT(5))
1353
#define ASEL_CAP_TX_SOUNDING_PPDUS_CAP ((u8) BIT(6))
1354
/* B7 - Reserved */
1355
1356
/* First octet of HT Operation Information within HT Operation element */
1357
0
#define HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK  ((u8) BIT(0) | BIT(1))
1358
0
#define HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE   ((u8) BIT(0))
1359
0
#define HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW   ((u8) BIT(0) | BIT(1))
1360
0
#define HT_INFO_HT_PARAM_STA_CHNL_WIDTH     ((u8) BIT(2))
1361
#define HT_INFO_HT_PARAM_RIFS_MODE      ((u8) BIT(3))
1362
/* B4..B7 - Reserved */
1363
1364
/* HT Protection (B8..B9 of HT Operation Information) */
1365
0
#define HT_PROT_NO_PROTECTION           0
1366
0
#define HT_PROT_NONMEMBER_PROTECTION    1
1367
0
#define HT_PROT_20MHZ_PROTECTION        2
1368
0
#define HT_PROT_NON_HT_MIXED            3
1369
/* Bits within ieee80211_ht_operation::operation_mode (BIT(0) maps to B8 in
1370
 * HT Operation Information) */
1371
0
#define HT_OPER_OP_MODE_HT_PROT_MASK ((u16) (BIT(0) | BIT(1))) /* B8..B9 */
1372
0
#define HT_OPER_OP_MODE_NON_GF_HT_STAS_PRESENT  ((u16) BIT(2)) /* B10 */
1373
/* BIT(3), i.e., B11 in HT Operation Information field - Reserved */
1374
0
#define HT_OPER_OP_MODE_OBSS_NON_HT_STAS_PRESENT  ((u16) BIT(4)) /* B12 */
1375
/* BIT(5)..BIT(15), i.e., B13..B23 - Reserved */
1376
1377
/* Last two octets of HT Operation Information (BIT(0) = B24) */
1378
/* B24..B29 - Reserved */
1379
#define HT_OPER_PARAM_DUAL_BEACON     ((u16) BIT(6))
1380
#define HT_OPER_PARAM_DUAL_CTS_PROTECTION   ((u16) BIT(7))
1381
#define HT_OPER_PARAM_STBC_BEACON     ((u16) BIT(8))
1382
#define HT_OPER_PARAM_LSIG_TXOP_PROT_FULL_SUPP    ((u16) BIT(9))
1383
#define HT_OPER_PARAM_PCO_ACTIVE      ((u16) BIT(10))
1384
#define HT_OPER_PARAM_PCO_PHASE       ((u16) BIT(11))
1385
/* B36..B39 - Reserved */
1386
1387
0
#define BSS_MEMBERSHIP_SELECTOR_HE_PHY 122
1388
#define BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY 123
1389
#define BSS_MEMBERSHIP_SELECTOR_EPD 124
1390
#define BSS_MEMBERSHIP_SELECTOR_GLK 125
1391
0
#define BSS_MEMBERSHIP_SELECTOR_VHT_PHY 126
1392
0
#define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127
1393
1394
/* VHT Defines */
1395
#define VHT_CAP_MAX_MPDU_LENGTH_7991                ((u32) BIT(0))
1396
#define VHT_CAP_MAX_MPDU_LENGTH_11454               ((u32) BIT(1))
1397
#define VHT_CAP_MAX_MPDU_LENGTH_MASK                ((u32) BIT(0) | BIT(1))
1398
#define VHT_CAP_MAX_MPDU_LENGTH_MASK_SHIFT          0
1399
0
#define VHT_CAP_SUPP_CHAN_WIDTH_160MHZ              ((u32) BIT(2))
1400
0
#define VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ     ((u32) BIT(3))
1401
#define VHT_CAP_SUPP_CHAN_WIDTH_MASK                ((u32) BIT(2) | BIT(3))
1402
#define VHT_CAP_SUPP_CHAN_WIDTH_MASK_SHIFT          2
1403
#define VHT_CAP_RXLDPC                              ((u32) BIT(4))
1404
#define VHT_CAP_SHORT_GI_80                         ((u32) BIT(5))
1405
#define VHT_CAP_SHORT_GI_160                        ((u32) BIT(6))
1406
#define VHT_CAP_TXSTBC                              ((u32) BIT(7))
1407
#define VHT_CAP_RXSTBC_1                            ((u32) BIT(8))
1408
#define VHT_CAP_RXSTBC_2                            ((u32) BIT(9))
1409
#define VHT_CAP_RXSTBC_3                            ((u32) BIT(8) | BIT(9))
1410
#define VHT_CAP_RXSTBC_4                            ((u32) BIT(10))
1411
#define VHT_CAP_RXSTBC_MASK                         ((u32) BIT(8) | BIT(9) | \
1412
                 BIT(10))
1413
#define VHT_CAP_RXSTBC_MASK_SHIFT                   8
1414
#define VHT_CAP_SU_BEAMFORMER_CAPABLE               ((u32) BIT(11))
1415
#define VHT_CAP_SU_BEAMFORMEE_CAPABLE               ((u32) BIT(12))
1416
#define VHT_CAP_BEAMFORMEE_STS_MAX                  ((u32) BIT(13) | \
1417
                 BIT(14) | BIT(15))
1418
#define VHT_CAP_BEAMFORMEE_STS_MAX_SHIFT            13
1419
#define VHT_CAP_BEAMFORMEE_STS_OFFSET               13
1420
#define VHT_CAP_SOUNDING_DIMENSION_MAX              ((u32) BIT(16) | \
1421
                 BIT(17) | BIT(18))
1422
#define VHT_CAP_SOUNDING_DIMENSION_MAX_SHIFT        16
1423
#define VHT_CAP_SOUNDING_DIMENSION_OFFSET           16
1424
#define VHT_CAP_MU_BEAMFORMER_CAPABLE               ((u32) BIT(19))
1425
#define VHT_CAP_MU_BEAMFORMEE_CAPABLE               ((u32) BIT(20))
1426
#define VHT_CAP_VHT_TXOP_PS                         ((u32) BIT(21))
1427
#define VHT_CAP_HTC_VHT                             ((u32) BIT(22))
1428
1429
#define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_1        ((u32) BIT(23))
1430
#define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_2        ((u32) BIT(24))
1431
#define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_3        ((u32) BIT(23) | BIT(24))
1432
#define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_4        ((u32) BIT(25))
1433
#define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_5        ((u32) BIT(23) | BIT(25))
1434
#define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_6        ((u32) BIT(24) | BIT(25))
1435
#define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MAX      ((u32) BIT(23) | \
1436
                 BIT(24) | BIT(25))
1437
#define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MAX_SHIFT 23
1438
#define VHT_CAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB   ((u32) BIT(27))
1439
#define VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB     ((u32) BIT(26) | BIT(27))
1440
#define VHT_CAP_RX_ANTENNA_PATTERN                  ((u32) BIT(28))
1441
#define VHT_CAP_TX_ANTENNA_PATTERN                  ((u32) BIT(29))
1442
1443
0
#define VHT_OPMODE_CHANNEL_WIDTH_MASK       ((u8) BIT(0) | BIT(1))
1444
#define VHT_OPMODE_CHANNEL_RxNSS_MASK       ((u8) BIT(4) | BIT(5) | \
1445
                 BIT(6))
1446
#define VHT_OPMODE_NOTIF_RX_NSS_SHIFT       4
1447
1448
#define VHT_RX_NSS_MAX_STREAMS          8
1449
1450
#define VHT_OPMODE_CHANNEL_40MHZ        ((u8) BIT(0))
1451
#define VHT_OPMODE_CHANNEL_80MHZ        ((u8) BIT(1))
1452
#define VHT_OPMODE_CHANNEL_160MHZ       ((u8) BIT(1) | BIT(2))
1453
1454
/* VHT operation information - channel widths */
1455
#define CHANWIDTH_USE_HT  0
1456
0
#define CHANWIDTH_80MHZ   1
1457
0
#define CHANWIDTH_160MHZ  2
1458
0
#define CHANWIDTH_80P80MHZ  3
1459
1460
#define HE_NSS_MAX_STREAMS          8
1461
1462
343k
#define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs)
1463
        * 00:50:F2 */
1464
91.9k
#define WPA_IE_VENDOR_TYPE 0x0050f201
1465
91.4k
#define WMM_IE_VENDOR_TYPE 0x0050f202
1466
91.0k
#define WPS_IE_VENDOR_TYPE 0x0050f204
1467
472k
#define OUI_WFA 0x506f9a
1468
104k
#define P2P_IE_VENDOR_TYPE 0x506f9a09
1469
11.4k
#define P2P2_IE_VENDOR_TYPE 0x506f9a28
1470
32.4k
#define WFD_IE_VENDOR_TYPE 0x506f9a0a
1471
104k
#define WFD_OUI_TYPE 10
1472
0
#define HS20_IE_VENDOR_TYPE 0x506f9a10
1473
#define NAN_IE_VENDOR_TYPE 0x506f9a13
1474
#define NAN_SDF_VENDOR_TYPE 0x506f9a13
1475
#define NAN_OUI_TYPE 0x13
1476
#define MBO_IE_VENDOR_TYPE 0x506f9a16
1477
#define NAN_NAF_VENDOR_TYPE 0x506f9a18
1478
3.89k
#define MBO_OUI_TYPE 22
1479
#define OWE_IE_VENDOR_TYPE 0x506f9a1c
1480
3.39k
#define OWE_OUI_TYPE 28
1481
1.46k
#define MULTI_AP_OUI_TYPE 0x1B
1482
#define DPP_CC_IE_VENDOR_TYPE 0x506f9a1e
1483
5.97k
#define DPP_CC_OUI_TYPE 0x1e
1484
#define SAE_PK_IE_VENDOR_TYPE 0x506f9a1f
1485
2.29k
#define SAE_PK_OUI_TYPE 0x1f
1486
0
#define QM_IE_VENDOR_TYPE 0x506f9a22
1487
#define QM_IE_OUI_TYPE 0x22
1488
0
#define WFA_CAPA_IE_VENDOR_TYPE 0x506f9a23
1489
3.23k
#define WFA_CAPA_OUI_TYPE 0x23
1490
9.19k
#define WFA_RSNE_OVERRIDE_OUI_TYPE 0x29
1491
3.97k
#define WFA_RSNE_OVERRIDE_2_OUI_TYPE 0x2a
1492
5.84k
#define WFA_RSNXE_OVERRIDE_OUI_TYPE 0x2b
1493
4.97k
#define WFA_RSN_SELECTION_OUI_TYPE 0x2c
1494
21.7k
#define RSNE_OVERRIDE_IE_VENDOR_TYPE 0x506f9a29
1495
18.3k
#define RSNE_OVERRIDE_2_IE_VENDOR_TYPE 0x506f9a2a
1496
15.0k
#define RSNXE_OVERRIDE_IE_VENDOR_TYPE 0x506f9a2b
1497
14.5k
#define RSN_SELECTION_IE_VENDOR_TYPE 0x506f9a2c
1498
1499
0
#define MULTI_AP_SUB_ELEM_TYPE 0x06
1500
0
#define MULTI_AP_PROFILE_SUB_ELEM_TYPE 0x07
1501
0
#define MULTI_AP_VLAN_SUB_ELEM_TYPE 0x08
1502
1503
0
#define MULTI_AP_PROFILE2_BACKHAUL_STA_DISALLOWED BIT(2)
1504
0
#define MULTI_AP_PROFILE1_BACKHAUL_STA_DISALLOWED BIT(3)
1505
#define MULTI_AP_TEAR_DOWN BIT(4)
1506
0
#define MULTI_AP_FRONTHAUL_BSS BIT(5)
1507
0
#define MULTI_AP_BACKHAUL_BSS BIT(6)
1508
0
#define MULTI_AP_BACKHAUL_STA BIT(7)
1509
1510
0
#define MULTI_AP_PROFILE_1  1
1511
4.34k
#define MULTI_AP_PROFILE_2  2
1512
0
#define MULTI_AP_PROFILE_MAX  6
1513
1514
46.5k
#define WMM_OUI_TYPE 2
1515
9.77k
#define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0
1516
10.6k
#define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1
1517
6.36k
#define WMM_OUI_SUBTYPE_TSPEC_ELEMENT 2
1518
0
#define WMM_VERSION 1
1519
1520
0
#define WMM_ACTION_CODE_ADDTS_REQ 0
1521
0
#define WMM_ACTION_CODE_ADDTS_RESP 1
1522
0
#define WMM_ACTION_CODE_DELTS 2
1523
1524
0
#define WMM_ADDTS_STATUS_ADMISSION_ACCEPTED 0
1525
0
#define WMM_ADDTS_STATUS_INVALID_PARAMETERS 1
1526
/* 2 - Reserved */
1527
0
#define WMM_ADDTS_STATUS_REFUSED 3
1528
/* 4-255 - Reserved */
1529
1530
/* WMM TSPEC Direction Field Values */
1531
0
#define WMM_TSPEC_DIRECTION_UPLINK 0
1532
0
#define WMM_TSPEC_DIRECTION_DOWNLINK 1
1533
/* 2 - Reserved */
1534
0
#define WMM_TSPEC_DIRECTION_BI_DIRECTIONAL 3
1535
1536
/*
1537
 * WMM Information Element (used in (Re)Association Request frames; may also be
1538
 * used in Beacon frames)
1539
 */
1540
struct wmm_information_element {
1541
  /* Element ID: 221 (0xdd); Length: 7 */
1542
  /* required fields for WMM version 1 */
1543
  u8 oui[3]; /* 00:50:f2 */
1544
  u8 oui_type; /* 2 */
1545
  u8 oui_subtype; /* 0 */
1546
  u8 version; /* 1 for WMM version 1.0 */
1547
  u8 qos_info; /* AP/STA specific QoS info */
1548
1549
} STRUCT_PACKED;
1550
1551
#define WMM_QOSINFO_AP_UAPSD 0x80
1552
1553
#define WMM_QOSINFO_STA_AC_MASK 0x0f
1554
#define WMM_QOSINFO_STA_SP_MASK 0x03
1555
#define WMM_QOSINFO_STA_SP_SHIFT 5
1556
1557
0
#define WMM_AC_AIFSN_MASK 0x0f
1558
0
#define WMM_AC_AIFNS_SHIFT 0
1559
0
#define WMM_AC_ACM 0x10
1560
0
#define WMM_AC_ACI_MASK 0x60
1561
0
#define WMM_AC_ACI_SHIFT 5
1562
1563
0
#define WMM_AC_ECWMIN_MASK 0x0f
1564
0
#define WMM_AC_ECWMIN_SHIFT 0
1565
0
#define WMM_AC_ECWMAX_MASK 0xf0
1566
0
#define WMM_AC_ECWMAX_SHIFT 4
1567
1568
struct wmm_ac_parameter {
1569
  u8 aci_aifsn; /* AIFSN, ACM, ACI */
1570
  u8 cw; /* ECWmin, ECWmax (CW = 2^ECW - 1) */
1571
  le16 txop_limit;
1572
}  STRUCT_PACKED;
1573
1574
/*
1575
 * WMM Parameter Element (used in Beacon, Probe Response, and (Re)Association
1576
 * Response frmaes)
1577
 */
1578
struct wmm_parameter_element {
1579
  /* Element ID: 221 (0xdd); Length: 24 */
1580
  /* required fields for WMM version 1 */
1581
  u8 oui[3]; /* 00:50:f2 */
1582
  u8 oui_type; /* 2 */
1583
  u8 oui_subtype; /* 1 */
1584
  u8 version; /* 1 for WMM version 1.0 */
1585
  u8 qos_info; /* AP/STA specific QoS info */
1586
  u8 reserved; /* 0 */
1587
  struct wmm_ac_parameter ac[4]; /* AC_BE, AC_BK, AC_VI, AC_VO */
1588
1589
} STRUCT_PACKED;
1590
1591
/* WMM TSPEC Element */
1592
struct wmm_tspec_element {
1593
  u8 eid; /* 221 = 0xdd */
1594
  u8 length; /* 6 + 55 = 61 */
1595
  u8 oui[3]; /* 00:50:f2 */
1596
  u8 oui_type; /* 2 */
1597
  u8 oui_subtype; /* 2 */
1598
  u8 version; /* 1 */
1599
  /* WMM TSPEC body (55 octets): */
1600
  u8 ts_info[3];
1601
  le16 nominal_msdu_size;
1602
  le16 maximum_msdu_size;
1603
  le32 minimum_service_interval;
1604
  le32 maximum_service_interval;
1605
  le32 inactivity_interval;
1606
  le32 suspension_interval;
1607
  le32 service_start_time;
1608
  le32 minimum_data_rate;
1609
  le32 mean_data_rate;
1610
  le32 peak_data_rate;
1611
  le32 maximum_burst_size;
1612
  le32 delay_bound;
1613
  le32 minimum_phy_rate;
1614
  le16 surplus_bandwidth_allowance;
1615
  le16 medium_time;
1616
} STRUCT_PACKED;
1617
1618
1619
/* Access Categories / ACI to AC coding */
1620
enum wmm_ac {
1621
  WMM_AC_BE = 0 /* Best Effort */,
1622
  WMM_AC_BK = 1 /* Background */,
1623
  WMM_AC_VI = 2 /* Video */,
1624
  WMM_AC_VO = 3 /* Voice */,
1625
  WMM_AC_NUM = 4
1626
};
1627
1628
1629
15.1k
#define HS20_INDICATION_OUI_TYPE 16
1630
0
#define HS20_ANQP_OUI_TYPE 17
1631
6.57k
#define HS20_ROAMING_CONS_SEL_OUI_TYPE 29
1632
0
#define HS20_STYPE_QUERY_LIST 1
1633
0
#define HS20_STYPE_CAPABILITY_LIST 2
1634
0
#define HS20_STYPE_OPERATOR_FRIENDLY_NAME 3
1635
0
#define HS20_STYPE_WAN_METRICS 4
1636
0
#define HS20_STYPE_CONNECTION_CAPABILITY 5
1637
0
#define HS20_STYPE_NAI_HOME_REALM_QUERY 6
1638
0
#define HS20_STYPE_OPERATING_CLASS 7
1639
1640
0
#define HS20_DGAF_DISABLED 0x01
1641
0
#define HS20_PPS_MO_ID_PRESENT 0x02
1642
0
#define HS20_ANQP_DOMAIN_ID_PRESENT 0x04
1643
#ifndef HS20_VERSION
1644
4.34k
#define HS20_VERSION 0x20 /* Release 3 */
1645
#endif /* HS20_VERSION */
1646
1647
/* WNM-Notification WFA vendors specific subtypes */
1648
3.08k
#define HS20_WNM_DEAUTH_IMMINENT_NOTICE 1
1649
#define WFA_WNM_NOTIF_SUBELEM_NON_PREF_CHAN_REPORT 2
1650
#define WFA_WNM_NOTIF_SUBELEM_CELL_DATA_CAPA 3
1651
3.70k
#define HS20_WNM_T_C_ACCEPTANCE 4
1652
1653
0
#define HS20_DEAUTH_REASON_CODE_BSS 0
1654
0
#define HS20_DEAUTH_REASON_CODE_ESS 1
1655
1656
/* MBO v0.0_r19, 4.2: MBO Attributes */
1657
/* Table 4-5: MBO Attributes */
1658
/* OCE v0.0.10, Table 4-3: OCE Attributes */
1659
enum mbo_attr_id {
1660
  MBO_ATTR_ID_AP_CAPA_IND = 1,
1661
  MBO_ATTR_ID_NON_PREF_CHAN_REPORT = 2,
1662
  MBO_ATTR_ID_CELL_DATA_CAPA = 3,
1663
  MBO_ATTR_ID_ASSOC_DISALLOW = 4,
1664
  MBO_ATTR_ID_CELL_DATA_PREF = 5,
1665
  MBO_ATTR_ID_TRANSITION_REASON = 6,
1666
  MBO_ATTR_ID_TRANSITION_REJECT_REASON = 7,
1667
  MBO_ATTR_ID_ASSOC_RETRY_DELAY = 8,
1668
  OCE_ATTR_ID_CAPA_IND = 101,
1669
  OCE_ATTR_ID_RSSI_BASED_ASSOC_REJECT = 102,
1670
  OCE_ATTR_ID_REDUCED_WAN_METRICS = 103,
1671
  OCE_ATTR_ID_RNR_COMPLETENESS = 104,
1672
};
1673
1674
/* MBO v0.0_r19, 4.2.1: MBO AP Capability Indication Attribute */
1675
/* Table 4-7: MBO AP Capability Indication Field Values */
1676
#define MBO_AP_CAPA_CELL_AWARE BIT(6)
1677
1678
/* MBO v0.0_r19, 4.2.2: Non-preferred Channel Report Attribute */
1679
/* Table 4-10: Reason Code Field Values */
1680
enum mbo_non_pref_chan_reason {
1681
  MBO_NON_PREF_CHAN_REASON_UNSPECIFIED = 0,
1682
  MBO_NON_PREF_CHAN_REASON_RSSI = 1,
1683
  MBO_NON_PREF_CHAN_REASON_EXT_INTERFERENCE = 2,
1684
  MBO_NON_PREF_CHAN_REASON_INT_INTERFERENCE = 3,
1685
};
1686
1687
/* MBO v0.0_r19, 4.2.3: Cellular Data Capabilities Attribute */
1688
/* Table 4-13: Cellular Data Connectivity Field */
1689
enum mbo_cellular_capa {
1690
  MBO_CELL_CAPA_AVAILABLE = 1,
1691
  MBO_CELL_CAPA_NOT_AVAILABLE = 2,
1692
  MBO_CELL_CAPA_NOT_SUPPORTED = 3,
1693
};
1694
1695
/* MBO v0.0_r19, 4.2.4: Association Disallowed Attribute */
1696
/* Table 4-15: Reason Code Field Values */
1697
enum mbo_assoc_disallow_reason {
1698
  MBO_ASSOC_DISALLOW_REASON_UNSPECIFIED = 1,
1699
  MBO_ASSOC_DISALLOW_REASON_MAX_STA = 2,
1700
  MBO_ASSOC_DISALLOW_REASON_AIR_INTERFERENCE = 3,
1701
  MBO_ASSOC_DISALLOW_REASON_AUTH_SERVER_OVERLOAD = 4,
1702
  MBO_ASSOC_DISALLOW_REASON_LOW_RSSI = 5,
1703
};
1704
1705
/* MBO v0.0_r19, 4.2.5: Cellular Data Connection Preference Attribute */
1706
/* Table 4-17: Cellular Preference Field Values */
1707
enum mbo_cell_pref {
1708
  MBO_CELL_PREF_EXCLUDED = 0,
1709
  MBO_CELL_PREF_NO_USE = 1,
1710
  MBO_CELL_PREF_USE = 255
1711
};
1712
1713
/* MBO v0.0_r19, 4.2.6: Transition Reason Code Attribute */
1714
/* Table 4-19: Transition Reason Code Field Values */
1715
enum mbo_transition_reason {
1716
  MBO_TRANSITION_REASON_UNSPECIFIED = 0,
1717
  MBO_TRANSITION_REASON_FRAME_LOSS = 1,
1718
  MBO_TRANSITION_REASON_DELAY = 2,
1719
  MBO_TRANSITION_REASON_BANDWIDTH = 3,
1720
  MBO_TRANSITION_REASON_LOAD_BALANCE = 4,
1721
  MBO_TRANSITION_REASON_RSSI = 5,
1722
  MBO_TRANSITION_REASON_RETRANSMISSIONS = 6,
1723
  MBO_TRANSITION_REASON_INTERFERENCE = 7,
1724
  MBO_TRANSITION_REASON_GRAY_ZONE = 8,
1725
  MBO_TRANSITION_REASON_PREMIUM_AP = 9,
1726
};
1727
1728
/* MBO v0.0_r19, 4.2.7: Transition Rejection Reason Code Attribute */
1729
/* Table 4-21: Transition Rejection Reason Code Field Values */
1730
enum mbo_transition_reject_reason {
1731
  MBO_TRANSITION_REJECT_REASON_UNSPECIFIED = 0,
1732
  MBO_TRANSITION_REJECT_REASON_FRAME_LOSS = 1,
1733
  MBO_TRANSITION_REJECT_REASON_DELAY = 2,
1734
  MBO_TRANSITION_REJECT_REASON_QOS_CAPACITY = 3,
1735
  MBO_TRANSITION_REJECT_REASON_RSSI = 4,
1736
  MBO_TRANSITION_REJECT_REASON_INTERFERENCE = 5,
1737
  MBO_TRANSITION_REJECT_REASON_SERVICES = 6,
1738
};
1739
1740
/* MBO v0.0_r27, 4.3: MBO ANQP-elements */
1741
#define MBO_ANQP_OUI_TYPE 0x12
1742
#define MBO_ANQP_SUBTYPE_QUERY_LIST 1
1743
#define MBO_ANQP_SUBTYPE_CELL_CONN_PREF 2
1744
#define MAX_MBO_ANQP_SUBTYPE MBO_ANQP_SUBTYPE_CELL_CONN_PREF
1745
1746
/* OCE v0.0.10, 4.2.1: OCE Capability Indication Attribute */
1747
#define OCE_RELEASE 1
1748
#define OCE_RELEASE_MASK (BIT(0) | BIT(1) | BIT(2))
1749
#define OCE_IS_STA_CFON BIT(3)
1750
#define OCE_IS_NON_OCE_AP_PRESENT BIT(4)
1751
1752
/* Wi-Fi Direct (P2P) */
1753
1754
176k
#define P2P_OUI_TYPE 9
1755
8.09k
#define P2P2_OUI_TYPE 0x28
1756
1757
enum p2p_attr_id {
1758
  P2P_ATTR_STATUS = 0,
1759
  P2P_ATTR_MINOR_REASON_CODE = 1,
1760
  P2P_ATTR_CAPABILITY = 2,
1761
  P2P_ATTR_DEVICE_ID = 3,
1762
  P2P_ATTR_GROUP_OWNER_INTENT = 4,
1763
  P2P_ATTR_CONFIGURATION_TIMEOUT = 5,
1764
  P2P_ATTR_LISTEN_CHANNEL = 6,
1765
  P2P_ATTR_GROUP_BSSID = 7,
1766
  P2P_ATTR_EXT_LISTEN_TIMING = 8,
1767
  P2P_ATTR_INTENDED_INTERFACE_ADDR = 9,
1768
  P2P_ATTR_MANAGEABILITY = 10,
1769
  P2P_ATTR_CHANNEL_LIST = 11,
1770
  P2P_ATTR_NOTICE_OF_ABSENCE = 12,
1771
  P2P_ATTR_DEVICE_INFO = 13,
1772
  P2P_ATTR_GROUP_INFO = 14,
1773
  P2P_ATTR_GROUP_ID = 15,
1774
  P2P_ATTR_INTERFACE = 16,
1775
  P2P_ATTR_OPERATING_CHANNEL = 17,
1776
  P2P_ATTR_INVITATION_FLAGS = 18,
1777
  P2P_ATTR_OOB_GO_NEG_CHANNEL = 19,
1778
  P2P_ATTR_SERVICE_HASH = 21,
1779
  P2P_ATTR_SESSION_INFORMATION_DATA = 22,
1780
  P2P_ATTR_CONNECTION_CAPABILITY = 23,
1781
  P2P_ATTR_ADVERTISEMENT_ID = 24,
1782
  P2P_ATTR_ADVERTISED_SERVICE = 25,
1783
  P2P_ATTR_SESSION_ID = 26,
1784
  P2P_ATTR_FEATURE_CAPABILITY = 27,
1785
  P2P_ATTR_PERSISTENT_GROUP = 28,
1786
  P2P_ATTR_CAPABILITY_EXTENSION = 29,
1787
  P2P_ATTR_WLAN_AP_INFORMATION = 30,
1788
  P2P_ATTR_DEVICE_IDENTITY_KEY = 31,
1789
  P2P_ATTR_DEVICE_IDENTITY_RESOLUTION = 32,
1790
  P2P_ATTR_PAIRING_AND_BOOTSTRAPPING = 33,
1791
  P2P_ATTR_PASSWORD = 34,
1792
  P2P_ATTR_ACTION_FRAME_WRAPPER = 35,
1793
  P2P_ATTR_VENDOR_SPECIFIC = 221
1794
};
1795
1796
0
#define P2P_MAX_GO_INTENT 15
1797
1798
/* P2P Capability - Device Capability bitmap */
1799
0
#define P2P_DEV_CAPAB_SERVICE_DISCOVERY BIT(0)
1800
6.74k
#define P2P_DEV_CAPAB_CLIENT_DISCOVERABILITY BIT(1)
1801
0
#define P2P_DEV_CAPAB_CONCURRENT_OPER BIT(2)
1802
0
#define P2P_DEV_CAPAB_INFRA_MANAGED BIT(3)
1803
#define P2P_DEV_CAPAB_DEVICE_LIMIT BIT(4)
1804
6.34k
#define P2P_DEV_CAPAB_INVITATION_PROCEDURE BIT(5)
1805
251
#define P2P_DEV_CAPAB_6GHZ_BAND_CAPABLE BIT(6)
1806
1807
/* P2P Capability - Group Capability bitmap */
1808
0
#define P2P_GROUP_CAPAB_GROUP_OWNER BIT(0)
1809
0
#define P2P_GROUP_CAPAB_PERSISTENT_GROUP BIT(1)
1810
0
#define P2P_GROUP_CAPAB_GROUP_LIMIT BIT(2)
1811
0
#define P2P_GROUP_CAPAB_INTRA_BSS_DIST BIT(3)
1812
0
#define P2P_GROUP_CAPAB_CROSS_CONN BIT(4)
1813
0
#define P2P_GROUP_CAPAB_PERSISTENT_RECONN BIT(5)
1814
0
#define P2P_GROUP_CAPAB_GROUP_FORMATION BIT(6)
1815
0
#define P2P_GROUP_CAPAB_IP_ADDR_ALLOCATION BIT(7)
1816
1817
/* P2P Capability Extension attribute - Capability info */
1818
75
#define P2P_PCEA_LEN_MASK (BIT(0) | BIT(1) | BIT(2) | BIT(3))
1819
71
#define P2P_PCEA_6GHZ BIT(4)
1820
71
#define P2P_PCEA_REG_INFO BIT(5)
1821
0
#define P2P_PCEA_DFS_OWNER BIT(6)
1822
0
#define P2P_PCEA_CLI_REQ_CS BIT(7)
1823
28
#define P2P_PCEA_PAIRING_CAPABLE BIT(8)
1824
28
#define P2P_PCEA_PAIRING_SETUP_ENABLED BIT(9)
1825
28
#define P2P_PCEA_PMK_CACHING BIT(10)
1826
70
#define P2P_PCEA_PASN_TYPE BIT(11)
1827
0
#define P2P_PCEA_TWT_POWER_MGMT BIT(12)
1828
1829
/* P2P Pairing Bootstrapping Method attribute - Bootstrapping Method */
1830
0
#define P2P_PBMA_OPPORTUNISTIC       BIT(0)
1831
0
#define P2P_PBMA_PIN_CODE_DISPLAY    BIT(1)
1832
0
#define P2P_PBMA_PASSPHRASE_DISPLAY  BIT(2)
1833
0
#define P2P_PBMA_QR_DISPLAY          BIT(3)
1834
0
#define P2P_PBMA_NFC_TAG             BIT(4)
1835
0
#define P2P_PBMA_PIN_CODE_KEYPAD     BIT(5)
1836
0
#define P2P_PBMA_PASSPHRASE_KEYPAD   BIT(6)
1837
0
#define P2P_PBMA_QR_SCAN             BIT(7)
1838
0
#define P2P_PBMA_NFC_READER          BIT(8)
1839
#define P2P_PBMA_SERVICE_MANAGED     BIT(14)
1840
#define P2P_PBMA_HANDSHAKE_SKIP      BIT(15)
1841
1842
/* P2PS Coordination Protocol Transport Bitmap */
1843
#define P2PS_FEATURE_CAPAB_UDP_TRANSPORT BIT(0)
1844
#define P2PS_FEATURE_CAPAB_MAC_TRANSPORT BIT(1)
1845
1846
struct p2ps_feature_capab {
1847
  u8 cpt;
1848
  u8 reserved;
1849
} STRUCT_PACKED;
1850
1851
/* Invitation Flags */
1852
1
#define P2P_INVITATION_FLAGS_TYPE BIT(0)
1853
1854
/* P2P Manageability */
1855
#define P2P_MAN_DEVICE_MANAGEMENT BIT(0)
1856
0
#define P2P_MAN_CROSS_CONNECTION_PERMITTED BIT(1)
1857
#define P2P_MAN_COEXISTENCE_OPTIONAL BIT(2)
1858
1859
enum p2p_status_code {
1860
  P2P_SC_SUCCESS = 0,
1861
  P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE = 1,
1862
  P2P_SC_FAIL_INCOMPATIBLE_PARAMS = 2,
1863
  P2P_SC_FAIL_LIMIT_REACHED = 3,
1864
  P2P_SC_FAIL_INVALID_PARAMS = 4,
1865
  P2P_SC_FAIL_UNABLE_TO_ACCOMMODATE = 5,
1866
  P2P_SC_FAIL_PREV_PROTOCOL_ERROR = 6,
1867
  P2P_SC_FAIL_NO_COMMON_CHANNELS = 7,
1868
  P2P_SC_FAIL_UNKNOWN_GROUP = 8,
1869
  P2P_SC_FAIL_BOTH_GO_INTENT_15 = 9,
1870
  P2P_SC_FAIL_INCOMPATIBLE_PROV_METHOD = 10,
1871
  P2P_SC_FAIL_REJECTED_BY_USER = 11,
1872
  P2P_SC_SUCCESS_DEFERRED = 12,
1873
  P2P_SC_COMEBACK = 13,
1874
};
1875
1876
enum p2p_role_indication {
1877
  P2P_DEVICE_NOT_IN_GROUP = 0x00,
1878
  P2P_CLIENT_IN_A_GROUP = 0x01,
1879
  P2P_GO_IN_A_GROUP = 0x02,
1880
};
1881
1882
0
#define P2P_WILDCARD_SSID "DIRECT-"
1883
4.02k
#define P2P_WILDCARD_SSID_LEN 7
1884
1885
/* P2P action frames */
1886
enum p2p_act_frame_type {
1887
  P2P_NOA = 0,
1888
  P2P_PRESENCE_REQ = 1,
1889
  P2P_PRESENCE_RESP = 2,
1890
  P2P_GO_DISC_REQ = 3
1891
};
1892
1893
/* P2P public action frames */
1894
enum p2p_action_frame_type {
1895
  P2P_GO_NEG_REQ = 0,
1896
  P2P_GO_NEG_RESP = 1,
1897
  P2P_GO_NEG_CONF = 2,
1898
  P2P_INVITATION_REQ = 3,
1899
  P2P_INVITATION_RESP = 4,
1900
  P2P_DEV_DISC_REQ = 5,
1901
  P2P_DEV_DISC_RESP = 6,
1902
  P2P_PROV_DISC_REQ = 7,
1903
  P2P_PROV_DISC_RESP = 8
1904
};
1905
1906
enum p2p_service_protocol_type {
1907
  P2P_SERV_ALL_SERVICES = 0,
1908
  P2P_SERV_BONJOUR = 1,
1909
  P2P_SERV_UPNP = 2,
1910
  P2P_SERV_WS_DISCOVERY = 3,
1911
  P2P_SERV_WIFI_DISPLAY = 4,
1912
  P2P_SERV_P2PS = 11,
1913
  P2P_SERV_VENDOR_SPECIFIC = 255
1914
};
1915
1916
enum p2p_sd_status {
1917
  P2P_SD_SUCCESS = 0,
1918
  P2P_SD_PROTO_NOT_AVAILABLE = 1,
1919
  P2P_SD_REQUESTED_INFO_NOT_AVAILABLE = 2,
1920
  P2P_SD_BAD_REQUEST = 3
1921
};
1922
1923
1924
enum wifi_display_subelem {
1925
  WFD_SUBELEM_DEVICE_INFO = 0,
1926
  WFD_SUBELEM_ASSOCIATED_BSSID = 1,
1927
  WFD_SUBELEM_AUDIO_FORMATS = 2,
1928
  WFD_SUBELEM_VIDEO_FORMATS = 3,
1929
  WFD_SUBELEM_3D_VIDEO_FORMATS = 4,
1930
  WFD_SUBELEM_CONTENT_PROTECTION = 5,
1931
  WFD_SUBELEM_COUPLED_SINK = 6,
1932
  WFD_SUBELEM_EXT_CAPAB = 7,
1933
  WFD_SUBELEM_LOCAL_IP_ADDRESS = 8,
1934
  WFD_SUBELEM_SESSION_INFO = 9,
1935
  WFD_SUBELEM_MAC_INFO = 10,
1936
  WFD_SUBELEM_R2_DEVICE_INFO = 11,
1937
};
1938
1939
/* 802.11s */
1940
#define MESH_SYNC_METHOD_NEIGHBOR_OFFSET 1
1941
#define MESH_SYNC_METHOD_VENDOR   255
1942
#define MESH_PATH_PROTOCOL_HWMP   1
1943
#define MESH_PATH_PROTOCOL_VENDOR 255
1944
#define MESH_PATH_METRIC_AIRTIME  1
1945
#define MESH_PATH_METRIC_VENDOR   255
1946
/* IEEE 802.11s - Mesh Capability */
1947
#define MESH_CAP_ACCEPT_ADDITIONAL_PEER BIT(0)
1948
#define MESH_CAP_MCCA_SUPPORTED   BIT(1)
1949
#define MESH_CAP_MCCA_ENABLED   BIT(2)
1950
#define MESH_CAP_FORWARDING   BIT(3)
1951
#define MESH_CAP_MBCA_ENABLED   BIT(4)
1952
#define MESH_CAP_TBTT_ADJUSTING   BIT(5)
1953
#define MESH_CAP_MESH_PS_LEVEL    BIT(6)
1954
1955
enum plink_action_field {
1956
  PLINK_OPEN = 1,
1957
  PLINK_CONFIRM,
1958
  PLINK_CLOSE
1959
};
1960
1961
17.5k
#define OUI_BROADCOM 0x00904c /* Broadcom (Epigram) */
1962
12.2k
#define VENDOR_VHT_TYPE   0x04
1963
20.7k
#define VENDOR_VHT_SUBTYPE  0x08
1964
9.05k
#define VENDOR_VHT_SUBTYPE2 0x00
1965
1966
2.07k
#define VENDOR_HT_CAPAB_OUI_TYPE 0x33 /* 00-90-4c:0x33 */
1967
1968
1969
/* IEEE 802.11v - WNM Action field values */
1970
enum wnm_action {
1971
  WNM_EVENT_REQ = 0,
1972
  WNM_EVENT_REPORT = 1,
1973
  WNM_DIAGNOSTIC_REQ = 2,
1974
  WNM_DIAGNOSTIC_REPORT = 3,
1975
  WNM_LOCATION_CFG_REQ = 4,
1976
  WNM_LOCATION_CFG_RESP = 5,
1977
  WNM_BSS_TRANS_MGMT_QUERY = 6,
1978
  WNM_BSS_TRANS_MGMT_REQ = 7,
1979
  WNM_BSS_TRANS_MGMT_RESP = 8,
1980
  WNM_FMS_REQ = 9,
1981
  WNM_FMS_RESP = 10,
1982
  WNM_COLLOCATED_INTERFERENCE_REQ = 11,
1983
  WNM_COLLOCATED_INTERFERENCE_REPORT = 12,
1984
  WNM_TFS_REQ = 13,
1985
  WNM_TFS_RESP = 14,
1986
  WNM_TFS_NOTIFY = 15,
1987
  WNM_SLEEP_MODE_REQ = 16,
1988
  WNM_SLEEP_MODE_RESP = 17,
1989
  WNM_TIM_BROADCAST_REQ = 18,
1990
  WNM_TIM_BROADCAST_RESP = 19,
1991
  WNM_QOS_TRAFFIC_CAPAB_UPDATE = 20,
1992
  WNM_CHANNEL_USAGE_REQ = 21,
1993
  WNM_CHANNEL_USAGE_RESP = 22,
1994
  WNM_DMS_REQ = 23,
1995
  WNM_DMS_RESP = 24,
1996
  WNM_TIMING_MEASUREMENT_REQ = 25,
1997
  WNM_NOTIFICATION_REQ = 26,
1998
  WNM_NOTIFICATION_RESP = 27
1999
};
2000
2001
/* IEEE 802.11v - BSS Transition Management Request - Request Mode */
2002
1.06k
#define WNM_BSS_TM_REQ_PREF_CAND_LIST_INCLUDED BIT(0)
2003
0
#define WNM_BSS_TM_REQ_ABRIDGED BIT(1)
2004
4.18k
#define WNM_BSS_TM_REQ_DISASSOC_IMMINENT BIT(2)
2005
1.14k
#define WNM_BSS_TM_REQ_BSS_TERMINATION_INCLUDED BIT(3)
2006
1.15k
#define WNM_BSS_TM_REQ_ESS_DISASSOC_IMMINENT BIT(4)
2007
0
#define WNM_BSS_TM_REQ_LINK_REMOVAL_IMMINENT BIT(5)
2008
2009
/* IEEE Std 802.11-2020, Table 9-428 (BTM status code definitions) */
2010
enum bss_trans_mgmt_status_code {
2011
  WNM_BSS_TM_ACCEPT = 0,
2012
  WNM_BSS_TM_REJECT_UNSPECIFIED = 1,
2013
  WNM_BSS_TM_REJECT_INSUFFICIENT_BEACON = 2,
2014
  WNM_BSS_TM_REJECT_INSUFFICIENT_CAPABITY = 3,
2015
  WNM_BSS_TM_REJECT_UNDESIRED = 4,
2016
  WNM_BSS_TM_REJECT_DELAY_REQUEST = 5,
2017
  WNM_BSS_TM_REJECT_STA_CANDIDATE_LIST_PROVIDED = 6,
2018
  WNM_BSS_TM_REJECT_NO_SUITABLE_CANDIDATES = 7,
2019
  WNM_BSS_TM_REJECT_LEAVING_ESS = 8
2020
};
2021
2022
/* BSS transition management reasons
2023
 * IEEE Std 802.11-2020, Table 9-198 (Transition and Transition Query reasons)
2024
 */
2025
enum bss_trans_mgmt_reason {
2026
  WNM_TRANSITION_REASON_UNSPECIFIED = 0,
2027
  WNM_TRANSITION_REASON_EXCESSIVE_FRAME_LOSS = 1,
2028
  WNM_TRANSITION_REASON_EXCESSIVE_DELAY = 2,
2029
  WNM_TRANSITION_REASON_INSUFFICIENT_QOS = 3,
2030
  WNM_TRANSITION_REASON_FIRST_ESS_ASSOC = 4,
2031
  WNM_TRANSITION_REASON_LOAD_BALANCING = 5,
2032
  WNM_TRANSITION_REASON_BETTER_AP_FOUND = 6,
2033
  WNM_TRANSITION_REASON_DEAUTH_FROM_PREV_AP = 7,
2034
  WNM_TRANSITION_REASON_AP_FAILED_EAP = 8,
2035
  WNM_TRANSITION_REASON_AP_FAILED_4WAY_HS = 9,
2036
  WNM_TRANSITION_REASON_RX_TOO_MANY_REPLAYS = 10,
2037
  WNM_TRANSITION_REASON_RX_TOO_MANY_MIC_FAILURES = 11,
2038
  WNM_TRANSITION_REASON_EXCEEDED_MAX_RETRANS = 12,
2039
  WNM_TRANSITION_REASON_RX_TOO_MANY_BC_DISASSOC = 13,
2040
  WNM_TRANSITION_REASON_RX_TOO_MANY_BC_DEAUTH = 14,
2041
  WNM_TRANSITION_REASON_PREV_TRANSITION_FAILED = 15,
2042
  WNM_TRANSITION_REASON_LOW_RSSI = 16,
2043
  WNM_TRANSITION_REASON_ROAM_FROM_NON_802_11 = 17,
2044
  WNM_TRANSITION_REASON_TRANSITION_DUE_TO_BTM_REQ = 18,
2045
  WNM_TRANSITION_REASON_PREF_TRANSITION_CANDIDATE_LIST = 19,
2046
  WNM_TRANSITION_REASON_LEAVING_ESS = 20,
2047
};
2048
2049
/*
2050
 * IEEE Std 802.11-2020, Table 9-173 - Optional subelement IDs for
2051
 * Neighbor Report
2052
 */
2053
1.23k
#define WNM_NEIGHBOR_TSF                         1
2054
684
#define WNM_NEIGHBOR_CONDENSED_COUNTRY_STRING    2
2055
1.19k
#define WNM_NEIGHBOR_BSS_TRANSITION_CANDIDATE    3
2056
1.05k
#define WNM_NEIGHBOR_BSS_TERMINATION_DURATION    4
2057
598
#define WNM_NEIGHBOR_BEARING                     5
2058
0
#define WNM_NEIGHBOR_WIDE_BW_CHAN                6
2059
#define WNM_NEIGHBOR_MEASUREMENT_REPORT         39
2060
#define WNM_NEIGHBOR_HT_CAPAB                   45
2061
#define WNM_NEIGHBOR_HT_OPER                    61
2062
#define WNM_NEIGHBOR_SEC_CHAN_OFFSET            62
2063
1.45k
#define WNM_NEIGHBOR_MEASUREMENT_PILOT          66
2064
476
#define WNM_NEIGHBOR_RRM_ENABLED_CAPABILITIES   70
2065
929
#define WNM_NEIGHBOR_MULTIPLE_BSSID             71
2066
#define WNM_NEIGHBOR_VHT_CAPAB                 191
2067
#define WNM_NEIGHBOR_VHT_OPER                  192
2068
947
#define WNM_NEIGHBOR_MULTI_LINK                201
2069
2070
/* QoS action */
2071
enum qos_action {
2072
  QOS_ADDTS_REQ = 0,
2073
  QOS_ADDTS_RESP = 1,
2074
  QOS_DELTS = 2,
2075
  QOS_SCHEDULE = 3,
2076
  QOS_QOS_MAP_CONFIG = 4,
2077
};
2078
2079
/* IEEE Std 802.11-2020, 9.4.2.59 (20/40 BSS Coexistence element) */
2080
#define WLAN_20_40_BSS_COEX_INFO_REQ            BIT(0)
2081
0
#define WLAN_20_40_BSS_COEX_40MHZ_INTOL         BIT(1)
2082
0
#define WLAN_20_40_BSS_COEX_20MHZ_WIDTH_REQ     BIT(2)
2083
#define WLAN_20_40_BSS_COEX_OBSS_EXEMPT_REQ     BIT(3)
2084
#define WLAN_20_40_BSS_COEX_OBSS_EXEMPT_GRNT    BIT(4)
2085
2086
struct ieee80211_2040_bss_coex_ie {
2087
  u8 element_id;
2088
  u8 length;
2089
  u8 coex_param;
2090
} STRUCT_PACKED;
2091
2092
struct ieee80211_2040_intol_chan_report {
2093
  u8 element_id;
2094
  u8 length;
2095
  u8 op_class;
2096
  u8 variable[0]; /* Channel List */
2097
} STRUCT_PACKED;
2098
2099
/* IEEE 802.11v - WNM-Sleep Mode element */
2100
struct wnm_sleep_element {
2101
  u8 eid;     /* WLAN_EID_WNMSLEEP */
2102
  u8 len;
2103
  u8 action_type; /* WNM_SLEEP_ENTER/WNM_SLEEP_MODE_EXIT */
2104
  u8 status;
2105
  le16 intval;
2106
} STRUCT_PACKED;
2107
2108
0
#define WNM_SLEEP_MODE_ENTER 0
2109
0
#define WNM_SLEEP_MODE_EXIT 1
2110
2111
enum wnm_sleep_mode_response_status {
2112
  WNM_STATUS_SLEEP_ACCEPT = 0,
2113
  WNM_STATUS_SLEEP_EXIT_ACCEPT_GTK_UPDATE = 1,
2114
  WNM_STATUS_DENIED_ACTION = 2,
2115
  WNM_STATUS_DENIED_TMP = 3,
2116
  WNM_STATUS_DENIED_KEY = 4,
2117
  WNM_STATUS_DENIED_OTHER_WNM_SERVICE = 5
2118
};
2119
2120
/* WNM-Sleep Mode subelement IDs */
2121
enum wnm_sleep_mode_subelement_id {
2122
  WNM_SLEEP_SUBELEM_GTK = 0,
2123
  WNM_SLEEP_SUBELEM_IGTK = 1,
2124
  WNM_SLEEP_SUBELEM_BIGTK = 2,
2125
};
2126
2127
/* WNM notification type (IEEE Std 802.11-2020, Table 9-431) */
2128
enum wnm_notification_Type {
2129
  WNM_NOTIF_TYPE_FIRMWARE_UPDATE = 0,
2130
  WNM_NOTIF_TYPE_BEACON_PROTECTION_FAILURE = 2,
2131
  WNM_NOTIF_TYPE_VENDOR_SPECIFIC = 221,
2132
};
2133
2134
struct wnm_event_report_element {
2135
  u8 eid; /* WLAN_EID_EVENT_REPORT */
2136
  u8 len;
2137
  u8 token;
2138
  u8 type;
2139
  u8 status;
2140
  /* Followed by conditional fields */
2141
  union {
2142
    struct {
2143
      u8 tsf[8]; /* Event TSF */
2144
      u8 color_bitmap[8]; /* Event Report field */
2145
    } STRUCT_PACKED bss_color_collision;
2146
    struct {
2147
      u8 tsf[8]; /* Event TSF */
2148
      u8 color; /* Event Report field */
2149
    } STRUCT_PACKED bss_color_in_use;
2150
  } u;
2151
} STRUCT_PACKED;
2152
2153
enum wnm_event_report_status {
2154
  WNM_STATUS_SUCCESSFUL = 0,
2155
  WNM_STATUS_REQ_FAILED = 1,
2156
  WNM_STATUS_REQ_REFUSED = 2,
2157
  WNM_STATUS_REQ_INCAPABLE = 3,
2158
  WNM_STATUS_FREQUENT_TRANSITION = 4,
2159
};
2160
2161
enum wnm_event_report_type {
2162
       WNM_EVENT_TYPE_TRANSITION = 0,
2163
       WNM_EVENT_TYPE_RSNA = 1,
2164
       WNM_EVENT_TYPE_P2P_LINK = 2,
2165
       WNM_EVENT_TYPE_WNM_LOG = 3,
2166
       WNM_EVENT_TYPE_BSS_COLOR_COLLISION = 4,
2167
       WNM_EVENT_TYPE_BSS_COLOR_IN_USE = 5,
2168
};
2169
2170
/* Channel Switch modes (802.11h) */
2171
#define CHAN_SWITCH_MODE_ALLOW_TX 0
2172
#define CHAN_SWITCH_MODE_BLOCK_TX 1
2173
2174
struct tpc_report {
2175
  u8 eid;
2176
  u8 len;
2177
  u8 tx_power;
2178
  u8 link_margin;
2179
} STRUCT_PACKED;
2180
2181
/*
2182
 * IEEE Std 802.11ax-2021, Table 9-275a - Maximum Transmit Power
2183
 * Interpretation subfield encoding
2184
 */
2185
enum max_tx_pwr_interpretation {
2186
  LOCAL_EIRP = 0,
2187
  LOCAL_EIRP_PSD = 1,
2188
  REGULATORY_CLIENT_EIRP = 2,
2189
  REGULATORY_CLIENT_EIRP_PSD = 3,
2190
};
2191
2192
/*
2193
 * IEEE Std 802.11ax-2021, Table E-13 - Maximum Transmit Power
2194
 * Category subfield encoding in the United States
2195
 */
2196
enum reg_6g_client_type {
2197
  REG_DEFAULT_CLIENT = 0,
2198
  REG_SUBORDINATE_CLIENT = 1,
2199
};
2200
2201
0
#define RRM_CAPABILITIES_IE_LEN 5
2202
2203
/* IEEE Std 802.11-2020, 9.6.6.4 - Link Measurement Request frame format */
2204
struct rrm_link_measurement_request {
2205
  u8 dialog_token;
2206
  s8 tx_power;
2207
  s8 max_tp;
2208
  u8 variable[0];
2209
} STRUCT_PACKED;
2210
2211
/* IEEE Std 802.11-2020, 9.6.6.5 - Link Measurement Report frame format */
2212
struct rrm_link_measurement_report {
2213
  u8 dialog_token;
2214
  struct tpc_report tpc;
2215
  u8 rx_ant_id;
2216
  u8 tx_ant_id;
2217
  u8 rcpi;
2218
  u8 rsni;
2219
  u8 variable[0];
2220
} STRUCT_PACKED;
2221
2222
/* IEEE Std 802.11-2020, 9.4.2.20 - Measurement Request element */
2223
struct rrm_measurement_request_element {
2224
  u8 eid; /* Element ID */
2225
  u8 len; /* Length */
2226
  u8 token; /* Measurement Token */
2227
  u8 mode; /* Measurement Request Mode */
2228
  u8 type; /* Measurement Type */
2229
  u8 variable[0]; /* Measurement Request */
2230
} STRUCT_PACKED;
2231
2232
/* IEEE Std 802.11-2020, Figure 9-180 - Measurement Request Mode field format */
2233
0
#define MEASUREMENT_REQUEST_MODE_PARALLEL BIT(0)
2234
0
#define MEASUREMENT_REQUEST_MODE_ENABLE BIT(1)
2235
#define MEASUREMENT_REQUEST_MODE_REQUEST BIT(2)
2236
#define MEASUREMENT_REQUEST_MODE_REPORT BIT(3)
2237
0
#define MEASUREMENT_REQUEST_MODE_DURATION_MANDATORY BIT(4)
2238
2239
/* IEEE Std 802.11-2020, 9.4.2.20.7 - Beacon request */
2240
struct rrm_measurement_beacon_request {
2241
  u8 oper_class; /* Operating Class */
2242
  u8 channel; /* Channel Number */
2243
  le16 rand_interval; /* Randomization Interval (in TUs) */
2244
  le16 duration; /* Measurement Duration (in TUs) */
2245
  u8 mode; /* Measurement Mode */
2246
  u8 bssid[ETH_ALEN]; /* BSSID */
2247
  u8 variable[0]; /* Optional Subelements */
2248
} STRUCT_PACKED;
2249
2250
/*
2251
 * IEEE Std 802.11-2020, Table 9-103 - Measurement Mode definitions for Beacon
2252
 * request
2253
 */
2254
enum beacon_report_mode {
2255
  BEACON_REPORT_MODE_PASSIVE = 0,
2256
  BEACON_REPORT_MODE_ACTIVE = 1,
2257
  BEACON_REPORT_MODE_TABLE = 2,
2258
};
2259
2260
/* IEEE Std 802.11-2020, Table 9-104 - Optional subelement IDs for
2261
 * Beacon request */
2262
0
#define WLAN_BEACON_REQUEST_SUBELEM_SSID  0
2263
0
#define WLAN_BEACON_REQUEST_SUBELEM_INFO  1 /* Beacon Reporting */
2264
0
#define WLAN_BEACON_REQUEST_SUBELEM_DETAIL  2 /* Reporting Detail */
2265
0
#define WLAN_BEACON_REQUEST_SUBELEM_REQUEST 10
2266
0
#define WLAN_BEACON_REQUEST_SUBELEM_EXT_REQUEST 11
2267
0
#define WLAN_BEACON_REQUEST_SUBELEM_AP_CHANNEL  51 /* AP Channel Report */
2268
#define WLAN_BEACON_REQUEST_SUBELEM_WIDE_BW_CS  163
2269
0
#define WLAN_BEACON_REQUEST_SUBELEM_LAST_INDICATION 164
2270
#define WLAN_BEACON_REQUEST_SUBELEM_VENDOR  221
2271
2272
/* IEEE Std 802.11-2020, Table 9-106 - Reporting Detail values */
2273
enum beacon_report_detail {
2274
  /* No fixed-length fields or elements */
2275
  BEACON_REPORT_DETAIL_NONE = 0,
2276
  /* All fixed-length fields and any requested elements in the Request
2277
   * element if present */
2278
  BEACON_REPORT_DETAIL_REQUESTED_ONLY = 1,
2279
  /* All fixed-length fields and elements (default, used when Reporting
2280
   * Detail subelement is not included in a Beacon request) */
2281
  BEACON_REPORT_DETAIL_ALL_FIELDS_AND_ELEMENTS = 2,
2282
};
2283
2284
/* IEEE Std 802.11-2020, 9.4.2.21 - Measurement Report element */
2285
struct rrm_measurement_report_element {
2286
  u8 eid; /* Element ID */
2287
  u8 len; /* Length */
2288
  u8 token; /* Measurement Token */
2289
  u8 mode; /* Measurement Report Mode */
2290
  u8 type; /* Measurement Type */
2291
  u8 variable[0]; /* Measurement Report */
2292
} STRUCT_PACKED;
2293
2294
/* IEEE Std 802.11-2020, Figure 9-223 - Measurement Report Mode field */
2295
0
#define MEASUREMENT_REPORT_MODE_ACCEPT 0
2296
#define MEASUREMENT_REPORT_MODE_REJECT_LATE BIT(0)
2297
0
#define MEASUREMENT_REPORT_MODE_REJECT_INCAPABLE BIT(1)
2298
0
#define MEASUREMENT_REPORT_MODE_REJECT_REFUSED BIT(2)
2299
2300
/* IEEE Std 802.11-2020, 9.4.2.21.7 - Beacon report */
2301
struct rrm_measurement_beacon_report {
2302
  u8 op_class; /* Operating Class */
2303
  u8 channel; /* Channel Number */
2304
  le64 start_time; /* Actual Measurement Start Time
2305
        * (in TSF of the BSS requesting the measurement) */
2306
  le16 duration; /* in TUs */
2307
  u8 report_info; /* Reported Frame Information */
2308
  u8 rcpi; /* RCPI */
2309
  u8 rsni; /* RSNI */
2310
  u8 bssid[ETH_ALEN]; /* BSSID */
2311
  u8 antenna_id; /* Antenna ID */
2312
  le32 parent_tsf; /* Parent TSF */
2313
  u8 variable[0]; /* Optional Subelements */
2314
} STRUCT_PACKED;
2315
2316
/* IEEE Std 802.11-2020, Table 9-130 - Optional subelement IDs for
2317
 * Beacon report */
2318
0
#define WLAN_BEACON_REPORT_SUBELEM_FRAME_BODY 1
2319
0
#define WLAN_BEACON_REPORT_SUBELEM_FRAME_BODY_FRAGMENT_ID 2
2320
#define WLAN_BEACON_REPORT_SUBELEM_WID_BW_CS  163
2321
0
#define WLAN_BEACON_REPORT_SUBELEM_LAST_INDICATION  164
2322
#define WLAN_BEACON_REPORT_SUBELEM_VENDOR 221
2323
2324
/* IEEE Std 802.11-2020, Table 9-232 - Data field format (of the
2325
 * Reported Frame Body Fragment ID subelement) */
2326
0
#define REPORTED_FRAME_BODY_SUBELEM_LEN   4
2327
0
#define REPORTED_FRAME_BODY_MORE_FRAGMENTS  BIT(7)
2328
2329
/* IEEE Std 802.11-2020, 9.4.2.21.7 - Beacon report  */
2330
0
#define BEACON_REPORT_LAST_INDICATION_SUBELEM_LEN 3
2331
2332
/* IEEE Std 802.11-2020, 9.4.2.138 - Multi-band element */
2333
struct multi_band_ie {
2334
  u8 eid; /* WLAN_EID_MULTI_BAND */
2335
  u8 len;
2336
  u8 mb_ctrl;
2337
  u8 band_id;
2338
  u8 op_class;
2339
  u8 chan;
2340
  u8 bssid[ETH_ALEN];
2341
  le16 beacon_int;
2342
  u8 tsf_offs[8];
2343
  u8 mb_connection_capability;
2344
  u8 fst_session_tmout;
2345
  /* Optional:
2346
   *   STA MAC Address
2347
   *   Pairwise Cipher Suite Count
2348
   *   Pairwise Cipher Suite List
2349
   */
2350
  u8 variable[0];
2351
} STRUCT_PACKED;
2352
2353
enum mb_ctrl_sta_role {
2354
  MB_STA_ROLE_AP = 0,
2355
  MB_STA_ROLE_TDLS_STA = 1,
2356
  MB_STA_ROLE_IBSS_STA = 2,
2357
  MB_STA_ROLE_PCP = 3,
2358
  MB_STA_ROLE_NON_PCP_NON_AP = 4
2359
};
2360
2361
#define MB_CTRL_ROLE_MASK (BIT(0) | BIT(1) | BIT(2))
2362
#define MB_CTRL_ROLE(ctrl) ((u8) ((ctrl) & MB_CTRL_ROLE_MASK))
2363
#define MB_CTRL_STA_MAC_PRESENT ((u8) (BIT(3)))
2364
#define MB_CTRL_PAIRWISE_CIPHER_SUITE_PRESENT ((u8) (BIT(4)))
2365
2366
enum mb_band_id {
2367
  MB_BAND_ID_WIFI_2_4GHZ = 2, /* 2.4 GHz */
2368
  MB_BAND_ID_WIFI_5GHZ = 4, /* 4.9 and 5 GHz */
2369
  MB_BAND_ID_WIFI_60GHZ = 5, /* 60 GHz */
2370
};
2371
2372
#define MB_CONNECTION_CAPABILITY_AP ((u8) (BIT(0)))
2373
#define MB_CONNECTION_CAPABILITY_PCP ((u8) (BIT(1)))
2374
#define MB_CONNECTION_CAPABILITY_DLS ((u8) (BIT(2)))
2375
#define MB_CONNECTION_CAPABILITY_TDLS ((u8) (BIT(3)))
2376
#define MB_CONNECTION_CAPABILITY_IBSS ((u8) (BIT(4)))
2377
2378
/* IEEE Std 802.11-2020, Table 9-479 - FST Action field values */
2379
enum fst_action {
2380
  FST_ACTION_SETUP_REQUEST = 0,
2381
  FST_ACTION_SETUP_RESPONSE = 1,
2382
  FST_ACTION_TEAR_DOWN = 2,
2383
  FST_ACTION_ACK_REQUEST = 3,
2384
  FST_ACTION_ACK_RESPONSE = 4,
2385
  FST_ACTION_ON_CHANNEL_TUNNEL = 5,
2386
};
2387
2388
/* IEEE Std 802.11-2020, Annex C - dot11PHYType */
2389
enum phy_type {
2390
  PHY_TYPE_UNSPECIFIED = 0,
2391
  PHY_TYPE_DSSS = 2,
2392
  PHY_TYPE_OFDM = 4,
2393
  PHY_TYPE_HRDSSS = 5,
2394
  PHY_TYPE_ERP = 6,
2395
  PHY_TYPE_HT = 7,
2396
  PHY_TYPE_DMG = 8,
2397
  PHY_TYPE_VHT = 9,
2398
  PHY_TYPE_TVHT = 10,
2399
  PHY_TYPE_S1G = 11,
2400
  PHY_TYPE_CDMG = 12,
2401
  PHY_TYPE_CMMG = 13,
2402
};
2403
2404
/* IEEE Std 802.11-2024, 9.4.2.35 - Neighbor Report element */
2405
/* BSSID Information Field */
2406
#define NEI_REP_BSSID_INFO_AP_NOT_REACH BIT(0)
2407
0
#define NEI_REP_BSSID_INFO_AP_UNKNOWN_REACH BIT(1)
2408
#define NEI_REP_BSSID_INFO_AP_REACHABLE (BIT(0) | BIT(1))
2409
0
#define NEI_REP_BSSID_INFO_SECURITY BIT(2)
2410
0
#define NEI_REP_BSSID_INFO_KEY_SCOPE BIT(3)
2411
0
#define NEI_REP_BSSID_INFO_SPECTRUM_MGMT BIT(4)
2412
0
#define NEI_REP_BSSID_INFO_QOS BIT(5)
2413
0
#define NEI_REP_BSSID_INFO_APSD BIT(6)
2414
0
#define NEI_REP_BSSID_INFO_RM BIT(7)
2415
/* bit 8 is reserved (was NEI_REP_BSSID_INFO_DELAYED_BA) */
2416
/* bit 9 is reserved (was NEI_REP_BSSID_INFO_IMM_BA) */
2417
0
#define NEI_REP_BSSID_INFO_MOBILITY_DOMAIN BIT(10)
2418
0
#define NEI_REP_BSSID_INFO_HT BIT(11)
2419
0
#define NEI_REP_BSSID_INFO_VHT BIT(12)
2420
#define NEI_REP_BSSID_INFO_FTM BIT(13)
2421
0
#define NEI_REP_BSSID_INFO_HE BIT(14)
2422
#define NEI_REP_BSSID_INFO_ER_BSS BIT(15)
2423
#define NEI_REP_BSSID_INFO_COLOCATED_AP BIT(16)
2424
#define NEI_REP_BSSID_INFO_UNSOLIC_PROBE_RESP BIT(17)
2425
#define NEI_REP_BSSID_INFO_MEMBER_OF_ESS_WITH_COLOC_AP BIT(18)
2426
#define NEI_REP_BSSID_INFO_OCT_WITH_REPORTING_AP BIT(19)
2427
#define NEI_REP_BSSID_INFO_COLOCATED_WITH_6GHZ BIT(20)
2428
0
#define NEI_REP_BSSID_INFO_EHT BIT(21)
2429
#define NEI_REP_BSSID_INFO_DMG_POSITIONING BIT(22)
2430
2431
/*
2432
 * IEEE Std 802.11-2020, Table 9-175 - HT/VHT Operation Information
2433
 * subfields.
2434
 * Note: These definitions are not the same as other CHANWIDTH_*.
2435
 */
2436
enum nr_chan_width {
2437
  NR_CHAN_WIDTH_20 = 0,
2438
  NR_CHAN_WIDTH_40 = 1,
2439
  NR_CHAN_WIDTH_80 = 2,
2440
  NR_CHAN_WIDTH_160 = 3,
2441
  NR_CHAN_WIDTH_80P80 = 4,
2442
};
2443
2444
struct ieee80211_he_capabilities {
2445
  u8 he_mac_capab_info[6];
2446
  u8 he_phy_capab_info[11];
2447
  /* Followed by 4, 8, or 12 octets of Supported HE-MCS And NSS Set field
2448
  * and optional variable length PPE Thresholds field. */
2449
  u8 optional[37];
2450
} STRUCT_PACKED;
2451
141k
#define IEEE80211_HE_CAPAB_MIN_LEN (6 + 11)
2452
2453
struct ieee80211_he_operation {
2454
  le32 he_oper_params; /* HE Operation Parameters[3] and
2455
            * BSS Color Information[1] */
2456
  le16 he_mcs_nss_set;
2457
  /* Followed by conditional VHT Operation Information (3 octets),
2458
   * Max Co-Hosted BSSID Indicator subfield (1 octet), and/or 6 GHz
2459
   * Operation Information subfield (5 octets). */
2460
} STRUCT_PACKED;
2461
2462
/* IEEE Std 802.11ax-2021, Figure 9-788k - 6 GHz Operation Information field */
2463
struct ieee80211_he_6ghz_oper_info {
2464
  u8 primary_chan;
2465
  u8 control;
2466
  u8 chan_center_freq_seg0;
2467
  u8 chan_center_freq_seg1;
2468
  u8 min_rate;
2469
} STRUCT_PACKED;
2470
2471
/* IEEE Std 802.11ax-2021, Figure 9-788l - Control field format */
2472
#define HE_6GHZ_OPER_INFO_CTRL_CHAN_WIDTH_MASK  (BIT(0) | BIT(1))
2473
#define HE_6GHZ_OPER_INFO_CTRL_DUP_BEACON BIT(2)
2474
#define HE_6GHZ_OPER_INFO_CTRL_REG_INFO_MASK  (BIT(3) | BIT(4) | BIT(5))
2475
#define HE_6GHZ_OPER_INFO_CTRL_REG_INFO_SHIFT 3
2476
2477
/* IEEE Std 802.11ax-2021, 9.4.2.263 HE 6 GHz Band Capabilities element */
2478
struct ieee80211_he_6ghz_band_cap {
2479
   /* Minimum MPDU Start Spacing B0..B2
2480
    * Maximum A-MPDU Length Exponent B3..B5
2481
    * Maximum MPDU Length B6..B7
2482
    * SM Power Save B9..B10
2483
    * RD Responder B11
2484
    * Rx Antenna Pattern Consistency B12
2485
    * Tx Antenna Consistency B13 */
2486
  le16 capab; /* Capabilities Information field */
2487
} STRUCT_PACKED;
2488
2489
#define HE_6GHZ_BAND_CAP_MIN_MPDU_START              (BIT(0) | BIT(1) | BIT(2))
2490
#define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_16K       BIT(3)
2491
#define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_32K       BIT(4)
2492
#define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_64K       (BIT(3) | BIT(4))
2493
#define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_128K      BIT(5)
2494
#define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_256K      (BIT(3) | BIT(5))
2495
#define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_512K      (BIT(4) | BIT(5))
2496
#define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_1024K     (BIT(3) | BIT(4) | BIT(5))
2497
#define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_MASK      (BIT(3) | BIT(4) | BIT(5))
2498
#define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_SHIFT     3
2499
#define HE_6GHZ_BAND_CAP_MAX_MPDU_LEN_7991           BIT(6)
2500
#define HE_6GHZ_BAND_CAP_MAX_MPDU_LEN_11454          BIT(7)
2501
#define HE_6GHZ_BAND_CAP_MAX_MPDU_LEN_MASK           (BIT(6) | BIT(7))
2502
#define HE_6GHZ_BAND_CAP_MAX_MPDU_LEN_SHIFT      6
2503
#define HE_6GHZ_BAND_CAP_SMPS_MASK                   (BIT(9) | BIT(10))
2504
#define HE_6GHZ_BAND_CAP_SMPS_STATIC                 0
2505
#define HE_6GHZ_BAND_CAP_SMPS_DYNAMIC                BIT(9)
2506
#define HE_6GHZ_BAND_CAP_SMPS_DISABLED               (BIT(9) | BIT(10))
2507
#define HE_6GHZ_BAND_CAP_RD_RESPONDER                BIT(11)
2508
#define HE_6GHZ_BAND_CAP_RX_ANTPAT_CONS              BIT(12)
2509
#define HE_6GHZ_BAND_CAP_TX_ANTPAT_CONS              BIT(13)
2510
2511
/*
2512
 * IEEE Std 802.11ax-2021, 9.4.2.252 Spatial Reuse Parameter Set element
2513
 */
2514
struct ieee80211_spatial_reuse {
2515
  u8 sr_ctrl; /* SR Control */
2516
  /* Up to 19 octets of parameters:
2517
   * Non-SRG OBSS PD Max Offset[0 or 1]
2518
   * SRG OBSS PD Min Offset[0 or 1]
2519
   * SRG OBSS PD Max Offset[0 or 1]
2520
   * SRG BSS Color Bitmap[0 or 8]
2521
   * SRG Partial BSSID Bitmap[0 or 8]
2522
   */
2523
  u8 params[19];
2524
} STRUCT_PACKED;
2525
2526
/* HE Capabilities Information defines */
2527
2528
#define HE_MACCAP_TWT_RESPONDER     ((u8) BIT(2))
2529
2530
0
#define HE_PHYCAP_CHANNEL_WIDTH_SET_IDX   0
2531
#define HE_PHYCAP_CHANNEL_WIDTH_MASK    ((u8) (BIT(1) | BIT(2) | \
2532
                  BIT(3) | BIT(4)))
2533
0
#define HE_PHYCAP_CHANNEL_WIDTH_SET_40MHZ_IN_2G         ((u8) BIT(1))
2534
0
#define HE_PHYCAP_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G ((u8) BIT(2))
2535
0
#define HE_PHYCAP_CHANNEL_WIDTH_SET_160MHZ_IN_5G  ((u8) BIT(3))
2536
0
#define HE_PHYCAP_CHANNEL_WIDTH_SET_80PLUS80MHZ_IN_5G ((u8) BIT(4))
2537
2538
#define HE_PHYCAP_SU_BEAMFORMER_CAPAB_IDX 3
2539
#define HE_PHYCAP_SU_BEAMFORMER_CAPAB   ((u8) BIT(7))
2540
#define HE_PHYCAP_SU_BEAMFORMEE_CAPAB_IDX 4
2541
#define HE_PHYCAP_SU_BEAMFORMEE_CAPAB   ((u8) BIT(0))
2542
#define HE_PHYCAP_MU_BEAMFORMER_CAPAB_IDX 4
2543
#define HE_PHYCAP_MU_BEAMFORMER_CAPAB   ((u8) BIT(1))
2544
2545
#define HE_PHYCAP_PPE_THRESHOLD_PRESENT_IDX 6
2546
#define HE_PHYCAP_PPE_THRESHOLD_PRESENT   ((u8) BIT(7))
2547
2548
/* HE PPE Threshold define */
2549
#define HE_PPE_THRES_RU_INDEX_BITMASK_MASK  0xf
2550
#define HE_PPE_THRES_RU_INDEX_BITMASK_SHIFT 3
2551
#define HE_PPE_THRES_NSS_MASK     0x7
2552
2553
/* HE Operation defines */
2554
/* HE Operation Parameters and BSS Color Information fields */
2555
#define HE_OPERATION_DFLT_PE_DURATION_MASK  ((u32) (BIT(0) | BIT(1) | \
2556
              BIT(2)))
2557
#define HE_OPERATION_DFLT_PE_DURATION_OFFSET  0
2558
#define HE_OPERATION_TWT_REQUIRED   ((u32) BIT(3))
2559
#define HE_OPERATION_RTS_THRESHOLD_MASK ((u32) (BIT(4) | BIT(5) | \
2560
            BIT(6) | BIT(7) | \
2561
            BIT(8) | BIT(9) | \
2562
            BIT(10) | BIT(11) | \
2563
            BIT(12) | BIT(13)))
2564
#define HE_OPERATION_RTS_THRESHOLD_OFFSET 4
2565
#define HE_OPERATION_VHT_OPER_INFO    ((u32) BIT(14))
2566
#define HE_OPERATION_COHOSTED_BSS   ((u32) BIT(15))
2567
#define HE_OPERATION_ER_SU_DISABLE    ((u32) BIT(16))
2568
#define HE_OPERATION_6GHZ_OPER_INFO   ((u32) BIT(17))
2569
#define HE_OPERATION_BSS_COLOR_MASK   ((u32) (BIT(24) | BIT(25) | \
2570
              BIT(26) | BIT(27) | \
2571
              BIT(28) | BIT(29)))
2572
#define HE_OPERATION_BSS_COLOR_PARTIAL    ((u32) BIT(30))
2573
#define HE_OPERATION_BSS_COLOR_DISABLED   ((u32) BIT(31))
2574
#define HE_OPERATION_BSS_COLOR_OFFSET   24
2575
#define HE_OPERATION_BSS_COLOR_MAX    64
2576
2577
/**
2578
 * enum he_reg_info_6ghz_ap_type - Allowed Access Point types for 6 GHz Band
2579
 *
2580
 * IEEE Std 802.11-2024, Table E-12 (Regulatory Info subfield interpretation by
2581
 * non-AP STAs with dot11ExtendedRegInfoSupport not set to true)
2582
 */
2583
enum he_reg_info_6ghz_ap_type {
2584
  HE_REG_INFO_6GHZ_AP_TYPE_INDOOR         = 0,
2585
  HE_REG_INFO_6GHZ_AP_TYPE_SP   = 1,
2586
  HE_REG_INFO_6GHZ_AP_TYPE_VLP    = 2,
2587
  HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_ENABLED = 3,
2588
  HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP  = 4,
2589
  HE_REG_INFO_6GHZ_AP_TYPE_MAX = HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP,
2590
};
2591
2592
static inline bool he_reg_is_indoor(enum he_reg_info_6ghz_ap_type type)
2593
0
{
2594
0
  return type == HE_REG_INFO_6GHZ_AP_TYPE_INDOOR ||
2595
0
    type == HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP;
2596
0
}
Unexecuted instantiation: common.c:he_reg_is_indoor
Unexecuted instantiation: sae.c:he_reg_is_indoor
Unexecuted instantiation: wpa_common.c:he_reg_is_indoor
Unexecuted instantiation: ieee802_11_common.c:he_reg_is_indoor
Unexecuted instantiation: comeback_token.c:he_reg_is_indoor
Unexecuted instantiation: pasn_common.c:he_reg_is_indoor
Unexecuted instantiation: pasn_responder.c:he_reg_is_indoor
Unexecuted instantiation: pasn-resp.c:he_reg_is_indoor
Unexecuted instantiation: p2p.c:he_reg_is_indoor
Unexecuted instantiation: p2p_dev_disc.c:he_reg_is_indoor
Unexecuted instantiation: p2p_go_neg.c:he_reg_is_indoor
Unexecuted instantiation: p2p_group.c:he_reg_is_indoor
Unexecuted instantiation: p2p_invitation.c:he_reg_is_indoor
Unexecuted instantiation: p2p_parse.c:he_reg_is_indoor
Unexecuted instantiation: p2p_pd.c:he_reg_is_indoor
Unexecuted instantiation: p2p_sd.c:he_reg_is_indoor
Unexecuted instantiation: p2p_utils.c:he_reg_is_indoor
Unexecuted instantiation: p2p_build.c:he_reg_is_indoor
Unexecuted instantiation: wps_attr_build.c:he_reg_is_indoor
Unexecuted instantiation: wps_attr_parse.c:he_reg_is_indoor
Unexecuted instantiation: wps_common.c:he_reg_is_indoor
Unexecuted instantiation: wps_dev_attr.c:he_reg_is_indoor
Unexecuted instantiation: wps_registrar.c:he_reg_is_indoor
Unexecuted instantiation: ndef.c:he_reg_is_indoor
Unexecuted instantiation: wps_attr_process.c:he_reg_is_indoor
Unexecuted instantiation: gas.c:he_reg_is_indoor
Unexecuted instantiation: wpa_ie.c:he_reg_is_indoor
Unexecuted instantiation: pmksa_cache.c:he_reg_is_indoor
Unexecuted instantiation: pasn_initiator.c:he_reg_is_indoor
Unexecuted instantiation: pasn-init.c:he_reg_is_indoor
Unexecuted instantiation: driver_common.c:he_reg_is_indoor
Unexecuted instantiation: ap-mgmt.c:he_reg_is_indoor
Unexecuted instantiation: ap_config.c:he_reg_is_indoor
Unexecuted instantiation: ap_list.c:he_reg_is_indoor
Unexecuted instantiation: beacon.c:he_reg_is_indoor
Unexecuted instantiation: dfs.c:he_reg_is_indoor
Unexecuted instantiation: hostapd.c:he_reg_is_indoor
Unexecuted instantiation: hs20.c:he_reg_is_indoor
Unexecuted instantiation: hw_features.c:he_reg_is_indoor
Unexecuted instantiation: ieee802_11_auth.c:he_reg_is_indoor
Unexecuted instantiation: ieee802_11.c:he_reg_is_indoor
Unexecuted instantiation: ieee802_11_ht.c:he_reg_is_indoor
Unexecuted instantiation: ieee802_11_shared.c:he_reg_is_indoor
Unexecuted instantiation: ieee802_1x.c:he_reg_is_indoor
Unexecuted instantiation: neighbor_db.c:he_reg_is_indoor
Unexecuted instantiation: ndisc_snoop.c:he_reg_is_indoor
Unexecuted instantiation: pmksa_cache_auth.c:he_reg_is_indoor
Unexecuted instantiation: rrm.c:he_reg_is_indoor
Unexecuted instantiation: sta_info.c:he_reg_is_indoor
Unexecuted instantiation: utils.c:he_reg_is_indoor
Unexecuted instantiation: vlan_init.c:he_reg_is_indoor
Unexecuted instantiation: wmm.c:he_reg_is_indoor
Unexecuted instantiation: wpa_auth.c:he_reg_is_indoor
Unexecuted instantiation: wpa_auth_ft.c:he_reg_is_indoor
Unexecuted instantiation: wpa_auth_glue.c:he_reg_is_indoor
Unexecuted instantiation: wpa_auth_ie.c:he_reg_is_indoor
Unexecuted instantiation: wps_hostapd.c:he_reg_is_indoor
Unexecuted instantiation: x_snoop.c:he_reg_is_indoor
Unexecuted instantiation: accounting.c:he_reg_is_indoor
Unexecuted instantiation: ap_drv_ops.c:he_reg_is_indoor
Unexecuted instantiation: ap_mlme.c:he_reg_is_indoor
Unexecuted instantiation: airtime_policy.c:he_reg_is_indoor
Unexecuted instantiation: authsrv.c:he_reg_is_indoor
Unexecuted instantiation: bss_load.c:he_reg_is_indoor
Unexecuted instantiation: dhcp_snoop.c:he_reg_is_indoor
Unexecuted instantiation: eap_user_db.c:he_reg_is_indoor
Unexecuted instantiation: eth_p_oui.c:he_reg_is_indoor
Unexecuted instantiation: gas_serv.c:he_reg_is_indoor
Unexecuted instantiation: tkip_countermeasures.c:he_reg_is_indoor
Unexecuted instantiation: hw_features_common.c:he_reg_is_indoor
Unexecuted instantiation: wps.c:he_reg_is_indoor
Unexecuted instantiation: wps_enrollee.c:he_reg_is_indoor
Unexecuted instantiation: eapol-key-auth.c:he_reg_is_indoor
Unexecuted instantiation: eapol-key-supp.c:he_reg_is_indoor
Unexecuted instantiation: wpa.c:he_reg_is_indoor
Unexecuted instantiation: wpa_ft.c:he_reg_is_indoor
Unexecuted instantiation: tdls.c:he_reg_is_indoor
Unexecuted instantiation: preauth.c:he_reg_is_indoor
Unexecuted instantiation: bssid_ignore.c:he_reg_is_indoor
Unexecuted instantiation: bss.c:he_reg_is_indoor
Unexecuted instantiation: config.c:he_reg_is_indoor
Unexecuted instantiation: config_file.c:he_reg_is_indoor
Unexecuted instantiation: eap_register.c:he_reg_is_indoor
Unexecuted instantiation: events.c:he_reg_is_indoor
Unexecuted instantiation: gas_query.c:he_reg_is_indoor
Unexecuted instantiation: hs20_supplicant.c:he_reg_is_indoor
Unexecuted instantiation: interworking.c:he_reg_is_indoor
Unexecuted instantiation: notify.c:he_reg_is_indoor
Unexecuted instantiation: offchannel.c:he_reg_is_indoor
Unexecuted instantiation: op_classes.c:he_reg_is_indoor
Unexecuted instantiation: robust_av.c:he_reg_is_indoor
Unexecuted instantiation: scan.c:he_reg_is_indoor
Unexecuted instantiation: wmm_ac.c:he_reg_is_indoor
Unexecuted instantiation: wnm_sta.c:he_reg_is_indoor
Unexecuted instantiation: wpa_supplicant.c:he_reg_is_indoor
Unexecuted instantiation: wpas_glue.c:he_reg_is_indoor
Unexecuted instantiation: drivers.c:he_reg_is_indoor
Unexecuted instantiation: wnm.c:he_reg_is_indoor
Unexecuted instantiation: dpp.c:he_reg_is_indoor
Unexecuted instantiation: dpp_auth.c:he_reg_is_indoor
Unexecuted instantiation: dpp_crypto.c:he_reg_is_indoor
Unexecuted instantiation: dpp_tcp.c:he_reg_is_indoor
Unexecuted instantiation: eapol-supp.c:he_reg_is_indoor
2597
2598
static inline bool he_reg_is_sp(enum he_reg_info_6ghz_ap_type type)
2599
0
{
2600
0
  return type == HE_REG_INFO_6GHZ_AP_TYPE_SP ||
2601
0
    type == HE_REG_INFO_6GHZ_AP_TYPE_INDOOR_SP;
2602
0
}
Unexecuted instantiation: common.c:he_reg_is_sp
Unexecuted instantiation: sae.c:he_reg_is_sp
Unexecuted instantiation: wpa_common.c:he_reg_is_sp
Unexecuted instantiation: ieee802_11_common.c:he_reg_is_sp
Unexecuted instantiation: comeback_token.c:he_reg_is_sp
Unexecuted instantiation: pasn_common.c:he_reg_is_sp
Unexecuted instantiation: pasn_responder.c:he_reg_is_sp
Unexecuted instantiation: pasn-resp.c:he_reg_is_sp
Unexecuted instantiation: p2p.c:he_reg_is_sp
Unexecuted instantiation: p2p_dev_disc.c:he_reg_is_sp
Unexecuted instantiation: p2p_go_neg.c:he_reg_is_sp
Unexecuted instantiation: p2p_group.c:he_reg_is_sp
Unexecuted instantiation: p2p_invitation.c:he_reg_is_sp
Unexecuted instantiation: p2p_parse.c:he_reg_is_sp
Unexecuted instantiation: p2p_pd.c:he_reg_is_sp
Unexecuted instantiation: p2p_sd.c:he_reg_is_sp
Unexecuted instantiation: p2p_utils.c:he_reg_is_sp
Unexecuted instantiation: p2p_build.c:he_reg_is_sp
Unexecuted instantiation: wps_attr_build.c:he_reg_is_sp
Unexecuted instantiation: wps_attr_parse.c:he_reg_is_sp
Unexecuted instantiation: wps_common.c:he_reg_is_sp
Unexecuted instantiation: wps_dev_attr.c:he_reg_is_sp
Unexecuted instantiation: wps_registrar.c:he_reg_is_sp
Unexecuted instantiation: ndef.c:he_reg_is_sp
Unexecuted instantiation: wps_attr_process.c:he_reg_is_sp
Unexecuted instantiation: gas.c:he_reg_is_sp
Unexecuted instantiation: wpa_ie.c:he_reg_is_sp
Unexecuted instantiation: pmksa_cache.c:he_reg_is_sp
Unexecuted instantiation: pasn_initiator.c:he_reg_is_sp
Unexecuted instantiation: pasn-init.c:he_reg_is_sp
Unexecuted instantiation: driver_common.c:he_reg_is_sp
Unexecuted instantiation: ap-mgmt.c:he_reg_is_sp
Unexecuted instantiation: ap_config.c:he_reg_is_sp
Unexecuted instantiation: ap_list.c:he_reg_is_sp
Unexecuted instantiation: beacon.c:he_reg_is_sp
Unexecuted instantiation: dfs.c:he_reg_is_sp
Unexecuted instantiation: hostapd.c:he_reg_is_sp
Unexecuted instantiation: hs20.c:he_reg_is_sp
Unexecuted instantiation: hw_features.c:he_reg_is_sp
Unexecuted instantiation: ieee802_11_auth.c:he_reg_is_sp
Unexecuted instantiation: ieee802_11.c:he_reg_is_sp
Unexecuted instantiation: ieee802_11_ht.c:he_reg_is_sp
Unexecuted instantiation: ieee802_11_shared.c:he_reg_is_sp
Unexecuted instantiation: ieee802_1x.c:he_reg_is_sp
Unexecuted instantiation: neighbor_db.c:he_reg_is_sp
Unexecuted instantiation: ndisc_snoop.c:he_reg_is_sp
Unexecuted instantiation: pmksa_cache_auth.c:he_reg_is_sp
Unexecuted instantiation: rrm.c:he_reg_is_sp
Unexecuted instantiation: sta_info.c:he_reg_is_sp
Unexecuted instantiation: utils.c:he_reg_is_sp
Unexecuted instantiation: vlan_init.c:he_reg_is_sp
Unexecuted instantiation: wmm.c:he_reg_is_sp
Unexecuted instantiation: wpa_auth.c:he_reg_is_sp
Unexecuted instantiation: wpa_auth_ft.c:he_reg_is_sp
Unexecuted instantiation: wpa_auth_glue.c:he_reg_is_sp
Unexecuted instantiation: wpa_auth_ie.c:he_reg_is_sp
Unexecuted instantiation: wps_hostapd.c:he_reg_is_sp
Unexecuted instantiation: x_snoop.c:he_reg_is_sp
Unexecuted instantiation: accounting.c:he_reg_is_sp
Unexecuted instantiation: ap_drv_ops.c:he_reg_is_sp
Unexecuted instantiation: ap_mlme.c:he_reg_is_sp
Unexecuted instantiation: airtime_policy.c:he_reg_is_sp
Unexecuted instantiation: authsrv.c:he_reg_is_sp
Unexecuted instantiation: bss_load.c:he_reg_is_sp
Unexecuted instantiation: dhcp_snoop.c:he_reg_is_sp
Unexecuted instantiation: eap_user_db.c:he_reg_is_sp
Unexecuted instantiation: eth_p_oui.c:he_reg_is_sp
Unexecuted instantiation: gas_serv.c:he_reg_is_sp
Unexecuted instantiation: tkip_countermeasures.c:he_reg_is_sp
Unexecuted instantiation: hw_features_common.c:he_reg_is_sp
Unexecuted instantiation: wps.c:he_reg_is_sp
Unexecuted instantiation: wps_enrollee.c:he_reg_is_sp
Unexecuted instantiation: eapol-key-auth.c:he_reg_is_sp
Unexecuted instantiation: eapol-key-supp.c:he_reg_is_sp
Unexecuted instantiation: wpa.c:he_reg_is_sp
Unexecuted instantiation: wpa_ft.c:he_reg_is_sp
Unexecuted instantiation: tdls.c:he_reg_is_sp
Unexecuted instantiation: preauth.c:he_reg_is_sp
Unexecuted instantiation: bssid_ignore.c:he_reg_is_sp
Unexecuted instantiation: bss.c:he_reg_is_sp
Unexecuted instantiation: config.c:he_reg_is_sp
Unexecuted instantiation: config_file.c:he_reg_is_sp
Unexecuted instantiation: eap_register.c:he_reg_is_sp
Unexecuted instantiation: events.c:he_reg_is_sp
Unexecuted instantiation: gas_query.c:he_reg_is_sp
Unexecuted instantiation: hs20_supplicant.c:he_reg_is_sp
Unexecuted instantiation: interworking.c:he_reg_is_sp
Unexecuted instantiation: notify.c:he_reg_is_sp
Unexecuted instantiation: offchannel.c:he_reg_is_sp
Unexecuted instantiation: op_classes.c:he_reg_is_sp
Unexecuted instantiation: robust_av.c:he_reg_is_sp
Unexecuted instantiation: scan.c:he_reg_is_sp
Unexecuted instantiation: wmm_ac.c:he_reg_is_sp
Unexecuted instantiation: wnm_sta.c:he_reg_is_sp
Unexecuted instantiation: wpa_supplicant.c:he_reg_is_sp
Unexecuted instantiation: wpas_glue.c:he_reg_is_sp
Unexecuted instantiation: drivers.c:he_reg_is_sp
Unexecuted instantiation: wnm.c:he_reg_is_sp
Unexecuted instantiation: dpp.c:he_reg_is_sp
Unexecuted instantiation: dpp_auth.c:he_reg_is_sp
Unexecuted instantiation: dpp_crypto.c:he_reg_is_sp
Unexecuted instantiation: dpp_tcp.c:he_reg_is_sp
Unexecuted instantiation: eapol-supp.c:he_reg_is_sp
2603
2604
/* Spatial Reuse defines */
2605
#define SPATIAL_REUSE_SRP_DISALLOWED    BIT(0)
2606
#define SPATIAL_REUSE_NON_SRG_OBSS_PD_SR_DISALLOWED BIT(1)
2607
#define SPATIAL_REUSE_NON_SRG_OFFSET_PRESENT  BIT(2)
2608
#define SPATIAL_REUSE_SRG_INFORMATION_PRESENT BIT(3)
2609
#define SPATIAL_REUSE_HESIGA_SR_VAL15_ALLOWED BIT(4)
2610
2611
struct ieee80211_he_mu_edca_parameter_set {
2612
  u8 he_qos_info;
2613
  u8 he_mu_ac_be_param[3];
2614
  u8 he_mu_ac_bk_param[3];
2615
  u8 he_mu_ac_vi_param[3];
2616
  u8 he_mu_ac_vo_param[3];
2617
} STRUCT_PACKED;
2618
2619
/* HE MU AC parameter record field format */
2620
/* ACI/AIFSN */
2621
#define HE_MU_AC_PARAM_ACI_IDX 0
2622
#define HE_MU_AC_PARAM_AIFSN ((u8) (BIT(0) | BIT(1) | BIT(2) | BIT(3)))
2623
#define HE_MU_AC_PARAM_ACM ((u8) BIT(4))
2624
#define HE_MU_AC_PARAM_ACI ((u8) (BIT(5) | BIT(6)))
2625
/* B7: Reserved */
2626
2627
/* ECWmin/ECWmax */
2628
#define HE_MU_AC_PARAM_ECW_IDX 1
2629
#define HE_MU_AC_PARAM_ECWMIN ((u8) (BIT(0) | BIT(1) | BIT(2) | BIT(3)))
2630
#define HE_MU_AC_PARAM_ECWMAX ((u8) (BIT(4) | BIT(5) | BIT(6) | BIT(7)))
2631
2632
/* MU EDCA Timer */
2633
#define HE_MU_AC_PARAM_TIMER_IDX 2
2634
2635
/* HE QoS Info field */
2636
#define HE_QOS_INFO_EDCA_PARAM_SET_COUNT ((u8) (BIT(0) | BIT(1) | \
2637
            BIT(2) | BIT(3)))
2638
#define HE_QOS_INFO_Q_ACK ((u8) (BIT(4)))
2639
#define HE_QOS_INFO_QUEUE_REQUEST ((u8) (BIT(5)))
2640
#define HE_QOS_INFO_TXOP_REQUEST ((u8) (BIT(6)))
2641
/* B7: Reserved if sent by an AP; More Data Ack if sent by a non-AP STA */
2642
#define HE_QOS_INFO_MORE_DATA_ACK ((u8) (BIT(7)))
2643
2644
/*
2645
 * IEEE Std 802.11-2020 and IEEE Std 802.11ax-2021
2646
 * 9.4.2.170 Reduced Neighbor Report element
2647
 */
2648
0
#define RNR_HEADER_LEN                              2
2649
0
#define RNR_TBTT_HEADER_LEN                         4
2650
0
#define RNR_TBTT_INFO_HDR_TYPE_MSK                  0x03
2651
#define RNR_TBTT_INFO_HDR_FILTERED_AP               0x04
2652
#define RNR_TBTT_INFO_HDR_CNT_MSK                   0xf0
2653
0
#define RNR_TBTT_INFO_COUNT(x)                      (((x) & 0xf) << 4)
2654
0
#define RNR_TBTT_INFO_COUNT_MAX                     16
2655
0
#define RNR_TBTT_INFO_COUNT_VAL(x)                  (((x) & 0xf0) >> 4)
2656
0
#define RNR_TBTT_INFO_LEN                           13
2657
0
#define RNR_TBTT_INFO_MLD_LEN                       16
2658
0
#define RNR_NEIGHBOR_AP_OFFSET_UNKNOWN              255
2659
/* Figure 9-632a - BSS Parameters subfield format */
2660
#define RNR_BSS_PARAM_OCT_RECOMMENDED               BIT(0)
2661
0
#define RNR_BSS_PARAM_SAME_SSID                     BIT(1)
2662
0
#define RNR_BSS_PARAM_MULTIPLE_BSSID                BIT(2)
2663
0
#define RNR_BSS_PARAM_TRANSMITTED_BSSID             BIT(3)
2664
#define RNR_BSS_PARAM_MEMBER_CO_LOCATED_ESS         BIT(4)
2665
0
#define RNR_BSS_PARAM_UNSOLIC_PROBE_RESP_ACTIVE     BIT(5)
2666
0
#define RNR_BSS_PARAM_CO_LOCATED                    BIT(6)
2667
/* Maximum transmit power in Y/2 dBm (-127..126); 127 indicates no maximum
2668
 * transmit power is specified for the corresponding 20 MHz channel. */
2669
0
#define RNR_20_MHZ_PSD_MAX_TXPOWER                  127
2670
2671
/* IEEE P802.11be/D5.0, Figure 9-704c - MLD Parameters subfield format */
2672
/* B0..B7: AP MLD ID */
2673
/* B8..B11: Link ID */
2674
/* B12..B19: BSS Parameters Change Count */
2675
/* B20: All Updates Included */
2676
#define RNR_TBTT_INFO_MLD_PARAM2_ALL_UPDATE_INC 0x10
2677
/* B21: Disabled Link Indication */
2678
0
#define RNR_TBTT_INFO_MLD_PARAM2_LINK_DISABLED  0x20
2679
2680
/* IEEE P802.11be/D2.3, 9.4.2.311 - EHT Operation element */
2681
2682
/* Figure 9-1002b: EHT Operation Parameters field subfields */
2683
#define EHT_OPER_INFO_PRESENT                          BIT(0)
2684
0
#define EHT_OPER_DISABLED_SUBCHAN_BITMAP_PRESENT       BIT(1)
2685
#define EHT_OPER_DEFAULT_PE_DURATION                   BIT(2)
2686
#define EHT_OPER_GROUP_ADDR_BU_INDICATION_LIMIT        BIT(3)
2687
#define EHT_OPER_GROUP_ADDR_BU_INDICATION_EXPONENT     (BIT(4) | BIT(5))
2688
#define EHT_OPER_DISABLED_SUBCHAN_BITMAP_SIZE          2
2689
2690
/* Control subfield: Channel Width subfield; see Table 9-401b */
2691
#define EHT_OPER_CHANNEL_WIDTH_20MHZ                   0
2692
#define EHT_OPER_CHANNEL_WIDTH_40MHZ                   1
2693
#define EHT_OPER_CHANNEL_WIDTH_80MHZ                   2
2694
#define EHT_OPER_CHANNEL_WIDTH_160MHZ                  3
2695
#define EHT_OPER_CHANNEL_WIDTH_320MHZ                  4
2696
2697
/* Figure 9-1002c: EHT Operation Information field format */
2698
struct ieee80211_eht_oper_info {
2699
  u8 control; /* B0..B2: Channel Width */
2700
  u8 ccfs0;
2701
  u8 ccfs1;
2702
  le16 disabled_chan_bitmap; /* 0 or 2 octets */
2703
} STRUCT_PACKED;
2704
2705
/* Figure 9-1002a: EHT Operation element format */
2706
struct ieee80211_eht_operation {
2707
  u8 oper_params; /* EHT Operation Parameters: EHT_OPER_* bits */
2708
  u8 basic_eht_mcs_nss_set[4];
2709
  struct ieee80211_eht_oper_info oper_info; /* 0 or 3 or 5 octets */
2710
} STRUCT_PACKED;
2711
2712
0
#define IEEE80211_EHT_OP_MIN_LEN (1 + 4)
2713
2714
/* IEEE P802.11be/D1.5, 9.4.2.313 - EHT Capabilities element */
2715
2716
/* Figure 9-1002af: EHT MAC Capabilities Information field */
2717
#define EHT_MACCAP_EPCS_PRIO      BIT(0)
2718
#define EHT_MACCAP_OM_CONTROL     BIT(1)
2719
#define EHT_MACCAP_TRIGGERED_TXOP_MODE1   BIT(2)
2720
#define EHT_MACCAP_TRIGGERED_TXOP_MODE2   BIT(3)
2721
#define EHT_MACCAP_RESTRICTED_TWT   BIT(4)
2722
0
#define EHT_MACCAP_SCS_TRAFFIC_DESC   BIT(5)
2723
#define EHT_MACCAP_MAX_MPDU_LEN_MASK    (BIT(6) | BIT(7))
2724
#define EHT_MACCAP_MAX_MPDU_LEN_3895    0
2725
#define EHT_MACCAP_MAX_MPDU_LEN_7991    BIT(6)
2726
#define EHT_MACCAP_MAX_MPDU_LEN_11454   BIT(7)
2727
#define EHT_MACCAP_MAX_AMPDU_LEN_EXP_EXT  BIT(8)
2728
2729
/* Figure 9-1002ag: EHT PHY Capabilities Information field format
2730
 * _IDX indicates the octet index within the field */
2731
#define EHT_PHY_CAPAB_LEN     9
2732
2733
0
#define EHT_PHYCAP_320MHZ_IN_6GHZ_SUPPORT_IDX 0
2734
0
#define EHT_PHYCAP_320MHZ_IN_6GHZ_SUPPORT_MASK  ((u8) BIT(1))
2735
2736
#define EHT_PHYCAP_SU_BEAMFORMER_IDX    0
2737
#define EHT_PHYCAP_SU_BEAMFORMER    ((u8) BIT(5))
2738
#define EHT_PHYCAP_SU_BEAMFORMEE_IDX    0
2739
#define EHT_PHYCAP_SU_BEAMFORMEE    ((u8) BIT(6))
2740
2741
#define EHT_PHYCAP_PPE_THRESHOLD_PRESENT_IDX  5
2742
#define EHT_PHYCAP_PPE_THRESHOLD_PRESENT  ((u8) BIT(3))
2743
2744
#define EHT_PHYCAP_MU_BEAMFORMER_IDX    7
2745
#define EHT_PHYCAP_MU_BEAMFORMER_80MHZ    ((u8) BIT(4))
2746
#define EHT_PHYCAP_MU_BEAMFORMER_160MHZ   ((u8) BIT(5))
2747
#define EHT_PHYCAP_MU_BEAMFORMER_320MHZ   ((u8) BIT(6))
2748
#define EHT_PHYCAP_MU_BEAMFORMER_MASK (EHT_PHYCAP_MU_BEAMFORMER_80MHZ | \
2749
           EHT_PHYCAP_MU_BEAMFORMER_160MHZ | \
2750
           EHT_PHYCAP_MU_BEAMFORMER_320MHZ)
2751
2752
/* Figure 9-1002ah: Supported EHT-MCS and NSS Set field format */
2753
#define EHT_PHYCAP_MCS_NSS_LEN_20MHZ_ONLY 4
2754
#define EHT_PHYCAP_MCS_NSS_LEN_20MHZ_PLUS 3
2755
2756
#define EHT_MCS_NSS_CAPAB_LEN     9
2757
/*
2758
 * Figure 9-1002ak: EHT PPE Thresholds field format
2759
 * Maximum PPE threshold length: 62 octets
2760
 * NSS: 4 bits (maximum NSS: 16), RU index: 5 bits, each pair: 6 bits
2761
 * 4 + 5 + 5 * 16 * 6 = 489 bits, Padding: 7 bits
2762
 */
2763
#define EHT_PPE_THRESH_CAPAB_LEN    62
2764
2765
/* 9.4.2.313.5: EHT PPE Thresholds field */
2766
#define EHT_PPE_THRES_NSS_SHIFT     0
2767
#define EHT_PPE_THRES_NSS_MASK      ((u8) (BIT(0) | BIT(1) | \
2768
                   BIT(2) | BIT(3)))
2769
#define EHT_PPE_THRES_RU_INDEX_SHIFT    4
2770
#define EHT_PPE_THRES_RU_INDEX_MASK   ((u16) (BIT(4) | BIT(5) | \
2771
              BIT(6) | BIT(7) | \
2772
              BIT(8)))
2773
2774
#define EHT_NSS_MAX_STREAMS     8
2775
2776
/* Figure 9-1002ae: EHT Capabilities element format */
2777
struct ieee80211_eht_capabilities {
2778
  /* EHT MAC Capabilities Information */
2779
  le16 mac_cap;
2780
  /* EHT PHY Capabilities Information */
2781
  u8 phy_cap[EHT_PHY_CAPAB_LEN];
2782
  /* Supported EHT-MCS And NSS Set and EHT PPE thresholds (Optional) */
2783
  u8 optional[EHT_MCS_NSS_CAPAB_LEN + EHT_PPE_THRESH_CAPAB_LEN];
2784
} STRUCT_PACKED;
2785
2786
137k
#define IEEE80211_EHT_CAPAB_MIN_LEN (2 + 9)
2787
2788
/* IEEE P802.11be/D2.1, 9.4.2.312 - Multi-Link element */
2789
2790
/* Figure 9-1002f: Multi-Link Control field */
2791
32.5k
#define MULTI_LINK_CONTROL_TYPE_MASK      0x07
2792
#define MULTI_LINK_CONTROL_LEN        2
2793
2794
/* Table 9-401c: Mult-Link element Type subfield encoding */
2795
7.33k
#define MULTI_LINK_CONTROL_TYPE_BASIC     0
2796
13.2k
#define MULTI_LINK_CONTROL_TYPE_PROBE_REQ   1
2797
3.41k
#define MULTI_LINK_CONTROL_TYPE_RECONF      2
2798
3.13k
#define MULTI_LINK_CONTROL_TYPE_TDLS      3
2799
2.68k
#define MULTI_LINK_CONTROL_TYPE_PRIOR_ACCESS    4
2800
2801
/*
2802
 * IEEE P802.11be/D2.2, Table 9-401c: Optional subelement IDs for Link Info
2803
 * field of the Multi-Link element
2804
 */
2805
#define MULTI_LINK_SUB_ELEM_ID_PER_STA_PROFILE    0
2806
#define MULTI_LINK_SUB_ELEM_ID_VENDOR     221
2807
0
#define MULTI_LINK_SUB_ELEM_ID_FRAGMENT     254
2808
2809
/* IEEE P802.11be/D7.0, 9.4.2.322.2 - Basic Multi-Link element */
2810
2811
/* Figure 9-1074o: Presence Bitmap subfield of the Basic Multi-Link element */
2812
1.96k
#define BASIC_MULTI_LINK_CTRL_PRES_LINK_ID    0x0010
2813
0
#define BASIC_MULTI_LINK_CTRL_PRES_BSS_PARAM_CH_COUNT 0x0020
2814
0
#define BASIC_MULTI_LINK_CTRL_PRES_MSD_INFO   0x0040
2815
0
#define BASIC_MULTI_LINK_CTRL_PRES_EML_CAPA   0x0080
2816
0
#define BASIC_MULTI_LINK_CTRL_PRES_MLD_CAPA   0x0100
2817
0
#define BASIC_MULTI_LINK_CTRL_PRES_AP_MLD_ID    0x0200
2818
0
#define BASIC_MULTI_LINK_CTRL_PRES_EXT_MLD_CAP    0x0400
2819
2820
/*
2821
 * STA Control field definitions of Per-STA Profile subelement in Basic
2822
 * Multi-Link element as described in Figure 9-1002n: STA Control field format.
2823
 */
2824
#define BASIC_MLE_STA_CTRL_LEN        2
2825
0
#define BASIC_MLE_STA_CTRL_LINK_ID_MASK     0x000F
2826
#define BASIC_MLE_STA_CTRL_COMPLETE_PROFILE   0x0010
2827
#define BASIC_MLE_STA_CTRL_PRES_STA_MAC     0x0020
2828
#define BASIC_MLE_STA_CTRL_PRES_BEACON_INT    0x0040
2829
#define BASIC_MLE_STA_CTRL_PRES_TSF_OFFSET    0x0080
2830
#define BASIC_MLE_STA_CTRL_PRES_DTIM_INFO   0x0100
2831
#define BASIC_MLE_STA_CTRL_PRES_NSTR_LINK_PAIR    0x0200
2832
#define BASIC_MLE_STA_CTRL_NSTR_BITMAP      0x0400
2833
#define BASIC_MLE_STA_CTRL_PRES_BSS_PARAM_COUNT   0x0800
2834
2835
#define BASIC_MLE_STA_PROF_STA_MAC_IDX      3
2836
2837
/* IEEE P802.11be/D2.2, 9.4.2.312.2.3 - Common Info field of the Basic
2838
 * Multi-Link element */
2839
struct eht_ml_basic_common_info {
2840
  u8 len;
2841
  u8 mld_addr[ETH_ALEN];
2842
2843
  /*
2844
   * Followed by optional fields based on the multi link basic presence
2845
   * bitmap
2846
   *
2847
   * Link ID Info: 1 octet
2848
   * BSS Parameters Change Count: 1 octet
2849
   * Medium Synchronization Delay Information: 2 octets
2850
   * EML Capabilities: 2 octets
2851
   * MLD Capabilities and Operations: 2 octets
2852
   * Extended MLD Capabilities And Operations: 2 octets
2853
   * AP MLD ID: 1 octet
2854
   */
2855
  u8 variable[];
2856
} STRUCT_PACKED;
2857
2858
372
#define EHT_ML_LINK_ID_MSK   0x0f
2859
2860
#define EHT_ML_MEDIUM_SYNC_DELAY_DURATION   0x00ff
2861
#define EHT_ML_MEDIUM_SYNC_DELAY_OFDM_ED_TH 0x0f00
2862
#define EHT_ML_MEDIUM_SYNC_DELAY_MAX_TXOP   0xf000
2863
2864
#define EHT_ML_EML_CAPA_EMLSR_SUPP               0x0001
2865
#define EHT_ML_EML_CAPA_EMLSR_PADDING_DELAY_MASK 0x000e
2866
#define EHT_ML_EML_CAPA_EMLSR_TRANS_DELAY_MASK   0x0070
2867
#define EHT_ML_EML_CAPA_EMLMR_SUPP               0x0080
2868
#define EHT_ML_EML_CAPA_TRANSITION_TIMEOUT_MASK  0x7800
2869
0
#define EHT_ML_EML_CAPA_RESERVED                 0x8780
2870
2871
#define EHT_ML_MLD_CAPA_MAX_NUM_SIM_LINKS_MASK        0x000f
2872
#define EHT_ML_MLD_CAPA_SRS_SUPP                      0x0010
2873
#define EHT_ML_MLD_CAPA_TID_TO_LINK_MAP_ALL_TO_ALL    0x0020
2874
#define EHT_ML_MLD_CAPA_TID_TO_LINK_MAP_ALL_TO_ONE    0x0040
2875
#define EHT_ML_MLD_CAPA_TID_TO_LINK_MAP_NEG_SUPP_MSK  0x0060
2876
#define EHT_ML_MLD_CAPA_AP_MLD_TYPE_IND_MASK          0x0080
2877
#define EHT_ML_MLD_CAPA_FREQ_SEP_FOR_STR_MASK         0x0f80
2878
#define EHT_ML_MLD_CAPA_AAR_SUPP                      0x1000
2879
#define EHT_ML_MLD_CAPA_LINK_RECONF_OP_SUPPORT        0x2000
2880
#define EHT_ML_MLD_CAPA_ALIGNED_TWT_SUPPORT           0x4000
2881
0
#define EHT_ML_MLD_CAPA_RESERVED                      0x8000
2882
2883
0
#define EHT_ML_EXT_MLD_CAPA_OP_PARAM_UPDATE           0x0001
2884
#define EHT_ML_EXT_MLD_CAPA_OP_RECO_MAX_LINKS_MASK    0x001e
2885
0
#define EHT_ML_EXT_MLD_CAPA_NSTR_UPDATE               0x0020
2886
0
#define EHT_ML_EXT_MLD_CAPA_EMLSR_ENA_ONE_LINK        0x0040
2887
#define EHT_ML_EXT_MLD_CAPA_BTM_MLD_RECO_MULTI_AP     0x0080
2888
2889
0
#define EHT_PER_STA_CTRL_LINK_ID_MSK                  0x000f
2890
0
#define EHT_PER_STA_CTRL_COMPLETE_PROFILE_MSK         0x0010
2891
0
#define EHT_PER_STA_CTRL_MAC_ADDR_PRESENT_MSK         0x0020
2892
0
#define EHT_PER_STA_CTRL_BEACON_INTERVAL_PRESENT_MSK  0x0040
2893
0
#define EHT_PER_STA_CTRL_TSF_OFFSET_PRESENT_MSK       0x0080
2894
0
#define EHT_PER_STA_CTRL_DTIM_INFO_PRESENT_MSK        0x0100
2895
0
#define EHT_PER_STA_CTRL_NSTR_LINK_PAIR_PRESENT_MSK   0x0200
2896
0
#define EHT_PER_STA_CTRL_NSTR_BM_SIZE_MSK             0x0400
2897
0
#define EHT_PER_STA_CTRL_BSS_PARAM_CNT_PRESENT_MSK    0x0800
2898
2899
/* IEEE P802.11be/D2.0, 9.4.2.312.2.4 - Per-STA Profile subelement format */
2900
struct ieee80211_eht_per_sta_profile {
2901
  le16 sta_control;
2902
2903
  /* Followed by STA Info and STA Profile fields */
2904
  u8 variable[];
2905
} STRUCT_PACKED;
2906
2907
/* IEEE P802.11be/D4.0, 9.4.2.312.3 - Probe Request Multi-Link element
2908
 * Presence Bitmap field is B4..B15 of the Multi-Link Control field, i.e.,
2909
 * B0 in the presence bitmap is B4 in the control field. */
2910
2911
0
#define EHT_ML_PRES_BM_PROBE_REQ_AP_MLD_ID 0x0010
2912
2913
struct eht_ml_probe_req_common_info {
2914
  u8 len;
2915
2916
  /*
2917
   * Followed by optional fields based on the multi link basic presence
2918
   * bitmap
2919
   *
2920
   * AP MLD ID: 1 octet
2921
   */
2922
  u8 variable[];
2923
} STRUCT_PACKED;
2924
2925
/* IEEE P802.11be/D4.0, 9.4.2.312.4 - Reconfiguration Multi-Link element */
2926
2927
0
#define RECONF_MULTI_LINK_CTRL_PRES_MLD_MAC_ADDR   0x0001
2928
#define RECONF_MULTI_LINK_CTRL_PRES_EML_CAPA       0x0002
2929
#define RECONF_MULTI_LINK_CTRL_PRES_MLD_CAPA       0x0004
2930
#define RECONF_MULTI_LINK_CTRL_PRES_EXT_MLD_CAP    0x0008
2931
2932
233
#define EHT_PER_STA_RECONF_CTRL_LINK_ID_MSK        0x000f
2933
#define EHT_PER_STA_RECONF_CTRL_COMPLETE_PROFILE   0x0010
2934
#define EHT_PER_STA_RECONF_CTRL_MAC_ADDR           0x0020
2935
#define EHT_PER_STA_RECONF_CTRL_AP_REMOVAL_TIMER   0x0040
2936
#define EHT_PER_STA_RECONF_CTRL_OP_UPDATE_TYPE_MSK 0x0780
2937
#define EHT_PER_STA_RECONF_CTRL_OP_PARAMS          0x0800
2938
#define EHT_PER_STA_RECONF_CTRL_NSTR_BITMAP_SIZE   0x1000
2939
#define EHT_PER_STA_RECONF_CTRL_NSTR_INDICATION    0x2000
2940
2941
#define EHT_PER_STA_RECONF_CTRL_OP_UPDATE_TYPE_VAL(x) ((x) >> 7)
2942
2943
/* IEEE P802.11be/D7.0, Figure 9-1074ad - Common Info field format of the
2944
 * Reconfiguration Multi-Link element */
2945
struct eht_ml_reconf_common_info {
2946
  u8 len;
2947
2948
  /*
2949
   * Followed by optional fields based on the multi link reconf presence
2950
   * bitmap
2951
   *
2952
   * MLD MAC Address: 6 octets
2953
   * EML Capabilities: 2 octets
2954
   * MLD Capabilities and Operations: 2 octets
2955
   * Extended MLD Capabilities and Operations: 2 octets
2956
   */
2957
  u8 variable[];
2958
} STRUCT_PACKED;
2959
2960
2961
/* IEEE P802.11be/D7.0, Table 9-417p - Reconfiguration Operation Type subfield
2962
 * encoding */
2963
enum ieee80211_eht_reconf_mle_op_type {
2964
  EHT_RECONF_TYPE_AP_REMOVAL = 0,
2965
  EHT_RECONF_TYPE_OP_PARAM_UPDATE = 1,
2966
  EHT_RECONF_TYPE_ADD_LINK = 2,
2967
  EHT_RECONF_TYPE_DELETE_LINK = 3,
2968
  EHT_RECONF_TYPE_NSTR_STATUS_UPDATE = 4,
2969
};
2970
2971
/* IEEE P802.11be/D7.0, Figure 9-1074ag — STA Info field format for the
2972
 * Reconfiguration Multi-Link element */
2973
struct eht_ml_reconf_sta_info {
2974
  u8 len;
2975
2976
  /* Followed by optional fields based on STA control presence bitmap.
2977
   *
2978
   * STA MAC Address: 6 octets
2979
   * AP Removal Timer: 2 octets
2980
   * Operation Parameters: 3 octets
2981
   * NSTR Indication Bitmap: 1 or 2 octets
2982
   */
2983
  u8 variable[];
2984
} STRUCT_PACKED;
2985
2986
/* IEEE P802.11be/D2.0, 9.4.2.312.1 - Multi-Link element / General */
2987
2988
struct ieee80211_eht_ml {
2989
  le16 ml_control;
2990
2991
  /* Followed by Common Info and Link Info fields */
2992
  u8 variable[];
2993
} STRUCT_PACKED;
2994
2995
/* Table 9-401c - Optional subelement IDs for Link Info field of the
2996
 * Multi-Link element */
2997
enum ieee80211_eht_ml_sub_elem {
2998
  EHT_ML_SUB_ELEM_PER_STA_PROFILE = 0,
2999
  EHT_ML_SUB_ELEM_VENDOR = 221,
3000
  EHT_ML_SUB_ELEM_FRAGMENT = 254,
3001
};
3002
3003
/* IEEE P802.11be/D7.0, 9.4.2.329 (Bandwidth Indication element) defines the
3004
 * Bandwidth Indication Information field to have the same definition as the
3005
 * EHT Operation Information field in the EHT Operation element.
3006
 */
3007
struct ieee80211_bw_ind_info {
3008
  u8 control; /* B0..B2: Channel Width */
3009
  u8 ccfs0;
3010
  u8 ccfs1;
3011
  le16 disabled_chan_bitmap; /* 0 or 2 octets */
3012
} STRUCT_PACKED;
3013
3014
/* Control subfield: Channel Width subfield; see Table 9-417e (Channel width,
3015
 * CCFS0, and CCFS1 subfields) in IEEE P802.11be/D7.0. */
3016
#define BW_IND_CHANNEL_WIDTH_20MHZ  EHT_OPER_CHANNEL_WIDTH_20MHZ
3017
#define BW_IND_CHANNEL_WIDTH_40MHZ  EHT_OPER_CHANNEL_WIDTH_40MHZ
3018
#define BW_IND_CHANNEL_WIDTH_80MHZ  EHT_OPER_CHANNEL_WIDTH_80MHZ
3019
#define BW_IND_CHANNEL_WIDTH_160MHZ EHT_OPER_CHANNEL_WIDTH_160MHZ
3020
#define BW_IND_CHANNEL_WIDTH_320MHZ EHT_OPER_CHANNEL_WIDTH_320MHZ
3021
3022
/* IEEE P802.11be/D7.0, 9.4.2.329 (Bandwidth Indication element) */
3023
struct ieee80211_bw_ind_element {
3024
  u8 bw_ind_params; /* Bandwidth Indication Parameters */
3025
  struct ieee80211_bw_ind_info bw_ind_info; /* 3 or 5 octets */
3026
} STRUCT_PACKED;
3027
3028
#define BW_IND_PARAMETER_DISABLED_SUBCHAN_BITMAP_PRESENT       BIT(1)
3029
3030
/* IEEE P802.11ay/D4.0, 9.4.2.251 - EDMG Operation element */
3031
0
#define EDMG_BSS_OPERATING_CHANNELS_OFFSET  6
3032
0
#define EDMG_OPERATING_CHANNEL_WIDTH_OFFSET 7
3033
3034
/* IEEE P802.11ay/D4.0, 29.3.4 - Channelization */
3035
enum edmg_channel {
3036
  EDMG_CHANNEL_9  = 9,
3037
  EDMG_CHANNEL_10 = 10,
3038
  EDMG_CHANNEL_11 = 11,
3039
  EDMG_CHANNEL_12 = 12,
3040
  EDMG_CHANNEL_13 = 13,
3041
};
3042
3043
/* Represent CB2 contiguous channels */
3044
0
#define EDMG_CHANNEL_9_SUBCHANNELS  (BIT(0) | BIT(1)) /* channels 1 and 2 */
3045
0
#define EDMG_CHANNEL_10_SUBCHANNELS (BIT(1) | BIT(2)) /* channels 2 and 3 */
3046
0
#define EDMG_CHANNEL_11_SUBCHANNELS (BIT(2) | BIT(3)) /* channels 3 and 4 */
3047
0
#define EDMG_CHANNEL_12_SUBCHANNELS (BIT(3) | BIT(4)) /* channels 4 and 5 */
3048
0
#define EDMG_CHANNEL_13_SUBCHANNELS (BIT(4) | BIT(5)) /* channels 5 and 6 */
3049
3050
/**
3051
 * enum edmg_bw_config - Allowed channel bandwidth configurations
3052
 * @EDMG_BW_CONFIG_4: 2.16 GHz
3053
 * @EDMG_BW_CONFIG_5: 2.16 GHz and 4.32 GHz
3054
 *
3055
 * IEEE P802.11ay/D4.0, 9.4.2.251 (EDMG Operation element),
3056
 * Table 13 (Channel BW Configuration subfield definition)
3057
 */
3058
enum edmg_bw_config {
3059
  EDMG_BW_CONFIG_4  = 4,
3060
  EDMG_BW_CONFIG_5  = 5,
3061
};
3062
3063
/* DPP Public Action frame identifiers - OUI_WFA */
3064
0
#define DPP_OUI_TYPE 0x1A
3065
3066
/* Robust AV streaming Action field values */
3067
enum robust_av_streaming_action {
3068
  ROBUST_AV_SCS_REQ = 0,
3069
  ROBUST_AV_SCS_RESP = 1,
3070
  ROBUST_AV_GROUP_MEMBERSHIP_REQ = 2,
3071
  ROBUST_AV_GROUP_MEMBERSHIP_RESP = 3,
3072
  ROBUST_AV_MSCS_REQ = 4,
3073
  ROBUST_AV_MSCS_RESP = 5,
3074
};
3075
3076
enum scs_request_type {
3077
  SCS_REQ_ADD = 0,
3078
  SCS_REQ_REMOVE = 1,
3079
  SCS_REQ_CHANGE = 2,
3080
};
3081
3082
/*
3083
 * IEEE P802.11be/D4.0, 9.4.2.316 QoS Characteristics element,
3084
 * Table 9-404s (Direction subfield encoding)
3085
 */
3086
enum scs_direction {
3087
  SCS_DIRECTION_UP = 0,
3088
  SCS_DIRECTION_DOWN = 1,
3089
  SCS_DIRECTION_DIRECT = 2,
3090
};
3091
3092
/*
3093
 * IEEE P802.11be/D4.0, 9.4.2.316 QoS Characteristics element,
3094
 * Figure 9-1001av (Control Info field format)
3095
 */
3096
0
#define EHT_QOS_CONTROL_INFO_DIRECTION_OFFSET   0
3097
0
#define EHT_QOS_CONTROL_INFO_TID_OFFSET     2
3098
0
#define EHT_QOS_CONTROL_INFO_USER_PRIORITY_OFFSET 6
3099
0
#define EHT_QOS_CONTROL_INFO_PRESENCE_MASK_OFFSET 9
3100
#define EHT_QOS_CONTROL_INFO_LINK_ID_OFFSET   25
3101
3102
/*
3103
 * IEEE P802.11be/D4.0, 9.4.2.316 QoS Characteristics element,
3104
 * Presence Bitmap Of Additional Parameters
3105
 */
3106
0
#define SCS_QOS_BIT_MAX_MSDU_SIZE     ((u16) BIT(0))
3107
0
#define SCS_QOS_BIT_SERVICE_START_TIME      ((u16) BIT(1))
3108
0
#define SCS_QOS_BIT_SERVICE_START_TIME_LINKID   ((u16) BIT(2))
3109
0
#define SCS_QOS_BIT_MEAN_DATA_RATE      ((u16) BIT(3))
3110
0
#define SCS_QOS_BIT_DELAYED_BOUNDED_BURST_SIZE    ((u16) BIT(4))
3111
0
#define SCS_QOS_BIT_MSDU_LIFETIME     ((u16) BIT(5))
3112
0
#define SCS_QOS_BIT_MSDU_DELIVERY_INFO      ((u16) BIT(6))
3113
0
#define SCS_QOS_BIT_MEDIUM_TIME       ((u16) BIT(7))
3114
3115
/* Optional subelement IDs for MSCS Descriptor element */
3116
enum mscs_description_subelem {
3117
  MCSC_SUBELEM_STATUS = 1,
3118
};
3119
3120
/*
3121
 * IEEE Std 802.11-2020, 9.6.7.36 FILS Discovery frame format,
3122
 * Figure 9-900 - FILS Discovery Frame Control subfield format
3123
 */
3124
#define FD_FRAME_CTL_CAP_PRESENT      ((u16) BIT(5))
3125
#define FD_FRAME_CTL_SHORT_SSID_PRESENT     ((u16) BIT(6))
3126
#define FD_FRAME_CTL_AP_CSN_PRESENT     ((u16) BIT(7))
3127
#define FD_FRAME_CTL_ANO_PRESENT      ((u16) BIT(8))
3128
#define FD_FRAME_CTL_FREQ_SEG1_PRESENT      ((u16) BIT(9))
3129
#define FD_FRAME_CTL_PRI_CHAN_PRESENT     ((u16) BIT(10))
3130
#define FD_FRAME_CTL_RSN_INFO_PRESENT     ((u16) BIT(11))
3131
#define FD_FRAME_CTL_LENGTH_PRESENT     ((u16) BIT(12))
3132
#define FD_FRAME_CTL_MD_PRESENT       ((u16) BIT(13))
3133
3134
/*
3135
 * IEEE Std 802.11-2020, 9.6.7.36 FILS Discovery frame format,
3136
 * Figure 9-901 - FD Capability subfield format
3137
 */
3138
#define FD_CAP_ESS          BIT(0)
3139
#define FD_CAP_PRIVACY          BIT(1)
3140
#define FD_CAP_MULTI_BSSID_PRESENT      BIT(9)
3141
3142
#define FD_CAP_BSS_CHWIDTH_20       0
3143
#define FD_CAP_BSS_CHWIDTH_40       1
3144
#define FD_CAP_BSS_CHWIDTH_80       2
3145
#define FD_CAP_BSS_CHWIDTH_160_80_80      3
3146
#define FD_CAP_BSS_CHWIDTH_320        4
3147
#define FD_CAP_BSS_CHWIDTH_SHIFT      2
3148
3149
#define FD_CAP_NSS_1          0
3150
#define FD_CAP_NSS_2          1
3151
#define FD_CAP_NSS_3          2
3152
#define FD_CAP_NSS_4          3
3153
#define FD_CAP_NSS_5_8          4
3154
#define FD_CAP_NSS_SHIFT        5
3155
3156
#define FD_CAP_PHY_INDEX_HR_DSSS      0
3157
#define FD_CAP_PHY_INDEX_ERP_OFDM     1
3158
#define FD_CAP_PHY_INDEX_HT       2
3159
#define FD_CAP_PHY_INDEX_VHT        3
3160
#define FD_CAP_PHY_INDEX_HE       4 /* P802.11ax */
3161
#define FD_CAP_PHY_INDEX_EHT        5 /* P802.11be */
3162
#define FD_CAP_PHY_INDEX_SHIFT        10
3163
3164
/*
3165
 * IEEE Std 802.11ax-2021, 26.17.2.3.2, AP behavior for fast passive scanning
3166
 */
3167
#define FD_MAX_INTERVAL_6GHZ                  20 /* TUs */
3168
3169
/* IEEE Std 802.11ax-2021, 26.17.3.5.1: AP needs to wait and see the collision
3170
 * persists for at least the minimum default timeout
3171
 * dot11BSSColorCollisionAPPeriod (50 seconds)
3172
 */
3173
#define DOT11BSS_COLOR_COLLISION_AP_PERIOD  50
3174
3175
/* Protected Vendor-specific QoS Management Action frame identifiers - WFA */
3176
0
#define QM_ACTION_VENDOR_TYPE 0x506f9a1a
3177
0
#define QM_ACTION_OUI_TYPE 0x1a
3178
3179
/* QoS Management Action frame OUI subtypes */
3180
0
#define QM_DSCP_POLICY_QUERY 0
3181
0
#define QM_DSCP_POLICY_REQ 1
3182
0
#define QM_DSCP_POLICY_RESP 2
3183
3184
/* QoS Management attributes */
3185
enum qm_attr_id {
3186
  QM_ATTR_PORT_RANGE = 1,
3187
  QM_ATTR_DSCP_POLICY = 2,
3188
  QM_ATTR_TCLAS = 3,
3189
  QM_ATTR_DOMAIN_NAME = 4,
3190
};
3191
3192
/* DSCP Policy attribute - Request Type */
3193
enum dscp_policy_request_type {
3194
  DSCP_POLICY_REQ_ADD = 0, /* ADD/UPDATE */
3195
  DSCP_POLICY_REQ_REMOVE = 1,
3196
};
3197
3198
/* Request/Response Control field of DSCP Policy Request/Response frame */
3199
0
#define DSCP_POLICY_CTRL_MORE BIT(0)
3200
0
#define DSCP_POLICY_CTRL_RESET  BIT(1)
3201
3202
/* Wi-Fi Alliance Capabilities element - Capabilities field */
3203
0
#define WFA_CAPA_QM_DSCP_POLICY BIT(0)
3204
0
#define WFA_CAPA_QM_UNSOLIC_DSCP BIT(1)
3205
0
#define WFA_CAPA_QM_NON_EHT_SCS_TRAFFIC_DESC BIT(2)
3206
3207
/* Wi-Fi Alliance Capabilities attributes */
3208
enum wfa_capa_attr_id {
3209
  WFA_CAPA_ATTR_GENERATIONAL_CAPAB = 1,
3210
  WFA_CAPA_ATTR_VENDOR_SPECIFIC = 221,
3211
};
3212
3213
/* Wi-Fi Alliance Capabilities frame */
3214
0
#define WFA_CAPAB_VENDOR_TYPE 0x506f9a1b
3215
3216
struct ieee80211_neighbor_ap_info {
3217
  u8 tbtt_info_hdr;
3218
  u8 tbtt_info_len;
3219
  u8 op_class;
3220
  u8 channel;
3221
3222
  /* Followed by the rest of the TBTT Information field contents */
3223
  u8 data[0];
3224
} STRUCT_PACKED;
3225
3226
/* S1G Beacon Compatibility element */
3227
struct ieee80211_s1g_beacon_compat {
3228
  u8 element_id;
3229
  u8 length;
3230
  le16 compat_info;
3231
  le16 beacon_interval;
3232
  le32 tsf_completion;
3233
} STRUCT_PACKED;
3234
3235
#ifdef _MSC_VER
3236
#pragma pack(pop)
3237
#endif /* _MSC_VER */
3238
3239
#endif /* IEEE802_11_DEFS_H */