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 -------------------------*/
41 typedef struct tagSDot11Counters
{
42 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
;
64 // unsigned long long WEPUndecryptableCount;
65 // unsigned long long WEPICVErrorCount;
66 // unsigned long long DecryptSuccessCount;
67 // unsigned long long DecryptFailureCount;
68 } SDot11Counters
, *PSDot11Counters
;
73 typedef struct tagSMib2Counter
{
75 char ifDescr
[256]; // max size 255 plus zero ending
79 unsigned long ifSpeed
;
80 unsigned char ifPhysAddress
[ETH_ALEN
];
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
;
97 } SMib2Counter
, *PSMib2Counter
;
99 // Value in the ifType entry
100 #define WIRELESSLANIEEE80211b 6 //
102 // Value in the ifAdminStatus/ifOperStatus entry
110 typedef struct tagSRmonCounter
{
111 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
;
132 } SRmonCounter
, *PSRmonCounter
;
137 typedef struct tagSCustomCounters
{
138 unsigned long Length
;
140 unsigned long long ullTsrAllOK
;
142 unsigned long long ullRsr11M
;
143 unsigned long long ullRsr5M
;
144 unsigned long long ullRsr2M
;
145 unsigned long long ullRsr1M
;
147 unsigned long long ullRsr11MCRCOk
;
148 unsigned long long ullRsr5MCRCOk
;
149 unsigned long long ullRsr2MCRCOk
;
150 unsigned long long ullRsr1MCRCOk
;
152 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
;
161 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
;
169 } SCustomCounters
, *PSCustomCounters
;
174 typedef struct tagSISRCounters
{
175 unsigned long Length
;
177 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
;
189 unsigned long dwIsrUnknown
; // unknown interrupt count
191 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 /////////////////////////////////////
199 } SISRCounters
, *PSISRCounters
;
201 // Value in the etherStatsStatus entry
203 #define CREATE_REQUEST 2 //
204 #define UNDER_CREATION 3 //
210 typedef struct tagSStatCounter
{
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
;
227 unsigned long dwNewRsrDECRYPTOK
;
228 unsigned long dwNewRsrCFP
;
229 unsigned long dwNewRsrUTSF
;
230 unsigned long dwNewRsrHITAID
;
231 unsigned long dwNewRsrHITAID0
;
233 unsigned long dwRsrLong
;
234 unsigned long dwRsrRunt
;
236 unsigned long dwRsrRxControl
;
237 unsigned long dwRsrRxData
;
238 unsigned long dwRsrRxManage
;
240 unsigned long dwRsrRxPacket
;
241 unsigned long dwRsrRxOctet
;
242 unsigned long dwRsrBroadcast
;
243 unsigned long dwRsrMulticast
;
244 unsigned long dwRsrDirected
;
246 unsigned long long ullRsrOK
;
248 // 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
;
256 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
;
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
];
277 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
];
284 unsigned long dwCntRxFrmLength
;
285 unsigned long dwCntTxBufLength
;
287 unsigned char abyCntRxPattern
[16];
288 unsigned char abyCntTxPattern
[16];
290 // 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
297 unsigned long long ullTsrOK
[TYPE_MAXTD
];
299 // 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
];
307 // unsigned long dwTxRetryCount[8];
311 SISRCounters ISRStat
;
313 SCustomCounters CustomStat
;
315 #ifdef Calcu_LinkQual
317 unsigned long TxNoRetryOkCount
; //success tx no retry !
318 unsigned long TxRetryOkCount
; //success tx but retry !
319 unsigned long TxFailCount
; //fail tx ?
321 unsigned long RxOkCnt
; //success rx !
322 unsigned long RxFcsErrCnt
; //fail rx ?
324 unsigned long SignalStren
;
325 unsigned long LinkQuality
;
327 } SStatCounter
, *PSStatCounter
;
329 /*--------------------- Export Classes ----------------------------*/
331 /*--------------------- Export Variables --------------------------*/
333 /*--------------------- Export Functions --------------------------*/
335 void STAvClearAllCounter(PSStatCounter pStatistic
);
337 void STAvUpdateIsrStatCounter(PSStatCounter pStatistic
, unsigned long dwIsr
);
339 void STAvUpdateRDStatCounter(PSStatCounter pStatistic
,
340 unsigned char byRSR
, unsigned char byNewRSR
, unsigned char byRxRate
,
341 unsigned char *pbyBuffer
, unsigned int cbFrameLength
);
343 void STAvUpdateRDStatCounterEx(PSStatCounter pStatistic
,
344 unsigned char byRSR
, unsigned char byNewRsr
, unsigned char byRxRate
,
345 unsigned char *pbyBuffer
, unsigned int cbFrameLength
);
347 void STAvUpdateTDStatCounter(PSStatCounter pStatistic
, unsigned char byTSR0
, unsigned char byTSR1
,
348 unsigned char *pbyBuffer
, unsigned int cbFrameLength
, unsigned int uIdx
);
350 void STAvUpdateTDStatCounterEx(
351 PSStatCounter pStatistic
,
352 unsigned char *pbyBuffer
,
353 unsigned long cbFrameLength
356 void STAvUpdate802_11Counter(
357 PSDot11Counters p802_11Counter
,
358 PSStatCounter pStatistic
,
359 unsigned long dwCounter
362 void STAvClear802_11Counter(PSDot11Counters p802_11Counter
);