blob: 6b99c119b78f852f4690e19665adbaf38afa5abd [file] [log] [blame]
Forest Bond5449c682009-04-25 10:30:44 -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 Bond5449c682009-04-25 10:30:44 -040032#include "ttype.h"
Forest Bond5449c682009-04-25 10:30:44 -040033#include "tether.h"
Forest Bond5449c682009-04-25 10:30:44 -040034#include "desc.h"
Forest Bond5449c682009-04-25 10:30:44 -040035
36/*--------------------- Export Definitions -------------------------*/
37//
38// 802.11 counter
39//
40
41typedef struct tagSDot11Counters {
Joe Perchesfd0badb2013-03-18 10:44:56 -070042 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;
Charles Clémentb2e876b2010-06-02 09:52:03 -070064// unsigned long long WEPUndecryptableCount;
65// unsigned long long WEPICVErrorCount;
66// unsigned long long DecryptSuccessCount;
67// unsigned long long DecryptFailureCount;
Jim Lieba8848472009-08-12 14:54:07 -070068} SDot11Counters, *PSDot11Counters;
Forest Bond5449c682009-04-25 10:30:44 -040069
Forest Bond5449c682009-04-25 10:30:44 -040070//
71// MIB2 counter
72//
73typedef struct tagSMib2Counter {
Joe Perchesfd0badb2013-03-18 10:44:56 -070074 long ifIndex;
75 char ifDescr[256]; // max size 255 plus zero ending
76 // e.g. "interface 1"
77 long ifType;
78 long ifMtu;
79 unsigned long ifSpeed;
80 unsigned char ifPhysAddress[ETH_ALEN];
81 long ifAdminStatus;
82 long ifOperStatus;
83 unsigned long ifLastChange;
84 unsigned long ifInOctets;
85 unsigned long ifInUcastPkts;
86 unsigned long ifInNUcastPkts;
87 unsigned long ifInDiscards;
88 unsigned long ifInErrors;
89 unsigned long ifInUnknownProtos;
90 unsigned long ifOutOctets;
91 unsigned long ifOutUcastPkts;
92 unsigned long ifOutNUcastPkts;
93 unsigned long ifOutDiscards;
94 unsigned long ifOutErrors;
95 unsigned long ifOutQLen;
96 unsigned long ifSpecific;
Jim Lieba8848472009-08-12 14:54:07 -070097} SMib2Counter, *PSMib2Counter;
Forest Bond5449c682009-04-25 10:30:44 -040098
99// Value in the ifType entry
Forest Bond5449c682009-04-25 10:30:44 -0400100#define WIRELESSLANIEEE80211b 6 //
101
102// Value in the ifAdminStatus/ifOperStatus entry
103#define UP 1 //
104#define DOWN 2 //
105#define TESTING 3 //
106
Forest Bond5449c682009-04-25 10:30:44 -0400107//
108// RMON counter
109//
110typedef struct tagSRmonCounter {
Joe Perchesfd0badb2013-03-18 10:44:56 -0700111 long etherStatsIndex;
112 unsigned long etherStatsDataSource;
113 unsigned long etherStatsDropEvents;
114 unsigned long etherStatsOctets;
115 unsigned long etherStatsPkts;
116 unsigned long etherStatsBroadcastPkts;
117 unsigned long etherStatsMulticastPkts;
118 unsigned long etherStatsCRCAlignErrors;
119 unsigned long etherStatsUndersizePkts;
120 unsigned long etherStatsOversizePkts;
121 unsigned long etherStatsFragments;
122 unsigned long etherStatsJabbers;
123 unsigned long etherStatsCollisions;
124 unsigned long etherStatsPkt64Octets;
125 unsigned long etherStatsPkt65to127Octets;
126 unsigned long etherStatsPkt128to255Octets;
127 unsigned long etherStatsPkt256to511Octets;
128 unsigned long etherStatsPkt512to1023Octets;
129 unsigned long etherStatsPkt1024to1518Octets;
130 unsigned long etherStatsOwners;
131 unsigned long etherStatsStatus;
Jim Lieba8848472009-08-12 14:54:07 -0700132} SRmonCounter, *PSRmonCounter;
Forest Bond5449c682009-04-25 10:30:44 -0400133
134//
135// Custom counter
136//
137typedef struct tagSCustomCounters {
Joe Perchesfd0badb2013-03-18 10:44:56 -0700138 unsigned long Length;
Forest Bond5449c682009-04-25 10:30:44 -0400139
Joe Perchesfd0badb2013-03-18 10:44:56 -0700140 unsigned long long ullTsrAllOK;
Forest Bond5449c682009-04-25 10:30:44 -0400141
Joe Perchesfd0badb2013-03-18 10:44:56 -0700142 unsigned long long ullRsr11M;
143 unsigned long long ullRsr5M;
144 unsigned long long ullRsr2M;
145 unsigned long long ullRsr1M;
Forest Bond5449c682009-04-25 10:30:44 -0400146
Joe Perchesfd0badb2013-03-18 10:44:56 -0700147 unsigned long long ullRsr11MCRCOk;
148 unsigned long long ullRsr5MCRCOk;
149 unsigned long long ullRsr2MCRCOk;
150 unsigned long long ullRsr1MCRCOk;
Forest Bond5449c682009-04-25 10:30:44 -0400151
Joe Perchesfd0badb2013-03-18 10:44:56 -0700152 unsigned long long ullRsr54M;
153 unsigned long long ullRsr48M;
154 unsigned long long ullRsr36M;
155 unsigned long long ullRsr24M;
156 unsigned long long ullRsr18M;
157 unsigned long long ullRsr12M;
158 unsigned long long ullRsr9M;
159 unsigned long long ullRsr6M;
Forest Bond5449c682009-04-25 10:30:44 -0400160
Joe Perchesfd0badb2013-03-18 10:44:56 -0700161 unsigned long long ullRsr54MCRCOk;
162 unsigned long long ullRsr48MCRCOk;
163 unsigned long long ullRsr36MCRCOk;
164 unsigned long long ullRsr24MCRCOk;
165 unsigned long long ullRsr18MCRCOk;
166 unsigned long long ullRsr12MCRCOk;
167 unsigned long long ullRsr9MCRCOk;
168 unsigned long long ullRsr6MCRCOk;
Jim Lieba8848472009-08-12 14:54:07 -0700169} SCustomCounters, *PSCustomCounters;
Forest Bond5449c682009-04-25 10:30:44 -0400170
Forest Bond5449c682009-04-25 10:30:44 -0400171//
172// Custom counter
173//
174typedef struct tagSISRCounters {
Joe Perchesfd0badb2013-03-18 10:44:56 -0700175 unsigned long Length;
Forest Bond5449c682009-04-25 10:30:44 -0400176
Joe Perchesfd0badb2013-03-18 10:44:56 -0700177 unsigned long dwIsrTx0OK;
178 unsigned long dwIsrAC0TxOK;
179 unsigned long dwIsrBeaconTxOK;
180 unsigned long dwIsrRx0OK;
181 unsigned long dwIsrTBTTInt;
182 unsigned long dwIsrSTIMERInt;
183 unsigned long dwIsrWatchDog;
184 unsigned long dwIsrUnrecoverableError;
185 unsigned long dwIsrSoftInterrupt;
186 unsigned long dwIsrMIBNearfull;
187 unsigned long dwIsrRxNoBuf;
Forest Bond5449c682009-04-25 10:30:44 -0400188
Joe Perchesfd0badb2013-03-18 10:44:56 -0700189 unsigned long dwIsrUnknown; // unknown interrupt count
Forest Bond5449c682009-04-25 10:30:44 -0400190
Joe Perchesfd0badb2013-03-18 10:44:56 -0700191 unsigned long dwIsrRx1OK;
192 unsigned long dwIsrATIMTxOK;
193 unsigned long dwIsrSYNCTxOK;
194 unsigned long dwIsrCFPEnd;
195 unsigned long dwIsrATIMEnd;
196 unsigned long dwIsrSYNCFlushOK;
197 unsigned long dwIsrSTIMER1Int;
198 /////////////////////////////////////
Jim Lieba8848472009-08-12 14:54:07 -0700199} SISRCounters, *PSISRCounters;
Forest Bond5449c682009-04-25 10:30:44 -0400200
Forest Bond5449c682009-04-25 10:30:44 -0400201// Value in the etherStatsStatus entry
202#define VALID 1 //
203#define CREATE_REQUEST 2 //
204#define UNDER_CREATION 3 //
205#define INVALID 4 //
206
Forest Bond5449c682009-04-25 10:30:44 -0400207//
208// statistic counter
209//
210typedef struct tagSStatCounter {
Joe Perchesfd0badb2013-03-18 10:44:56 -0700211 //
212 // ISR status count
213 //
Forest Bond5449c682009-04-25 10:30:44 -0400214
Joe Perchesfd0badb2013-03-18 10:44:56 -0700215 // RSR status count
216 //
217 unsigned long dwRsrFrmAlgnErr;
218 unsigned long dwRsrErr;
219 unsigned long dwRsrCRCErr;
220 unsigned long dwRsrCRCOk;
221 unsigned long dwRsrBSSIDOk;
222 unsigned long dwRsrADDROk;
223 unsigned long dwRsrBCNSSIDOk;
224 unsigned long dwRsrLENErr;
225 unsigned long dwRsrTYPErr;
Forest Bond5449c682009-04-25 10:30:44 -0400226
Joe Perchesfd0badb2013-03-18 10:44:56 -0700227 unsigned long dwNewRsrDECRYPTOK;
228 unsigned long dwNewRsrCFP;
229 unsigned long dwNewRsrUTSF;
230 unsigned long dwNewRsrHITAID;
231 unsigned long dwNewRsrHITAID0;
Forest Bond5449c682009-04-25 10:30:44 -0400232
Joe Perchesfd0badb2013-03-18 10:44:56 -0700233 unsigned long dwRsrLong;
234 unsigned long dwRsrRunt;
Forest Bond5449c682009-04-25 10:30:44 -0400235
Joe Perchesfd0badb2013-03-18 10:44:56 -0700236 unsigned long dwRsrRxControl;
237 unsigned long dwRsrRxData;
238 unsigned long dwRsrRxManage;
Forest Bond5449c682009-04-25 10:30:44 -0400239
Joe Perchesfd0badb2013-03-18 10:44:56 -0700240 unsigned long dwRsrRxPacket;
241 unsigned long dwRsrRxOctet;
242 unsigned long dwRsrBroadcast;
243 unsigned long dwRsrMulticast;
244 unsigned long dwRsrDirected;
245 // 64-bit OID
246 unsigned long long ullRsrOK;
Forest Bond5449c682009-04-25 10:30:44 -0400247
Joe Perchesfd0badb2013-03-18 10:44:56 -0700248 // for some optional OIDs (64 bits) and DMI support
249 unsigned long long ullRxBroadcastBytes;
250 unsigned long long ullRxMulticastBytes;
251 unsigned long long ullRxDirectedBytes;
252 unsigned long long ullRxBroadcastFrames;
253 unsigned long long ullRxMulticastFrames;
254 unsigned long long ullRxDirectedFrames;
Forest Bond5449c682009-04-25 10:30:44 -0400255
Joe Perchesfd0badb2013-03-18 10:44:56 -0700256 unsigned long dwRsrRxFragment;
257 unsigned long dwRsrRxFrmLen64;
258 unsigned long dwRsrRxFrmLen65_127;
259 unsigned long dwRsrRxFrmLen128_255;
260 unsigned long dwRsrRxFrmLen256_511;
261 unsigned long dwRsrRxFrmLen512_1023;
262 unsigned long dwRsrRxFrmLen1024_1518;
Forest Bond5449c682009-04-25 10:30:44 -0400263
Joe Perchesfd0badb2013-03-18 10:44:56 -0700264 // TSR status count
265 //
266 unsigned long dwTsrTotalRetry[TYPE_MAXTD]; // total collision retry count
267 unsigned long dwTsrOnceRetry[TYPE_MAXTD]; // this packet only occur one collision
268 unsigned long dwTsrMoreThanOnceRetry[TYPE_MAXTD]; // this packet occur more than one collision
269 unsigned long dwTsrRetry[TYPE_MAXTD]; // this packet has ever occur collision,
270 // that is (dwTsrOnceCollision0 + dwTsrMoreThanOnceCollision0)
271 unsigned long dwTsrACKData[TYPE_MAXTD];
272 unsigned long dwTsrErr[TYPE_MAXTD];
273 unsigned long dwAllTsrOK[TYPE_MAXTD];
274 unsigned long dwTsrRetryTimeout[TYPE_MAXTD];
275 unsigned long dwTsrTransmitTimeout[TYPE_MAXTD];
Forest Bond5449c682009-04-25 10:30:44 -0400276
Joe Perchesfd0badb2013-03-18 10:44:56 -0700277 unsigned long dwTsrTxPacket[TYPE_MAXTD];
278 unsigned long dwTsrTxOctet[TYPE_MAXTD];
279 unsigned long dwTsrBroadcast[TYPE_MAXTD];
280 unsigned long dwTsrMulticast[TYPE_MAXTD];
281 unsigned long dwTsrDirected[TYPE_MAXTD];
Forest Bond5449c682009-04-25 10:30:44 -0400282
Joe Perchesfd0badb2013-03-18 10:44:56 -0700283 // RD/TD count
284 unsigned long dwCntRxFrmLength;
285 unsigned long dwCntTxBufLength;
Forest Bond5449c682009-04-25 10:30:44 -0400286
Joe Perchesfd0badb2013-03-18 10:44:56 -0700287 unsigned char abyCntRxPattern[16];
288 unsigned char abyCntTxPattern[16];
Forest Bond5449c682009-04-25 10:30:44 -0400289
Joe Perchesfd0badb2013-03-18 10:44:56 -0700290 // Software check....
291 unsigned long dwCntRxDataErr; // rx buffer data software compare CRC err count
292 unsigned long dwCntDecryptErr; // rx buffer data software compare CRC err count
293 unsigned long dwCntRxICVErr; // rx buffer data software compare CRC err count
294 unsigned int idxRxErrorDesc[TYPE_MAXRD]; // index for rx data error RD
Forest Bond5449c682009-04-25 10:30:44 -0400295
Joe Perchesfd0badb2013-03-18 10:44:56 -0700296 // 64-bit OID
297 unsigned long long ullTsrOK[TYPE_MAXTD];
Forest Bond5449c682009-04-25 10:30:44 -0400298
Joe Perchesfd0badb2013-03-18 10:44:56 -0700299 // for some optional OIDs (64 bits) and DMI support
300 unsigned long long ullTxBroadcastFrames[TYPE_MAXTD];
301 unsigned long long ullTxMulticastFrames[TYPE_MAXTD];
302 unsigned long long ullTxDirectedFrames[TYPE_MAXTD];
303 unsigned long long ullTxBroadcastBytes[TYPE_MAXTD];
304 unsigned long long ullTxMulticastBytes[TYPE_MAXTD];
305 unsigned long long ullTxDirectedBytes[TYPE_MAXTD];
Forest Bond5449c682009-04-25 10:30:44 -0400306
Charles Clément0f4c60d2010-06-24 11:02:25 -0700307// unsigned long dwTxRetryCount[8];
Joe Perchesfd0badb2013-03-18 10:44:56 -0700308 //
309 // ISR status count
310 //
311 SISRCounters ISRStat;
Forest Bond5449c682009-04-25 10:30:44 -0400312
Joe Perchesfd0badb2013-03-18 10:44:56 -0700313 SCustomCounters CustomStat;
Forest Bond5449c682009-04-25 10:30:44 -0400314
Joe Perchesfd0badb2013-03-18 10:44:56 -0700315#ifdef Calcu_LinkQual
316 //Tx count:
317 unsigned long TxNoRetryOkCount; //success tx no retry !
318 unsigned long TxRetryOkCount; //success tx but retry !
319 unsigned long TxFailCount; //fail tx ?
320 //Rx count:
321 unsigned long RxOkCnt; //success rx !
322 unsigned long RxFcsErrCnt; //fail rx ?
323 //statistic
324 unsigned long SignalStren;
325 unsigned long LinkQuality;
326#endif
Jim Lieba8848472009-08-12 14:54:07 -0700327} SStatCounter, *PSStatCounter;
Forest Bond5449c682009-04-25 10:30:44 -0400328
329/*--------------------- Export Classes ----------------------------*/
330
331/*--------------------- Export Variables --------------------------*/
332
333/*--------------------- Export Functions --------------------------*/
Forest Bond5449c682009-04-25 10:30:44 -0400334
335void STAvClearAllCounter(PSStatCounter pStatistic);
336
Charles Clément0f4c60d2010-06-24 11:02:25 -0700337void STAvUpdateIsrStatCounter(PSStatCounter pStatistic, unsigned long dwIsr);
Forest Bond5449c682009-04-25 10:30:44 -0400338
339void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
Joe Perchesfd0badb2013-03-18 10:44:56 -0700340 unsigned char byRSR, unsigned char byNewRSR, unsigned char byRxRate,
341 unsigned char *pbyBuffer, unsigned int cbFrameLength);
Forest Bond5449c682009-04-25 10:30:44 -0400342
343void STAvUpdateRDStatCounterEx(PSStatCounter pStatistic,
Joe Perchesfd0badb2013-03-18 10:44:56 -0700344 unsigned char byRSR, unsigned char byNewRsr, unsigned char byRxRate,
345 unsigned char *pbyBuffer, unsigned int cbFrameLength);
Forest Bond5449c682009-04-25 10:30:44 -0400346
Charles Clément3fc9b582010-06-24 11:02:27 -0700347void STAvUpdateTDStatCounter(PSStatCounter pStatistic, unsigned char byTSR0, unsigned char byTSR1,
Joe Perchesfd0badb2013-03-18 10:44:56 -0700348 unsigned char *pbyBuffer, unsigned int cbFrameLength, unsigned int uIdx);
Forest Bond5449c682009-04-25 10:30:44 -0400349
350void STAvUpdateTDStatCounterEx(
Joe Perchesfd0badb2013-03-18 10:44:56 -0700351 PSStatCounter pStatistic,
352 unsigned char *pbyBuffer,
353 unsigned long cbFrameLength
354);
Forest Bond5449c682009-04-25 10:30:44 -0400355
356void STAvUpdate802_11Counter(
Joe Perchesfd0badb2013-03-18 10:44:56 -0700357 PSDot11Counters p802_11Counter,
358 PSStatCounter pStatistic,
359 unsigned long dwCounter
360);
Forest Bond5449c682009-04-25 10:30:44 -0400361
362void STAvClear802_11Counter(PSDot11Counters p802_11Counter);
363
Forest Bond5449c682009-04-25 10:30:44 -0400364#endif // __MIB_H__