Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
[linux-2.6] / drivers / staging / winbond / mlme_s.h
1 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 //      Mlme.h
3 //              Define the related definitions of MLME module
4 //      history -- 01/14/03' created
5 //
6 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
7
8 #define AUTH_REJECT_REASON_CHALLENGE_FAIL               1
9
10 //====== the state of MLME module
11 #define INACTIVE                        0x0
12 #define IDLE_SCAN                       0x1
13
14 //====== the state of MLME/ESS module
15 #define STATE_1                         0x2
16 #define AUTH_REQ                        0x3
17 #define AUTH_WEP                        0x4
18 #define STATE_2                         0x5
19 #define ASSOC_REQ                       0x6
20 #define STATE_3                         0x7
21
22 //====== the state of MLME/IBSS module
23 #define IBSS_JOIN_SYNC          0x8
24 #define IBSS_AUTH_REQ           0x9
25 #define IBSS_AUTH_CHANLGE       0xa
26 #define IBSS_AUTH_WEP           0xb
27 #define IBSS_AUTH_IND           0xc
28 #define IBSS_STATE_2            0xd
29
30
31
32 //=========================================
33 //depend on D5C(MAC timing control 03 register): MaxTxMSDULifeTime default 0x80000us
34 #define AUTH_FAIL_TIMEOUT               550
35 #define ASSOC_FAIL_TIMEOUT              550
36 #define REASSOC_FAIL_TIMEOUT    550
37
38
39
40 //
41 // MLME task global CONSTANTS, STRUCTURE, variables
42 //
43
44
45 /////////////////////////////////////////////////////////////
46 //  enum_ResultCode --
47 //  Result code returned from MLME to SME.
48 //
49 /////////////////////////////////////////////////////////////
50 // PD43 20030829 Modifiled
51 //#define       SUCCESS                                                         0
52 #define MLME_SUCCESS                        0 //follow spec.
53 #define INVALID_PARAMETERS                                      1 //Not following spec.
54 #define NOT_SUPPPORTED                                          2
55 #define TIMEOUT                                                         3
56 #define TOO_MANY_SIMULTANEOUS_REQUESTS          4
57 #define REFUSED                                                         5
58 #define BSS_ALREADY_STARTED_OR_JOINED           6
59 #define TRANSMIT_FRAME_FAIL                                     7
60 #define NO_BSS_FOUND                                            8
61 #define RETRY                                                           9
62 #define GIVE_UP                                                         10
63
64
65 #define OPEN_AUTH                                                       0
66 #define SHARE_AUTH                                                      1
67 #define ANY_AUTH                                                        2
68 #define WPA_AUTH                                                        3       //for WPA
69 #define WPAPSK_AUTH                                                     4
70 #define WPANONE_AUTH                                            5
71 ///////////////////////////////////////////// added by ws 04/19/04
72 #ifdef _WPA2_
73 #define WPA2_AUTH                           6//for WPA2
74 #define WPA2PSK_AUTH                        7
75 #endif //end def _WPA2_
76
77 //////////////////////////////////////////////////////////////////
78 //define the msg type of MLME module
79 //////////////////////////////////////////////////////////////////
80 //--------------------------------------------------------
81 //from SME
82
83 #define MLMEMSG_AUTH_REQ                                0x0b
84 #define MLMEMSG_DEAUTH_REQ                              0x0c
85 #define MLMEMSG_ASSOC_REQ                               0x0d
86 #define MLMEMSG_REASSOC_REQ                             0x0e
87 #define MLMEMSG_DISASSOC_REQ                    0x0f
88 #define MLMEMSG_START_IBSS_REQ                  0x10
89 #define MLMEMSG_IBSS_NET_CFM                    0x11
90
91 //from RX :
92 #define MLMEMSG_RCV_MLMEFRAME                   0x20
93 #define MLMEMSG_RCV_ASSOCRSP                    0x22
94 #define MLMEMSG_RCV_REASSOCRSP                  0x24
95 #define MLMEMSG_RCV_DISASSOC                    0x2b
96 #define MLMEMSG_RCV_AUTH                                0x2c
97 #define MLMEMSG_RCV_DEAUTH                              0x2d
98
99
100 //from TX callback
101 #define MLMEMSG_TX_CALLBACK                             0x40
102 #define MLMEMSG_ASSOCREQ_CALLBACK               0x41
103 #define MLMEMSG_REASSOCREQ_CALLBACK             0x43
104 #define MLMEMSG_DISASSOC_CALLBACK               0x4a
105 #define MLMEMSG_AUTH_CALLBACK                   0x4c
106 #define MLMEMSG_DEAUTH_CALLBACK                 0x4d
107
108 //#define MLMEMSG_JOIN_FAIL                             4
109 //#define MLMEMSG_AUTHEN_FAIL                   18
110 #define MLMEMSG_TIMEOUT                                 0x50
111
112 ///////////////////////////////////////////////////////////////////////////
113 //Global data structures
114 #define MAX_NUM_TX_MMPDU        2
115 #define MAX_MMPDU_SIZE          1512
116 #define MAX_NUM_RX_MMPDU        6
117
118
119 ///////////////////////////////////////////////////////////////////////////
120 //MACRO
121 #define boMLME_InactiveState(_AA_)      (_AA_->wState==INACTIVE)
122 #define boMLME_IdleScanState(_BB_)      (_BB_->wState==IDLE_SCAN)
123 #define boMLME_FoundSTAinfo(_CC_)       (_CC_->wState>=IDLE_SCAN)
124
125 typedef struct _MLME_FRAME
126 {
127         //NDIS_PACKET           MLME_Packet;
128         s8 *                    pMMPDU;
129         u16                     len;
130         u8                      DataType;
131         u8                      IsInUsed;
132
133         spinlock_t      MLMESpinLock;
134
135     u8          TxMMPDU[MAX_NUM_TX_MMPDU][MAX_MMPDU_SIZE];
136         u8              TxMMPDUInUse[ (MAX_NUM_TX_MMPDU+3) & ~0x03 ];
137
138         u16             wNumTxMMPDU;
139         u16             wNumTxMMPDUDiscarded;
140
141     u8          RxMMPDU[MAX_NUM_RX_MMPDU][MAX_MMPDU_SIZE];
142     u8          SaveRxBufSlotInUse[ (MAX_NUM_RX_MMPDU+3) & ~0x03 ];
143
144         u16             wNumRxMMPDU;
145         u16             wNumRxMMPDUDiscarded;
146
147         u16             wNumRxMMPDUInMLME;      // Number of the Rx MMPDU
148         u16             reserved_1;                     //  in MLME.
149                                     //  excluding the discarded
150 } MLME_FRAME, *psMLME_FRAME;
151
152 typedef struct _AUTHREQ {
153
154         u8      peerMACaddr[MAC_ADDR_LENGTH];
155         u16     wAuthAlgorithm;
156
157 } MLME_AUTHREQ_PARA, *psMLME_AUTHREQ_PARA;
158
159 struct _Reason_Code {
160
161         u8      peerMACaddr[MAC_ADDR_LENGTH];
162         u16     wReasonCode;
163 };
164 typedef struct _Reason_Code MLME_DEAUTHREQ_PARA, *psMLME_DEAUTHREQ_PARA;
165 typedef struct _Reason_Code MLME_DISASSOCREQ_PARA, *psMLME_DISASSOCREQ_PARA;
166
167 typedef struct _ASSOCREQ {
168   u8       PeerSTAAddr[MAC_ADDR_LENGTH];
169   u16       CapabilityInfo;
170   u16       ListenInterval;
171
172 }__attribute__ ((packed)) MLME_ASSOCREQ_PARA, *psMLME_ASSOCREQ_PARA;
173
174 typedef struct _REASSOCREQ {
175   u8       NewAPAddr[MAC_ADDR_LENGTH];
176   u16       CapabilityInfo;
177   u16       ListenInterval;
178
179 }__attribute__ ((packed)) MLME_REASSOCREQ_PARA, *psMLME_REASSOCREQ_PARA;
180
181 typedef struct _MLMECALLBACK {
182
183   u8    *psFramePtr;
184   u8            bResult;
185
186 } MLME_TXCALLBACK, *psMLME_TXCALLBACK;
187
188 typedef struct _RXDATA
189 {
190         s32             FrameLength;
191         u8      __attribute__ ((packed)) *pbFramePtr;
192
193 }__attribute__ ((packed)) RXDATA, *psRXDATA;
194
195