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 // 802.11 counter
39 //
40 
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;
69 
70 
71 //
72 // MIB2 counter
73 //
74 typedef struct tagSMib2Counter {
75  long ifIndex;
76  char ifDescr[256]; // max size 255 plus zero ending
77  // e.g. "interface 1"
78  long ifType;
79  long ifMtu;
80  unsigned long ifSpeed;
81  unsigned char ifPhysAddress[ETH_ALEN];
84  unsigned long ifLastChange;
85  unsigned long ifInOctets;
86  unsigned long ifInUcastPkts;
87  unsigned long ifInNUcastPkts;
88  unsigned long ifInDiscards;
89  unsigned long ifInErrors;
90  unsigned long ifInUnknownProtos;
91  unsigned long ifOutOctets;
92  unsigned long ifOutUcastPkts;
93  unsigned long ifOutNUcastPkts;
94  unsigned long ifOutDiscards;
95  unsigned long ifOutErrors;
96  unsigned long ifOutQLen;
97  unsigned long ifSpecific;
99 
100 // Value in the ifType entry
101 #define WIRELESSLANIEEE80211b 6 //
102 
103 // Value in the ifAdminStatus/ifOperStatus entry
104 #define UP 1 //
105 #define DOWN 2 //
106 #define TESTING 3 //
107 
108 
109 //
110 // RMON counter
111 //
112 typedef struct tagSRmonCounter {
114  unsigned long etherStatsDataSource;
115  unsigned long etherStatsDropEvents;
116  unsigned long etherStatsOctets;
117  unsigned long etherStatsPkts;
118  unsigned long etherStatsBroadcastPkts;
119  unsigned long etherStatsMulticastPkts;
121  unsigned long etherStatsUndersizePkts;
122  unsigned long etherStatsOversizePkts;
123  unsigned long etherStatsFragments;
124  unsigned long etherStatsJabbers;
125  unsigned long etherStatsCollisions;
126  unsigned long etherStatsPkt64Octets;
132  unsigned long etherStatsOwners;
133  unsigned long etherStatsStatus;
135 
136 //
137 // Custom counter
138 //
139 typedef struct tagSCustomCounters {
140  unsigned long Length;
141 
142  unsigned long long ullTsrAllOK;
143 
144  unsigned long long ullRsr11M;
145  unsigned long long ullRsr5M;
146  unsigned long long ullRsr2M;
147  unsigned long long ullRsr1M;
148 
149  unsigned long long ullRsr11MCRCOk;
150  unsigned long long ullRsr5MCRCOk;
151  unsigned long long ullRsr2MCRCOk;
152  unsigned long long ullRsr1MCRCOk;
153 
154  unsigned long long ullRsr54M;
155  unsigned long long ullRsr48M;
156  unsigned long long ullRsr36M;
157  unsigned long long ullRsr24M;
158  unsigned long long ullRsr18M;
159  unsigned long long ullRsr12M;
160  unsigned long long ullRsr9M;
161  unsigned long long ullRsr6M;
162 
163  unsigned long long ullRsr54MCRCOk;
164  unsigned long long ullRsr48MCRCOk;
165  unsigned long long ullRsr36MCRCOk;
166  unsigned long long ullRsr24MCRCOk;
167  unsigned long long ullRsr18MCRCOk;
168  unsigned long long ullRsr12MCRCOk;
169  unsigned long long ullRsr9MCRCOk;
170  unsigned long long ullRsr6MCRCOk;
171 
173 
174 
175 //
176 // Custom counter
177 //
178 typedef struct tagSISRCounters {
179  unsigned long Length;
180 
181  unsigned long dwIsrTx0OK;
182  unsigned long dwIsrAC0TxOK;
183  unsigned long dwIsrBeaconTxOK;
184  unsigned long dwIsrRx0OK;
185  unsigned long dwIsrTBTTInt;
186  unsigned long dwIsrSTIMERInt;
187  unsigned long dwIsrWatchDog;
188  unsigned long dwIsrUnrecoverableError;
189  unsigned long dwIsrSoftInterrupt;
190  unsigned long dwIsrMIBNearfull;
191  unsigned long dwIsrRxNoBuf;
192 
193  unsigned long dwIsrUnknown; // unknown interrupt count
194 
195  unsigned long dwIsrRx1OK;
196  unsigned long dwIsrATIMTxOK;
197  unsigned long dwIsrSYNCTxOK;
198  unsigned long dwIsrCFPEnd;
199  unsigned long dwIsrATIMEnd;
200  unsigned long dwIsrSYNCFlushOK;
201  unsigned long dwIsrSTIMER1Int;
204 
205 
206 // Value in the etherStatsStatus entry
207 #define VALID 1 //
208 #define CREATE_REQUEST 2 //
209 #define UNDER_CREATION 3 //
210 #define INVALID 4 //
211 
212 //
213 // statistic counter
214 //
215 typedef struct tagSStatCounter {
216  //
217  // ISR status count
218  //
219 
220 
221  // RSR status count
222  //
223  unsigned long dwRsrFrmAlgnErr;
224  unsigned long dwRsrErr;
225  unsigned long dwRsrCRCErr;
226  unsigned long dwRsrCRCOk;
227  unsigned long dwRsrBSSIDOk;
228  unsigned long dwRsrADDROk;
229  unsigned long dwRsrBCNSSIDOk;
230  unsigned long dwRsrLENErr;
231  unsigned long dwRsrTYPErr;
232 
233  unsigned long dwNewRsrDECRYPTOK;
234  unsigned long dwNewRsrCFP;
235  unsigned long dwNewRsrUTSF;
236  unsigned long dwNewRsrHITAID;
237  unsigned long dwNewRsrHITAID0;
238 
239  unsigned long dwRsrLong;
240  unsigned long dwRsrRunt;
241 
242  unsigned long dwRsrRxControl;
243  unsigned long dwRsrRxData;
244  unsigned long dwRsrRxManage;
245 
246  unsigned long dwRsrRxPacket;
247  unsigned long dwRsrRxOctet;
248  unsigned long dwRsrBroadcast;
249  unsigned long dwRsrMulticast;
250  unsigned long dwRsrDirected;
251  // 64-bit OID
252  unsigned long long ullRsrOK;
253 
254  // for some optional OIDs (64 bits) and DMI support
255  unsigned long long ullRxBroadcastBytes;
256  unsigned long long ullRxMulticastBytes;
257  unsigned long long ullRxDirectedBytes;
258  unsigned long long ullRxBroadcastFrames;
259  unsigned long long ullRxMulticastFrames;
260  unsigned long long ullRxDirectedFrames;
261 
262  unsigned long dwRsrRxFragment;
263  unsigned long dwRsrRxFrmLen64;
264  unsigned long dwRsrRxFrmLen65_127;
265  unsigned long dwRsrRxFrmLen128_255;
266  unsigned long dwRsrRxFrmLen256_511;
267  unsigned long dwRsrRxFrmLen512_1023;
268  unsigned long dwRsrRxFrmLen1024_1518;
269 
270  // TSR status count
271  //
272  unsigned long dwTsrTotalRetry[TYPE_MAXTD]; // total collision retry count
273  unsigned long dwTsrOnceRetry[TYPE_MAXTD]; // this packet only occur one collision
274  unsigned long dwTsrMoreThanOnceRetry[TYPE_MAXTD]; // this packet occur more than one collision
275  unsigned long dwTsrRetry[TYPE_MAXTD]; // this packet has ever occur collision,
276  // that is (dwTsrOnceCollision0 + dwTsrMoreThanOnceCollision0)
277  unsigned long dwTsrACKData[TYPE_MAXTD];
278  unsigned long dwTsrErr[TYPE_MAXTD];
279  unsigned long dwAllTsrOK[TYPE_MAXTD];
282 
283  unsigned long dwTsrTxPacket[TYPE_MAXTD];
284  unsigned long dwTsrTxOctet[TYPE_MAXTD];
285  unsigned long dwTsrBroadcast[TYPE_MAXTD];
286  unsigned long dwTsrMulticast[TYPE_MAXTD];
287  unsigned long dwTsrDirected[TYPE_MAXTD];
288 
289  // RD/TD count
290  unsigned long dwCntRxFrmLength;
291  unsigned long dwCntTxBufLength;
292 
293  unsigned char abyCntRxPattern[16];
294  unsigned char abyCntTxPattern[16];
295 
296 
297 
298  // Software check....
299  unsigned long dwCntRxDataErr; // rx buffer data software compare CRC err count
300  unsigned long dwCntDecryptErr; // rx buffer data software compare CRC err count
301  unsigned long dwCntRxICVErr; // rx buffer data software compare CRC err count
302  unsigned int idxRxErrorDesc[TYPE_MAXRD]; // index for rx data error RD
303 
304  // 64-bit OID
305  unsigned long long ullTsrOK[TYPE_MAXTD];
306 
307  // for some optional OIDs (64 bits) and DMI support
308  unsigned long long ullTxBroadcastFrames[TYPE_MAXTD];
309  unsigned long long ullTxMulticastFrames[TYPE_MAXTD];
310  unsigned long long ullTxDirectedFrames[TYPE_MAXTD];
311  unsigned long long ullTxBroadcastBytes[TYPE_MAXTD];
312  unsigned long long ullTxMulticastBytes[TYPE_MAXTD];
313  unsigned long long ullTxDirectedBytes[TYPE_MAXTD];
314 
315 // unsigned long dwTxRetryCount[8];
316  //
317  // ISR status count
318  //
320 
322 
323  #ifdef Calcu_LinkQual
324  //Tx count:
325  unsigned long TxNoRetryOkCount; //success tx no retry !
326  unsigned long TxRetryOkCount; //success tx but retry !
327  unsigned long TxFailCount; //fail tx ?
328  //Rx count:
329  unsigned long RxOkCnt; //success rx !
330  unsigned long RxFcsErrCnt; //fail rx ?
331  //statistic
332  unsigned long SignalStren;
333  unsigned long LinkQuality;
334  #endif
336 
337 /*--------------------- Export Classes ----------------------------*/
338 
339 /*--------------------- Export Variables --------------------------*/
340 
341 /*--------------------- Export Functions --------------------------*/
342 
343 void STAvClearAllCounter(PSStatCounter pStatistic);
344 
345 void STAvUpdateIsrStatCounter(PSStatCounter pStatistic, unsigned long dwIsr);
346 
347 void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
348  unsigned char byRSR, unsigned char byNewRSR, unsigned char byRxRate,
349  unsigned char *pbyBuffer, unsigned int cbFrameLength);
350 
351 void STAvUpdateRDStatCounterEx(PSStatCounter pStatistic,
352  unsigned char byRSR, unsigned char byNewRsr, unsigned char byRxRate,
353  unsigned char *pbyBuffer, unsigned int cbFrameLength);
354 
355 void STAvUpdateTDStatCounter(PSStatCounter pStatistic, unsigned char byTSR0, unsigned char byTSR1,
356  unsigned char *pbyBuffer, unsigned int cbFrameLength, unsigned int uIdx);
357 
359  PSStatCounter pStatistic,
360  unsigned char *pbyBuffer,
361  unsigned long cbFrameLength
362  );
363 
365  PSDot11Counters p802_11Counter,
366  PSStatCounter pStatistic,
367  unsigned long dwCounter
368  );
369 
370 void STAvClear802_11Counter(PSDot11Counters p802_11Counter);
371 
372 #endif // __MIB_H__
373 
374 
375