]> Pileus Git - ~andy/linux/blobdiff - drivers/staging/vt6655/mib.c
Merge tag 'ktest-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
[~andy/linux] / drivers / staging / vt6655 / mib.c
index a1b99990b569075a075e56fb65cd01c92352f052..6a59652052b652f1d558f88fad1f152967e7922e 100644 (file)
@@ -56,8 +56,6 @@ static int msglevel = MSG_LEVEL_INFO;
 
 /*---------------------  Export Functions  --------------------------*/
 
-
-
 /*
  * Description: Clear All Statistic Counter
  *
@@ -76,7 +74,6 @@ void STAvClearAllCounter(PSStatCounter pStatistic)
        memset(pStatistic, 0, sizeof(SStatCounter));
 }
 
-
 /*
  * Description: Update Isr Statistic Counter
  *
@@ -139,27 +136,10 @@ void STAvUpdateIsrStatCounter(PSStatCounter pStatistic, unsigned long dwIsr)
        if (dwIsr & ISR_RXDMA1)               // ISR, bit12
                pStatistic->ISRStat.dwIsrRx1OK++;             // Rx1 successful
 
-//    if (dwIsr & ISR_ATIMTX)               // ISR, bit13
-//        pStatistic->ISRStat.dwIsrATIMTxOK++;          // ATIMTX successful
-
-//    if (dwIsr & ISR_SYNCTX)               // ISR, bit14
-//        pStatistic->ISRStat.dwIsrSYNCTxOK++;          // SYNCTX successful
-
-//    if (dwIsr & ISR_CFPEND)               // ISR, bit18
-//        pStatistic->ISRStat.dwIsrCFPEnd++;
-
-//    if (dwIsr & ISR_ATIMEND)              // ISR, bit19
-//        pStatistic->ISRStat.dwIsrATIMEnd++;
-
-//    if (dwIsr & ISR_SYNCFLUSHOK)          // ISR, bit20
-//        pStatistic->ISRStat.dwIsrSYNCFlushOK++;
-
        if (dwIsr & ISR_SOFTTIMER1)           // ISR, bit21
                pStatistic->ISRStat.dwIsrSTIMER1Int++;
-
 }
 
-
 /*
  * Description: Update Rx Statistic Counter
  *
@@ -195,12 +175,10 @@ void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
                        if (byRSR & RSR_ADDRBROAD) {
                                pStatistic->ullRxBroadcastFrames++;
                                pStatistic->ullRxBroadcastBytes += (unsigned long long) cbFrameLength;
-                       }
-                       else if (byRSR & RSR_ADDRMULTI) {
+                       } else if (byRSR & RSR_ADDRMULTI) {
                                pStatistic->ullRxMulticastFrames++;
                                pStatistic->ullRxMulticastBytes += (unsigned long long) cbFrameLength;
-                       }
-                       else {
+                       } else {
                                pStatistic->ullRxDirectedFrames++;
                                pStatistic->ullRxDirectedBytes += (unsigned long long) cbFrameLength;
                        }
@@ -213,85 +191,73 @@ void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
                        pStatistic->CustomStat.ullRsr11MCRCOk++;
                }
                DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "11M: ALL[%d], OK[%d]:[%02x]\n", (int)pStatistic->CustomStat.ullRsr11M, (int)pStatistic->CustomStat.ullRsr11MCRCOk, byRSR);
-       }
-       else if (byRxRate == 11) {
+       } else if (byRxRate == 11) {
                pStatistic->CustomStat.ullRsr5M++;
                if (byRSR & RSR_CRCOK) {
                        pStatistic->CustomStat.ullRsr5MCRCOk++;
                }
                DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 5M: ALL[%d], OK[%d]:[%02x]\n", (int)pStatistic->CustomStat.ullRsr5M, (int)pStatistic->CustomStat.ullRsr5MCRCOk, byRSR);
-       }
-       else if (byRxRate == 4) {
+       } else if (byRxRate == 4) {
                pStatistic->CustomStat.ullRsr2M++;
                if (byRSR & RSR_CRCOK) {
                        pStatistic->CustomStat.ullRsr2MCRCOk++;
                }
                DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 2M: ALL[%d], OK[%d]:[%02x]\n", (int)pStatistic->CustomStat.ullRsr2M, (int)pStatistic->CustomStat.ullRsr2MCRCOk, byRSR);
-       }
-       else if (byRxRate == 2) {
+       } else if (byRxRate == 2) {
                pStatistic->CustomStat.ullRsr1M++;
                if (byRSR & RSR_CRCOK) {
                        pStatistic->CustomStat.ullRsr1MCRCOk++;
                }
                DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 1M: ALL[%d], OK[%d]:[%02x]\n", (int)pStatistic->CustomStat.ullRsr1M, (int)pStatistic->CustomStat.ullRsr1MCRCOk, byRSR);
-       }
-       else if (byRxRate == 12) {
+       } else if (byRxRate == 12) {
                pStatistic->CustomStat.ullRsr6M++;
                if (byRSR & RSR_CRCOK) {
                        pStatistic->CustomStat.ullRsr6MCRCOk++;
                }
                DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 6M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr6M, (int)pStatistic->CustomStat.ullRsr6MCRCOk);
-       }
-       else if (byRxRate == 18) {
+       } else if (byRxRate == 18) {
                pStatistic->CustomStat.ullRsr9M++;
                if (byRSR & RSR_CRCOK) {
                        pStatistic->CustomStat.ullRsr9MCRCOk++;
                }
                DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 9M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr9M, (int)pStatistic->CustomStat.ullRsr9MCRCOk);
-       }
-       else if (byRxRate == 24) {
+       } else if (byRxRate == 24) {
                pStatistic->CustomStat.ullRsr12M++;
                if (byRSR & RSR_CRCOK) {
                        pStatistic->CustomStat.ullRsr12MCRCOk++;
                }
                DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "12M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr12M, (int)pStatistic->CustomStat.ullRsr12MCRCOk);
-       }
-       else if (byRxRate == 36) {
+       } else if (byRxRate == 36) {
                pStatistic->CustomStat.ullRsr18M++;
                if (byRSR & RSR_CRCOK) {
                        pStatistic->CustomStat.ullRsr18MCRCOk++;
                }
                DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "18M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr18M, (int)pStatistic->CustomStat.ullRsr18MCRCOk);
-       }
-       else if (byRxRate == 48) {
+       } else if (byRxRate == 48) {
                pStatistic->CustomStat.ullRsr24M++;
                if (byRSR & RSR_CRCOK) {
                        pStatistic->CustomStat.ullRsr24MCRCOk++;
                }
                DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "24M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr24M, (int)pStatistic->CustomStat.ullRsr24MCRCOk);
-       }
-       else if (byRxRate == 72) {
+       } else if (byRxRate == 72) {
                pStatistic->CustomStat.ullRsr36M++;
                if (byRSR & RSR_CRCOK) {
                        pStatistic->CustomStat.ullRsr36MCRCOk++;
                }
                DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "36M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr36M, (int)pStatistic->CustomStat.ullRsr36MCRCOk);
-       }
-       else if (byRxRate == 96) {
+       } else if (byRxRate == 96) {
                pStatistic->CustomStat.ullRsr48M++;
                if (byRSR & RSR_CRCOK) {
                        pStatistic->CustomStat.ullRsr48MCRCOk++;
                }
                DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "48M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr48M, (int)pStatistic->CustomStat.ullRsr48MCRCOk);
-       }
-       else if (byRxRate == 108) {
+       } else if (byRxRate == 108) {
                pStatistic->CustomStat.ullRsr54M++;
                if (byRSR & RSR_CRCOK) {
                        pStatistic->CustomStat.ullRsr54MCRCOk++;
                }
                DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "54M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr54M, (int)pStatistic->CustomStat.ullRsr54MCRCOk);
-       }
-       else {
+       } else {
                DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Unknown: Total[%d], CRCOK[%d]\n", (int)pStatistic->dwRsrRxPacket+1, (int)pStatistic->dwRsrCRCOk);
        }
 
@@ -322,7 +288,6 @@ void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
        pStatistic->dwRsrRxPacket++;
        pStatistic->dwRsrRxOctet += cbFrameLength;
 
-
        if (IS_TYPE_DATA(pbyBuffer)) {
                pStatistic->dwRsrRxData++;
        } else if (IS_TYPE_MGMT(pbyBuffer)) {
@@ -343,32 +308,23 @@ void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
 
        if (cbFrameLength < ETH_ZLEN + 4) {
                pStatistic->dwRsrRunt++;
-       }
-       else if (cbFrameLength == ETH_ZLEN + 4) {
+       } else if (cbFrameLength == ETH_ZLEN + 4) {
                pStatistic->dwRsrRxFrmLen64++;
-       }
-       else if ((65 <= cbFrameLength) && (cbFrameLength <= 127)) {
+       } else if ((65 <= cbFrameLength) && (cbFrameLength <= 127)) {
                pStatistic->dwRsrRxFrmLen65_127++;
-       }
-       else if ((128 <= cbFrameLength) && (cbFrameLength <= 255)) {
+       } else if ((128 <= cbFrameLength) && (cbFrameLength <= 255)) {
                pStatistic->dwRsrRxFrmLen128_255++;
-       }
-       else if ((256 <= cbFrameLength) && (cbFrameLength <= 511)) {
+       } else if ((256 <= cbFrameLength) && (cbFrameLength <= 511)) {
                pStatistic->dwRsrRxFrmLen256_511++;
-       }
-       else if ((512 <= cbFrameLength) && (cbFrameLength <= 1023)) {
+       } else if ((512 <= cbFrameLength) && (cbFrameLength <= 1023)) {
                pStatistic->dwRsrRxFrmLen512_1023++;
-       }
-       else if ((1024 <= cbFrameLength) && (cbFrameLength <= ETH_FRAME_LEN + 4)) {
+       } else if ((1024 <= cbFrameLength) && (cbFrameLength <= ETH_FRAME_LEN + 4)) {
                pStatistic->dwRsrRxFrmLen1024_1518++;
        } else if (cbFrameLength > ETH_FRAME_LEN + 4) {
                pStatistic->dwRsrLong++;
        }
-
 }
 
-
-
 /*
  * Description: Update Rx Statistic Counter and copy Rx buffer
  *
@@ -411,7 +367,6 @@ STAvUpdateRDStatCounterEx(
        memcpy(pStatistic->abyCntRxPattern, (unsigned char *)pbyBuffer, 10);
 }
 
-
 /*
  * Description: Update Tx Statistic Counter
  *
@@ -443,13 +398,10 @@ STAvUpdateTDStatCounter(
        unsigned char *pbyDestAddr;
        unsigned char byTSR0_NCR = byTSR0 & TSR0_NCR;
 
-
-
        pHeader = (PWLAN_80211HDR_A4) pbyBuffer;
        if (WLAN_GET_FC_TODS(pHeader->wFrameCtl) == 0) {
                pbyDestAddr = &(pHeader->abyAddr1[0]);
-       }
-       else {
+       } else {
                pbyDestAddr = &(pHeader->abyAddr3[0]);
        }
        // increase tx packet count
@@ -474,17 +426,14 @@ STAvUpdateTDStatCounter(
                if (is_broadcast_ether_addr(pbyDestAddr)) {
                        pStatistic->ullTxBroadcastFrames[uIdx]++;
                        pStatistic->ullTxBroadcastBytes[uIdx] += (unsigned long long) cbFrameLength;
-               }
-               else if (is_multicast_ether_addr(pbyDestAddr)) {
+               } else if (is_multicast_ether_addr(pbyDestAddr)) {
                        pStatistic->ullTxMulticastFrames[uIdx]++;
                        pStatistic->ullTxMulticastBytes[uIdx] += (unsigned long long) cbFrameLength;
-               }
-               else {
+               } else {
                        pStatistic->ullTxDirectedFrames[uIdx]++;
                        pStatistic->ullTxDirectedBytes[uIdx] += (unsigned long long) cbFrameLength;
                }
-       }
-       else {
+       } else {
                if (byTSR1 & TSR1_TERR)
                        pStatistic->dwTsrErr[uIdx]++;
                if (byTSR1 & TSR1_RETRYTMO)
@@ -501,10 +450,8 @@ STAvUpdateTDStatCounter(
                pStatistic->dwTsrMulticast[uIdx]++;
        else
                pStatistic->dwTsrDirected[uIdx]++;
-
 }
 
-
 /*
  * Description: Update Tx Statistic Counter and copy Tx buffer
  *
@@ -536,7 +483,6 @@ STAvUpdateTDStatCounterEx(
        memcpy(pStatistic->abyCntTxPattern, pbyBuffer, 16);
 }
 
-
 /*
  * Description: Update 802.11 mib counter
  *