Linux Audio

Check our new training course

Loading...
Note: File does not exist in v6.8.
  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
 41typedef 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;
 69
 70//
 71// MIB2 counter
 72//
 73typedef struct tagSMib2Counter {
 74	long    ifIndex;
 75	char    ifDescr[256];               // max size 255 plus zero ending
 76	// e.g. "interface 1"
 77	long    ifType;
 78	long    ifMtu;
 79	unsigned long ifSpeed;
 80	unsigned char ifPhysAddress[ETH_ALEN];
 81	long    ifAdminStatus;
 82	long    ifOperStatus;
 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;
 98
 99// Value in the ifType entry
100#define WIRELESSLANIEEE80211b      6           //
101
102// Value in the ifAdminStatus/ifOperStatus entry
103#define UP                  1           //
104#define DOWN                2           //
105#define TESTING             3           //
106
107//
108// RMON counter
109//
110typedef 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;
133
134//
135// Custom counter
136//
137typedef struct tagSCustomCounters {
138	unsigned long Length;
139
140	unsigned long long   ullTsrAllOK;
141
142	unsigned long long   ullRsr11M;
143	unsigned long long   ullRsr5M;
144	unsigned long long   ullRsr2M;
145	unsigned long long   ullRsr1M;
146
147	unsigned long long   ullRsr11MCRCOk;
148	unsigned long long   ullRsr5MCRCOk;
149	unsigned long long   ullRsr2MCRCOk;
150	unsigned long long   ullRsr1MCRCOk;
151
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;
160
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;
170
171//
172// Custom counter
173//
174typedef struct tagSISRCounters {
175	unsigned long Length;
176
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;
188
189	unsigned long dwIsrUnknown;               // unknown interrupt count
190
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;
200
201// Value in the etherStatsStatus entry
202#define VALID               1           //
203#define CREATE_REQUEST      2           //
204#define UNDER_CREATION      3           //
205#define INVALID             4           //
206
207//
208// statistic counter
209//
210typedef struct tagSStatCounter {
211	//
212	// ISR status count
213	//
214
215	// RSR status count
216	//
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;
226
227	unsigned long dwNewRsrDECRYPTOK;
228	unsigned long dwNewRsrCFP;
229	unsigned long dwNewRsrUTSF;
230	unsigned long dwNewRsrHITAID;
231	unsigned long dwNewRsrHITAID0;
232
233	unsigned long dwRsrLong;
234	unsigned long dwRsrRunt;
235
236	unsigned long dwRsrRxControl;
237	unsigned long dwRsrRxData;
238	unsigned long dwRsrRxManage;
239
240	unsigned long dwRsrRxPacket;
241	unsigned long dwRsrRxOctet;
242	unsigned long dwRsrBroadcast;
243	unsigned long dwRsrMulticast;
244	unsigned long dwRsrDirected;
245	// 64-bit OID
246	unsigned long long   ullRsrOK;
247
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;
255
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;
263
264	// TSR status count
265	//
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];
276
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];
282
283	// RD/TD count
284	unsigned long dwCntRxFrmLength;
285	unsigned long dwCntTxBufLength;
286
287	unsigned char abyCntRxPattern[16];
288	unsigned char abyCntTxPattern[16];
289
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
295
296	// 64-bit OID
297	unsigned long long   ullTsrOK[TYPE_MAXTD];
298
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];
306
307//    unsigned long dwTxRetryCount[8];
308	//
309	// ISR status count
310	//
311	SISRCounters ISRStat;
312
313	SCustomCounters CustomStat;
314
315#ifdef Calcu_LinkQual
316	//Tx count:
317	unsigned long TxNoRetryOkCount;         //success tx no retry !
318	unsigned long TxRetryOkCount;              //success tx but retry !
319	unsigned long TxFailCount;                      //fail tx ?
320	//Rx count:
321	unsigned long RxOkCnt;                          //success rx !
322	unsigned long RxFcsErrCnt;                    //fail rx ?
323	//statistic
324	unsigned long SignalStren;
325	unsigned long LinkQuality;
326#endif
327} SStatCounter, *PSStatCounter;
328
329/*---------------------  Export Classes  ----------------------------*/
330
331/*---------------------  Export Variables  --------------------------*/
332
333/*---------------------  Export Functions  --------------------------*/
334
335void STAvClearAllCounter(PSStatCounter pStatistic);
336
337void STAvUpdateIsrStatCounter(PSStatCounter pStatistic, unsigned long dwIsr);
338
339void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
340			     unsigned char byRSR, unsigned char byNewRSR, unsigned char byRxRate,
341			     unsigned char *pbyBuffer, unsigned int cbFrameLength);
342
343void STAvUpdateRDStatCounterEx(PSStatCounter pStatistic,
344			       unsigned char byRSR, unsigned char byNewRsr, unsigned char byRxRate,
345			       unsigned char *pbyBuffer, unsigned int cbFrameLength);
346
347void STAvUpdateTDStatCounter(PSStatCounter pStatistic, unsigned char byTSR0, unsigned char byTSR1,
348			     unsigned char *pbyBuffer, unsigned int cbFrameLength, unsigned int uIdx);
349
350void STAvUpdateTDStatCounterEx(
351	PSStatCounter   pStatistic,
352	unsigned char *pbyBuffer,
353	unsigned long cbFrameLength
354);
355
356void STAvUpdate802_11Counter(
357	PSDot11Counters p802_11Counter,
358	PSStatCounter   pStatistic,
359	unsigned long dwCounter
360);
361
362void STAvClear802_11Counter(PSDot11Counters p802_11Counter);
363
364#endif // __MIB_H__