Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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