]> Pileus Git - ~andy/linux/blob - drivers/staging/vt6656/mib.c
Merge tag 'upstream-3.8-rc1' of git://git.infradead.org/linux-ubi
[~andy/linux] / drivers / staging / vt6656 / mib.c
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.c
20  *
21  * Purpose: Implement MIB Data Structure
22  *
23  * Author: Tevin Chen
24  *
25  * Date: May 21, 1996
26  *
27  * Functions:
28  *      STAvClearAllCounter - Clear All MIB Counter
29  *      STAvUpdateIstStatCounter - Update ISR statistic counter
30  *      STAvUpdateRDStatCounter - Update Rx statistic counter
31  *      STAvUpdateRDStatCounterEx - Update Rx statistic counter and copy rcv data
32  *      STAvUpdateTDStatCounter - Update Tx statistic counter
33  *      STAvUpdateTDStatCounterEx - Update Tx statistic counter and copy tx data
34  *      STAvUpdate802_11Counter - Update 802.11 mib counter
35  *
36  * Revision History:
37  *
38  */
39
40 #include "mac.h"
41 #include "tether.h"
42 #include "mib.h"
43 #include "wctl.h"
44 #include "baseband.h"
45
46 /*---------------------  Static Definitions -------------------------*/
47 static int          msglevel                =MSG_LEVEL_INFO;
48 /*---------------------  Static Classes  ----------------------------*/
49
50 /*---------------------  Static Variables  --------------------------*/
51
52 /*---------------------  Static Functions  --------------------------*/
53
54 /*---------------------  Export Variables  --------------------------*/
55
56 /*---------------------  Export Functions  --------------------------*/
57
58
59
60 /*
61  * Description: Clear All Statistic Counter
62  *
63  * Parameters:
64  *  In:
65  *      pStatistic  - Pointer to Statistic Counter Data Structure
66  *  Out:
67  *      none
68  *
69  * Return Value: none
70  *
71  */
72 void STAvClearAllCounter (PSStatCounter pStatistic)
73 {
74     // set memory to zero
75         memset(pStatistic, 0, sizeof(SStatCounter));
76 }
77
78
79 /*
80  * Description: Update Isr Statistic Counter
81  *
82  * Parameters:
83  *  In:
84  *      pStatistic  - Pointer to Statistic Counter Data Structure
85  *      wisr        - Interrupt status
86  *  Out:
87  *      none
88  *
89  * Return Value: none
90  *
91  */
92 void STAvUpdateIsrStatCounter (PSStatCounter pStatistic, BYTE byIsr0, BYTE byIsr1)
93 {
94     /**********************/
95     /* ABNORMAL interrupt */
96     /**********************/
97     // not any IMR bit invoke irq
98     if (byIsr0 == 0) {
99         pStatistic->ISRStat.dwIsrUnknown++;
100         return;
101     }
102
103
104     if (byIsr0 & ISR_ACTX)              // ISR, bit0
105         pStatistic->ISRStat.dwIsrTx0OK++;           // TXDMA0 successful
106
107     if (byIsr0 & ISR_BNTX)              // ISR, bit2
108         pStatistic->ISRStat.dwIsrBeaconTxOK++;      // BeaconTx successful
109
110     if (byIsr0 & ISR_RXDMA0)            // ISR, bit3
111         pStatistic->ISRStat.dwIsrRx0OK++;           // Rx0 successful
112
113     if (byIsr0 & ISR_TBTT)              // ISR, bit4
114         pStatistic->ISRStat.dwIsrTBTTInt++;         // TBTT successful
115
116     if (byIsr0 & ISR_SOFTTIMER)         // ISR, bit6
117         pStatistic->ISRStat.dwIsrSTIMERInt++;
118
119     if (byIsr0 & ISR_WATCHDOG)          // ISR, bit7
120         pStatistic->ISRStat.dwIsrWatchDog++;
121
122
123     if (byIsr1 & ISR_FETALERR)              // ISR, bit8
124         pStatistic->ISRStat.dwIsrUnrecoverableError++;
125
126     if (byIsr1 & ISR_SOFTINT)               // ISR, bit9
127         pStatistic->ISRStat.dwIsrSoftInterrupt++;       // software interrupt
128
129     if (byIsr1 & ISR_MIBNEARFULL)           // ISR, bit10
130         pStatistic->ISRStat.dwIsrMIBNearfull++;
131
132     if (byIsr1 & ISR_RXNOBUF)               // ISR, bit11
133         pStatistic->ISRStat.dwIsrRxNoBuf++;             // Rx No Buff
134
135 }
136
137
138 /*
139  * Description: Update Rx Statistic Counter
140  *
141  * Parameters:
142  *  In:
143  *      pStatistic      - Pointer to Statistic Counter Data Structure
144  *      byRSR           - Rx Status
145  *      byNewRSR        - Rx Status
146  *      pbyBuffer       - Rx Buffer
147  *      cbFrameLength   - Rx Length
148  *  Out:
149  *      none
150  *
151  * Return Value: none
152  *
153  */
154 void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
155                              BYTE byRSR, BYTE byNewRSR,
156                              BYTE byRxSts, BYTE byRxRate,
157                              PBYTE pbyBuffer, unsigned int cbFrameLength)
158 {
159         /* need change */
160         PS802_11Header pHeader = (PS802_11Header)pbyBuffer;
161
162         if (byRSR & RSR_ADDROK)
163                 pStatistic->dwRsrADDROk++;
164         if (byRSR & RSR_CRCOK) {
165                 pStatistic->dwRsrCRCOk++;
166                 pStatistic->ullRsrOK++;
167
168                 if (cbFrameLength >= ETH_ALEN) {
169                         /* update counters in case of successful transmission */
170             if (byRSR & RSR_ADDRBROAD) {
171                 pStatistic->ullRxBroadcastFrames++;
172                 pStatistic->ullRxBroadcastBytes +=
173                   (unsigned long long) cbFrameLength;
174             }
175             else if (byRSR & RSR_ADDRMULTI) {
176                 pStatistic->ullRxMulticastFrames++;
177                 pStatistic->ullRxMulticastBytes +=
178                   (unsigned long long) cbFrameLength;
179             }
180             else {
181                 pStatistic->ullRxDirectedFrames++;
182                 pStatistic->ullRxDirectedBytes +=
183                   (unsigned long long) cbFrameLength;
184             }
185         }
186     }
187
188     if(byRxRate==22) {
189         pStatistic->CustomStat.ullRsr11M++;
190         if(byRSR & RSR_CRCOK) {
191             pStatistic->CustomStat.ullRsr11MCRCOk++;
192         }
193         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "11M: ALL[%d], OK[%d]:[%02x]\n",
194                 (signed int) pStatistic->CustomStat.ullRsr11M,
195                 (signed int) pStatistic->CustomStat.ullRsr11MCRCOk, byRSR);
196     }
197     else if(byRxRate==11) {
198         pStatistic->CustomStat.ullRsr5M++;
199         if(byRSR & RSR_CRCOK) {
200             pStatistic->CustomStat.ullRsr5MCRCOk++;
201         }
202         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 5M: ALL[%d], OK[%d]:[%02x]\n",
203                 (signed int) pStatistic->CustomStat.ullRsr5M,
204                 (signed int) pStatistic->CustomStat.ullRsr5MCRCOk, byRSR);
205     }
206     else if(byRxRate==4) {
207         pStatistic->CustomStat.ullRsr2M++;
208         if(byRSR & RSR_CRCOK) {
209             pStatistic->CustomStat.ullRsr2MCRCOk++;
210         }
211         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 2M: ALL[%d], OK[%d]:[%02x]\n",
212                 (signed int) pStatistic->CustomStat.ullRsr2M,
213                 (signed int) pStatistic->CustomStat.ullRsr2MCRCOk, byRSR);
214     }
215     else if(byRxRate==2){
216         pStatistic->CustomStat.ullRsr1M++;
217         if(byRSR & RSR_CRCOK) {
218             pStatistic->CustomStat.ullRsr1MCRCOk++;
219         }
220         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 1M: ALL[%d], OK[%d]:[%02x]\n",
221                 (signed int) pStatistic->CustomStat.ullRsr1M,
222                 (signed int) pStatistic->CustomStat.ullRsr1MCRCOk, byRSR);
223     }
224     else if(byRxRate==12){
225         pStatistic->CustomStat.ullRsr6M++;
226         if(byRSR & RSR_CRCOK) {
227             pStatistic->CustomStat.ullRsr6MCRCOk++;
228         }
229         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 6M: ALL[%d], OK[%d]\n",
230                 (signed int) pStatistic->CustomStat.ullRsr6M,
231                 (signed int) pStatistic->CustomStat.ullRsr6MCRCOk);
232     }
233     else if(byRxRate==18){
234         pStatistic->CustomStat.ullRsr9M++;
235         if(byRSR & RSR_CRCOK) {
236             pStatistic->CustomStat.ullRsr9MCRCOk++;
237         }
238         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 9M: ALL[%d], OK[%d]\n",
239                 (signed int) pStatistic->CustomStat.ullRsr9M,
240                 (signed int) pStatistic->CustomStat.ullRsr9MCRCOk);
241     }
242     else if(byRxRate==24){
243         pStatistic->CustomStat.ullRsr12M++;
244         if(byRSR & RSR_CRCOK) {
245             pStatistic->CustomStat.ullRsr12MCRCOk++;
246         }
247         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "12M: ALL[%d], OK[%d]\n",
248                 (signed int) pStatistic->CustomStat.ullRsr12M,
249                 (signed int) pStatistic->CustomStat.ullRsr12MCRCOk);
250     }
251     else if(byRxRate==36){
252         pStatistic->CustomStat.ullRsr18M++;
253         if(byRSR & RSR_CRCOK) {
254             pStatistic->CustomStat.ullRsr18MCRCOk++;
255         }
256         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "18M: ALL[%d], OK[%d]\n",
257                 (signed int) pStatistic->CustomStat.ullRsr18M,
258                 (signed int) pStatistic->CustomStat.ullRsr18MCRCOk);
259     }
260     else if(byRxRate==48){
261         pStatistic->CustomStat.ullRsr24M++;
262         if(byRSR & RSR_CRCOK) {
263             pStatistic->CustomStat.ullRsr24MCRCOk++;
264         }
265         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "24M: ALL[%d], OK[%d]\n",
266                 (signed int) pStatistic->CustomStat.ullRsr24M,
267                 (signed int) pStatistic->CustomStat.ullRsr24MCRCOk);
268     }
269     else if(byRxRate==72){
270         pStatistic->CustomStat.ullRsr36M++;
271         if(byRSR & RSR_CRCOK) {
272             pStatistic->CustomStat.ullRsr36MCRCOk++;
273         }
274         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "36M: ALL[%d], OK[%d]\n",
275                 (signed int) pStatistic->CustomStat.ullRsr36M,
276                 (signed int) pStatistic->CustomStat.ullRsr36MCRCOk);
277     }
278     else if(byRxRate==96){
279         pStatistic->CustomStat.ullRsr48M++;
280         if(byRSR & RSR_CRCOK) {
281             pStatistic->CustomStat.ullRsr48MCRCOk++;
282         }
283         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "48M: ALL[%d], OK[%d]\n",
284                 (signed int) pStatistic->CustomStat.ullRsr48M,
285                 (signed int) pStatistic->CustomStat.ullRsr48MCRCOk);
286     }
287     else if(byRxRate==108){
288         pStatistic->CustomStat.ullRsr54M++;
289         if(byRSR & RSR_CRCOK) {
290             pStatistic->CustomStat.ullRsr54MCRCOk++;
291         }
292         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "54M: ALL[%d], OK[%d]\n",
293                 (signed int) pStatistic->CustomStat.ullRsr54M,
294                 (signed int) pStatistic->CustomStat.ullRsr54MCRCOk);
295     }
296     else {
297             DBG_PRT(MSG_LEVEL_DEBUG,
298                     KERN_INFO "Unknown: Total[%d], CRCOK[%d]\n",
299                     (signed int) pStatistic->dwRsrRxPacket+1,
300                     (signed int)pStatistic->dwRsrCRCOk);
301     }
302
303     if (byRSR & RSR_BSSIDOK)
304         pStatistic->dwRsrBSSIDOk++;
305
306     if (byRSR & RSR_BCNSSIDOK)
307         pStatistic->dwRsrBCNSSIDOk++;
308     if (byRSR & RSR_IVLDLEN)  //invalid len (> 2312 byte)
309         pStatistic->dwRsrLENErr++;
310     if (byRSR & RSR_IVLDTYP)  //invalid packet type
311         pStatistic->dwRsrTYPErr++;
312     if ((byRSR & (RSR_IVLDTYP | RSR_IVLDLEN)) || !(byRSR & RSR_CRCOK))
313         pStatistic->dwRsrErr++;
314
315     if (byNewRSR & NEWRSR_DECRYPTOK)
316         pStatistic->dwNewRsrDECRYPTOK++;
317     if (byNewRSR & NEWRSR_CFPIND)
318         pStatistic->dwNewRsrCFP++;
319     if (byNewRSR & NEWRSR_HWUTSF)
320         pStatistic->dwNewRsrUTSF++;
321     if (byNewRSR & NEWRSR_BCNHITAID)
322         pStatistic->dwNewRsrHITAID++;
323     if (byNewRSR & NEWRSR_BCNHITAID0)
324         pStatistic->dwNewRsrHITAID0++;
325
326     // increase rx packet count
327     pStatistic->dwRsrRxPacket++;
328     pStatistic->dwRsrRxOctet += cbFrameLength;
329
330
331     if (IS_TYPE_DATA(pbyBuffer)) {
332         pStatistic->dwRsrRxData++;
333     } else if (IS_TYPE_MGMT(pbyBuffer)){
334         pStatistic->dwRsrRxManage++;
335     } else if (IS_TYPE_CONTROL(pbyBuffer)){
336         pStatistic->dwRsrRxControl++;
337     }
338
339     if (byRSR & RSR_ADDRBROAD)
340         pStatistic->dwRsrBroadcast++;
341     else if (byRSR & RSR_ADDRMULTI)
342         pStatistic->dwRsrMulticast++;
343     else
344         pStatistic->dwRsrDirected++;
345
346     if (WLAN_GET_FC_MOREFRAG(pHeader->wFrameCtl))
347         pStatistic->dwRsrRxFragment++;
348
349     if (cbFrameLength < ETH_ZLEN + 4) {
350         pStatistic->dwRsrRunt++;
351     } else if (cbFrameLength == ETH_ZLEN + 4) {
352         pStatistic->dwRsrRxFrmLen64++;
353     }
354     else if ((65 <= cbFrameLength) && (cbFrameLength <= 127)) {
355         pStatistic->dwRsrRxFrmLen65_127++;
356     }
357     else if ((128 <= cbFrameLength) && (cbFrameLength <= 255)) {
358         pStatistic->dwRsrRxFrmLen128_255++;
359     }
360     else if ((256 <= cbFrameLength) && (cbFrameLength <= 511)) {
361         pStatistic->dwRsrRxFrmLen256_511++;
362     }
363     else if ((512 <= cbFrameLength) && (cbFrameLength <= 1023)) {
364         pStatistic->dwRsrRxFrmLen512_1023++;
365     } else if ((1024 <= cbFrameLength) &&
366                (cbFrameLength <= ETH_FRAME_LEN + 4)) {
367         pStatistic->dwRsrRxFrmLen1024_1518++;
368     } else if (cbFrameLength > ETH_FRAME_LEN + 4) {
369         pStatistic->dwRsrLong++;
370     }
371 }
372
373 /*
374  * Description: Update Rx Statistic Counter and copy Rx buffer
375  *
376  * Parameters:
377  *  In:
378  *      pStatistic      - Pointer to Statistic Counter Data Structure
379  *      byRSR           - Rx Status
380  *      byNewRSR        - Rx Status
381  *      pbyBuffer       - Rx Buffer
382  *      cbFrameLength   - Rx Length
383  *  Out:
384  *      none
385  *
386  * Return Value: none
387  *
388  */
389
390 void
391 STAvUpdateRDStatCounterEx (
392     PSStatCounter   pStatistic,
393     BYTE            byRSR,
394     BYTE            byNewRSR,
395     BYTE            byRxSts,
396     BYTE            byRxRate,
397     PBYTE           pbyBuffer,
398     unsigned int            cbFrameLength
399     )
400 {
401     STAvUpdateRDStatCounter(
402                     pStatistic,
403                     byRSR,
404                     byNewRSR,
405                     byRxSts,
406                     byRxRate,
407                     pbyBuffer,
408                     cbFrameLength
409                     );
410
411     // rx length
412     pStatistic->dwCntRxFrmLength = cbFrameLength;
413     // rx pattern, we just see 10 bytes for sample
414     memcpy(pStatistic->abyCntRxPattern, (PBYTE)pbyBuffer, 10);
415 }
416
417
418 /*
419  * Description: Update Tx Statistic Counter
420  *
421  * Parameters:
422  *  In:
423  *      pStatistic      - Pointer to Statistic Counter Data Structure
424  *      byTSR0          - Tx Status
425  *      byTSR1          - Tx Status
426  *      pbyBuffer       - Tx Buffer
427  *      cbFrameLength   - Tx Length
428  *      uIdx            - Index of Tx DMA
429  *  Out:
430  *      none
431  *
432  * Return Value: none
433  *
434  */
435 void
436 STAvUpdateTDStatCounter (
437     PSStatCounter   pStatistic,
438     BYTE            byPktNum,
439     BYTE            byRate,
440     BYTE            byTSR
441     )
442 {
443     BYTE    byRetyCnt;
444     // increase tx packet count
445     pStatistic->dwTsrTxPacket++;
446
447     byRetyCnt = (byTSR & 0xF0) >> 4;
448     if (byRetyCnt != 0) {
449         pStatistic->dwTsrRetry++;
450         pStatistic->dwTsrTotalRetry += byRetyCnt;
451         pStatistic->dwTxFail[byRate]+= byRetyCnt;
452         pStatistic->dwTxFail[MAX_RATE] += byRetyCnt;
453
454         if ( byRetyCnt == 0x1)
455             pStatistic->dwTsrOnceRetry++;
456         else
457             pStatistic->dwTsrMoreThanOnceRetry++;
458
459         if (byRetyCnt <= 8)
460             pStatistic->dwTxRetryCount[byRetyCnt-1]++;
461
462     }
463     if ( !(byTSR & (TSR_TMO | TSR_RETRYTMO))) {
464
465    if (byRetyCnt < 2)
466         pStatistic->TxNoRetryOkCount ++;
467    else
468         pStatistic->TxRetryOkCount ++;
469
470         pStatistic->ullTsrOK++;
471         pStatistic->CustomStat.ullTsrAllOK++;
472         // update counters in case that successful transmit
473         pStatistic->dwTxOk[byRate]++;
474         pStatistic->dwTxOk[MAX_RATE]++;
475
476         if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_BROAD )  {
477             pStatistic->ullTxBroadcastFrames++;
478             pStatistic->ullTxBroadcastBytes += pStatistic->abyTxPktInfo[byPktNum].wLength;
479         } else if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_MULTI ) {
480             pStatistic->ullTxMulticastFrames++;
481             pStatistic->ullTxMulticastBytes += pStatistic->abyTxPktInfo[byPktNum].wLength;
482         } else if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_UNI ) {
483             pStatistic->ullTxDirectedFrames++;
484             pStatistic->ullTxDirectedBytes += pStatistic->abyTxPktInfo[byPktNum].wLength;
485         }
486     }
487     else {
488
489         pStatistic->TxFailCount ++;
490
491         pStatistic->dwTsrErr++;
492         if (byTSR & TSR_RETRYTMO)
493             pStatistic->dwTsrRetryTimeout++;
494         if (byTSR & TSR_TMO)
495             pStatistic->dwTsrTransmitTimeout++;
496     }
497
498     if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_BROAD )  {
499         pStatistic->dwTsrBroadcast++;
500     } else if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_MULTI ) {
501         pStatistic->dwTsrMulticast++;
502     } else if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_UNI ) {
503         pStatistic->dwTsrDirected++;
504     }
505 }
506
507
508
509 /*
510  * Description: Update 802.11 mib counter
511  *
512  * Parameters:
513  *  In:
514  *      p802_11Counter  - Pointer to 802.11 mib counter
515  *      pStatistic      - Pointer to Statistic Counter Data Structure
516  *      dwCounter       - hardware counter for 802.11 mib
517  *  Out:
518  *      none
519  *
520  * Return Value: none
521  *
522  */
523 void
524 STAvUpdate802_11Counter(
525     PSDot11Counters         p802_11Counter,
526     PSStatCounter           pStatistic,
527     BYTE                    byRTSSuccess,
528     BYTE                    byRTSFail,
529     BYTE                    byACKFail,
530     BYTE                    byFCSErr
531     )
532 {
533     //p802_11Counter->TransmittedFragmentCount
534     p802_11Counter->MulticastTransmittedFrameCount =
535       (unsigned long long) (pStatistic->dwTsrBroadcast +
536                             pStatistic->dwTsrMulticast);
537     p802_11Counter->FailedCount = (unsigned long long) (pStatistic->dwTsrErr);
538     p802_11Counter->RetryCount = (unsigned long long) (pStatistic->dwTsrRetry);
539     p802_11Counter->MultipleRetryCount =
540       (unsigned long long) (pStatistic->dwTsrMoreThanOnceRetry);
541     //p802_11Counter->FrameDuplicateCount
542     p802_11Counter->RTSSuccessCount += (unsigned long long) byRTSSuccess;
543     p802_11Counter->RTSFailureCount += (unsigned long long) byRTSFail;
544     p802_11Counter->ACKFailureCount += (unsigned long long) byACKFail;
545     p802_11Counter->FCSErrorCount +=   (unsigned long long) byFCSErr;
546     //p802_11Counter->ReceivedFragmentCount
547     p802_11Counter->MulticastReceivedFrameCount =
548       (unsigned long long) (pStatistic->dwRsrBroadcast +
549                             pStatistic->dwRsrMulticast);
550 }
551
552 /*
553  * Description: Clear 802.11 mib counter
554  *
555  * Parameters:
556  *  In:
557  *      p802_11Counter  - Pointer to 802.11 mib counter
558  *  Out:
559  *      none
560  *
561  * Return Value: none
562  *
563  */
564 void
565 STAvClear802_11Counter(PSDot11Counters p802_11Counter)
566 {
567     // set memory to zero
568         memset(p802_11Counter, 0, sizeof(SDot11Counters));
569 }
570
571 /*
572  * Description: Clear 802.11 mib counter
573  *
574  * Parameters:
575  *  In:
576  *      pUsbCounter  - Pointer to USB mib counter
577  *      ntStatus - URB status
578  *  Out:
579  *      none
580  *
581  * Return Value: none
582  *
583  */
584
585 void STAvUpdateUSBCounter(PSUSBCounter pUsbCounter, int ntStatus)
586 {
587
588 //    if ( ntStatus == USBD_STATUS_CRC ) {
589         pUsbCounter->dwCrc++;
590 //    }
591
592 }