x86/xen: resume timer irqs early
[linux/fpc-iii.git] / drivers / staging / vt6656 / mib.h
blob35375325a777a62868bc07149ac77e1107d990a7
1 /*
2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
3 * All rights reserved.
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.
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.
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.
19 * File: mib.h
21 * Purpose: Implement MIB Data Structure
23 * Author: Tevin Chen
25 * Date: May 21, 1996
29 #ifndef __MIB_H__
30 #define __MIB_H__
32 #include "tether.h"
33 #include "desc.h"
36 // USB counter
38 typedef struct tagSUSBCounter {
39 u32 dwCrc;
41 } SUSBCounter, *PSUSBCounter;
44 // 802.11 counter
47 typedef struct tagSDot11Counters {
48 /* unsigned long Length; // Length of structure */
49 unsigned long long TransmittedFragmentCount;
50 unsigned long long MulticastTransmittedFrameCount;
51 unsigned long long FailedCount;
52 unsigned long long RetryCount;
53 unsigned long long MultipleRetryCount;
54 unsigned long long RTSSuccessCount;
55 unsigned long long RTSFailureCount;
56 unsigned long long ACKFailureCount;
57 unsigned long long FrameDuplicateCount;
58 unsigned long long ReceivedFragmentCount;
59 unsigned long long MulticastReceivedFrameCount;
60 unsigned long long FCSErrorCount;
61 unsigned long long TKIPLocalMICFailures;
62 unsigned long long TKIPRemoteMICFailures;
63 unsigned long long TKIPICVErrors;
64 unsigned long long TKIPReplays;
65 unsigned long long CCMPFormatErrors;
66 unsigned long long CCMPReplays;
67 unsigned long long CCMPDecryptErrors;
68 unsigned long long FourWayHandshakeFailures;
70 * unsigned long long WEPUndecryptableCount;
71 * unsigned long long WEPICVErrorCount;
72 * unsigned long long DecryptSuccessCount;
73 * unsigned long long DecryptFailureCount;
75 } SDot11Counters, *PSDot11Counters;
78 // MIB2 counter
80 typedef struct tagSMib2Counter {
81 signed long ifIndex;
82 char ifDescr[256]; // max size 255 plus zero ending
83 // e.g. "interface 1"
84 signed long ifType;
85 signed long ifMtu;
86 u32 ifSpeed;
87 u8 ifPhysAddress[ETH_ALEN];
88 signed long ifAdminStatus;
89 signed long ifOperStatus;
90 u32 ifLastChange;
91 u32 ifInOctets;
92 u32 ifInUcastPkts;
93 u32 ifInNUcastPkts;
94 u32 ifInDiscards;
95 u32 ifInErrors;
96 u32 ifInUnknownProtos;
97 u32 ifOutOctets;
98 u32 ifOutUcastPkts;
99 u32 ifOutNUcastPkts;
100 u32 ifOutDiscards;
101 u32 ifOutErrors;
102 u32 ifOutQLen;
103 u32 ifSpecific;
104 } SMib2Counter, *PSMib2Counter;
106 // Value in the ifType entry
107 #define WIRELESSLANIEEE80211b 6 //
109 // Value in the ifAdminStatus/ifOperStatus entry
110 #define UP 1 //
111 #define DOWN 2 //
112 #define TESTING 3 //
115 // RMON counter
117 typedef struct tagSRmonCounter {
118 signed long etherStatsIndex;
119 u32 etherStatsDataSource;
120 u32 etherStatsDropEvents;
121 u32 etherStatsOctets;
122 u32 etherStatsPkts;
123 u32 etherStatsBroadcastPkts;
124 u32 etherStatsMulticastPkts;
125 u32 etherStatsCRCAlignErrors;
126 u32 etherStatsUndersizePkts;
127 u32 etherStatsOversizePkts;
128 u32 etherStatsFragments;
129 u32 etherStatsJabbers;
130 u32 etherStatsCollisions;
131 u32 etherStatsPkt64Octets;
132 u32 etherStatsPkt65to127Octets;
133 u32 etherStatsPkt128to255Octets;
134 u32 etherStatsPkt256to511Octets;
135 u32 etherStatsPkt512to1023Octets;
136 u32 etherStatsPkt1024to1518Octets;
137 u32 etherStatsOwners;
138 u32 etherStatsStatus;
139 } SRmonCounter, *PSRmonCounter;
142 // Custom counter
144 typedef struct tagSCustomCounters {
145 unsigned long Length;
147 unsigned long long ullTsrAllOK;
149 unsigned long long ullRsr11M;
150 unsigned long long ullRsr5M;
151 unsigned long long ullRsr2M;
152 unsigned long long ullRsr1M;
154 unsigned long long ullRsr11MCRCOk;
155 unsigned long long ullRsr5MCRCOk;
156 unsigned long long ullRsr2MCRCOk;
157 unsigned long long ullRsr1MCRCOk;
159 unsigned long long ullRsr54M;
160 unsigned long long ullRsr48M;
161 unsigned long long ullRsr36M;
162 unsigned long long ullRsr24M;
163 unsigned long long ullRsr18M;
164 unsigned long long ullRsr12M;
165 unsigned long long ullRsr9M;
166 unsigned long long ullRsr6M;
168 unsigned long long ullRsr54MCRCOk;
169 unsigned long long ullRsr48MCRCOk;
170 unsigned long long ullRsr36MCRCOk;
171 unsigned long long ullRsr24MCRCOk;
172 unsigned long long ullRsr18MCRCOk;
173 unsigned long long ullRsr12MCRCOk;
174 unsigned long long ullRsr9MCRCOk;
175 unsigned long long ullRsr6MCRCOk;
177 } SCustomCounters, *PSCustomCounters;
180 // Custom counter
182 typedef struct tagSISRCounters {
183 unsigned long Length;
185 u32 dwIsrTx0OK;
186 u32 dwIsrAC0TxOK;
187 u32 dwIsrBeaconTxOK;
188 u32 dwIsrRx0OK;
189 u32 dwIsrTBTTInt;
190 u32 dwIsrSTIMERInt;
191 u32 dwIsrWatchDog;
192 u32 dwIsrUnrecoverableError;
193 u32 dwIsrSoftInterrupt;
194 u32 dwIsrMIBNearfull;
195 u32 dwIsrRxNoBuf;
197 u32 dwIsrUnknown; // unknown interrupt count
199 u32 dwIsrRx1OK;
200 u32 dwIsrATIMTxOK;
201 u32 dwIsrSYNCTxOK;
202 u32 dwIsrCFPEnd;
203 u32 dwIsrATIMEnd;
204 u32 dwIsrSYNCFlushOK;
205 u32 dwIsrSTIMER1Int;
206 /////////////////////////////////////
207 } SISRCounters, *PSISRCounters;
209 // Value in the etherStatsStatus entry
210 #define VALID 1 //
211 #define CREATE_REQUEST 2 //
212 #define UNDER_CREATION 3 //
213 #define INVALID 4 //
216 // Tx packet information
218 typedef struct tagSTxPktInfo {
219 u8 byBroadMultiUni;
220 u16 wLength;
221 u16 wFIFOCtl;
222 u8 abyDestAddr[ETH_ALEN];
223 } STxPktInfo, *PSTxPktInfo;
225 #define MAX_RATE 12
227 // statistic counter
229 typedef struct tagSStatCounter {
231 // ISR status count
234 SISRCounters ISRStat;
236 // RSR status count
238 u32 dwRsrFrmAlgnErr;
239 u32 dwRsrErr;
240 u32 dwRsrCRCErr;
241 u32 dwRsrCRCOk;
242 u32 dwRsrBSSIDOk;
243 u32 dwRsrADDROk;
244 u32 dwRsrBCNSSIDOk;
245 u32 dwRsrLENErr;
246 u32 dwRsrTYPErr;
248 u32 dwNewRsrDECRYPTOK;
249 u32 dwNewRsrCFP;
250 u32 dwNewRsrUTSF;
251 u32 dwNewRsrHITAID;
252 u32 dwNewRsrHITAID0;
254 u32 dwRsrLong;
255 u32 dwRsrRunt;
257 u32 dwRsrRxControl;
258 u32 dwRsrRxData;
259 u32 dwRsrRxManage;
261 u32 dwRsrRxPacket;
262 u32 dwRsrRxOctet;
263 u32 dwRsrBroadcast;
264 u32 dwRsrMulticast;
265 u32 dwRsrDirected;
266 // 64-bit OID
267 unsigned long long ullRsrOK;
269 // for some optional OIDs (64 bits) and DMI support
270 unsigned long long ullRxBroadcastBytes;
271 unsigned long long ullRxMulticastBytes;
272 unsigned long long ullRxDirectedBytes;
273 unsigned long long ullRxBroadcastFrames;
274 unsigned long long ullRxMulticastFrames;
275 unsigned long long ullRxDirectedFrames;
277 u32 dwRsrRxFragment;
278 u32 dwRsrRxFrmLen64;
279 u32 dwRsrRxFrmLen65_127;
280 u32 dwRsrRxFrmLen128_255;
281 u32 dwRsrRxFrmLen256_511;
282 u32 dwRsrRxFrmLen512_1023;
283 u32 dwRsrRxFrmLen1024_1518;
285 // TSR status count
287 u32 dwTsrTotalRetry; // total collision retry count
288 u32 dwTsrOnceRetry; // this packet only occur one collision
289 u32 dwTsrMoreThanOnceRetry; // this packet occur more than one collision
290 u32 dwTsrRetry; // this packet has ever occur collision,
291 // that is (dwTsrOnceCollision0 + dwTsrMoreThanOnceCollision0)
292 u32 dwTsrACKData;
293 u32 dwTsrErr;
294 u32 dwAllTsrOK;
295 u32 dwTsrRetryTimeout;
296 u32 dwTsrTransmitTimeout;
298 u32 dwTsrTxPacket;
299 u32 dwTsrTxOctet;
300 u32 dwTsrBroadcast;
301 u32 dwTsrMulticast;
302 u32 dwTsrDirected;
304 // RD/TD count
305 u32 dwCntRxFrmLength;
306 u32 dwCntTxBufLength;
308 u8 abyCntRxPattern[16];
309 u8 abyCntTxPattern[16];
311 // Software check....
312 u32 dwCntRxDataErr; // rx buffer data software compare CRC err count
313 u32 dwCntDecryptErr; // rx buffer data software compare CRC err count
314 u32 dwCntRxICVErr; // rx buffer data software compare CRC err count
316 // 64-bit OID
317 unsigned long long ullTsrOK;
319 // for some optional OIDs (64 bits) and DMI support
320 unsigned long long ullTxBroadcastFrames;
321 unsigned long long ullTxMulticastFrames;
322 unsigned long long ullTxDirectedFrames;
323 unsigned long long ullTxBroadcastBytes;
324 unsigned long long ullTxMulticastBytes;
325 unsigned long long ullTxDirectedBytes;
327 // for autorate
328 u32 dwTxOk[MAX_RATE+1];
329 u32 dwTxFail[MAX_RATE+1];
330 u32 dwTxRetryCount[8];
332 STxPktInfo abyTxPktInfo[16];
334 SUSBCounter USB_EP0Stat;
335 SUSBCounter USB_BulkInStat;
336 SUSBCounter USB_BulkOutStat;
337 SUSBCounter USB_InterruptStat;
339 SCustomCounters CustomStat;
341 //Tx count:
342 unsigned long TxNoRetryOkCount; /* success tx no retry ! */
343 unsigned long TxRetryOkCount; /* success tx but retry ! */
344 unsigned long TxFailCount; /* fail tx ? */
345 //Rx count:
346 unsigned long RxOkCnt; /* success rx ! */
347 unsigned long RxFcsErrCnt; /* fail rx ? */
348 //statistic
349 unsigned long SignalStren;
350 unsigned long LinkQuality;
352 } SStatCounter, *PSStatCounter;
354 void STAvUpdateIsrStatCounter(PSStatCounter pStatistic,
355 u8 byIsr0,
356 u8 byIsr1);
358 void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
359 u8 byRSR, u8 byNewRSR, u8 byRxSts,
360 u8 byRxRate, u8 * pbyBuffer,
361 unsigned int cbFrameLength);
363 void STAvUpdateTDStatCounter(PSStatCounter pStatistic, u8 byPktNum,
364 u8 byRate, u8 byTSR);
366 void
367 STAvUpdate802_11Counter(
368 PSDot11Counters p802_11Counter,
369 PSStatCounter pStatistic,
370 u8 byRTSSuccess,
371 u8 byRTSFail,
372 u8 byACKFail,
373 u8 byFCSErr
376 void STAvUpdateUSBCounter(PSUSBCounter pUsbCounter, int ntStatus);
378 #endif /* __MIB_H__ */