2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
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.
21 * Purpose: Implement MIB Data Structure
36 /*--------------------- Export Definitions -------------------------*/
42 typedef struct tagSUSBCounter
{
45 } SUSBCounter
, *PSUSBCounter
;
54 typedef struct tagSDot11Counters
{
55 /* 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 TKIPReplays
;
72 unsigned long long CCMPFormatErrors
;
73 unsigned long long CCMPReplays
;
74 unsigned long long CCMPDecryptErrors
;
75 unsigned long long FourWayHandshakeFailures
;
77 * unsigned long long WEPUndecryptableCount;
78 * unsigned long long WEPICVErrorCount;
79 * unsigned long long DecryptSuccessCount;
80 * unsigned long long DecryptFailureCount;
82 } SDot11Counters
, *PSDot11Counters
;
88 typedef struct tagSMib2Counter
{
90 char ifDescr
[256]; // max size 255 plus zero ending
95 BYTE ifPhysAddress
[ETH_ALEN
];
96 signed long ifAdminStatus
;
97 signed long ifOperStatus
;
101 DWORD ifInNUcastPkts
;
104 DWORD ifInUnknownProtos
;
106 DWORD ifOutUcastPkts
;
107 DWORD ifOutNUcastPkts
;
112 } SMib2Counter
, *PSMib2Counter
;
114 // Value in the ifType entry
115 #define WIRELESSLANIEEE80211b 6 //
117 // Value in the ifAdminStatus/ifOperStatus entry
126 typedef struct tagSRmonCounter
{
127 signed long etherStatsIndex
;
128 DWORD etherStatsDataSource
;
129 DWORD etherStatsDropEvents
;
130 DWORD etherStatsOctets
;
131 DWORD etherStatsPkts
;
132 DWORD etherStatsBroadcastPkts
;
133 DWORD etherStatsMulticastPkts
;
134 DWORD etherStatsCRCAlignErrors
;
135 DWORD etherStatsUndersizePkts
;
136 DWORD etherStatsOversizePkts
;
137 DWORD etherStatsFragments
;
138 DWORD etherStatsJabbers
;
139 DWORD etherStatsCollisions
;
140 DWORD etherStatsPkt64Octets
;
141 DWORD etherStatsPkt65to127Octets
;
142 DWORD etherStatsPkt128to255Octets
;
143 DWORD etherStatsPkt256to511Octets
;
144 DWORD etherStatsPkt512to1023Octets
;
145 DWORD etherStatsPkt1024to1518Octets
;
146 DWORD etherStatsOwners
;
147 DWORD etherStatsStatus
;
148 } SRmonCounter
, *PSRmonCounter
;
153 typedef struct tagSCustomCounters
{
154 unsigned long Length
;
156 unsigned long long ullTsrAllOK
;
158 unsigned long long ullRsr11M
;
159 unsigned long long ullRsr5M
;
160 unsigned long long ullRsr2M
;
161 unsigned long long ullRsr1M
;
163 unsigned long long ullRsr11MCRCOk
;
164 unsigned long long ullRsr5MCRCOk
;
165 unsigned long long ullRsr2MCRCOk
;
166 unsigned long long ullRsr1MCRCOk
;
168 unsigned long long ullRsr54M
;
169 unsigned long long ullRsr48M
;
170 unsigned long long ullRsr36M
;
171 unsigned long long ullRsr24M
;
172 unsigned long long ullRsr18M
;
173 unsigned long long ullRsr12M
;
174 unsigned long long ullRsr9M
;
175 unsigned long long ullRsr6M
;
177 unsigned long long ullRsr54MCRCOk
;
178 unsigned long long ullRsr48MCRCOk
;
179 unsigned long long ullRsr36MCRCOk
;
180 unsigned long long ullRsr24MCRCOk
;
181 unsigned long long ullRsr18MCRCOk
;
182 unsigned long long ullRsr12MCRCOk
;
183 unsigned long long ullRsr9MCRCOk
;
184 unsigned long long ullRsr6MCRCOk
;
186 } SCustomCounters
, *PSCustomCounters
;
192 typedef struct tagSISRCounters
{
193 unsigned long Length
;
197 DWORD dwIsrBeaconTxOK
;
200 DWORD dwIsrSTIMERInt
;
202 DWORD dwIsrUnrecoverableError
;
203 DWORD dwIsrSoftInterrupt
;
204 DWORD dwIsrMIBNearfull
;
207 DWORD dwIsrUnknown
; // unknown interrupt count
214 DWORD dwIsrSYNCFlushOK
;
215 DWORD dwIsrSTIMER1Int
;
216 /////////////////////////////////////
217 } SISRCounters
, *PSISRCounters
;
220 // Value in the etherStatsStatus entry
222 #define CREATE_REQUEST 2 //
223 #define UNDER_CREATION 3 //
228 // Tx packet information
230 typedef struct tagSTxPktInfo
{
231 BYTE byBroadMultiUni
;
234 BYTE abyDestAddr
[ETH_ALEN
];
235 } STxPktInfo
, *PSTxPktInfo
;
242 typedef struct tagSStatCounter
{
247 SISRCounters ISRStat
;
251 DWORD dwRsrFrmAlgnErr
;
257 DWORD dwRsrBCNSSIDOk
;
261 DWORD dwNewRsrDECRYPTOK
;
264 DWORD dwNewRsrHITAID
;
265 DWORD dwNewRsrHITAID0
;
270 DWORD dwRsrRxControl
;
276 DWORD dwRsrBroadcast
;
277 DWORD dwRsrMulticast
;
280 unsigned long long ullRsrOK
;
282 // for some optional OIDs (64 bits) and DMI support
283 unsigned long long ullRxBroadcastBytes
;
284 unsigned long long ullRxMulticastBytes
;
285 unsigned long long ullRxDirectedBytes
;
286 unsigned long long ullRxBroadcastFrames
;
287 unsigned long long ullRxMulticastFrames
;
288 unsigned long long ullRxDirectedFrames
;
290 DWORD dwRsrRxFragment
;
291 DWORD dwRsrRxFrmLen64
;
292 DWORD dwRsrRxFrmLen65_127
;
293 DWORD dwRsrRxFrmLen128_255
;
294 DWORD dwRsrRxFrmLen256_511
;
295 DWORD dwRsrRxFrmLen512_1023
;
296 DWORD dwRsrRxFrmLen1024_1518
;
300 DWORD dwTsrTotalRetry
; // total collision retry count
301 DWORD dwTsrOnceRetry
; // this packet only occur one collision
302 DWORD dwTsrMoreThanOnceRetry
; // this packet occur more than one collision
303 DWORD dwTsrRetry
; // this packet has ever occur collision,
304 // that is (dwTsrOnceCollision0 + dwTsrMoreThanOnceCollision0)
308 DWORD dwTsrRetryTimeout
;
309 DWORD dwTsrTransmitTimeout
;
313 DWORD dwTsrBroadcast
;
314 DWORD dwTsrMulticast
;
318 DWORD dwCntRxFrmLength
;
319 DWORD dwCntTxBufLength
;
321 BYTE abyCntRxPattern
[16];
322 BYTE abyCntTxPattern
[16];
326 // Software check....
327 DWORD dwCntRxDataErr
; // rx buffer data software compare CRC err count
328 DWORD dwCntDecryptErr
; // rx buffer data software compare CRC err count
329 DWORD dwCntRxICVErr
; // rx buffer data software compare CRC err count
333 unsigned long long ullTsrOK
;
335 // for some optional OIDs (64 bits) and DMI support
336 unsigned long long ullTxBroadcastFrames
;
337 unsigned long long ullTxMulticastFrames
;
338 unsigned long long ullTxDirectedFrames
;
339 unsigned long long ullTxBroadcastBytes
;
340 unsigned long long ullTxMulticastBytes
;
341 unsigned long long ullTxDirectedBytes
;
344 DWORD dwTxOk
[MAX_RATE
+1];
345 DWORD dwTxFail
[MAX_RATE
+1];
346 DWORD dwTxRetryCount
[8];
348 STxPktInfo abyTxPktInfo
[16];
350 SUSBCounter USB_EP0Stat
;
351 SUSBCounter USB_BulkInStat
;
352 SUSBCounter USB_BulkOutStat
;
353 SUSBCounter USB_InterruptStat
;
355 SCustomCounters CustomStat
;
358 unsigned long TxNoRetryOkCount
; /* success tx no retry ! */
359 unsigned long TxRetryOkCount
; /* success tx but retry ! */
360 unsigned long TxFailCount
; /* fail tx ? */
362 unsigned long RxOkCnt
; /* success rx ! */
363 unsigned long RxFcsErrCnt
; /* fail rx ? */
365 unsigned long SignalStren
;
366 unsigned long LinkQuality
;
368 } SStatCounter
, *PSStatCounter
;
370 /*--------------------- Export Classes ----------------------------*/
372 /*--------------------- Export Variables --------------------------*/
374 /*--------------------- Export Functions --------------------------*/
376 void STAvClearAllCounter(PSStatCounter pStatistic
);
378 void STAvUpdateIsrStatCounter(PSStatCounter pStatistic
,
382 void STAvUpdateRDStatCounter(PSStatCounter pStatistic
,
383 BYTE byRSR
, BYTE byNewRSR
, BYTE byRxSts
,
384 BYTE byRxRate
, PBYTE pbyBuffer
,
385 unsigned int cbFrameLength
);
387 void STAvUpdateRDStatCounterEx(PSStatCounter pStatistic
,
388 BYTE byRSR
, BYTE byNewRSR
, BYTE byRxSts
,
389 BYTE byRxRate
, PBYTE pbyBuffer
,
390 unsigned int cbFrameLength
);
392 void STAvUpdateTDStatCounter(PSStatCounter pStatistic
, BYTE byPktNum
,
393 BYTE byRate
, BYTE byTSR
);
396 STAvUpdate802_11Counter(
397 PSDot11Counters p802_11Counter
,
398 PSStatCounter pStatistic
,
405 void STAvClear802_11Counter(PSDot11Counters p802_11Counter
);
406 void STAvUpdateUSBCounter(PSUSBCounter pUsbCounter
, int ntStatus
);
408 #endif /* __MIB_H__ */