Commit | Line | Data |
---|---|---|
03a4389c | 1 | /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
66101de1 PM |
2 | // MAC_Structures.h |
3 | // | |
4 | // This file contains the definitions and data structures used by SW-MAC. | |
5 | // | |
6 | // Revision Histoy | |
7 | //================= | |
8 | // 0.1 2002 UN00 | |
9 | // 0.2 20021004 PD43 CCLiu6 | |
10 | // 20021018 PD43 CCLiu6 | |
11 | // Add enum_TxRate type | |
12 | // Modify enum_STAState type | |
13 | // 0.3 20021023 PE23 CYLiu update MAC session struct | |
14 | // 20021108 | |
15 | // 20021122 PD43 Austin | |
16 | // Deleted some unused. | |
17 | // 20021129 PD43 Austin | |
18 | // 20030617 increase the 802.11g definition | |
03a4389c | 19 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ |
66101de1 PM |
20 | |
21 | #ifndef _MAC_Structures_H_ | |
22 | #define _MAC_Structures_H_ | |
23 | ||
80aba536 | 24 | #include <linux/skbuff.h> |
66101de1 | 25 | |
03a4389c | 26 | /*========================================================= |
66101de1 | 27 | // Some miscellaneous definitions |
03a4389c | 28 | //-----*/ |
66101de1 PM |
29 | #define MAX_CHANNELS 30 |
30 | #define MAC_ADDR_LENGTH 6 | |
03a4389c RP |
31 | #define MAX_WEP_KEY_SIZE 16 /* 128 bits */ |
32 | #define MAX_802_11_FRAGMENT_NUMBER 10 /* By spec */ | |
66101de1 | 33 | |
03a4389c | 34 | /* ======================================================== |
66101de1 | 35 | // 802.11 Frame define |
03a4389c | 36 | //----- */ |
66101de1 PM |
37 | #define MASK_PROTOCOL_VERSION_TYPE 0x0F |
38 | #define MASK_FRAGMENT_NUMBER 0x000F | |
39 | #define SEQUENCE_NUMBER_SHIFT 4 | |
40 | #define DIFFER_11_TO_3 18 | |
41 | #define DOT_11_MAC_HEADER_SIZE 24 | |
42 | #define DOT_11_SNAP_SIZE 6 | |
43 | #define DOT_11_DURATION_OFFSET 2 | |
03a4389c RP |
44 | #define DOT_11_SEQUENCE_OFFSET 22 /* Sequence control offset */ |
45 | #define DOT_11_TYPE_OFFSET 30 /* The start offset of 802.11 Frame// */ | |
66101de1 PM |
46 | #define DOT_11_DATA_OFFSET 24 |
47 | #define DOT_11_DA_OFFSET 4 | |
48 | #define DOT_3_TYPE_ARP 0x80F3 | |
49 | #define DOT_3_TYPE_IPX 0x8137 | |
50 | #define DOT_3_TYPE_OFFSET 12 | |
51 | ||
52 | ||
53 | #define ETHERNET_HEADER_SIZE 14 | |
54 | #define MAX_ETHERNET_PACKET_SIZE 1514 | |
55 | ||
56 | ||
03a4389c | 57 | /* ----- management : Type of Bits (2, 3) and Subtype of Bits (4, 5, 6, 7) */ |
66101de1 PM |
58 | #define MAC_SUBTYPE_MNGMNT_ASSOC_REQUEST 0x00 |
59 | #define MAC_SUBTYPE_MNGMNT_ASSOC_RESPONSE 0x10 | |
60 | #define MAC_SUBTYPE_MNGMNT_REASSOC_REQUEST 0x20 | |
61 | #define MAC_SUBTYPE_MNGMNT_REASSOC_RESPONSE 0x30 | |
62 | #define MAC_SUBTYPE_MNGMNT_PROBE_REQUEST 0x40 | |
63 | #define MAC_SUBTYPE_MNGMNT_PROBE_RESPONSE 0x50 | |
64 | #define MAC_SUBTYPE_MNGMNT_BEACON 0x80 | |
65 | #define MAC_SUBTYPE_MNGMNT_ATIM 0x90 | |
66 | #define MAC_SUBTYPE_MNGMNT_DISASSOCIATION 0xA0 | |
67 | #define MAC_SUBTYPE_MNGMNT_AUTHENTICATION 0xB0 | |
68 | #define MAC_SUBTYPE_MNGMNT_DEAUTHENTICATION 0xC0 | |
69 | ||
03a4389c | 70 | /* ----- control : Type of Bits (2, 3) and Subtype of Bits (4, 5, 6, 7) */ |
66101de1 PM |
71 | #define MAC_SUBTYPE_CONTROL_PSPOLL 0xA4 |
72 | #define MAC_SUBTYPE_CONTROL_RTS 0xB4 | |
73 | #define MAC_SUBTYPE_CONTROL_CTS 0xC4 | |
74 | #define MAC_SUBTYPE_CONTROL_ACK 0xD4 | |
75 | #define MAC_SUBTYPE_CONTROL_CFEND 0xE4 | |
76 | #define MAC_SUBTYPE_CONTROL_CFEND_CFACK 0xF4 | |
77 | ||
03a4389c | 78 | /* ----- data : Type of Bits (2, 3) and Subtype of Bits (4, 5, 6, 7) */ |
66101de1 PM |
79 | #define MAC_SUBTYPE_DATA 0x08 |
80 | #define MAC_SUBTYPE_DATA_CFACK 0x18 | |
81 | #define MAC_SUBTYPE_DATA_CFPOLL 0x28 | |
82 | #define MAC_SUBTYPE_DATA_CFACK_CFPOLL 0x38 | |
83 | #define MAC_SUBTYPE_DATA_NULL 0x48 | |
84 | #define MAC_SUBTYPE_DATA_CFACK_NULL 0x58 | |
85 | #define MAC_SUBTYPE_DATA_CFPOLL_NULL 0x68 | |
86 | #define MAC_SUBTYPE_DATA_CFACK_CFPOLL_NULL 0x78 | |
87 | ||
03a4389c | 88 | /* ----- Frame Type of Bits (2, 3) */ |
66101de1 PM |
89 | #define MAC_TYPE_MANAGEMENT 0x00 |
90 | #define MAC_TYPE_CONTROL 0x04 | |
91 | #define MAC_TYPE_DATA 0x08 | |
92 | ||
03a4389c | 93 | /* ----- definitions for Management Frame Element ID (1 BYTE) */ |
66101de1 PM |
94 | #define ELEMENT_ID_SSID 0 |
95 | #define ELEMENT_ID_SUPPORTED_RATES 1 | |
96 | #define ELEMENT_ID_FH_PARAMETER_SET 2 | |
97 | #define ELEMENT_ID_DS_PARAMETER_SET 3 | |
98 | #define ELEMENT_ID_CF_PARAMETER_SET 4 | |
99 | #define ELEMENT_ID_TIM 5 | |
100 | #define ELEMENT_ID_IBSS_PARAMETER_SET 6 | |
101 | // 7~15 reserverd | |
102 | #define ELEMENT_ID_CHALLENGE_TEXT 16 | |
103 | // 17~31 reserved for challenge text extension | |
104 | // 32~255 reserved | |
105 | //-- 11G -- | |
106 | #define ELEMENT_ID_ERP_INFORMATION 42 | |
107 | #define ELEMENT_ID_EXTENDED_SUPPORTED_RATES 50 | |
108 | ||
109 | //-- WPA -- | |
110 | ||
111 | #define ELEMENT_ID_RSN_WPA 221 | |
112 | #ifdef _WPA2_ | |
113 | #define ELEMENT_ID_RSN_WPA2 48 | |
114 | #endif //endif WPA2 | |
115 | ||
116 | #define WLAN_MAX_PAIRWISE_CIPHER_SUITE_COUNT ((u16) 6) | |
117 | #define WLAN_MAX_AUTH_KEY_MGT_SUITE_LIST_COUNT ((u16) 2) | |
118 | ||
66101de1 PM |
119 | //=================================================================== |
120 | // Reason Code (Table 18): indicate the reason of DisAssoc, DeAuthen | |
121 | // length of ReasonCode is 2 Octs. | |
122 | //=================================================================== | |
123 | #define REASON_REASERED 0 | |
124 | #define REASON_UNSPECIDIED 1 | |
125 | #define REASON_PREAUTH_INVALID 2 | |
126 | #define DEAUTH_REASON_LEFT_BSS 3 | |
127 | #define DISASS_REASON_AP_INACTIVE 4 | |
128 | #define DISASS_REASON_AP_BUSY 5 | |
129 | #define REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6 | |
130 | #define REASON_CLASS3_FRAME_FROM_NONASSO_STA 7 | |
131 | #define DISASS_REASON_LEFT_BSS 8 | |
132 | #define REASON_NOT_AUTH_YET 9 | |
03a4389c | 133 | /* 802.11i define */ |
66101de1 PM |
134 | #define REASON_INVALID_IE 13 |
135 | #define REASON_MIC_ERROR 14 | |
136 | #define REASON_4WAY_HANDSHAKE_TIMEOUT 15 | |
137 | #define REASON_GROUPKEY_UPDATE_TIMEOUT 16 | |
138 | #define REASON_IE_DIFF_4WAY_ASSOC 17 | |
139 | #define REASON_INVALID_MULTICAST_CIPHER 18 | |
140 | #define REASON_INVALID_UNICAST_CIPHER 19 | |
141 | #define REASON_INVALID_AKMP 20 | |
142 | #define REASON_UNSUPPORTED_RSNIE_VERSION 21 | |
143 | #define REASON_INVALID_RSNIE_CAPABILITY 22 | |
144 | #define REASON_802_1X_AUTH_FAIL 23 | |
145 | #define REASON_CIPHER_REJECT_PER_SEC_POLICY 14 | |
146 | ||
147 | /* | |
148 | //=========================================================== | |
149 | // enum_MMPDUResultCode -- | |
150 | // Status code (2 Octs) in the MMPDU's frame body. Table.19 | |
151 | // | |
152 | //=========================================================== | |
153 | enum enum_MMPDUResultCode | |
154 | { | |
155 | // SUCCESS = 0, // Redefined | |
156 | UNSPECIFIED_FAILURE = 1, | |
157 | ||
158 | // 2 - 9 Reserved | |
159 | ||
160 | NOT_SUPPROT_CAPABILITIES = 10, | |
161 | ||
162 | //REASSOCIATION_DENIED | |
163 | // | |
164 | REASSOC_DENIED_UNABLE_CFM_ASSOC_EXIST = 11, | |
165 | ||
166 | //ASSOCIATION_DENIED_NOT_IN_STANDARD | |
167 | // | |
168 | ASSOC_DENIED_REASON_NOT_IN_STANDARD = 12, | |
169 | PEER_NOT_SUPPORT_AUTH_ALGORITHM = 13, | |
170 | AUTH_SEQNUM_OUT_OF_EXPECT = 14, | |
171 | AUTH_REJECT_REASON_CHALLENGE_FAIL = 15, | |
172 | AUTH_REJECT_REASON_WAIT_TIMEOUT = 16, | |
173 | ASSOC_DENIED_REASON_AP_BUSY = 17, | |
174 | ASSOC_DENIED_REASON_NOT_SUPPORT_BASIC_RATE = 18 | |
175 | } WB_MMPDURESULTCODE, *PWB_MMPDURESULTCODE; | |
176 | */ | |
177 | ||
03a4389c | 178 | /*=========================================================== |
66101de1 PM |
179 | // enum_TxRate -- |
180 | // Define the transmission constants based on W89C32 MAC | |
181 | // target specification. | |
03a4389c | 182 | //===========================================================*/ |
d20279d7 | 183 | typedef enum enum_TxRate { |
66101de1 PM |
184 | TXRATE_1M = 0, |
185 | TXRATE_2MLONG = 2, | |
186 | TXRATE_2MSHORT = 3, | |
187 | TXRATE_55MLONG = 4, | |
188 | TXRATE_55MSHORT = 5, | |
189 | TXRATE_11MLONG = 6, | |
190 | TXRATE_11MSHORT = 7, | |
03a4389c | 191 | TXRATE_AUTO = 255 /* PD43 20021108 */ |
66101de1 PM |
192 | } WB_TXRATE, *PWB_TXRATE; |
193 | ||
194 | ||
195 | #define RATE_BITMAP_1M 1 | |
196 | #define RATE_BITMAP_2M 2 | |
197 | #define RATE_BITMAP_5dot5M 5 | |
198 | #define RATE_BITMAP_6M 6 | |
199 | #define RATE_BITMAP_9M 9 | |
200 | #define RATE_BITMAP_11M 11 | |
201 | #define RATE_BITMAP_12M 12 | |
202 | #define RATE_BITMAP_18M 18 | |
203 | #define RATE_BITMAP_22M 22 | |
204 | #define RATE_BITMAP_24M 24 | |
205 | #define RATE_BITMAP_33M 17 | |
206 | #define RATE_BITMAP_36M 19 | |
207 | #define RATE_BITMAP_48M 25 | |
208 | #define RATE_BITMAP_54M 28 | |
209 | ||
210 | #define RATE_AUTO 0 | |
211 | #define RATE_1M 2 | |
212 | #define RATE_2M 4 | |
213 | #define RATE_5dot5M 11 | |
214 | #define RATE_6M 12 | |
215 | #define RATE_9M 18 | |
216 | #define RATE_11M 22 | |
217 | #define RATE_12M 24 | |
218 | #define RATE_18M 36 | |
219 | #define RATE_22M 44 | |
220 | #define RATE_24M 48 | |
221 | #define RATE_33M 66 | |
222 | #define RATE_36M 72 | |
223 | #define RATE_48M 96 | |
224 | #define RATE_54M 108 | |
225 | #define RATE_MAX 255 | |
226 | ||
03a4389c | 227 | /* CAPABILITY */ |
66101de1 PM |
228 | #define CAPABILITY_ESS_BIT 0x0001 |
229 | #define CAPABILITY_IBSS_BIT 0x0002 | |
230 | #define CAPABILITY_CF_POLL_BIT 0x0004 | |
231 | #define CAPABILITY_CF_POLL_REQ_BIT 0x0008 | |
232 | #define CAPABILITY_PRIVACY_BIT 0x0010 | |
233 | #define CAPABILITY_SHORT_PREAMBLE_BIT 0x0020 | |
234 | #define CAPABILITY_PBCC_BIT 0x0040 | |
235 | #define CAPABILITY_CHAN_AGILITY_BIT 0x0080 | |
236 | #define CAPABILITY_SHORT_SLOT_TIME_BIT 0x0400 | |
237 | #define CAPABILITY_DSSS_OFDM_BIT 0x2000 | |
238 | ||
239 | ||
d20279d7 RP |
240 | struct Capability_Information_Element { |
241 | union { | |
242 | u16 __attribute__ ((packed)) wValue; | |
03a4389c | 243 | #ifdef _BIG_ENDIAN_ /* 20060926 add by anson's endian */ |
d20279d7 RP |
244 | struct _Capability { |
245 | /* -- 11G -- */ | |
246 | u8 Reserved3:2; | |
247 | u8 DSSS_OFDM:1; | |
248 | u8 Reserved2:2; | |
249 | u8 Short_Slot_Time:1; | |
250 | u8 Reserved1:2; | |
251 | u8 Channel_Agility:1; | |
252 | u8 PBCC:1; | |
253 | u8 ShortPreamble:1; | |
254 | u8 CF_Privacy:1; | |
255 | u8 CF_Poll_Request:1; | |
256 | u8 CF_Pollable:1; | |
257 | u8 IBSS:1; | |
258 | u8 ESS:1; | |
66101de1 PM |
259 | } __attribute__ ((packed)) Capability; |
260 | #else | |
d20279d7 RP |
261 | struct _Capability { |
262 | u8 ESS:1; | |
263 | u8 IBSS:1; | |
264 | u8 CF_Pollable:1; | |
265 | u8 CF_Poll_Request:1; | |
266 | u8 CF_Privacy:1; | |
267 | u8 ShortPreamble:1; | |
268 | u8 PBCC:1; | |
269 | u8 Channel_Agility:1; | |
270 | u8 Reserved1:2; | |
03a4389c | 271 | /* -- 11G -- */ |
d20279d7 RP |
272 | u8 Short_Slot_Time:1; |
273 | u8 Reserved2:2; | |
274 | u8 DSSS_OFDM:1; | |
275 | u8 Reserved3:2; | |
66101de1 PM |
276 | } __attribute__ ((packed)) Capability; |
277 | #endif | |
d20279d7 RP |
278 | } __attribute__ ((packed)) ; |
279 | } __attribute__ ((packed)); | |
66101de1 | 280 | |
d20279d7 | 281 | struct FH_Parameter_Set_Element { |
66101de1 PM |
282 | u8 Element_ID; |
283 | u8 Length; | |
284 | u8 Dwell_Time[2]; | |
285 | u8 Hop_Set; | |
286 | u8 Hop_Pattern; | |
287 | u8 Hop_Index; | |
288 | }; | |
289 | ||
d20279d7 | 290 | struct DS_Parameter_Set_Element { |
66101de1 PM |
291 | u8 Element_ID; |
292 | u8 Length; | |
293 | u8 Current_Channel; | |
294 | }; | |
295 | ||
d20279d7 | 296 | struct Supported_Rates_Element { |
66101de1 PM |
297 | u8 Element_ID; |
298 | u8 Length; | |
299 | u8 SupportedRates[8]; | |
d20279d7 | 300 | } __attribute__ ((packed)); |
66101de1 | 301 | |
d20279d7 | 302 | struct SSID_Element { |
66101de1 PM |
303 | u8 Element_ID; |
304 | u8 Length; | |
305 | u8 SSID[32]; | |
d20279d7 | 306 | } __attribute__ ((packed)) ; |
66101de1 | 307 | |
d20279d7 | 308 | struct CF_Parameter_Set_Element { |
66101de1 PM |
309 | u8 Element_ID; |
310 | u8 Length; | |
311 | u8 CFP_Count; | |
312 | u8 CFP_Period; | |
03a4389c RP |
313 | u8 CFP_MaxDuration[2]; /* in Time Units */ |
314 | u8 CFP_DurRemaining[2]; /* in time units */ | |
66101de1 PM |
315 | }; |
316 | ||
d20279d7 | 317 | struct TIM_Element { |
66101de1 PM |
318 | u8 Element_ID; |
319 | u8 Length; | |
320 | u8 DTIM_Count; | |
321 | u8 DTIM_Period; | |
322 | u8 Bitmap_Control; | |
323 | u8 Partial_Virtual_Bitmap[251]; | |
324 | }; | |
325 | ||
d20279d7 | 326 | struct IBSS_Parameter_Set_Element { |
66101de1 PM |
327 | u8 Element_ID; |
328 | u8 Length; | |
329 | u8 ATIM_Window[2]; | |
330 | }; | |
331 | ||
d20279d7 | 332 | struct Challenge_Text_Element { |
66101de1 PM |
333 | u8 Element_ID; |
334 | u8 Length; | |
335 | u8 Challenge_Text[253]; | |
336 | }; | |
337 | ||
d20279d7 | 338 | struct PHY_Parameter_Set_Element { |
03a4389c RP |
339 | /* int aSlotTime; */ |
340 | /* int aSifsTime; */ | |
66101de1 PM |
341 | s32 aCCATime; |
342 | s32 aRxTxTurnaroundTime; | |
343 | s32 aTxPLCPDelay; | |
344 | s32 RxPLCPDelay; | |
345 | s32 aRxTxSwitchTime; | |
346 | s32 aTxRampOntime; | |
347 | s32 aTxRampOffTime; | |
348 | s32 aTxRFDelay; | |
349 | s32 aRxRFDelay; | |
350 | s32 aAirPropagationTime; | |
351 | s32 aMACProcessingDelay; | |
352 | s32 aPreambleLength; | |
353 | s32 aPLCPHeaderLength; | |
354 | s32 aMPDUDurationFactor; | |
355 | s32 aMPDUMaxLength; | |
03a4389c RP |
356 | /* int aCWmin; */ |
357 | /* int aCWmax; */ | |
66101de1 PM |
358 | }; |
359 | ||
03a4389c | 360 | /* -- 11G -- */ |
d20279d7 | 361 | struct ERP_Information_Element { |
66101de1 PM |
362 | u8 Element_ID; |
363 | u8 Length; | |
03a4389c | 364 | #ifdef _BIG_ENDIAN_ /* 20060926 add by anson's endian */ |
d20279d7 RP |
365 | u8 Reserved:5; /* 20060926 add by anson */ |
366 | u8 Barker_Preamble_Mode:1; | |
66101de1 PM |
367 | u8 Use_Protection:1; |
368 | u8 NonERP_Present:1; | |
369 | #else | |
370 | u8 NonERP_Present:1; | |
371 | u8 Use_Protection:1; | |
372 | u8 Barker_Preamble_Mode:1; | |
373 | u8 Reserved:5; | |
374 | #endif | |
375 | }; | |
376 | ||
d20279d7 | 377 | struct Extended_Supported_Rates_Element { |
66101de1 PM |
378 | u8 Element_ID; |
379 | u8 Length; | |
380 | u8 ExtendedSupportedRates[255]; | |
d20279d7 | 381 | } __attribute__ ((packed)); |
66101de1 | 382 | |
03a4389c | 383 | /* WPA(802.11i draft 3.0) */ |
66101de1 PM |
384 | #define VERSION_WPA 1 |
385 | #ifdef _WPA2_ | |
386 | #define VERSION_WPA2 1 | |
03a4389c RP |
387 | #endif /* end def _WPA2_ */ |
388 | #define OUI_WPA 0x00F25000 /* WPA2.0 OUI=00:50:F2, the MSB is reserved for suite type */ | |
66101de1 | 389 | #ifdef _WPA2_ |
03a4389c RP |
390 | #define OUI_WPA2 0x00AC0F00 /* for wpa2 change to 0x00ACOF04 by Ws 26/04/04 */ |
391 | #endif /* end def _WPA2_ */ | |
66101de1 PM |
392 | |
393 | #define OUI_WPA_ADDITIONAL 0x01 | |
03a4389c | 394 | #define WLAN_MIN_RSN_WPA_LENGTH 6 /* added by ws 09/10/04 */ |
66101de1 | 395 | #ifdef _WPA2_ |
03a4389c RP |
396 | #define WLAN_MIN_RSN_WPA2_LENGTH 2 /* Fix to 2 09/14/05 */ |
397 | #endif /* end def _WPA2_ */ | |
66101de1 PM |
398 | |
399 | #define oui_wpa (u32)(OUI_WPA|OUI_WPA_ADDITIONAL) | |
400 | ||
03a4389c RP |
401 | #define WPA_OUI_BIG ((u32) 0x01F25000)/* added by ws 09/23/04 */ |
402 | #define WPA_OUI_LITTLE ((u32) 0x01F25001)/* added by ws 09/23/04 */ | |
66101de1 | 403 | |
03a4389c | 404 | #define WPA_WPS_OUI cpu_to_le32(0x04F25000) /* 20061108 For WPS. It's little endian. Big endian is 0x0050F204 */ |
66101de1 | 405 | |
03a4389c | 406 | /* -----WPA2----- */ |
66101de1 PM |
407 | #ifdef _WPA2_ |
408 | #define WPA2_OUI_BIG ((u32)0x01AC0F00) | |
409 | #define WPA2_OUI_LITTLE ((u32)0x01AC0F01) | |
03a4389c | 410 | #endif /* end def _WPA2_ */ |
66101de1 | 411 | |
03a4389c RP |
412 | /* Authentication suite */ |
413 | #define OUI_AUTH_WPA_NONE 0x00 /* for WPA_NONE */ | |
66101de1 PM |
414 | #define OUI_AUTH_8021X 0x01 |
415 | #define OUI_AUTH_PSK 0x02 | |
03a4389c RP |
416 | /* Cipher suite */ |
417 | #define OUI_CIPHER_GROUP_KEY 0x00 /* added by ws 05/21/04 */ | |
66101de1 PM |
418 | #define OUI_CIPHER_WEP_40 0x01 |
419 | #define OUI_CIPHER_TKIP 0x02 | |
420 | #define OUI_CIPHER_CCMP 0x04 | |
421 | #define OUI_CIPHER_WEP_104 0x05 | |
422 | ||
2de97533 | 423 | struct suite_selector |
66101de1 PM |
424 | { |
425 | union | |
426 | { | |
427 | u8 Value[4]; | |
428 | struct _SUIT_ | |
429 | { | |
430 | u8 OUI[3]; | |
431 | u8 Type; | |
432 | }SuitSelector; | |
433 | }; | |
2de97533 | 434 | }; |
66101de1 PM |
435 | |
436 | //-- WPA -- | |
437 | struct RSN_Information_Element | |
438 | { | |
439 | u8 Element_ID; | |
440 | u8 Length; | |
2de97533 | 441 | struct suite_selector OuiWPAAdditional; /* WPA version 2.0 additional field, and should be 00:50:F2:01 */ |
66101de1 | 442 | u16 Version; |
2de97533 | 443 | struct suite_selector GroupKeySuite; |
66101de1 | 444 | u16 PairwiseKeySuiteCount; |
2de97533 | 445 | struct suite_selector PairwiseKeySuite[1]; |
66101de1 PM |
446 | }__attribute__ ((packed)); |
447 | struct RSN_Auth_Sub_Information_Element | |
448 | { | |
449 | u16 AuthKeyMngtSuiteCount; | |
2de97533 | 450 | struct suite_selector AuthKeyMngtSuite[1]; |
66101de1 PM |
451 | }__attribute__ ((packed)); |
452 | ||
03a4389c | 453 | /* -- WPA2 -- */ |
66101de1 PM |
454 | struct RSN_Capability_Element |
455 | { | |
456 | union | |
457 | { | |
458 | u16 __attribute__ ((packed)) wValue; | |
03a4389c | 459 | #ifdef _BIG_ENDIAN_ /* 20060927 add by anson's endian */ |
66101de1 PM |
460 | struct _RSN_Capability |
461 | { | |
03a4389c | 462 | u16 __attribute__ ((packed)) Reserved2 : 8; /* 20051201 */ |
66101de1 PM |
463 | u16 __attribute__ ((packed)) Reserved1 : 2; |
464 | u16 __attribute__ ((packed)) GTK_Replay_Counter : 2; | |
465 | u16 __attribute__ ((packed)) PTK_Replay_Counter : 2; | |
466 | u16 __attribute__ ((packed)) No_Pairwise : 1; | |
467 | u16 __attribute__ ((packed)) Pre_Auth : 1; | |
468 | }__attribute__ ((packed)) RSN_Capability; | |
469 | #else | |
470 | struct _RSN_Capability | |
471 | { | |
472 | u16 __attribute__ ((packed)) Pre_Auth : 1; | |
473 | u16 __attribute__ ((packed)) No_Pairwise : 1; | |
474 | u16 __attribute__ ((packed)) PTK_Replay_Counter : 2; | |
475 | u16 __attribute__ ((packed)) GTK_Replay_Counter : 2; | |
476 | u16 __attribute__ ((packed)) Reserved1 : 2; | |
03a4389c | 477 | u16 __attribute__ ((packed)) Reserved2 : 8; /* 20051201 */ |
66101de1 PM |
478 | }__attribute__ ((packed)) RSN_Capability; |
479 | #endif | |
480 | ||
481 | }__attribute__ ((packed)) ; | |
482 | }__attribute__ ((packed)) ; | |
483 | ||
484 | #ifdef _WPA2_ | |
649f0650 | 485 | struct pmkid |
66101de1 PM |
486 | { |
487 | u8 pValue[16]; | |
649f0650 | 488 | }; |
66101de1 PM |
489 | |
490 | struct WPA2_RSN_Information_Element | |
491 | { | |
492 | u8 Element_ID; | |
493 | u8 Length; | |
494 | u16 Version; | |
2de97533 | 495 | struct suite_selector GroupKeySuite; |
66101de1 | 496 | u16 PairwiseKeySuiteCount; |
2de97533 | 497 | struct suite_selector PairwiseKeySuite[1]; |
66101de1 PM |
498 | |
499 | }__attribute__ ((packed)); | |
500 | ||
501 | struct WPA2_RSN_Auth_Sub_Information_Element | |
502 | { | |
503 | u16 AuthKeyMngtSuiteCount; | |
2de97533 | 504 | struct suite_selector AuthKeyMngtSuite[1]; |
66101de1 PM |
505 | }__attribute__ ((packed)); |
506 | ||
507 | ||
508 | struct PMKID_Information_Element | |
509 | { | |
510 | u16 PMKID_Count; | |
649f0650 | 511 | struct pmkid pmkid[16]; |
66101de1 PM |
512 | }__attribute__ ((packed)); |
513 | ||
03a4389c RP |
514 | #endif /* enddef _WPA2_ */ |
515 | /*============================================================ | |
66101de1 | 516 | // MAC Frame structure (different type) and subfield structure |
03a4389c | 517 | //============================================================*/ |
66101de1 PM |
518 | struct MAC_frame_control |
519 | { | |
03a4389c RP |
520 | u8 mac_frame_info; /* a combination of the [Protocol Version, Control Type, Control Subtype]*/ |
521 | #ifdef _BIG_ENDIAN_ /* 20060927 add by anson's endian */ | |
66101de1 PM |
522 | u8 order:1; |
523 | u8 WEP:1; | |
524 | u8 more_data:1; | |
525 | u8 pwr_mgt:1; | |
526 | u8 retry:1; | |
527 | u8 more_frag:1; | |
528 | u8 from_ds:1; | |
529 | u8 to_ds:1; | |
530 | #else | |
531 | u8 to_ds:1; | |
532 | u8 from_ds:1; | |
533 | u8 more_frag:1; | |
534 | u8 retry:1; | |
535 | u8 pwr_mgt:1; | |
536 | u8 more_data:1; | |
537 | u8 WEP:1; | |
538 | u8 order:1; | |
539 | #endif | |
540 | } __attribute__ ((packed)); | |
541 | ||
542 | struct Management_Frame { | |
03a4389c | 543 | struct MAC_frame_control frame_control; /* 2B, ToDS,FromDS,MoreFrag,MoreData,Order=0 */ |
66101de1 | 544 | u16 duration; |
03a4389c RP |
545 | u8 DA[MAC_ADDR_LENGTH]; /* Addr1 */ |
546 | u8 SA[MAC_ADDR_LENGTH]; /* Addr2 */ | |
547 | u8 BSSID[MAC_ADDR_LENGTH]; /* Addr3 */ | |
66101de1 | 548 | u16 Sequence_Control; |
03a4389c RP |
549 | /* Management Frame Body <= 325 bytes */ |
550 | /* FCS 4 bytes */ | |
d20279d7 | 551 | } __attribute__ ((packed)); |
66101de1 | 552 | |
03a4389c | 553 | /* SW-MAC don't Tx/Rx Control-Frame, HW-MAC do it. */ |
66101de1 | 554 | struct Control_Frame { |
03a4389c | 555 | struct MAC_frame_control frame_control; /* ToDS,FromDS,MoreFrag,Retry,MoreData,WEP,Order=0 */ |
66101de1 PM |
556 | u16 duration; |
557 | u8 RA[MAC_ADDR_LENGTH]; | |
558 | u8 TA[MAC_ADDR_LENGTH]; | |
559 | u16 FCS; | |
d20279d7 | 560 | } __attribute__ ((packed)); |
66101de1 PM |
561 | |
562 | struct Data_Frame { | |
563 | struct MAC_frame_control frame_control; | |
564 | u16 duration; | |
565 | u8 Addr1[MAC_ADDR_LENGTH]; | |
566 | u8 Addr2[MAC_ADDR_LENGTH]; | |
567 | u8 Addr3[MAC_ADDR_LENGTH]; | |
568 | u16 Sequence_Control; | |
03a4389c RP |
569 | u8 Addr4[MAC_ADDR_LENGTH]; /* only exist when ToDS=FromDS=1 */ |
570 | /* Data Frame Body <= 2312 */ | |
571 | /* FCS */ | |
d20279d7 | 572 | } __attribute__ ((packed)); |
66101de1 | 573 | |
d20279d7 | 574 | struct Disassociation_Frame_Body { |
66101de1 | 575 | u16 reasonCode; |
d20279d7 | 576 | } __attribute__ ((packed)); |
66101de1 | 577 | |
d20279d7 | 578 | struct Association_Request_Frame_Body { |
66101de1 PM |
579 | u16 capability_information; |
580 | u16 listenInterval; | |
03a4389c RP |
581 | u8 Current_AP_Address[MAC_ADDR_LENGTH];/* for reassociation only */ |
582 | /* SSID (2+32 bytes) */ | |
583 | /* Supported_Rates (2+8 bytes) */ | |
d20279d7 | 584 | } __attribute__ ((packed)); |
66101de1 | 585 | |
d20279d7 | 586 | struct Association_Response_Frame_Body { |
66101de1 PM |
587 | u16 capability_information; |
588 | u16 statusCode; | |
589 | u16 Association_ID; | |
590 | struct Supported_Rates_Element supportedRates; | |
d20279d7 | 591 | } __attribute__ ((packed)); |
66101de1 PM |
592 | |
593 | /*struct Reassociation_Request_Frame_Body | |
594 | { | |
595 | u16 capability_information; | |
596 | u16 listenInterval; | |
597 | u8 Current_AP_Address[MAC_ADDR_LENGTH]; | |
598 | // SSID (2+32 bytes) | |
599 | // Supported_Rates (2+8 bytes) | |
600 | };*/ | |
03a4389c | 601 | /* eliminated by WS 07/22/04 comboined with associateion request frame. */ |
66101de1 | 602 | |
d20279d7 | 603 | struct Reassociation_Response_Frame_Body { |
66101de1 PM |
604 | u16 capability_information; |
605 | u16 statusCode; | |
606 | u16 Association_ID; | |
607 | struct Supported_Rates_Element supportedRates; | |
d20279d7 | 608 | } __attribute__ ((packed)); |
66101de1 | 609 | |
d20279d7 | 610 | struct Deauthentication_Frame_Body { |
66101de1 | 611 | u16 reasonCode; |
d20279d7 | 612 | } __attribute__ ((packed)); |
66101de1 PM |
613 | |
614 | ||
d20279d7 | 615 | struct Probe_Response_Frame_Body { |
66101de1 PM |
616 | u16 Timestamp; |
617 | u16 Beacon_Interval; | |
618 | u16 Capability_Information; | |
03a4389c | 619 | /* SSID |
66101de1 PM |
620 | // Supported_Rates |
621 | // PHY parameter Set (DS Parameters) | |
622 | // CF parameter Set | |
03a4389c | 623 | // IBSS parameter Set */ |
d20279d7 | 624 | } __attribute__ ((packed)); |
66101de1 | 625 | |
d20279d7 | 626 | struct Authentication_Frame_Body { |
66101de1 PM |
627 | u16 algorithmNumber; |
628 | u16 sequenceNumber; | |
629 | u16 statusCode; | |
03a4389c RP |
630 | /* NB: don't include ChallengeText in this structure |
631 | // struct Challenge_Text_Element sChallengeTextElement; // wkchen added */ | |
d20279d7 | 632 | } __attribute__ ((packed)); |
66101de1 PM |
633 | |
634 | ||
03a4389c | 635 | #endif /* _MAC_Structure_H_ */ |
66101de1 PM |
636 | |
637 |