⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mib.c

📁 VIA VT6656 USB linux source code.
💻 C
📖 第 1 页 / 共 2 页
字号:
    if (BITbIsBitOn(byRSR, RSR_IVLDLEN))  //invalid len (> 2312 byte)        pStatistic->dwRsrLENErr++;    if (BITbIsBitOn(byRSR, RSR_IVLDTYP))  //invalid packet type        pStatistic->dwRsrTYPErr++;    if (BITbIsBitOn(byRSR, (RSR_IVLDTYP | RSR_IVLDLEN)) || BITbIsBitOff(byRSR, RSR_CRCOK))            pStatistic->dwRsrErr++;    if (BITbIsBitOn(byNewRSR, NEWRSR_DECRYPTOK))        pStatistic->dwNewRsrDECRYPTOK++;    if (BITbIsBitOn(byNewRSR, NEWRSR_CFPIND))        pStatistic->dwNewRsrCFP++;    if (BITbIsBitOn(byNewRSR, NEWRSR_HWUTSF))        pStatistic->dwNewRsrUTSF++;    if (BITbIsBitOn(byNewRSR, NEWRSR_BCNHITAID))        pStatistic->dwNewRsrHITAID++;    if (BITbIsBitOn(byNewRSR, NEWRSR_BCNHITAID0))        pStatistic->dwNewRsrHITAID0++;    // increase rx packet count    pStatistic->dwRsrRxPacket++;    pStatistic->dwRsrRxOctet += cbFrameLength;    if (IS_TYPE_DATA(pbyBuffer)) {        pStatistic->dwRsrRxData++;    } else if (IS_TYPE_MGMT(pbyBuffer)){        pStatistic->dwRsrRxManage++;    } else if (IS_TYPE_CONTROL(pbyBuffer)){        pStatistic->dwRsrRxControl++;    }    if (BITbIsBitOn(byRSR, RSR_ADDRBROAD))        pStatistic->dwRsrBroadcast++;    else if (BITbIsBitOn(byRSR, RSR_ADDRMULTI))        pStatistic->dwRsrMulticast++;    else        pStatistic->dwRsrDirected++;    if (WLAN_GET_FC_MOREFRAG(pHeader->wFrameCtl))        pStatistic->dwRsrRxFragment++;    if (cbFrameLength < MIN_PACKET_LEN + 4) {        pStatistic->dwRsrRunt++;    }    else if (cbFrameLength == MIN_PACKET_LEN + 4) {        pStatistic->dwRsrRxFrmLen64++;    }    else if ((65 <= cbFrameLength) && (cbFrameLength <= 127)) {        pStatistic->dwRsrRxFrmLen65_127++;    }    else if ((128 <= cbFrameLength) && (cbFrameLength <= 255)) {        pStatistic->dwRsrRxFrmLen128_255++;    }    else if ((256 <= cbFrameLength) && (cbFrameLength <= 511)) {        pStatistic->dwRsrRxFrmLen256_511++;    }    else if ((512 <= cbFrameLength) && (cbFrameLength <= 1023)) {        pStatistic->dwRsrRxFrmLen512_1023++;    }    else if ((1024 <= cbFrameLength) && (cbFrameLength <= MAX_PACKET_LEN + 4)) {        pStatistic->dwRsrRxFrmLen1024_1518++;    } else if (cbFrameLength > MAX_PACKET_LEN + 4) {        pStatistic->dwRsrLong++;    }}                                                        /* * Description: Update Rx Statistic Counter and copy Rx buffer * * Parameters: *  In: *      pStatistic      - Pointer to Statistic Counter Data Structure *      byRSR           - Rx Status *      byNewRSR        - Rx Status *      pbyBuffer       - Rx Buffer *      cbFrameLength   - Rx Length *  Out: *      none * * Return Value: none * */ voidSTAvUpdateRDStatCounterEx (    PSStatCounter   pStatistic,    BYTE            byRSR,    BYTE            byNewRSR,    BYTE            byRxSts,        BYTE            byRxRate,    PBYTE           pbyBuffer,    UINT            cbFrameLength    ){    STAvUpdateRDStatCounter(                    pStatistic,                    byRSR,                    byNewRSR,                    byRxSts,                                        byRxRate,                    pbyBuffer,                    cbFrameLength                    );    // rx length    pStatistic->dwCntRxFrmLength = cbFrameLength;    // rx pattern, we just see 10 bytes for sample    MEMvCopy(pStatistic->abyCntRxPattern, (PBYTE)pbyBuffer, 10);} /* * Description: Update Tx Statistic Counter * * Parameters: *  In: *      pStatistic      - Pointer to Statistic Counter Data Structure *      byTSR0          - Tx Status *      byTSR1          - Tx Status *      pbyBuffer       - Tx Buffer *      cbFrameLength   - Tx Length *      uIdx            - Index of Tx DMA *  Out: *      none * * Return Value: none * */voidSTAvUpdateTDStatCounter (    PSStatCounter   pStatistic,    BYTE            byPktNum,    BYTE            byRate,    BYTE            byTSR    ){    BYTE    byRetyCnt;    // increase tx packet count    pStatistic->dwTsrTxPacket++;    byRetyCnt = (byTSR & 0xF0) >> 4;    if (byRetyCnt != 0) {        pStatistic->dwTsrRetry++;        pStatistic->dwTsrTotalRetry += byRetyCnt;        pStatistic->dwTxFail[byRate]+= byRetyCnt;        pStatistic->dwTxFail[MAX_RATE] += byRetyCnt;        if ( byRetyCnt == 0x1)            pStatistic->dwTsrOnceRetry++;        else            pStatistic->dwTsrMoreThanOnceRetry++;                if (byRetyCnt <= 8)            pStatistic->dwTxRetryCount[byRetyCnt-1]++;            }    if (BITbIsAllBitsOff(byTSR, (TSR_TMO | TSR_RETRYTMO))) {		#ifdef Calcu_LinkQual   if (byRetyCnt < 2)         pStatistic->TxNoRetryOkCount ++;   else         pStatistic->TxRetryOkCount ++;#endif        pStatistic->ullTsrOK++;        pStatistic->CustomStat.ullTsrAllOK++;        // update counters in case that successful transmit        pStatistic->dwTxOk[byRate]++;        pStatistic->dwTxOk[MAX_RATE]++;                if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_BROAD )  {            pStatistic->ullTxBroadcastFrames++;            pStatistic->ullTxBroadcastBytes += pStatistic->abyTxPktInfo[byPktNum].wLength;        } else if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_MULTI ) {             pStatistic->ullTxMulticastFrames++;            pStatistic->ullTxMulticastBytes += pStatistic->abyTxPktInfo[byPktNum].wLength;        } else if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_UNI ) {            pStatistic->ullTxDirectedFrames++;            pStatistic->ullTxDirectedBytes += pStatistic->abyTxPktInfo[byPktNum].wLength;        }    }    else {#ifdef Calcu_LinkQual        pStatistic->TxFailCount ++;#endif        pStatistic->dwTsrErr++;        if (BITbIsBitOn(byTSR, TSR_RETRYTMO))            pStatistic->dwTsrRetryTimeout++;        if (BITbIsBitOn(byTSR, TSR_TMO))            pStatistic->dwTsrTransmitTimeout++;    }        if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_BROAD )  {        pStatistic->dwTsrBroadcast++;    } else if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_MULTI ) {         pStatistic->dwTsrMulticast++;    } else if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_UNI ) {        pStatistic->dwTsrDirected++;    }}/* * Description: Update 802.11 mib counter * * Parameters: *  In: *      p802_11Counter  - Pointer to 802.11 mib counter *      pStatistic      - Pointer to Statistic Counter Data Structure *      dwCounter       - hardware counter for 802.11 mib *  Out: *      none * * Return Value: none * */voidSTAvUpdate802_11Counter(    PSDot11Counters         p802_11Counter,    PSStatCounter           pStatistic,    BYTE                    byRTSSuccess,    BYTE                    byRTSFail,    BYTE                    byACKFail,    BYTE                    byFCSErr    ){    //p802_11Counter->TransmittedFragmentCount    p802_11Counter->MulticastTransmittedFrameCount = (ULONGLONG) (pStatistic->dwTsrBroadcast +                                                                   pStatistic->dwTsrMulticast);    p802_11Counter->FailedCount = (ULONGLONG) (pStatistic->dwTsrErr);    p802_11Counter->RetryCount = (ULONGLONG) (pStatistic->dwTsrRetry);    p802_11Counter->MultipleRetryCount = (ULONGLONG) (pStatistic->dwTsrMoreThanOnceRetry);    //p802_11Counter->FrameDuplicateCount    p802_11Counter->RTSSuccessCount += (ULONGLONG) byRTSSuccess;    p802_11Counter->RTSFailureCount += (ULONGLONG) byRTSFail;    p802_11Counter->ACKFailureCount += (ULONGLONG) byACKFail;    p802_11Counter->FCSErrorCount +=   (ULONGLONG) byFCSErr;    //p802_11Counter->ReceivedFragmentCount    p802_11Counter->MulticastReceivedFrameCount = (ULONGLONG) (pStatistic->dwRsrBroadcast +                                                               pStatistic->dwRsrMulticast);}/* * Description: Clear 802.11 mib counter * * Parameters: *  In: *      p802_11Counter  - Pointer to 802.11 mib counter *  Out: *      none * * Return Value: none * */void STAvClear802_11Counter(PSDot11Counters p802_11Counter){    // set memory to zero    ZERO_MEMORY(p802_11Counter, sizeof(SDot11Counters));}    /* * Description: Clear 802.11 mib counter * * Parameters: *  In: *      pUsbCounter  - Pointer to USB mib counter *      ntStatus - URB status *  Out: *      none * * Return Value: none * */voidSTAvUpdateUSBCounter(PSUSBCounter pUsbCounter,                     NTSTATUS ntStatus                     ){    //    if ( ntStatus == USBD_STATUS_CRC ) {        pUsbCounter->dwCrc++;//    }       }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -