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 // ULONG Length; // Length of structure
56 ULONGLONG TransmittedFragmentCount
;
57 ULONGLONG MulticastTransmittedFrameCount
;
58 ULONGLONG FailedCount
;
60 ULONGLONG MultipleRetryCount
;
61 ULONGLONG RTSSuccessCount
;
62 ULONGLONG RTSFailureCount
;
63 ULONGLONG ACKFailureCount
;
64 ULONGLONG FrameDuplicateCount
;
65 ULONGLONG ReceivedFragmentCount
;
66 ULONGLONG MulticastReceivedFrameCount
;
67 ULONGLONG FCSErrorCount
;
68 ULONGLONG TKIPLocalMICFailures
;
69 ULONGLONG TKIPRemoteMICFailures
;
70 ULONGLONG TKIPICVErrors
;
71 ULONGLONG TKIPCounterMeasuresInvoked
;
72 ULONGLONG TKIPReplays
;
73 ULONGLONG CCMPFormatErrors
;
74 ULONGLONG CCMPReplays
;
75 ULONGLONG CCMPDecryptErrors
;
76 ULONGLONG FourWayHandshakeFailures
;
77 // ULONGLONG WEPUndecryptableCount;
78 // ULONGLONG WEPICVErrorCount;
79 // ULONGLONG DecryptSuccessCount;
80 // ULONGLONG DecryptFailureCount;
81 } SDot11Counters
, *PSDot11Counters
;
87 typedef struct tagSMib2Counter
{
89 char ifDescr
[256]; // max size 255 plus zero ending
94 BYTE ifPhysAddress
[U_ETHER_ADDR_LEN
];
100 DWORD ifInNUcastPkts
;
103 DWORD ifInUnknownProtos
;
105 DWORD ifOutUcastPkts
;
106 DWORD ifOutNUcastPkts
;
111 } SMib2Counter
, *PSMib2Counter
;
113 // Value in the ifType entry
114 //#define ETHERNETCSMACD 6 //
115 #define WIRELESSLANIEEE80211b 6 //
117 // Value in the ifAdminStatus/ifOperStatus entry
126 typedef struct tagSRmonCounter
{
127 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
{
156 ULONGLONG ullTsrAllOK
;
163 ULONGLONG ullRsr11MCRCOk
;
164 ULONGLONG ullRsr5MCRCOk
;
165 ULONGLONG ullRsr2MCRCOk
;
166 ULONGLONG ullRsr1MCRCOk
;
177 ULONGLONG ullRsr54MCRCOk
;
178 ULONGLONG ullRsr48MCRCOk
;
179 ULONGLONG ullRsr36MCRCOk
;
180 ULONGLONG ullRsr24MCRCOk
;
181 ULONGLONG ullRsr18MCRCOk
;
182 ULONGLONG ullRsr12MCRCOk
;
183 ULONGLONG ullRsr9MCRCOk
;
184 ULONGLONG ullRsr6MCRCOk
;
186 } SCustomCounters
, *PSCustomCounters
;
192 typedef struct tagSISRCounters
{
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
[U_ETHER_ADDR_LEN
];
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
;
282 // for some optional OIDs (64 bits) and DMI support
283 ULONGLONG ullRxBroadcastBytes
;
284 ULONGLONG ullRxMulticastBytes
;
285 ULONGLONG ullRxDirectedBytes
;
286 ULONGLONG ullRxBroadcastFrames
;
287 ULONGLONG ullRxMulticastFrames
;
288 ULONGLONG 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
335 // for some optional OIDs (64 bits) and DMI support
336 ULONGLONG ullTxBroadcastFrames
;
337 ULONGLONG ullTxMulticastFrames
;
338 ULONGLONG ullTxDirectedFrames
;
339 ULONGLONG ullTxBroadcastBytes
;
340 ULONGLONG ullTxMulticastBytes
;
341 ULONGLONG 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
;
357 #ifdef Calcu_LinkQual
359 ULONG TxNoRetryOkCount
; //success tx no retry !
360 ULONG TxRetryOkCount
; //sucess tx but retry !
361 ULONG TxFailCount
; //fail tx ?
363 ULONG RxOkCnt
; //sucess rx !
364 ULONG RxFcsErrCnt
; //fail rx ?
370 } SStatCounter
, *PSStatCounter
;
374 /*--------------------- Export Classes ----------------------------*/
376 /*--------------------- Export Variables --------------------------*/
378 /*--------------------- Export Functions --------------------------*/
380 void STAvClearAllCounter(PSStatCounter pStatistic
);
382 void STAvUpdateIsrStatCounter (PSStatCounter pStatistic
, BYTE byIsr0
, BYTE byIsr1
);
384 void STAvUpdateRDStatCounter(PSStatCounter pStatistic
,
385 BYTE byRSR
, BYTE byNewRSR
, BYTE byRxSts
, BYTE byRxRate
,
386 PBYTE pbyBuffer
, UINT cbFrameLength
);
388 void STAvUpdateRDStatCounterEx(PSStatCounter pStatistic
,
389 BYTE byRSR
, BYTE byNewRSR
, BYTE byRxSts
, BYTE byRxRate
,
390 PBYTE pbyBuffer
, UINT cbFrameLength
);
394 STAvUpdateTDStatCounter (
395 PSStatCounter pStatistic
,
403 STAvUpdate802_11Counter(
404 PSDot11Counters p802_11Counter
,
405 PSStatCounter pStatistic
,
412 void STAvClear802_11Counter(PSDot11Counters p802_11Counter
);
415 STAvUpdateUSBCounter(
416 PSUSBCounter pUsbCounter
,