Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mib.h
Go to the documentation of this file.
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 
32 #include "ttype.h"
33 #include "tether.h"
34 #include "desc.h"
35 
36 /*--------------------- Export Definitions -------------------------*/
37 
38 
39 //
40 // USB counter
41 //
42 typedef struct tagSUSBCounter {
44 
46 
47 
48 
49 //
50 // 802.11 counter
51 //
52 
53 
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;
77  /*
78  * unsigned long long WEPUndecryptableCount;
79  * unsigned long long WEPICVErrorCount;
80  * unsigned long long DecryptSuccessCount;
81  * unsigned long long DecryptFailureCount;
82  */
84 
85 
86 //
87 // MIB2 counter
88 //
89 typedef struct tagSMib2Counter {
90  signed long ifIndex;
91  char ifDescr[256]; // max size 255 plus zero ending
92  // e.g. "interface 1"
93  signed long ifType;
94  signed long ifMtu;
97  signed long ifAdminStatus;
98  signed long ifOperStatus;
114 
115 // Value in the ifType entry
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 {
128  signed long etherStatsIndex;
150 
151 //
152 // Custom counter
153 //
154 typedef struct tagSCustomCounters {
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;
186 
188 
189 
190 //
191 // Custom counter
192 //
193 typedef struct tagSISRCounters {
194  unsigned long Length;
195 
207 
208  DWORD dwIsrUnknown; // unknown interrupt count
209 
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 {
237 
238 
239 #define MAX_RATE 12
240 //
241 // statistic counter
242 //
243 typedef struct tagSStatCounter {
244  //
245  // ISR status count
246  //
247 
249 
250  // RSR status count
251  //
261 
267 
270 
274 
280  // 64-bit OID
281  unsigned long long ullRsrOK;
282 
283  // for some optional OIDs (64 bits) and DMI support
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;
290 
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)
311 
317 
318  // RD/TD count
321 
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
334  unsigned long long ullTsrOK;
335 
336  // for some optional OIDs (64 bits) and DMI support
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;
343 
344  // for autorate
348 
350 
355 
357 
358  //Tx count:
359  unsigned long TxNoRetryOkCount; /* success tx no retry ! */
360  unsigned long TxRetryOkCount; /* success tx but retry ! */
361  unsigned long TxFailCount; /* fail tx ? */
362  //Rx count:
363  unsigned long RxOkCnt; /* success rx ! */
364  unsigned long RxFcsErrCnt; /* fail rx ? */
365  //statistic
366  unsigned long SignalStren;
367  unsigned long LinkQuality;
368 
370 
371 /*--------------------- Export Classes ----------------------------*/
372 
373 /*--------------------- Export Variables --------------------------*/
374 
375 /*--------------------- Export Functions --------------------------*/
376 
377 void STAvClearAllCounter(PSStatCounter pStatistic);
378 
379 void STAvUpdateIsrStatCounter(PSStatCounter pStatistic,
380  BYTE byIsr0,
381  BYTE byIsr1);
382 
383 void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
384  BYTE byRSR, BYTE byNewRSR, BYTE byRxSts,
385  BYTE byRxRate, PBYTE pbyBuffer,
386  unsigned int cbFrameLength);
387 
388 void STAvUpdateRDStatCounterEx(PSStatCounter pStatistic,
389  BYTE byRSR, BYTE byNewRSR, BYTE byRxSts,
390  BYTE byRxRate, PBYTE pbyBuffer,
391  unsigned int cbFrameLength);
392 
393 void STAvUpdateTDStatCounter(PSStatCounter pStatistic, BYTE byPktNum,
394  BYTE byRate, BYTE byTSR);
395 
396 void
398  PSDot11Counters p802_11Counter,
399  PSStatCounter pStatistic,
401  BYTE byRTSFail,
402  BYTE byACKFail,
403  BYTE byFCSErr
404  );
405 
406 void STAvClear802_11Counter(PSDot11Counters p802_11Counter);
407 void STAvUpdateUSBCounter(PSUSBCounter pUsbCounter, int ntStatus);
408 
409 #endif /* __MIB_H__ */