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