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 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
;
78 * unsigned long long WEPUndecryptableCount;
79 * unsigned long long WEPICVErrorCount;
80 * unsigned long long DecryptSuccessCount;
81 * unsigned long long DecryptFailureCount;
83 } SDot11Counters
, *PSDot11Counters
;
89 typedef struct tagSMib2Counter
{
91 char ifDescr
[256]; // max size 255 plus zero ending
96 BYTE ifPhysAddress
[ETH_ALEN
];
97 signed long ifAdminStatus
;
98 signed long ifOperStatus
;
102 DWORD ifInNUcastPkts
;
105 DWORD ifInUnknownProtos
;
107 DWORD ifOutUcastPkts
;
108 DWORD ifOutNUcastPkts
;
113 } SMib2Counter
, *PSMib2Counter
;
115 // Value in the ifType entry
116 //#define ETHERNETCSMACD 6 //
117 #define WIRELESSLANIEEE80211b 6 //
119 // Value in the ifAdminStatus/ifOperStatus entry
128 typedef struct tagSRmonCounter
{
129 signed long etherStatsIndex
;
130 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
;
150 } SRmonCounter
, *PSRmonCounter
;
155 typedef struct tagSCustomCounters
{
156 unsigned long Length
;
158 unsigned long long ullTsrAllOK
;
160 unsigned long long ullRsr11M
;
161 unsigned long long ullRsr5M
;
162 unsigned long long ullRsr2M
;
163 unsigned long long ullRsr1M
;
165 unsigned long long ullRsr11MCRCOk
;
166 unsigned long long ullRsr5MCRCOk
;
167 unsigned long long ullRsr2MCRCOk
;
168 unsigned long long ullRsr1MCRCOk
;
170 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
;
179 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
;
188 } SCustomCounters
, *PSCustomCounters
;
194 typedef struct tagSISRCounters
{
195 unsigned long Length
;
199 DWORD dwIsrBeaconTxOK
;
202 DWORD dwIsrSTIMERInt
;
204 DWORD dwIsrUnrecoverableError
;
205 DWORD dwIsrSoftInterrupt
;
206 DWORD dwIsrMIBNearfull
;
209 DWORD dwIsrUnknown
; // unknown interrupt count
216 DWORD dwIsrSYNCFlushOK
;
217 DWORD dwIsrSTIMER1Int
;
218 /////////////////////////////////////
219 } SISRCounters
, *PSISRCounters
;
222 // Value in the etherStatsStatus entry
224 #define CREATE_REQUEST 2 //
225 #define UNDER_CREATION 3 //
230 // Tx packet information
232 typedef struct tagSTxPktInfo
{
233 BYTE byBroadMultiUni
;
236 BYTE abyDestAddr
[ETH_ALEN
];
237 } STxPktInfo
, *PSTxPktInfo
;
244 typedef struct tagSStatCounter
{
249 SISRCounters ISRStat
;
253 DWORD dwRsrFrmAlgnErr
;
259 DWORD dwRsrBCNSSIDOk
;
263 DWORD dwNewRsrDECRYPTOK
;
266 DWORD dwNewRsrHITAID
;
267 DWORD dwNewRsrHITAID0
;
272 DWORD dwRsrRxControl
;
278 DWORD dwRsrBroadcast
;
279 DWORD dwRsrMulticast
;
282 unsigned long long ullRsrOK
;
284 // for some optional OIDs (64 bits) and DMI support
285 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
;
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
;
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)
310 DWORD dwTsrRetryTimeout
;
311 DWORD dwTsrTransmitTimeout
;
315 DWORD dwTsrBroadcast
;
316 DWORD dwTsrMulticast
;
320 DWORD dwCntRxFrmLength
;
321 DWORD dwCntTxBufLength
;
323 BYTE abyCntRxPattern
[16];
324 BYTE abyCntTxPattern
[16];
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
335 unsigned long long ullTsrOK
;
337 // for some optional OIDs (64 bits) and DMI support
338 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
;
346 DWORD dwTxOk
[MAX_RATE
+1];
347 DWORD dwTxFail
[MAX_RATE
+1];
348 DWORD dwTxRetryCount
[8];
350 STxPktInfo abyTxPktInfo
[16];
352 SUSBCounter USB_EP0Stat
;
353 SUSBCounter USB_BulkInStat
;
354 SUSBCounter USB_BulkOutStat
;
355 SUSBCounter USB_InterruptStat
;
357 SCustomCounters CustomStat
;
360 unsigned long TxNoRetryOkCount
; /* success tx no retry ! */
361 unsigned long TxRetryOkCount
; /* success tx but retry ! */
362 unsigned long TxFailCount
; /* fail tx ? */
364 unsigned long RxOkCnt
; /* success rx ! */
365 unsigned long RxFcsErrCnt
; /* fail rx ? */
367 unsigned long SignalStren
;
368 unsigned long LinkQuality
;
370 } SStatCounter
, *PSStatCounter
;
372 /*--------------------- Export Classes ----------------------------*/
374 /*--------------------- Export Variables --------------------------*/
376 /*--------------------- Export Functions --------------------------*/
378 void STAvClearAllCounter(PSStatCounter pStatistic
);
380 void STAvUpdateIsrStatCounter(PSStatCounter pStatistic
,
384 void STAvUpdateRDStatCounter(PSStatCounter pStatistic
,
385 BYTE byRSR
, BYTE byNewRSR
, BYTE byRxSts
,
386 BYTE byRxRate
, PBYTE pbyBuffer
,
387 unsigned int cbFrameLength
);
389 void STAvUpdateRDStatCounterEx(PSStatCounter pStatistic
,
390 BYTE byRSR
, BYTE byNewRSR
, BYTE byRxSts
,
391 BYTE byRxRate
, PBYTE pbyBuffer
,
392 unsigned int cbFrameLength
);
394 void STAvUpdateTDStatCounter(PSStatCounter pStatistic
, BYTE byPktNum
,
395 BYTE byRate
, BYTE byTSR
);
398 STAvUpdate802_11Counter(
399 PSDot11Counters p802_11Counter
,
400 PSStatCounter pStatistic
,
407 void STAvClear802_11Counter(PSDot11Counters p802_11Counter
);
408 void STAvUpdateUSBCounter(PSUSBCounter pUsbCounter
, int ntStatus
);
410 #endif /* __MIB_H__ */