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