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