]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/staging/winbond/localpara.h
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[karo-tx-linux.git] / drivers / staging / winbond / localpara.h
1 #ifndef __WINBOND_LOCALPARA_H
2 #define __WINBOND_LOCALPARA_H
3
4 //=============================================================
5 // LocalPara.h -
6 //=============================================================
7
8 #include "mac_structures.h"
9
10 //Define the local ability
11
12 #define LOCAL_DEFAULT_BEACON_PERIOD                     100             //ms
13 #define LOCAL_DEFAULT_ATIM_WINDOW                       0
14 #define LOCAL_DEFAULT_ERP_CAPABILITY            0x0431  //0x0001:       ESS
15                                                                                                         //0x0010:       Privacy
16                                                                                                         //0x0020:       short preamble
17                                                                                                         //0x0400:       short slot time
18 #define LOCAL_DEFAULT_LISTEN_INTERVAL           5
19
20 //#define LOCAL_DEFAULT_24_CHANNEL_NUM          11              // channel 1..11
21 #define LOCAL_DEFAULT_24_CHANNEL_NUM            13              // channel 1..13
22 #define LOCAL_DEFAULT_5_CHANNEL_NUM                     8               // channel 36..64
23
24 #define LOCAL_USA_24_CHANNEL_NUM                        11
25 #define LOCAL_USA_5_CHANNEL_NUM                         12
26 #define LOCAL_EUROPE_24_CHANNEL_NUM                     13
27 #define LOCAL_EUROPE_5_CHANNEL_NUM                      19
28 #define LOCAL_JAPAN_24_CHANNEL_NUM                      14
29 #define LOCAL_JAPAN_5_CHANNEL_NUM                       11
30 #define LOCAL_UNKNOWN_24_CHANNEL_NUM            14
31 #define LOCAL_UNKNOWN_5_CHANNEL_NUM                     34      //not include 165
32
33
34 #define psLOCAL                 (&(adapter->sLocalPara))
35
36 #define MODE_802_11_BG                  0
37 #define MODE_802_11_A                   1
38 #define MODE_802_11_ABG                 2
39 #define MODE_802_11_BG_IBSS             3
40 #define MODE_802_11_B                   4
41 #define MODE_AUTO                               255
42
43 #define BAND_TYPE_DSSS                  0
44 #define BAND_TYPE_OFDM_24               1
45 #define BAND_TYPE_OFDM_5                2
46
47 //refer Bitmap2RateValue table
48 #define LOCAL_ALL_SUPPORTED_RATES_BITMAP                0x130c1a66      //the bitmap value of all the H/W supported rates
49                                                                                                                         //1, 2, 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54
50 #define LOCAL_OFDM_SUPPORTED_RATES_BITMAP               0x130c1240      //the bitmap value of all the H/W supported rates
51                                                                                                                         //except to non-OFDM rates
52                                                                                                                         //6, 9, 12, 18, 24, 36, 48, 54
53
54 #define LOCAL_11B_SUPPORTED_RATE_BITMAP                 0x826
55 #define LOCAL_11B_BASIC_RATE_BITMAP                             0x826
56 #define LOCAL_11B_OPERATION_RATE_BITMAP                 0x826
57 #define LOCAL_11G_BASIC_RATE_BITMAP                             0x826           //1, 2, 5.5, 11
58 #define LOCAL_11G_OPERATION_RATE_BITMAP                 0x130c1240      //6, 9, 12, 18, 24, 36, 48, 54
59 #define LOCAL_11A_BASIC_RATE_BITMAP                             0x01001040      //6, 12, 24
60 #define LOCAL_11A_OPERATION_RATE_BITMAP                 0x120c0200      //9, 18, 36, 48, 54
61
62
63
64 #define PWR_ACTIVE              0
65 #define PWR_SAVE                1
66 #define PWR_TX_IDLE_CYCLE                       6
67
68 //bPreambleMode and bSlotTimeMode
69 #define AUTO_MODE                       0
70 #define LONG_MODE                       1
71
72 //Region definition
73 #define REGION_AUTO                     0xff
74 #define REGION_UNKNOWN          0
75 #define REGION_EUROPE           1       //ETSI
76 #define REGION_JAPAN            2       //MKK
77 #define REGION_USA                      3       //FCC
78 #define REGION_FRANCE           4       //FRANCE
79 #define REGION_SPAIN            5       //SPAIN
80 #define REGION_ISRAEL           6       //ISRAEL
81 //#define REGION_CANADA         7       //IC
82
83 #define MAX_BSS_DESCRIPT_ELEMENT                32
84 #define MAX_PMKID_CandidateList         16
85
86 //High byte : Event number,  low byte : reason
87 //Event definition
88 //-- SME/MLME event
89 #define EVENT_RCV_DEAUTH                                        0x0100
90 #define EVENT_JOIN_FAIL                                         0x0200
91 #define EVENT_AUTH_FAIL                                         0x0300
92 #define EVENT_ASSOC_FAIL                                        0x0400
93 #define EVENT_LOST_SIGNAL                                       0x0500
94 #define EVENT_BSS_DESCRIPT_LACK                         0x0600
95 #define EVENT_COUNTERMEASURE                            0x0700
96 #define EVENT_JOIN_FILTER                                       0x0800
97 //-- TX/RX event
98 #define EVENT_RX_BUFF_UNAVAILABLE                       0x4100
99
100 #define EVENT_CONNECT                                           0x8100
101 #define EVENT_DISCONNECT                                        0x8200
102 #define EVENT_SCAN_REQ                                          0x8300
103
104 //Reason of Event
105 #define EVENT_REASON_FILTER_BASIC_RATE          0x0001
106 #define EVENT_REASON_FILTER_PRIVACY                     0x0002
107 #define EVENT_REASON_FILTER_AUTH_MODE           0x0003
108 #define EVENT_REASON_TIMEOUT                            0x00ff
109
110 // 20061108 WPS IE buffer
111 #define MAX_IE_APPEND_SIZE                                      256 + 4 // Due to [E id][Length][OUI][Data] may 257 bytes
112
113 struct chan_info
114 {
115         u8              band;
116         u8              ChanNo;
117 };
118
119 struct radio_off
120 {
121         u8                      boHwRadioOff;
122         u8                      boSwRadioOff;
123 };
124
125 //===========================================================================
126 struct wb_local_para
127 {
128         u8                      PermanentAddress[ MAC_ADDR_LENGTH + 2 ];        // read from EPROM, manufacture set for each NetCard
129     u8                  ThisMacAddress[ MAC_ADDR_LENGTH + 2 ];                  // the driver will use actually.
130
131         u32                     MTUsize;                                // Ind to Uplayer, Max transmission unit size
132
133         u8                      region_INF;     //region setting from INF
134         u8                      region;         //real region setting of the device
135         u8                      Reserved_1[2];
136
137     //// power-save variables
138     u8                          iPowerSaveMode;     // 0 indicates it is on, 1 indicates it is off
139         u8                      ATIMmode;
140         u8                      ExcludeUnencrypted;
141
142         u16                     CheckCountForPS;        //Unit ime count for the decision to enter PS mode
143         u8                      boHasTxActivity;        //tx activity has occurred
144         u8                      boMacPsValid;           //Power save mode obtained from H/W is valid or not
145
146         //// Rate
147         u8                      TxRateMode;                             // Initial, input from Registry, may be updated by GUI
148                                                                                         //Tx Rate Mode: auto(DTO on), max, 1M, 2M, ..
149         u8                      CurrentTxRate;                  // The current Tx rate
150         u8                      CurrentTxRateForMng;    // The current Tx rate for management frames
151                                                                                 // It will be decided before connection succeeds.
152         u8                      CurrentTxFallbackRate;
153
154         //for Rate handler
155         u8                      BRateSet[32];                   //basic rate set
156         u8                      SRateSet[32];                   //support rate set
157
158         u8                      NumOfBRate;
159         u8                      NumOfSRate;
160         u8                      NumOfDsssRateInSRate;   //number of DSSS rates in supported rate set
161         u8                      reserved1;
162
163         u32                     dwBasicRateBitmap;              //bit map of basic rates
164         u32                     dwSupportRateBitmap;    //bit map of all support rates including
165                                                                                 //basic and operational rates
166
167         ////For SME/MLME handler
168         u16                     wOldSTAindex;                   // valid when boHandover=TRUE, store old connected STA index
169         u16                     wConnectedSTAindex;             // Index of peerly connected AP or IBSS in
170                                                                                 // the descriptionset.
171     u16                 Association_ID;         // The Association ID in the (Re)Association
172                                         // Response frame.
173     u16                 ListenInterval;         // The listen interval when SME invoking MLME_
174                                         // (Re)Associate_Request().
175
176         struct radio_off                RadioOffStatus;
177         u8                      Reserved0[2];
178
179         u8                      boMsRadioOff;                   // Ndis demands to be true when set Disassoc. OID and be false when set SSID OID.
180         u8                      bAntennaNo;                             //which antenna
181         u8                      bConnectFlag;                   //the connect status flag for roaming task
182
183         u8                      RoamStatus;
184         u8                      reserved7[3];
185
186         struct chan_info        CurrentChan;                    //Current channel no. and channel band. It may be changed by scanning.
187         u8                      boHandover;                             // Roaming, Hnadover to other AP.
188         u8                      boCCAbusy;
189
190         u16                     CWMax;                                  // It may not be the real value that H/W used
191         u8                      CWMin;                                  // 255: set according to 802.11 spec.
192         u8                      reserved2;
193
194         //11G:
195         u8                      bMacOperationMode;              // operation in 802.11b or 802.11g
196         u8                      bSlotTimeMode;                  //AUTO, s32
197         u8                      bPreambleMode;                  //AUTO, s32
198         u8                      boNonERPpresent;
199
200         u8                      boProtectMechanism;     // H/W will take the necessary action based on this variable
201         u8                      boShortPreamble;        // H/W will take the necessary action based on this variable
202         u8                      boShortSlotTime;        // H/W will take the necessary action based on this variable
203         u8                      reserved_3;
204
205         u32             RSN_IE_Bitmap;          //added by WS
206         u32                     RSN_OUI_Type;           //added by WS
207
208         //For the BSSID
209         u8                      HwBssid[MAC_ADDR_LENGTH + 2];
210         u32                     HwBssidValid;
211
212         //For scan list
213         u8                      BssListCount;                                                   //Total count of valid descriptor indexes
214         u8                      boReceiveUncorrectInfo; //important settings in beacon/probe resp. have been changed
215         u8                      NoOfJoinerInIbss;
216         u8                      reserved_4;
217
218         u8                      BssListIndex[ (MAX_BSS_DESCRIPT_ELEMENT+3) & ~0x03 ];   //Store the valid descriptor indexes obtained from scannings
219         u8                      JoinerInIbss[ (MAX_BSS_DESCRIPT_ELEMENT+3) & ~0x03 ];   //save the BssDescriptor index in this
220                                                                                                                 //IBSS. The index 0 is local descriptor
221                                                                                                                 //(psLOCAL->wConnectedSTAindex).
222                                                                                                                 //If CONNECTED : NoOfJoinerInIbss >=2
223                                                                                                                 //              else   : NoOfJoinerInIbss <=1
224
225         //// General Statistics, count at Rx_handler or Tx_callback interrupt handler
226     u64         GS_XMIT_OK;                             // Good Frames Transmitted
227     u64         GS_RCV_OK;                              // Good Frames Received
228         u32             GS_RCV_ERROR;                   // Frames received with crc error
229         u32             GS_XMIT_ERROR;                  // Bad Frames Transmitted
230         u32             GS_RCV_NO_BUFFER;               // Receive Buffer underrun
231         u32             GS_XMIT_ONE_COLLISION;  // one collision
232         u32             GS_XMIT_MORE_COLLISIONS;// more collisions
233
234     //================================================================
235     // Statistics (no matter whether it had done successfully) -wkchen
236     //================================================================
237     u32                 _NumRxMSDU;
238     u32                 _NumTxMSDU;
239     u32                 _dot11WEPExcludedCount;
240     u32                 _dot11WEPUndecryptableCount;
241     u32                 _dot11FrameDuplicateCount;
242
243         struct chan_info        IbssChanSetting;        // 2B. Start IBSS Channel setting by registry or WWU.
244         u8              reserved_5[2];          //It may not be used after considering RF type,
245                                                                         //region and modulation type.
246
247         u8              reserved_6[2];          //two variables are for wep key error detection added by ws 02/02/04
248
249     u32       bWepKeyError;
250     u32         bToSelfPacketReceived;
251     u32         WepKeyDetectTimerCount;
252
253         u16             SignalLostTh;
254         u16             SignalRoamTh;
255
256         // 20061108 WPS IE Append
257         u8              IE_Append_data[MAX_IE_APPEND_SIZE];
258         u16             IE_Append_size;
259         u16             reserved_7;
260
261 };
262
263 #endif