blob: a89cca0c5ecf2d16d2a4d95b7f6de240bf09fe07 [file] [log] [blame]
Forest Bond92b96792009-06-13 07:38:31 -04001/*
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
Forest Bond92b96792009-06-13 07:38:31 -040032#include "ttype.h"
Forest Bond92b96792009-06-13 07:38:31 -040033#include "tether.h"
Forest Bond92b96792009-06-13 07:38:31 -040034#include "desc.h"
Forest Bond92b96792009-06-13 07:38:31 -040035
36/*--------------------- Export Definitions -------------------------*/
37
38
39//
40// USB counter
41//
42typedef struct tagSUSBCounter {
43 DWORD dwCrc;
44
Jim Lieb193a8232009-08-12 14:54:06 -070045} SUSBCounter, *PSUSBCounter;
Forest Bond92b96792009-06-13 07:38:31 -040046
47
48
49//
50// 802.11 counter
51//
52
53
54typedef struct tagSDot11Counters {
Andres Morecc856e62010-05-17 21:34:01 -030055 /* unsigned long Length; // Length of structure */
56 unsigned long long TransmittedFragmentCount;
57 unsigned long long MulticastTransmittedFrameCount;
58 unsigned long long FailedCount;
59 unsigned long long RetryCount;
60 unsigned long long MultipleRetryCount;
61 unsigned long long RTSSuccessCount;
62 unsigned long long RTSFailureCount;
63 unsigned long long ACKFailureCount;
64 unsigned long long FrameDuplicateCount;
65 unsigned long long ReceivedFragmentCount;
66 unsigned long long MulticastReceivedFrameCount;
67 unsigned long long FCSErrorCount;
68 unsigned long long TKIPLocalMICFailures;
69 unsigned long long TKIPRemoteMICFailures;
70 unsigned long long TKIPICVErrors;
71 unsigned long long TKIPCounterMeasuresInvoked;
72 unsigned long long TKIPReplays;
73 unsigned long long CCMPFormatErrors;
74 unsigned long long CCMPReplays;
75 unsigned long long CCMPDecryptErrors;
76 unsigned long long FourWayHandshakeFailures;
77 /*
78 * unsigned long long WEPUndecryptableCount;
79 * unsigned long long WEPICVErrorCount;
80 * unsigned long long DecryptSuccessCount;
81 * unsigned long long DecryptFailureCount;
82 */
Jim Lieb193a8232009-08-12 14:54:06 -070083} SDot11Counters, *PSDot11Counters;
Forest Bond92b96792009-06-13 07:38:31 -040084
85
86//
87// MIB2 counter
88//
89typedef struct tagSMib2Counter {
Andres More213d2e92010-05-17 21:34:00 -030090 signed long ifIndex;
Jim Lieb193a8232009-08-12 14:54:06 -070091 char ifDescr[256]; // max size 255 plus zero ending
Forest Bond92b96792009-06-13 07:38:31 -040092 // e.g. "interface 1"
Andres More213d2e92010-05-17 21:34:00 -030093 signed long ifType;
94 signed long ifMtu;
Forest Bond92b96792009-06-13 07:38:31 -040095 DWORD ifSpeed;
Andres More9a0e7562010-04-13 21:54:48 -030096 BYTE ifPhysAddress[ETH_ALEN];
Andres More213d2e92010-05-17 21:34:00 -030097 signed long ifAdminStatus;
98 signed long ifOperStatus;
Forest Bond92b96792009-06-13 07:38:31 -040099 DWORD ifLastChange;
100 DWORD ifInOctets;
101 DWORD ifInUcastPkts;
102 DWORD ifInNUcastPkts;
103 DWORD ifInDiscards;
104 DWORD ifInErrors;
105 DWORD ifInUnknownProtos;
106 DWORD ifOutOctets;
107 DWORD ifOutUcastPkts;
108 DWORD ifOutNUcastPkts;
109 DWORD ifOutDiscards;
110 DWORD ifOutErrors;
111 DWORD ifOutQLen;
112 DWORD ifSpecific;
Jim Lieb193a8232009-08-12 14:54:06 -0700113} SMib2Counter, *PSMib2Counter;
Forest Bond92b96792009-06-13 07:38:31 -0400114
115// Value in the ifType entry
116//#define ETHERNETCSMACD 6 //
117#define WIRELESSLANIEEE80211b 6 //
118
119// Value in the ifAdminStatus/ifOperStatus entry
120#define UP 1 //
121#define DOWN 2 //
122#define TESTING 3 //
123
124
125//
126// RMON counter
127//
128typedef struct tagSRmonCounter {
Andres More213d2e92010-05-17 21:34:00 -0300129 signed long etherStatsIndex;
Forest Bond92b96792009-06-13 07:38:31 -0400130 DWORD etherStatsDataSource;
131 DWORD etherStatsDropEvents;
132 DWORD etherStatsOctets;
133 DWORD etherStatsPkts;
134 DWORD etherStatsBroadcastPkts;
135 DWORD etherStatsMulticastPkts;
136 DWORD etherStatsCRCAlignErrors;
137 DWORD etherStatsUndersizePkts;
138 DWORD etherStatsOversizePkts;
139 DWORD etherStatsFragments;
140 DWORD etherStatsJabbers;
141 DWORD etherStatsCollisions;
142 DWORD etherStatsPkt64Octets;
143 DWORD etherStatsPkt65to127Octets;
144 DWORD etherStatsPkt128to255Octets;
145 DWORD etherStatsPkt256to511Octets;
146 DWORD etherStatsPkt512to1023Octets;
147 DWORD etherStatsPkt1024to1518Octets;
148 DWORD etherStatsOwners;
149 DWORD etherStatsStatus;
Jim Lieb193a8232009-08-12 14:54:06 -0700150} SRmonCounter, *PSRmonCounter;
Forest Bond92b96792009-06-13 07:38:31 -0400151
152//
153// Custom counter
154//
155typedef struct tagSCustomCounters {
Andres Morecc856e62010-05-17 21:34:01 -0300156 unsigned long Length;
Forest Bond92b96792009-06-13 07:38:31 -0400157
Andres Morecc856e62010-05-17 21:34:01 -0300158 unsigned long long ullTsrAllOK;
Forest Bond92b96792009-06-13 07:38:31 -0400159
Andres Morecc856e62010-05-17 21:34:01 -0300160 unsigned long long ullRsr11M;
161 unsigned long long ullRsr5M;
162 unsigned long long ullRsr2M;
163 unsigned long long ullRsr1M;
Forest Bond92b96792009-06-13 07:38:31 -0400164
Andres Morecc856e62010-05-17 21:34:01 -0300165 unsigned long long ullRsr11MCRCOk;
166 unsigned long long ullRsr5MCRCOk;
167 unsigned long long ullRsr2MCRCOk;
168 unsigned long long ullRsr1MCRCOk;
Forest Bond92b96792009-06-13 07:38:31 -0400169
Andres Morecc856e62010-05-17 21:34:01 -0300170 unsigned long long ullRsr54M;
171 unsigned long long ullRsr48M;
172 unsigned long long ullRsr36M;
173 unsigned long long ullRsr24M;
174 unsigned long long ullRsr18M;
175 unsigned long long ullRsr12M;
176 unsigned long long ullRsr9M;
177 unsigned long long ullRsr6M;
Forest Bond92b96792009-06-13 07:38:31 -0400178
Andres Morecc856e62010-05-17 21:34:01 -0300179 unsigned long long ullRsr54MCRCOk;
180 unsigned long long ullRsr48MCRCOk;
181 unsigned long long ullRsr36MCRCOk;
182 unsigned long long ullRsr24MCRCOk;
183 unsigned long long ullRsr18MCRCOk;
184 unsigned long long ullRsr12MCRCOk;
185 unsigned long long ullRsr9MCRCOk;
186 unsigned long long ullRsr6MCRCOk;
Forest Bond92b96792009-06-13 07:38:31 -0400187
Jim Lieb193a8232009-08-12 14:54:06 -0700188} SCustomCounters, *PSCustomCounters;
Forest Bond92b96792009-06-13 07:38:31 -0400189
190
191//
192// Custom counter
193//
194typedef struct tagSISRCounters {
Andres Morecc856e62010-05-17 21:34:01 -0300195 unsigned long Length;
Forest Bond92b96792009-06-13 07:38:31 -0400196
197 DWORD dwIsrTx0OK;
198 DWORD dwIsrAC0TxOK;
199 DWORD dwIsrBeaconTxOK;
200 DWORD dwIsrRx0OK;
201 DWORD dwIsrTBTTInt;
202 DWORD dwIsrSTIMERInt;
203 DWORD dwIsrWatchDog;
204 DWORD dwIsrUnrecoverableError;
205 DWORD dwIsrSoftInterrupt;
206 DWORD dwIsrMIBNearfull;
207 DWORD dwIsrRxNoBuf;
208
209 DWORD dwIsrUnknown; // unknown interrupt count
210
211 DWORD dwIsrRx1OK;
212 DWORD dwIsrATIMTxOK;
213 DWORD dwIsrSYNCTxOK;
214 DWORD dwIsrCFPEnd;
215 DWORD dwIsrATIMEnd;
216 DWORD dwIsrSYNCFlushOK;
217 DWORD dwIsrSTIMER1Int;
218 /////////////////////////////////////
Jim Lieb193a8232009-08-12 14:54:06 -0700219} SISRCounters, *PSISRCounters;
Forest Bond92b96792009-06-13 07:38:31 -0400220
221
222// Value in the etherStatsStatus entry
223#define VALID 1 //
224#define CREATE_REQUEST 2 //
225#define UNDER_CREATION 3 //
226#define INVALID 4 //
227
228
229//
230// Tx packet information
231//
232typedef struct tagSTxPktInfo {
233 BYTE byBroadMultiUni;
234 WORD wLength;
235 WORD wFIFOCtl;
Andres More9a0e7562010-04-13 21:54:48 -0300236 BYTE abyDestAddr[ETH_ALEN];
Jim Lieb193a8232009-08-12 14:54:06 -0700237} STxPktInfo, *PSTxPktInfo;
Forest Bond92b96792009-06-13 07:38:31 -0400238
239
240#define MAX_RATE 12
241//
242// statistic counter
243//
244typedef struct tagSStatCounter {
245 //
246 // ISR status count
247 //
248
249 SISRCounters ISRStat;
250
251 // RSR status count
252 //
253 DWORD dwRsrFrmAlgnErr;
254 DWORD dwRsrErr;
255 DWORD dwRsrCRCErr;
256 DWORD dwRsrCRCOk;
257 DWORD dwRsrBSSIDOk;
258 DWORD dwRsrADDROk;
259 DWORD dwRsrBCNSSIDOk;
260 DWORD dwRsrLENErr;
261 DWORD dwRsrTYPErr;
262
263 DWORD dwNewRsrDECRYPTOK;
264 DWORD dwNewRsrCFP;
265 DWORD dwNewRsrUTSF;
266 DWORD dwNewRsrHITAID;
267 DWORD dwNewRsrHITAID0;
268
269 DWORD dwRsrLong;
270 DWORD dwRsrRunt;
271
272 DWORD dwRsrRxControl;
273 DWORD dwRsrRxData;
274 DWORD dwRsrRxManage;
275
276 DWORD dwRsrRxPacket;
277 DWORD dwRsrRxOctet;
278 DWORD dwRsrBroadcast;
279 DWORD dwRsrMulticast;
280 DWORD dwRsrDirected;
281 // 64-bit OID
Andres Morecc856e62010-05-17 21:34:01 -0300282 unsigned long long ullRsrOK;
Forest Bond92b96792009-06-13 07:38:31 -0400283
284 // for some optional OIDs (64 bits) and DMI support
Andres Morecc856e62010-05-17 21:34:01 -0300285 unsigned long long ullRxBroadcastBytes;
286 unsigned long long ullRxMulticastBytes;
287 unsigned long long ullRxDirectedBytes;
288 unsigned long long ullRxBroadcastFrames;
289 unsigned long long ullRxMulticastFrames;
290 unsigned long long ullRxDirectedFrames;
Forest Bond92b96792009-06-13 07:38:31 -0400291
292 DWORD dwRsrRxFragment;
293 DWORD dwRsrRxFrmLen64;
294 DWORD dwRsrRxFrmLen65_127;
295 DWORD dwRsrRxFrmLen128_255;
296 DWORD dwRsrRxFrmLen256_511;
297 DWORD dwRsrRxFrmLen512_1023;
298 DWORD dwRsrRxFrmLen1024_1518;
299
300 // TSR status count
301 //
302 DWORD dwTsrTotalRetry; // total collision retry count
303 DWORD dwTsrOnceRetry; // this packet only occur one collision
304 DWORD dwTsrMoreThanOnceRetry; // this packet occur more than one collision
305 DWORD dwTsrRetry; // this packet has ever occur collision,
306 // that is (dwTsrOnceCollision0 + dwTsrMoreThanOnceCollision0)
307 DWORD dwTsrACKData;
308 DWORD dwTsrErr;
309 DWORD dwAllTsrOK;
310 DWORD dwTsrRetryTimeout;
311 DWORD dwTsrTransmitTimeout;
312
313 DWORD dwTsrTxPacket;
314 DWORD dwTsrTxOctet;
315 DWORD dwTsrBroadcast;
316 DWORD dwTsrMulticast;
317 DWORD dwTsrDirected;
318
319 // RD/TD count
320 DWORD dwCntRxFrmLength;
321 DWORD dwCntTxBufLength;
322
323 BYTE abyCntRxPattern[16];
324 BYTE abyCntTxPattern[16];
325
326
327
328 // Software check....
329 DWORD dwCntRxDataErr; // rx buffer data software compare CRC err count
330 DWORD dwCntDecryptErr; // rx buffer data software compare CRC err count
331 DWORD dwCntRxICVErr; // rx buffer data software compare CRC err count
332
333
334 // 64-bit OID
Andres Morecc856e62010-05-17 21:34:01 -0300335 unsigned long long ullTsrOK;
Forest Bond92b96792009-06-13 07:38:31 -0400336
337 // for some optional OIDs (64 bits) and DMI support
Andres Morecc856e62010-05-17 21:34:01 -0300338 unsigned long long ullTxBroadcastFrames;
339 unsigned long long ullTxMulticastFrames;
340 unsigned long long ullTxDirectedFrames;
341 unsigned long long ullTxBroadcastBytes;
342 unsigned long long ullTxMulticastBytes;
343 unsigned long long ullTxDirectedBytes;
Forest Bond92b96792009-06-13 07:38:31 -0400344
345 // for autorate
346 DWORD dwTxOk[MAX_RATE+1];
347 DWORD dwTxFail[MAX_RATE+1];
348 DWORD dwTxRetryCount[8];
349
350 STxPktInfo abyTxPktInfo[16];
351
352 SUSBCounter USB_EP0Stat;
353 SUSBCounter USB_BulkInStat;
354 SUSBCounter USB_BulkOutStat;
355 SUSBCounter USB_InterruptStat;
356
357 SCustomCounters CustomStat;
358
Forest Bond92b96792009-06-13 07:38:31 -0400359 //Tx count:
Andres Morecc856e62010-05-17 21:34:01 -0300360 unsigned long TxNoRetryOkCount; /* success tx no retry ! */
361 unsigned long TxRetryOkCount; /* success tx but retry ! */
362 unsigned long TxFailCount; /* fail tx ? */
Forest Bond92b96792009-06-13 07:38:31 -0400363 //Rx count:
Andres Morecc856e62010-05-17 21:34:01 -0300364 unsigned long RxOkCnt; /* success rx ! */
365 unsigned long RxFcsErrCnt; /* fail rx ? */
Forest Bond92b96792009-06-13 07:38:31 -0400366 //statistic
Andres Morecc856e62010-05-17 21:34:01 -0300367 unsigned long SignalStren;
368 unsigned long LinkQuality;
Forest Bond92b96792009-06-13 07:38:31 -0400369
Jim Lieb193a8232009-08-12 14:54:06 -0700370} SStatCounter, *PSStatCounter;
Forest Bond92b96792009-06-13 07:38:31 -0400371
Forest Bond92b96792009-06-13 07:38:31 -0400372/*--------------------- Export Classes ----------------------------*/
373
374/*--------------------- Export Variables --------------------------*/
375
376/*--------------------- Export Functions --------------------------*/
Forest Bond92b96792009-06-13 07:38:31 -0400377
378void STAvClearAllCounter(PSStatCounter pStatistic);
379
Andres Mored9d1ccb2010-05-26 20:00:36 -0300380void STAvUpdateIsrStatCounter(PSStatCounter pStatistic,
381 BYTE byIsr0,
382 BYTE byIsr1);
Forest Bond92b96792009-06-13 07:38:31 -0400383
384void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
Andres Morecc856e62010-05-17 21:34:01 -0300385 BYTE byRSR, BYTE byNewRSR, BYTE byRxSts,
386 BYTE byRxRate, PBYTE pbyBuffer,
387 unsigned int cbFrameLength);
Forest Bond92b96792009-06-13 07:38:31 -0400388
389void STAvUpdateRDStatCounterEx(PSStatCounter pStatistic,
Andres Morecc856e62010-05-17 21:34:01 -0300390 BYTE byRSR, BYTE byNewRSR, BYTE byRxSts,
391 BYTE byRxRate, PBYTE pbyBuffer,
392 unsigned int cbFrameLength);
Forest Bond92b96792009-06-13 07:38:31 -0400393
Andres Mored9d1ccb2010-05-26 20:00:36 -0300394void STAvUpdateTDStatCounter(PSStatCounter pStatistic, BYTE byPktNum,
395 BYTE byRate, BYTE byTSR);
Forest Bond92b96792009-06-13 07:38:31 -0400396
397void
398STAvUpdate802_11Counter(
399 PSDot11Counters p802_11Counter,
400 PSStatCounter pStatistic,
401 BYTE byRTSSuccess,
402 BYTE byRTSFail,
403 BYTE byACKFail,
404 BYTE byFCSErr
405 );
406
407void STAvClear802_11Counter(PSDot11Counters p802_11Counter);
Andres More6487c492010-08-02 20:51:57 -0300408void STAvUpdateUSBCounter(PSUSBCounter pUsbCounter, int ntStatus);
Forest Bond92b96792009-06-13 07:38:31 -0400409
Andres Moree7b07d12010-05-01 19:12:26 -0300410#endif /* __MIB_H__ */