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