2
* IEEE 802.11 Frame type definitions
3
* Copyright (c) 2002-2007, Jouni Malinen <j@w1.fi>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation.
9
* Alternatively, this software may be distributed under the terms of BSD
12
* See README and COPYING for more details.
15
#ifndef IEEE802_11_DEFS_H
16
#define IEEE802_11_DEFS_H
18
/* IEEE 802.11 defines */
20
#define WLAN_FC_PVER 0x0003
21
#define WLAN_FC_TODS 0x0100
22
#define WLAN_FC_FROMDS 0x0200
23
#define WLAN_FC_MOREFRAG 0x0400
24
#define WLAN_FC_RETRY 0x0800
25
#define WLAN_FC_PWRMGT 0x1000
26
#define WLAN_FC_MOREDATA 0x2000
27
#define WLAN_FC_ISWEP 0x4000
28
#define WLAN_FC_ORDER 0x8000
30
#define WLAN_FC_GET_TYPE(fc) (((fc) & 0x000c) >> 2)
31
#define WLAN_FC_GET_STYPE(fc) (((fc) & 0x00f0) >> 4)
33
#define WLAN_GET_SEQ_FRAG(seq) ((seq) & (BIT(3) | BIT(2) | BIT(1) | BIT(0)))
34
#define WLAN_GET_SEQ_SEQ(seq) \
35
(((seq) & (~(BIT(3) | BIT(2) | BIT(1) | BIT(0)))) >> 4)
37
#define WLAN_FC_TYPE_MGMT 0
38
#define WLAN_FC_TYPE_CTRL 1
39
#define WLAN_FC_TYPE_DATA 2
42
#define WLAN_FC_STYPE_ASSOC_REQ 0
43
#define WLAN_FC_STYPE_ASSOC_RESP 1
44
#define WLAN_FC_STYPE_REASSOC_REQ 2
45
#define WLAN_FC_STYPE_REASSOC_RESP 3
46
#define WLAN_FC_STYPE_PROBE_REQ 4
47
#define WLAN_FC_STYPE_PROBE_RESP 5
48
#define WLAN_FC_STYPE_BEACON 8
49
#define WLAN_FC_STYPE_ATIM 9
50
#define WLAN_FC_STYPE_DISASSOC 10
51
#define WLAN_FC_STYPE_AUTH 11
52
#define WLAN_FC_STYPE_DEAUTH 12
53
#define WLAN_FC_STYPE_ACTION 13
56
#define WLAN_FC_STYPE_PSPOLL 10
57
#define WLAN_FC_STYPE_RTS 11
58
#define WLAN_FC_STYPE_CTS 12
59
#define WLAN_FC_STYPE_ACK 13
60
#define WLAN_FC_STYPE_CFEND 14
61
#define WLAN_FC_STYPE_CFENDACK 15
64
#define WLAN_FC_STYPE_DATA 0
65
#define WLAN_FC_STYPE_DATA_CFACK 1
66
#define WLAN_FC_STYPE_DATA_CFPOLL 2
67
#define WLAN_FC_STYPE_DATA_CFACKPOLL 3
68
#define WLAN_FC_STYPE_NULLFUNC 4
69
#define WLAN_FC_STYPE_CFACK 5
70
#define WLAN_FC_STYPE_CFPOLL 6
71
#define WLAN_FC_STYPE_CFACKPOLL 7
72
#define WLAN_FC_STYPE_QOS_DATA 8
74
/* Authentication algorithms */
75
#define WLAN_AUTH_OPEN 0
76
#define WLAN_AUTH_SHARED_KEY 1
77
#define WLAN_AUTH_FT 2
78
#define WLAN_AUTH_LEAP 128
80
#define WLAN_AUTH_CHALLENGE_LEN 128
82
#define WLAN_CAPABILITY_ESS BIT(0)
83
#define WLAN_CAPABILITY_IBSS BIT(1)
84
#define WLAN_CAPABILITY_CF_POLLABLE BIT(2)
85
#define WLAN_CAPABILITY_CF_POLL_REQUEST BIT(3)
86
#define WLAN_CAPABILITY_PRIVACY BIT(4)
87
#define WLAN_CAPABILITY_SHORT_PREAMBLE BIT(5)
88
#define WLAN_CAPABILITY_PBCC BIT(6)
89
#define WLAN_CAPABILITY_CHANNEL_AGILITY BIT(7)
90
#define WLAN_CAPABILITY_SPECTRUM_MGMT BIT(8)
91
#define WLAN_CAPABILITY_SHORT_SLOT_TIME BIT(10)
92
#define WLAN_CAPABILITY_DSSS_OFDM BIT(13)
95
#define WLAN_STATUS_SUCCESS 0
96
#define WLAN_STATUS_UNSPECIFIED_FAILURE 1
97
#define WLAN_STATUS_CAPS_UNSUPPORTED 10
98
#define WLAN_STATUS_REASSOC_NO_ASSOC 11
99
#define WLAN_STATUS_ASSOC_DENIED_UNSPEC 12
100
#define WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 13
101
#define WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION 14
102
#define WLAN_STATUS_CHALLENGE_FAIL 15
103
#define WLAN_STATUS_AUTH_TIMEOUT 16
104
#define WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 17
105
#define WLAN_STATUS_ASSOC_DENIED_RATES 18
107
#define WLAN_STATUS_ASSOC_DENIED_NOSHORT 19
108
#define WLAN_STATUS_ASSOC_DENIED_NOPBCC 20
109
#define WLAN_STATUS_ASSOC_DENIED_NOAGILITY 21
111
#define WLAN_STATUS_SPEC_MGMT_REQUIRED 22
112
#define WLAN_STATUS_PWR_CAPABILITY_NOT_VALID 23
113
#define WLAN_STATUS_SUPPORTED_CHANNEL_NOT_VALID 24
115
#define WLAN_STATUS_ASSOC_DENOED_NO_SHORT_SLOT_TIME 25
116
#define WLAN_STATUS_ASSOC_DENOED_NO_ER_PBCC 26
117
#define WLAN_STATUS_ASSOC_DENOED_NO_DSSS_OFDM 27
119
#define WLAN_STATUS_INVALID_IE 40
120
#define WLAN_STATUS_GROUP_CIPHER_NOT_VALID 41
121
#define WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID 42
122
#define WLAN_STATUS_AKMP_NOT_VALID 43
123
#define WLAN_STATUS_UNSUPPORTED_RSN_IE_VERSION 44
124
#define WLAN_STATUS_INVALID_RSN_IE_CAPAB 45
125
#define WLAN_STATUS_CIPHER_REJECTED_PER_POLICY 46
127
#define WLAN_STATUS_INVALID_FT_ACTION_FRAME_COUNT 52
128
#define WLAN_STATUS_EXPECTED_RESOURCE_REQ_FT 53
129
#define WLAN_STATUS_INVALID_PMKID 54
130
#define WLAN_STATUS_INVALID_MDIE 55
131
#define WLAN_STATUS_INVALID_FTIE 56
134
#define WLAN_REASON_UNSPECIFIED 1
135
#define WLAN_REASON_PREV_AUTH_NOT_VALID 2
136
#define WLAN_REASON_DEAUTH_LEAVING 3
137
#define WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4
138
#define WLAN_REASON_DISASSOC_AP_BUSY 5
139
#define WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6
140
#define WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 7
141
#define WLAN_REASON_DISASSOC_STA_HAS_LEFT 8
142
#define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9
144
#define WLAN_REASON_PWR_CAPABILITY_NOT_VALID 10
145
#define WLAN_REASON_SUPPORTED_CHANNEL_NOT_VALID 11
147
#define WLAN_REASON_INVALID_IE 13
148
#define WLAN_REASON_MICHAEL_MIC_FAILURE 14
149
#define WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT 15
150
#define WLAN_REASON_GROUP_KEY_UPDATE_TIMEOUT 16
151
#define WLAN_REASON_IE_IN_4WAY_DIFFERS 17
152
#define WLAN_REASON_GROUP_CIPHER_NOT_VALID 18
153
#define WLAN_REASON_PAIRWISE_CIPHER_NOT_VALID 19
154
#define WLAN_REASON_AKMP_NOT_VALID 20
155
#define WLAN_REASON_UNSUPPORTED_RSN_IE_VERSION 21
156
#define WLAN_REASON_INVALID_RSN_IE_CAPAB 22
157
#define WLAN_REASON_IEEE_802_1X_AUTH_FAILED 23
158
#define WLAN_REASON_CIPHER_SUITE_REJECTED 24
161
/* Information Element IDs */
162
#define WLAN_EID_SSID 0
163
#define WLAN_EID_SUPP_RATES 1
164
#define WLAN_EID_FH_PARAMS 2
165
#define WLAN_EID_DS_PARAMS 3
166
#define WLAN_EID_CF_PARAMS 4
167
#define WLAN_EID_TIM 5
168
#define WLAN_EID_IBSS_PARAMS 6
169
#define WLAN_EID_COUNTRY 7
170
#define WLAN_EID_CHALLENGE 16
171
/* EIDs defined by IEEE 802.11h - START */
172
#define WLAN_EID_PWR_CONSTRAINT 32
173
#define WLAN_EID_PWR_CAPABILITY 33
174
#define WLAN_EID_TPC_REQUEST 34
175
#define WLAN_EID_TPC_REPORT 35
176
#define WLAN_EID_SUPPORTED_CHANNELS 36
177
#define WLAN_EID_CHANNEL_SWITCH 37
178
#define WLAN_EID_MEASURE_REQUEST 38
179
#define WLAN_EID_MEASURE_REPORT 39
180
#define WLAN_EID_QUITE 40
181
#define WLAN_EID_IBSS_DFS 41
182
/* EIDs defined by IEEE 802.11h - END */
183
#define WLAN_EID_ERP_INFO 42
184
#define WLAN_EID_RSN 48
185
#define WLAN_EID_EXT_SUPP_RATES 50
186
#define WLAN_EID_MOBILITY_DOMAIN 54
187
#define WLAN_EID_FAST_BSS_TRANSITION 55
188
#define WLAN_EID_TIMEOUT_INTERVAL 56
189
#define WLAN_EID_RIC_DATA 57
190
#define WLAN_EID_VENDOR_SPECIFIC 221
193
/* Action frame categories */
194
#define WLAN_ACTION_SPECTRUM_MGMT 0
195
#define WLAN_ACTION_QOS 1
196
#define WLAN_ACTION_DLS 2
197
#define WLAN_ACTION_BLOCK_ACK 3
198
#define WLAN_ACTION_RADIO_MEASUREMENT 5
199
#define WLAN_ACTION_FT 6
203
#pragma pack(push, 1)
204
#endif /* _MSC_VER */
206
struct ieee80211_mgmt {
216
le16 auth_transaction;
218
/* possibly followed by Challenge text */
220
} STRUCT_PACKED auth;
223
} STRUCT_PACKED deauth;
226
le16 listen_interval;
227
/* followed by SSID and Supported rates */
229
} STRUCT_PACKED assoc_req;
234
/* followed by Supported rates */
236
} STRUCT_PACKED assoc_resp, reassoc_resp;
239
le16 listen_interval;
241
/* followed by SSID and Supported rates */
243
} STRUCT_PACKED reassoc_req;
246
} STRUCT_PACKED disassoc;
251
/* followed by some of SSID, Supported rates,
252
* FH Params, DS Params, CF Params, IBSS Params, TIM */
254
} STRUCT_PACKED beacon;
256
/* only variable items: SSID, Supported rates */
258
} STRUCT_PACKED probe_req;
263
/* followed by some of SSID, Supported rates,
264
* FH Params, DS Params, CF Params, IBSS Params */
266
} STRUCT_PACKED probe_resp;
275
} STRUCT_PACKED wme_action;
283
} STRUCT_PACKED chan_switch;
286
u8 sta_addr[ETH_ALEN];
287
u8 target_ap_addr[ETH_ALEN];
288
u8 variable[0]; /* FT Request */
289
} STRUCT_PACKED ft_action_req;
292
u8 sta_addr[ETH_ALEN];
293
u8 target_ap_addr[ETH_ALEN];
295
u8 variable[0]; /* FT Request */
296
} STRUCT_PACKED ft_action_resp;
298
} STRUCT_PACKED action;
304
#endif /* _MSC_VER */
306
#define ERP_INFO_NON_ERP_PRESENT BIT(0)
307
#define ERP_INFO_USE_PROTECTION BIT(1)
308
#define ERP_INFO_BARKER_PREAMBLE_MODE BIT(2)
310
#endif /* IEEE802_11_DEFS_H */