]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - drivers/staging/winbond/sme_s.h
33f5d2aa96f47b05eee78371737a6a7453154c53
[linux-2.6-omap-h63xx.git] / drivers / staging / winbond / sme_s.h
1 //
2 // SME_S.H -
3 // SME task global CONSTANTS, STRUCTURES, variables
4 //
5
6 //////////////////////////////////////////////////////////////////////////
7 //define the msg type of SME module
8 // 0x00~0x1F : MSG from GUI dispatch
9 // 0x20~0x3F : MSG from MLME
10 // 0x40~0x5F : MSG from SCAN
11 // 0x60~0x6F : MSG from TX/RX
12 // 0x70~0x7F : MSG from ROAMING
13 // 0x80~0x8F : MSG from ISR
14 // 0x90          : MSG TimeOut
15
16 // from GUI
17 #define SMEMSG_SCAN_REQ                                 0x01
18 //#define SMEMSG_PASSIVE_SCAN_REQ                       0x02
19 #define SMEMSG_JOIN_REQ                                 0x03
20 #define SMEMSG_START_IBSS                               0x04
21 #define SMEMSG_DISCONNECT_REQ                   0x05
22 #define SMEMSG_AUTHEN_REQ                               0x06
23 #define SMEMSG_DEAUTHEN_REQ                             0x07
24 #define SMEMSG_ASSOC_REQ                                0x08
25 #define SMEMSG_REASSOC_REQ                              0x09
26 #define SMEMSG_DISASSOC_REQ                             0x0a
27 #define SMEMSG_POWERSAVE_REQ                    0x0b
28
29
30 // from MLME
31 #define SMEMSG_AUTHEN_CFM                               0x21
32 #define SMEMSG_AUTHEN_IND                               0x22
33 #define SMEMSG_ASSOC_CFM                                0x23
34 #define SMEMSG_DEAUTHEN_IND                             0x24
35 #define SMEMSG_DISASSOC_IND                             0x25
36 // from SCAN
37 #define SMEMSG_SCAN_CFM                                 0x41
38 #define SMEMSG_START_IBSS_CFM                   0x42
39 // from MTO, function call to set SME parameters
40
41 // 0x60~0x6F : MSG from TX/RX
42 //#define SMEMSG_IBSS_JOIN_UPDATE_BSSID 0x61
43 #define SMEMSG_COUNTERMEASURE_MICFAIL_TIMEOUT           0x62
44 #define SMEMSG_COUNTERMEASURE_BLOCK_TIMEOUT     0x63
45 // from ROAMING
46 #define SMEMSG_HANDOVER_JOIN_REQ                0x71
47 #define SMEMSG_END_ROAMING                              0x72
48 #define SMEMSG_SCAN_JOIN_REQ                    0x73
49 // from ISR
50 #define SMEMSG_TSF_SYNC_IND                             0x81
51 // from TimeOut
52 #define SMEMSG_TIMEOUT                                  0x91
53
54
55
56 #define MAX_PMKID_Accunt                16
57 //@added by ws 04/22/05
58 #define Cipher_Disabled                 0
59 #define Cipher_Wep                      1
60 #define Cipher_Tkip                     2
61 #define Cipher_Ccmp                     4
62
63
64 ///////////////////////////////////////////////////////////////////////////
65 //Constants
66
67 ///////////////////////////////////////////////////////////////////////////
68 //Global data structures
69
70 #define NUMOFWEPENTRIES     64
71
72 typedef enum _WEPKeyMode
73 {
74     WEPKEY_DISABLED = 0,
75     WEPKEY_64       = 1,
76     WEPKEY_128      = 2
77
78 } WEPKEYMODE, *pWEPKEYMODE;
79
80 #ifdef _WPA2_
81
82 typedef struct _BSSInfo
83 {
84   u8        PreAuthBssID[6];
85   PMKID        pmkid_value;
86 }BSSID_Info;
87
88 typedef struct _PMKID_Table //added by ws 05/05/04
89 {
90    u32  Length;
91    u32  BSSIDInfoCount;
92    BSSID_Info BSSIDInfo[16];
93
94 } PMKID_Table;
95
96 #endif //end def _WPA2_
97
98 #define MAX_BASIC_RATE_SET          15
99 #define MAX_OPT_RATE_SET            MAX_BASIC_RATE_SET
100
101
102 typedef struct _SME_PARAMETERS
103 {
104     u16                         wState;
105         u8                              boDUTmode;
106         u8                              bDesiredPowerSave;
107
108         // SME timer and timeout value
109         struct timer_list timer;
110
111         u8                              boInTimerHandler;
112         u8                              boAuthRetryActive;
113         u8                              reserved_0[2];
114
115         u32                             AuthenRetryTimerVal;    // NOTE: Assoc don't fail timeout
116         u32                             JoinFailTimerVal;               // 10*Beacon-Interval
117
118         //Rates
119         u8                              BSSBasicRateSet[(MAX_BASIC_RATE_SET + 3) & ~0x03 ];    // BSS basic rate set
120         u8                              OperationalRateSet[(MAX_OPT_RATE_SET + 3) & ~0x03 ]; // Operational rate set
121
122         u8                              NumOfBSSBasicRate;
123         u8                              NumOfOperationalRate;
124         u8                              reserved_1[2];
125
126         u32                             BasicRateBitmap;
127         u32                             OpRateBitmap;
128
129         // System parameters Set by GUI
130         //-------------------- start IBSS parameter ---------------------------//
131         u32                             boStartIBSS;                    //Start IBSS toggle
132
133         u16                             wBeaconPeriod;
134         u16                             wATIM_Window;
135
136         ChanInfo                        IbssChan; // 2B //channel setting when start IBSS
137         u8                              reserved_2[2];
138
139     // Join related
140         u16                             wDesiredJoinBSS;                // BSS index which desire to join
141         u8                              boJoinReq;                              //Join request toggle
142         u8                              bDesiredBSSType;                //for Join request
143
144     u16                         wCapabilityInfo;        // Used when invoking the MLME_Associate_request().
145         u16                             wNonERPcapabilityInfo;
146
147     struct SSID_Element sDesiredSSID; // 34 B
148         u8                              reserved_3[2];
149
150         u8                      abDesiredBSSID[MAC_ADDR_LENGTH + 2];
151
152         u8                              bJoinScanCount;                 // the time of scan-join action need to do
153         u8                              bDesiredAuthMode;       // AUTH_OPEN_SYSTEM or AUTH_SHARED_KEY
154         u8                              reserved_4[2];
155
156     // Encryption parameters
157         u8                      _dot11PrivacyInvoked;
158     u8                  _dot11PrivacyOptionImplemented;
159         u8                              reserved_5[2];
160
161     //@ ws added
162     u8                          DesiredEncrypt;
163         u8                              encrypt_status; //ENCRYPT_DISABLE, ENCRYPT_WEP, ENCRYPT_WEP_NOKEY, ENCRYPT_TKIP, ...
164         u8                              key_length;
165         u8                              pairwise_key_ok;
166
167         u8                              group_key_ok;
168     u8                          wpa_ok;             // indicate the control port of 802.1x is open or close
169         u8                              pairwise_key_type;
170         u8                              group_key_type;
171
172     u32               _dot11WEPDefaultKeyID;
173
174         u8                      tx_mic_key[8];      // TODO: 0627 kevin-TKIP
175         u8                      rx_mic_key[8];      // TODO: 0627 kevin-TKIP
176         u8                              group_tx_mic_key[8];
177         u8                              group_rx_mic_key[8];
178
179 //      #ifdef _WPA_
180         u8                              AssocReqVarIE[200];
181         u8                              AssocRespVarIE[200];
182
183         u16                             AssocReqVarLen;
184         u16                             AssocRespVarLen;
185         u8                              boReassoc;                              //use assoc. or reassoc.
186         u8                              reserved_6[3];
187         u16                             AssocRespCapability;
188         u16                             AssocRespStatus;
189 //      #endif
190
191         #ifdef _WPA2_
192     u8               PmkIdTable[256];
193     u32               PmkidTableIndex;
194         #endif //end def _WPA2_
195
196 } SME_PARAMETERS, *PSME_PARAMETERS;
197
198 #define psSME                   (&(adapter->sSmePara))
199
200 #define wSMEGetCurrentSTAState(adapter)         ((u16)(adapter)->sSmePara.wState)
201
202
203
204 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
205 //      SmeModule.h
206 //              Define the related definitions of SME module
207 //      history -- 01/14/03' created
208 //
209 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
210
211 //Define the state of SME module
212 #define DISABLED                                                0
213 #define INIT_SCAN                                               1
214 #define SCAN_READY                                              2
215 #define START_IBSS                                              3
216 #define JOIN_PENDING                                    4
217 #define JOIN_CFM                                                5
218 #define AUTHENTICATE_PENDING                    6
219 #define AUTHENTICATED                                   7
220 #define CONNECTED                                               8
221 //#define EAP_STARTING                                  9
222 //#define EAPOL_AUTHEN_PENDING                  10
223 //#define SECURE_CONNECTED                              11
224
225
226 // Static function
227