Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6] / drivers / staging / vt6655 / mib.h
1 /*
2  * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
3  * All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
19  * File: mib.h
20  *
21  * Purpose: Implement MIB Data Structure
22  *
23  * Author: Tevin Chen
24  *
25  * Date: May 21, 1996
26  *
27  */
28
29 #ifndef __MIB_H__
30 #define __MIB_H__
31
32 #if !defined(__TTYPE_H__)
33 #include "ttype.h"
34 #endif
35 #if !defined(__TETHER_H__)
36 #include "tether.h"
37 #endif
38 #if !defined(__DESC_H__)
39 #include "desc.h"
40 #endif
41
42
43
44 //#define ULONGLONG   ULONG
45
46 /*---------------------  Export Definitions -------------------------*/
47 //
48 // 802.11 counter
49 //
50
51 typedef struct tagSDot11Counters {
52     ULONG       Length;             // Length of structure
53     ULONGLONG   TransmittedFragmentCount;
54     ULONGLONG   MulticastTransmittedFrameCount;
55     ULONGLONG   FailedCount;
56     ULONGLONG   RetryCount;
57     ULONGLONG   MultipleRetryCount;
58     ULONGLONG   RTSSuccessCount;
59     ULONGLONG   RTSFailureCount;
60     ULONGLONG   ACKFailureCount;
61     ULONGLONG   FrameDuplicateCount;
62     ULONGLONG   ReceivedFragmentCount;
63     ULONGLONG   MulticastReceivedFrameCount;
64     ULONGLONG   FCSErrorCount;
65     ULONGLONG   TKIPLocalMICFailures;
66     ULONGLONG   TKIPRemoteMICFailures;
67     ULONGLONG   TKIPICVErrors;
68     ULONGLONG   TKIPCounterMeasuresInvoked;
69     ULONGLONG   TKIPReplays;
70     ULONGLONG   CCMPFormatErrors;
71     ULONGLONG   CCMPReplays;
72     ULONGLONG   CCMPDecryptErrors;
73     ULONGLONG   FourWayHandshakeFailures;
74 //    ULONGLONG   WEPUndecryptableCount;
75 //    ULONGLONG   WEPICVErrorCount;
76 //    ULONGLONG   DecryptSuccessCount;
77 //    ULONGLONG   DecryptFailureCount;
78 } SDot11Counters, DEF* PSDot11Counters;
79
80
81 //
82 // MIB2 counter
83 //
84 typedef struct tagSMib2Counter {
85     LONG    ifIndex;
86     TCHAR   ifDescr[256];               // max size 255 plus zero ending
87                                         // e.g. "interface 1"
88     LONG    ifType;
89     LONG    ifMtu;
90     DWORD   ifSpeed;
91     BYTE    ifPhysAddress[U_ETHER_ADDR_LEN];
92     LONG    ifAdminStatus;
93     LONG    ifOperStatus;
94     DWORD   ifLastChange;
95     DWORD   ifInOctets;
96     DWORD   ifInUcastPkts;
97     DWORD   ifInNUcastPkts;
98     DWORD   ifInDiscards;
99     DWORD   ifInErrors;
100     DWORD   ifInUnknownProtos;
101     DWORD   ifOutOctets;
102     DWORD   ifOutUcastPkts;
103     DWORD   ifOutNUcastPkts;
104     DWORD   ifOutDiscards;
105     DWORD   ifOutErrors;
106     DWORD   ifOutQLen;
107     DWORD   ifSpecific;
108 } SMib2Counter, DEF* PSMib2Counter;
109
110 // Value in the ifType entry
111 //#define ETHERNETCSMACD      6           //
112 #define WIRELESSLANIEEE80211b      6           //
113
114 // Value in the ifAdminStatus/ifOperStatus entry
115 #define UP                  1           //
116 #define DOWN                2           //
117 #define TESTING             3           //
118
119
120 //
121 // RMON counter
122 //
123 typedef struct tagSRmonCounter {
124     LONG    etherStatsIndex;
125     DWORD   etherStatsDataSource;
126     DWORD   etherStatsDropEvents;
127     DWORD   etherStatsOctets;
128     DWORD   etherStatsPkts;
129     DWORD   etherStatsBroadcastPkts;
130     DWORD   etherStatsMulticastPkts;
131     DWORD   etherStatsCRCAlignErrors;
132     DWORD   etherStatsUndersizePkts;
133     DWORD   etherStatsOversizePkts;
134     DWORD   etherStatsFragments;
135     DWORD   etherStatsJabbers;
136     DWORD   etherStatsCollisions;
137     DWORD   etherStatsPkt64Octets;
138     DWORD   etherStatsPkt65to127Octets;
139     DWORD   etherStatsPkt128to255Octets;
140     DWORD   etherStatsPkt256to511Octets;
141     DWORD   etherStatsPkt512to1023Octets;
142     DWORD   etherStatsPkt1024to1518Octets;
143     DWORD   etherStatsOwners;
144     DWORD   etherStatsStatus;
145 } SRmonCounter, DEF* PSRmonCounter;
146
147 //
148 // Custom counter
149 //
150 typedef struct tagSCustomCounters {
151     ULONG       Length;
152
153     ULONGLONG   ullTsrAllOK;
154
155     ULONGLONG   ullRsr11M;
156     ULONGLONG   ullRsr5M;
157     ULONGLONG   ullRsr2M;
158     ULONGLONG   ullRsr1M;
159
160     ULONGLONG   ullRsr11MCRCOk;
161     ULONGLONG   ullRsr5MCRCOk;
162     ULONGLONG   ullRsr2MCRCOk;
163     ULONGLONG   ullRsr1MCRCOk;
164
165     ULONGLONG   ullRsr54M;
166     ULONGLONG   ullRsr48M;
167     ULONGLONG   ullRsr36M;
168     ULONGLONG   ullRsr24M;
169     ULONGLONG   ullRsr18M;
170     ULONGLONG   ullRsr12M;
171     ULONGLONG   ullRsr9M;
172     ULONGLONG   ullRsr6M;
173
174     ULONGLONG   ullRsr54MCRCOk;
175     ULONGLONG   ullRsr48MCRCOk;
176     ULONGLONG   ullRsr36MCRCOk;
177     ULONGLONG   ullRsr24MCRCOk;
178     ULONGLONG   ullRsr18MCRCOk;
179     ULONGLONG   ullRsr12MCRCOk;
180     ULONGLONG   ullRsr9MCRCOk;
181     ULONGLONG   ullRsr6MCRCOk;
182
183 } SCustomCounters, DEF* PSCustomCounters;
184
185
186 //
187 // Custom counter
188 //
189 typedef struct tagSISRCounters {
190     ULONG   Length;
191
192     DWORD   dwIsrTx0OK;
193     DWORD   dwIsrAC0TxOK;
194     DWORD   dwIsrBeaconTxOK;
195     DWORD   dwIsrRx0OK;
196     DWORD   dwIsrTBTTInt;
197     DWORD   dwIsrSTIMERInt;
198     DWORD   dwIsrWatchDog;
199     DWORD   dwIsrUnrecoverableError;
200     DWORD   dwIsrSoftInterrupt;
201     DWORD   dwIsrMIBNearfull;
202     DWORD   dwIsrRxNoBuf;
203
204     DWORD   dwIsrUnknown;               // unknown interrupt count
205
206     DWORD   dwIsrRx1OK;
207     DWORD   dwIsrATIMTxOK;
208     DWORD   dwIsrSYNCTxOK;
209     DWORD   dwIsrCFPEnd;
210     DWORD   dwIsrATIMEnd;
211     DWORD   dwIsrSYNCFlushOK;
212     DWORD   dwIsrSTIMER1Int;
213     /////////////////////////////////////
214 } SISRCounters, DEF* PSISRCounters;
215
216
217 // Value in the etherStatsStatus entry
218 #define VALID               1           //
219 #define CREATE_REQUEST      2           //
220 #define UNDER_CREATION      3           //
221 #define INVALID             4           //
222
223 //#define MAX_RATE            12
224 //
225 // statistic counter
226 //
227 typedef struct tagSStatCounter {
228     //
229     // ISR status count
230     //
231
232
233     // RSR status count
234     //
235     DWORD   dwRsrFrmAlgnErr;
236     DWORD   dwRsrErr;
237     DWORD   dwRsrCRCErr;
238     DWORD   dwRsrCRCOk;
239     DWORD   dwRsrBSSIDOk;
240     DWORD   dwRsrADDROk;
241     DWORD   dwRsrBCNSSIDOk;
242     DWORD   dwRsrLENErr;
243     DWORD   dwRsrTYPErr;
244
245     DWORD   dwNewRsrDECRYPTOK;
246     DWORD   dwNewRsrCFP;
247     DWORD   dwNewRsrUTSF;
248     DWORD   dwNewRsrHITAID;
249     DWORD   dwNewRsrHITAID0;
250
251     DWORD   dwRsrLong;
252     DWORD   dwRsrRunt;
253
254     DWORD   dwRsrRxControl;
255     DWORD   dwRsrRxData;
256     DWORD   dwRsrRxManage;
257
258     DWORD   dwRsrRxPacket;
259     DWORD   dwRsrRxOctet;
260     DWORD   dwRsrBroadcast;
261     DWORD   dwRsrMulticast;
262     DWORD   dwRsrDirected;
263     // 64-bit OID
264     ULONGLONG   ullRsrOK;
265
266     // for some optional OIDs (64 bits) and DMI support
267     ULONGLONG   ullRxBroadcastBytes;
268     ULONGLONG   ullRxMulticastBytes;
269     ULONGLONG   ullRxDirectedBytes;
270     ULONGLONG   ullRxBroadcastFrames;
271     ULONGLONG   ullRxMulticastFrames;
272     ULONGLONG   ullRxDirectedFrames;
273
274     DWORD   dwRsrRxFragment;
275     DWORD   dwRsrRxFrmLen64;
276     DWORD   dwRsrRxFrmLen65_127;
277     DWORD   dwRsrRxFrmLen128_255;
278     DWORD   dwRsrRxFrmLen256_511;
279     DWORD   dwRsrRxFrmLen512_1023;
280     DWORD   dwRsrRxFrmLen1024_1518;
281
282     // TSR status count
283     //
284     DWORD   dwTsrTotalRetry[TYPE_MAXTD];        // total collision retry count
285     DWORD   dwTsrOnceRetry[TYPE_MAXTD];         // this packet only occur one collision
286     DWORD   dwTsrMoreThanOnceRetry[TYPE_MAXTD]; // this packet occur more than one collision
287     DWORD   dwTsrRetry[TYPE_MAXTD];             // this packet has ever occur collision,
288                                          // that is (dwTsrOnceCollision0 + dwTsrMoreThanOnceCollision0)
289     DWORD   dwTsrACKData[TYPE_MAXTD];
290     DWORD   dwTsrErr[TYPE_MAXTD];
291     DWORD   dwAllTsrOK[TYPE_MAXTD];
292     DWORD   dwTsrRetryTimeout[TYPE_MAXTD];
293     DWORD   dwTsrTransmitTimeout[TYPE_MAXTD];
294
295     DWORD   dwTsrTxPacket[TYPE_MAXTD];
296     DWORD   dwTsrTxOctet[TYPE_MAXTD];
297     DWORD   dwTsrBroadcast[TYPE_MAXTD];
298     DWORD   dwTsrMulticast[TYPE_MAXTD];
299     DWORD   dwTsrDirected[TYPE_MAXTD];
300
301     // RD/TD count
302     DWORD   dwCntRxFrmLength;
303     DWORD   dwCntTxBufLength;
304
305     BYTE    abyCntRxPattern[16];
306     BYTE    abyCntTxPattern[16];
307
308
309
310     // Software check....
311     DWORD   dwCntRxDataErr;             // rx buffer data software compare CRC err count
312     DWORD   dwCntDecryptErr;            // rx buffer data software compare CRC err count
313     DWORD   dwCntRxICVErr;              // rx buffer data software compare CRC err count
314     UINT    idxRxErrorDesc[TYPE_MAXRD]; // index for rx data error RD
315
316     // 64-bit OID
317     ULONGLONG   ullTsrOK[TYPE_MAXTD];
318
319     // for some optional OIDs (64 bits) and DMI support
320     ULONGLONG   ullTxBroadcastFrames[TYPE_MAXTD];
321     ULONGLONG   ullTxMulticastFrames[TYPE_MAXTD];
322     ULONGLONG   ullTxDirectedFrames[TYPE_MAXTD];
323     ULONGLONG   ullTxBroadcastBytes[TYPE_MAXTD];
324     ULONGLONG   ullTxMulticastBytes[TYPE_MAXTD];
325     ULONGLONG   ullTxDirectedBytes[TYPE_MAXTD];
326
327 //    DWORD   dwTxRetryCount[8];
328     //
329     // ISR status count
330     //
331     SISRCounters ISRStat;
332
333     SCustomCounters CustomStat;
334
335    #ifdef Calcu_LinkQual
336        //Tx count:
337     ULONG TxNoRetryOkCount;         //success tx no retry !
338     ULONG TxRetryOkCount;              //sucess tx but retry !
339     ULONG TxFailCount;                      //fail tx ?
340       //Rx count:
341     ULONG RxOkCnt;                          //sucess rx !
342     ULONG RxFcsErrCnt;                    //fail rx ?
343       //statistic
344     ULONG SignalStren;
345     ULONG LinkQuality;
346    #endif
347 } SStatCounter, DEF* PSStatCounter;
348
349 /*---------------------  Export Classes  ----------------------------*/
350
351 /*---------------------  Export Variables  --------------------------*/
352
353 /*---------------------  Export Functions  --------------------------*/
354 #ifdef __cplusplus
355 extern "C" {                            /* Assume C declarations for C++ */
356 #endif /* __cplusplus */
357
358
359 void STAvClearAllCounter(PSStatCounter pStatistic);
360
361 void STAvUpdateIsrStatCounter(PSStatCounter pStatistic, DWORD dwIsr);
362
363 void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
364                               BYTE byRSR, BYTE byNewRSR, BYTE byRxRate,
365                               PBYTE pbyBuffer, UINT cbFrameLength);
366
367 void STAvUpdateRDStatCounterEx(PSStatCounter pStatistic,
368                               BYTE byRSR, BYTE byNewRsr, BYTE byRxRate,
369                               PBYTE pbyBuffer, UINT cbFrameLength);
370
371 void STAvUpdateTDStatCounter(PSStatCounter pStatistic,
372                              BYTE byTSR0, BYTE byTSR1,
373                              PBYTE pbyBuffer, UINT cbFrameLength, UINT uIdx );
374
375 void STAvUpdateTDStatCounterEx(
376     PSStatCounter   pStatistic,
377     PBYTE           pbyBuffer,
378     DWORD           cbFrameLength
379     );
380
381 void STAvUpdate802_11Counter(
382     PSDot11Counters p802_11Counter,
383     PSStatCounter   pStatistic,
384     DWORD           dwCounter
385     );
386
387 void STAvClear802_11Counter(PSDot11Counters p802_11Counter);
388
389 #ifdef __cplusplus
390 }                                       /* End of extern "C" { */
391 #endif /* __cplusplus */
392
393
394
395
396 #endif // __MIB_H__
397
398
399