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