Commit | Line | Data |
---|---|---|
92b96797 FB |
1 | /* |
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 | ||
92b96797 | 32 | #include "ttype.h" |
92b96797 | 33 | #include "tether.h" |
92b96797 | 34 | #include "desc.h" |
92b96797 FB |
35 | |
36 | /*--------------------- Export Definitions -------------------------*/ | |
37 | ||
38 | ||
39 | // | |
40 | // USB counter | |
41 | // | |
42 | typedef struct tagSUSBCounter { | |
43 | DWORD dwCrc; | |
44 | ||
193a823c | 45 | } SUSBCounter, *PSUSBCounter; |
92b96797 FB |
46 | |
47 | ||
48 | ||
49 | // | |
50 | // 802.11 counter | |
51 | // | |
52 | ||
53 | ||
54 | typedef struct tagSDot11Counters { | |
cc856e61 AM |
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; | |
77 | /* | |
78 | * unsigned long long WEPUndecryptableCount; | |
79 | * unsigned long long WEPICVErrorCount; | |
80 | * unsigned long long DecryptSuccessCount; | |
81 | * unsigned long long DecryptFailureCount; | |
82 | */ | |
193a823c | 83 | } SDot11Counters, *PSDot11Counters; |
92b96797 FB |
84 | |
85 | ||
86 | // | |
87 | // MIB2 counter | |
88 | // | |
89 | typedef struct tagSMib2Counter { | |
213d2e93 | 90 | signed long ifIndex; |
193a823c | 91 | char ifDescr[256]; // max size 255 plus zero ending |
92b96797 | 92 | // e.g. "interface 1" |
213d2e93 AM |
93 | signed long ifType; |
94 | signed long ifMtu; | |
92b96797 | 95 | DWORD ifSpeed; |
9a0e756c | 96 | BYTE ifPhysAddress[ETH_ALEN]; |
213d2e93 AM |
97 | signed long ifAdminStatus; |
98 | signed long ifOperStatus; | |
92b96797 FB |
99 | DWORD ifLastChange; |
100 | DWORD ifInOctets; | |
101 | DWORD ifInUcastPkts; | |
102 | DWORD ifInNUcastPkts; | |
103 | DWORD ifInDiscards; | |
104 | DWORD ifInErrors; | |
105 | DWORD ifInUnknownProtos; | |
106 | DWORD ifOutOctets; | |
107 | DWORD ifOutUcastPkts; | |
108 | DWORD ifOutNUcastPkts; | |
109 | DWORD ifOutDiscards; | |
110 | DWORD ifOutErrors; | |
111 | DWORD ifOutQLen; | |
112 | DWORD ifSpecific; | |
193a823c | 113 | } SMib2Counter, *PSMib2Counter; |
92b96797 FB |
114 | |
115 | // Value in the ifType entry | |
92b96797 FB |
116 | #define WIRELESSLANIEEE80211b 6 // |
117 | ||
118 | // Value in the ifAdminStatus/ifOperStatus entry | |
119 | #define UP 1 // | |
120 | #define DOWN 2 // | |
121 | #define TESTING 3 // | |
122 | ||
123 | ||
124 | // | |
125 | // RMON counter | |
126 | // | |
127 | typedef struct tagSRmonCounter { | |
213d2e93 | 128 | signed long etherStatsIndex; |
92b96797 FB |
129 | DWORD etherStatsDataSource; |
130 | DWORD etherStatsDropEvents; | |
131 | DWORD etherStatsOctets; | |
132 | DWORD etherStatsPkts; | |
133 | DWORD etherStatsBroadcastPkts; | |
134 | DWORD etherStatsMulticastPkts; | |
135 | DWORD etherStatsCRCAlignErrors; | |
136 | DWORD etherStatsUndersizePkts; | |
137 | DWORD etherStatsOversizePkts; | |
138 | DWORD etherStatsFragments; | |
139 | DWORD etherStatsJabbers; | |
140 | DWORD etherStatsCollisions; | |
141 | DWORD etherStatsPkt64Octets; | |
142 | DWORD etherStatsPkt65to127Octets; | |
143 | DWORD etherStatsPkt128to255Octets; | |
144 | DWORD etherStatsPkt256to511Octets; | |
145 | DWORD etherStatsPkt512to1023Octets; | |
146 | DWORD etherStatsPkt1024to1518Octets; | |
147 | DWORD etherStatsOwners; | |
148 | DWORD etherStatsStatus; | |
193a823c | 149 | } SRmonCounter, *PSRmonCounter; |
92b96797 FB |
150 | |
151 | // | |
152 | // Custom counter | |
153 | // | |
154 | typedef struct tagSCustomCounters { | |
cc856e61 AM |
155 | unsigned long Length; |
156 | ||
157 | unsigned long long ullTsrAllOK; | |
158 | ||
159 | unsigned long long ullRsr11M; | |
160 | unsigned long long ullRsr5M; | |
161 | unsigned long long ullRsr2M; | |
162 | unsigned long long ullRsr1M; | |
163 | ||
164 | unsigned long long ullRsr11MCRCOk; | |
165 | unsigned long long ullRsr5MCRCOk; | |
166 | unsigned long long ullRsr2MCRCOk; | |
167 | unsigned long long ullRsr1MCRCOk; | |
168 | ||
169 | unsigned long long ullRsr54M; | |
170 | unsigned long long ullRsr48M; | |
171 | unsigned long long ullRsr36M; | |
172 | unsigned long long ullRsr24M; | |
173 | unsigned long long ullRsr18M; | |
174 | unsigned long long ullRsr12M; | |
175 | unsigned long long ullRsr9M; | |
176 | unsigned long long ullRsr6M; | |
177 | ||
178 | unsigned long long ullRsr54MCRCOk; | |
179 | unsigned long long ullRsr48MCRCOk; | |
180 | unsigned long long ullRsr36MCRCOk; | |
181 | unsigned long long ullRsr24MCRCOk; | |
182 | unsigned long long ullRsr18MCRCOk; | |
183 | unsigned long long ullRsr12MCRCOk; | |
184 | unsigned long long ullRsr9MCRCOk; | |
185 | unsigned long long ullRsr6MCRCOk; | |
92b96797 | 186 | |
193a823c | 187 | } SCustomCounters, *PSCustomCounters; |
92b96797 FB |
188 | |
189 | ||
190 | // | |
191 | // Custom counter | |
192 | // | |
193 | typedef struct tagSISRCounters { | |
cc856e61 | 194 | unsigned long Length; |
92b96797 FB |
195 | |
196 | DWORD dwIsrTx0OK; | |
197 | DWORD dwIsrAC0TxOK; | |
198 | DWORD dwIsrBeaconTxOK; | |
199 | DWORD dwIsrRx0OK; | |
200 | DWORD dwIsrTBTTInt; | |
201 | DWORD dwIsrSTIMERInt; | |
202 | DWORD dwIsrWatchDog; | |
203 | DWORD dwIsrUnrecoverableError; | |
204 | DWORD dwIsrSoftInterrupt; | |
205 | DWORD dwIsrMIBNearfull; | |
206 | DWORD dwIsrRxNoBuf; | |
207 | ||
208 | DWORD dwIsrUnknown; // unknown interrupt count | |
209 | ||
210 | DWORD dwIsrRx1OK; | |
211 | DWORD dwIsrATIMTxOK; | |
212 | DWORD dwIsrSYNCTxOK; | |
213 | DWORD dwIsrCFPEnd; | |
214 | DWORD dwIsrATIMEnd; | |
215 | DWORD dwIsrSYNCFlushOK; | |
216 | DWORD dwIsrSTIMER1Int; | |
217 | ///////////////////////////////////// | |
193a823c | 218 | } SISRCounters, *PSISRCounters; |
92b96797 FB |
219 | |
220 | ||
221 | // Value in the etherStatsStatus entry | |
222 | #define VALID 1 // | |
223 | #define CREATE_REQUEST 2 // | |
224 | #define UNDER_CREATION 3 // | |
225 | #define INVALID 4 // | |
226 | ||
227 | ||
228 | // | |
229 | // Tx packet information | |
230 | // | |
231 | typedef struct tagSTxPktInfo { | |
232 | BYTE byBroadMultiUni; | |
233 | WORD wLength; | |
234 | WORD wFIFOCtl; | |
9a0e756c | 235 | BYTE abyDestAddr[ETH_ALEN]; |
193a823c | 236 | } STxPktInfo, *PSTxPktInfo; |
92b96797 FB |
237 | |
238 | ||
239 | #define MAX_RATE 12 | |
240 | // | |
241 | // statistic counter | |
242 | // | |
243 | typedef struct tagSStatCounter { | |
244 | // | |
245 | // ISR status count | |
246 | // | |
247 | ||
248 | SISRCounters ISRStat; | |
249 | ||
250 | // RSR status count | |
251 | // | |
252 | DWORD dwRsrFrmAlgnErr; | |
253 | DWORD dwRsrErr; | |
254 | DWORD dwRsrCRCErr; | |
255 | DWORD dwRsrCRCOk; | |
256 | DWORD dwRsrBSSIDOk; | |
257 | DWORD dwRsrADDROk; | |
258 | DWORD dwRsrBCNSSIDOk; | |
259 | DWORD dwRsrLENErr; | |
260 | DWORD dwRsrTYPErr; | |
261 | ||
262 | DWORD dwNewRsrDECRYPTOK; | |
263 | DWORD dwNewRsrCFP; | |
264 | DWORD dwNewRsrUTSF; | |
265 | DWORD dwNewRsrHITAID; | |
266 | DWORD dwNewRsrHITAID0; | |
267 | ||
268 | DWORD dwRsrLong; | |
269 | DWORD dwRsrRunt; | |
270 | ||
271 | DWORD dwRsrRxControl; | |
272 | DWORD dwRsrRxData; | |
273 | DWORD dwRsrRxManage; | |
274 | ||
275 | DWORD dwRsrRxPacket; | |
276 | DWORD dwRsrRxOctet; | |
277 | DWORD dwRsrBroadcast; | |
278 | DWORD dwRsrMulticast; | |
279 | DWORD dwRsrDirected; | |
280 | // 64-bit OID | |
cc856e61 | 281 | unsigned long long ullRsrOK; |
92b96797 FB |
282 | |
283 | // for some optional OIDs (64 bits) and DMI support | |
cc856e61 AM |
284 | unsigned long long ullRxBroadcastBytes; |
285 | unsigned long long ullRxMulticastBytes; | |
286 | unsigned long long ullRxDirectedBytes; | |
287 | unsigned long long ullRxBroadcastFrames; | |
288 | unsigned long long ullRxMulticastFrames; | |
289 | unsigned long long ullRxDirectedFrames; | |
92b96797 FB |
290 | |
291 | DWORD dwRsrRxFragment; | |
292 | DWORD dwRsrRxFrmLen64; | |
293 | DWORD dwRsrRxFrmLen65_127; | |
294 | DWORD dwRsrRxFrmLen128_255; | |
295 | DWORD dwRsrRxFrmLen256_511; | |
296 | DWORD dwRsrRxFrmLen512_1023; | |
297 | DWORD dwRsrRxFrmLen1024_1518; | |
298 | ||
299 | // TSR status count | |
300 | // | |
301 | DWORD dwTsrTotalRetry; // total collision retry count | |
302 | DWORD dwTsrOnceRetry; // this packet only occur one collision | |
303 | DWORD dwTsrMoreThanOnceRetry; // this packet occur more than one collision | |
304 | DWORD dwTsrRetry; // this packet has ever occur collision, | |
305 | // that is (dwTsrOnceCollision0 + dwTsrMoreThanOnceCollision0) | |
306 | DWORD dwTsrACKData; | |
307 | DWORD dwTsrErr; | |
308 | DWORD dwAllTsrOK; | |
309 | DWORD dwTsrRetryTimeout; | |
310 | DWORD dwTsrTransmitTimeout; | |
311 | ||
312 | DWORD dwTsrTxPacket; | |
313 | DWORD dwTsrTxOctet; | |
314 | DWORD dwTsrBroadcast; | |
315 | DWORD dwTsrMulticast; | |
316 | DWORD dwTsrDirected; | |
317 | ||
318 | // RD/TD count | |
319 | DWORD dwCntRxFrmLength; | |
320 | DWORD dwCntTxBufLength; | |
321 | ||
322 | BYTE abyCntRxPattern[16]; | |
323 | BYTE abyCntTxPattern[16]; | |
324 | ||
325 | ||
326 | ||
327 | // Software check.... | |
328 | DWORD dwCntRxDataErr; // rx buffer data software compare CRC err count | |
329 | DWORD dwCntDecryptErr; // rx buffer data software compare CRC err count | |
330 | DWORD dwCntRxICVErr; // rx buffer data software compare CRC err count | |
331 | ||
332 | ||
333 | // 64-bit OID | |
cc856e61 | 334 | unsigned long long ullTsrOK; |
92b96797 FB |
335 | |
336 | // for some optional OIDs (64 bits) and DMI support | |
cc856e61 AM |
337 | unsigned long long ullTxBroadcastFrames; |
338 | unsigned long long ullTxMulticastFrames; | |
339 | unsigned long long ullTxDirectedFrames; | |
340 | unsigned long long ullTxBroadcastBytes; | |
341 | unsigned long long ullTxMulticastBytes; | |
342 | unsigned long long ullTxDirectedBytes; | |
92b96797 FB |
343 | |
344 | // for autorate | |
345 | DWORD dwTxOk[MAX_RATE+1]; | |
346 | DWORD dwTxFail[MAX_RATE+1]; | |
347 | DWORD dwTxRetryCount[8]; | |
348 | ||
349 | STxPktInfo abyTxPktInfo[16]; | |
350 | ||
351 | SUSBCounter USB_EP0Stat; | |
352 | SUSBCounter USB_BulkInStat; | |
353 | SUSBCounter USB_BulkOutStat; | |
354 | SUSBCounter USB_InterruptStat; | |
355 | ||
356 | SCustomCounters CustomStat; | |
357 | ||
92b96797 | 358 | //Tx count: |
cc856e61 AM |
359 | unsigned long TxNoRetryOkCount; /* success tx no retry ! */ |
360 | unsigned long TxRetryOkCount; /* success tx but retry ! */ | |
361 | unsigned long TxFailCount; /* fail tx ? */ | |
92b96797 | 362 | //Rx count: |
cc856e61 AM |
363 | unsigned long RxOkCnt; /* success rx ! */ |
364 | unsigned long RxFcsErrCnt; /* fail rx ? */ | |
92b96797 | 365 | //statistic |
cc856e61 AM |
366 | unsigned long SignalStren; |
367 | unsigned long LinkQuality; | |
92b96797 | 368 | |
193a823c | 369 | } SStatCounter, *PSStatCounter; |
92b96797 | 370 | |
92b96797 FB |
371 | /*--------------------- Export Classes ----------------------------*/ |
372 | ||
373 | /*--------------------- Export Variables --------------------------*/ | |
374 | ||
375 | /*--------------------- Export Functions --------------------------*/ | |
92b96797 FB |
376 | |
377 | void STAvClearAllCounter(PSStatCounter pStatistic); | |
378 | ||
d9d1ccb5 AM |
379 | void STAvUpdateIsrStatCounter(PSStatCounter pStatistic, |
380 | BYTE byIsr0, | |
381 | BYTE byIsr1); | |
92b96797 FB |
382 | |
383 | void STAvUpdateRDStatCounter(PSStatCounter pStatistic, | |
cc856e61 AM |
384 | BYTE byRSR, BYTE byNewRSR, BYTE byRxSts, |
385 | BYTE byRxRate, PBYTE pbyBuffer, | |
386 | unsigned int cbFrameLength); | |
92b96797 FB |
387 | |
388 | void STAvUpdateRDStatCounterEx(PSStatCounter pStatistic, | |
cc856e61 AM |
389 | BYTE byRSR, BYTE byNewRSR, BYTE byRxSts, |
390 | BYTE byRxRate, PBYTE pbyBuffer, | |
391 | unsigned int cbFrameLength); | |
92b96797 | 392 | |
d9d1ccb5 AM |
393 | void STAvUpdateTDStatCounter(PSStatCounter pStatistic, BYTE byPktNum, |
394 | BYTE byRate, BYTE byTSR); | |
92b96797 FB |
395 | |
396 | void | |
397 | STAvUpdate802_11Counter( | |
398 | PSDot11Counters p802_11Counter, | |
399 | PSStatCounter pStatistic, | |
400 | BYTE byRTSSuccess, | |
401 | BYTE byRTSFail, | |
402 | BYTE byACKFail, | |
403 | BYTE byFCSErr | |
404 | ); | |
405 | ||
406 | void STAvClear802_11Counter(PSDot11Counters p802_11Counter); | |
6487c49e | 407 | void STAvUpdateUSBCounter(PSUSBCounter pUsbCounter, int ntStatus); |
92b96797 | 408 | |
e7b07d1d | 409 | #endif /* __MIB_H__ */ |