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

📄 cisaironetshow.c

📁 vworks 下wlan的实现代码
💻 C
📖 第 1 页 / 共 3 页
字号:
                pStats->reasonSts15);        printf ("\tAuthentication rejected - timeout              : $%04x\n",                 pStats->reasonSts16);        printf ("\tAssociation denied - AP is unable to associate : $%04x\n",                 pStats->reasonSts17);        printf ("\tAssociation denied - basic rates not supported : $%04x\n",                 pStats->reasonSts18);        printf ("\tReserved                                       : $%04x\n",                 pStats->reasonSts19);        printf ("\tmanagement packets received and handled        : $%04x\n",                 pStats->rxMan);        printf ("\tmanagement packets transmitted                 : $%04x\n",                 pStats->txMan);        printf ("\tnull data packets received                     : $%04x\n",                 pStats->rxRefresh);        printf ("\tnull data packets transmitted                  : $%04x\n",                 pStats->txRefresh);        printf ("\tPS-Poll packets received                       : $%04x\n",                 pStats->rxPoll);        printf ("\tPS-Poll packets transmitted                    : $%04x\n",                 pStats->txPoll);        printf ("\tlong and short retries used to tx host pkts    : $%04x\n",                 pStats->hostRetries);        printf ("\tLost sync with our cell due to host request    : $%04x\n",                 pStats->lostSyncHostReq);        printf ("\tbytes transferred from the host                : $%04x\n",                 pStats->hostTxBytes);        printf ("\tbytes transferred to the host                  : $%04x\n",                 pStats->hostRxBytes);        printf ("\ttime since power up (or clear) in microseconds : $%04x\n",                 pStats->elapsedUsec);        printf ("\ttime since power up (or clear) in seconds      : $%04x\n",                 pStats->elapsedSec);            printf ("\tLost Sync to switch to a better access point   : $%04x\n",                 pStats->lostSyncBetterAp);        }        /* Derive the statistics */    totalRxErr          = (pStats->rxPlcpLengthErr + pStats->rxMacCrcErr) +        (pStats->rxOverrunErr + pStats->rxPlcpFormatErr);    totalRxOk           = pStats->rxMacCrcOk;    totalRxAttempt      = totalRxErr + totalRxOk;    miscRadioRxDiscards = (pStats->ssidMismatch  + pStats->apMismatch) +         (pStats->ratesMismatch + pStats->rxFragDisc);    totalRetries        = pStats->retryLong + pStats->retryShort;    protOvhdRxFrames    = (pStats->rxAck  + pStats->rxCts)      +         (pStats->txCts  + pStats->rxBeacon)   +         (pStats->rxPoll + pStats->rxRefresh)  +         pStats->rxMan;    protOvhdTxFrames    = (pStats->txBeacon + pStats->txMan) +        pStats->txRefresh;    totalTxHoldOffs     = pStats->defersProt + pStats->defersEngy;    txFramesReqRetry    = pStats->txSinColl + pStats->txMulColl;    totalRxPlcpOk       = (pStats->rxMacCrcOk + pStats->rxMacCrcErr) +        (pStats->rxPlcpFormatErr + pStats->rxPlcpLengthErr);    totalRxPlcpErrors   = pStats->rxPlcpCrcErr;            printf ("Derived statistics\n");    printf ("\ttotal rx errors             : %d\n", totalRxErr);    printf ("\ttotal rx ok                 : %d\n", totalRxOk);    printf ("\ttotal rx attempts           : %d\n", totalRxAttempt);    printf ("\ttotal rx discards           : %d\n", miscRadioRxDiscards);    printf ("\ttotal retries               : %d\n", totalRetries);    printf ("\tprotocol overhead rx frames : %d\n", protOvhdRxFrames);    printf ("\tprotocol overhead tx frames : %d\n", protOvhdTxFrames);    printf ("\ttotal tx holdoffs           : %d\n", totalTxHoldOffs);    printf ("\ttx frames requiring retries : %d\n", txFramesReqRetry);    printf ("\ttotal rx plcp ok            : %d\n", totalRxPlcpOk);       printf ("\ttotal rx plcp error count   : %d\n", totalRxPlcpErrors);      /* return - status */      return (OK);    }/**************************************************************************** cisAironetStatusShow - Displays the contents of the card status rid.* * Displays the contents of the card status rid.** RETURNS : OK or ERROR on NULL pointer passed as parameter.** ERRNO : N/A** SEE ALSO: Cisco Aironet 340/350 Driver Programmer's Manual*/STATUS cisAironetStatusShow (void)    {    STATUS_RID_T   stat;    STATUS_RID_T * pStat   = (STATUS_RID_T *) &stat;    CARD_CTRL_T *  pDriver = (CARD_CTRL_T *) cisAironetHwDrvIDGet ();    char           ssid[32];        /* sanity check */    if (pDriver == NULL)        {        ANET_DEBUG(DEBUG_ERROR,                   ("cisAironetStatusShow: error NULL pointer\n"));        return (ERROR);        }    /* Read the Status RID */    if ( cisAironetHwRidStatusGet (pDriver, (void *) pStat)         == ERROR )        {        ANET_DEBUG(DEBUG_ERROR,                   ("cisAironetHwRidStatusShow: Error reading STATUS RID\n"));        return (ERROR);        }    printf ("\nAironet card status:\n");    printf ("\tMac address  0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n",            pStat->mac[0],            pStat->mac[1],            pStat->mac[2],            pStat->mac[3],            pStat->mac[4],            pStat->mac[5]);    printf ("\tmode                     : $%04x\n", pStat->mode);    printf ("\terrorCode                : $%04x\n", pStat->errorCode);    printf ("\tsigQuality               : %d\n", pStat->sigQuality);    printf ("\tSSIDlen                  : %d\n", pStat->SSIDlen);    cisAironetBcopy (pDriver, (const UINT8 *) pStat->SSID,                      (UINT8 *) ssid, NELEMENTS(pStat->SSID));       printf ("\tSSID                     : %s\n", ssid);    printf ("\tAp name                  : %s\n", pStat->apName);    printf ("\tBSSID        0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n",            pStat->currentBssID[0],            pStat->currentBssID[1],            pStat->currentBssID[2],            pStat->currentBssID[3],            pStat->currentBssID[4],            pStat->currentBssID[5]);    printf ("\tbeaconPeriod             : %d\n", pStat->beaconPeriod);    printf ("\tdtimPeriod               : %d\n", pStat->dtimPeriod);    printf ("\thopPeriod                : %d\n", pStat->hopPeriod);    printf ("\tchannelSet               : %d\n", pStat->channelSet);    printf ("\tchannel                  : %d\n", pStat->channel);    printf ("\thopsToBackbone           : %d\n", pStat->hopsToBackbone);    printf ("\tapTotalLoad              : %d\n", pStat->apTotalLoad);    printf ("\tgeneratedLoad            : %d\n", pStat->generatedLoad);    printf ("\taccumulatedArl           : %d\n", pStat->accumulatedArl);    printf ("\tsignalQuality            : %d\n", pStat->signalQuality);    printf ("\ttxRate                   : %d\n", pStat->txRate);    printf ("\tsignalToStrength         : %d\n", pStat->signalToStrength);    printf ("\tshortPreamble            : %d\n", pStat->shortPreamble);    printf ("\tapIpAddress  %d.%d.%d.%d\n",            pStat->apIpAddress[0], pStat->apIpAddress[1],              pStat->apIpAddress[2], pStat->apIpAddress[3]);    printf ("\tassocStatus              : %d\n", pStat->assocStatus);    return (OK);    }/**************************************************************************** cisAironetCapShow - Displays the contents of the card capabilities rid.* * Displays the contents of the card capabilities rid.** RETURNS : OK or ERROR on NULL pointer passed as parameter.** ERRNO : N/A** SEE ALSO: Cisco Aironet 340/350 Driver Programmer's Manual*/STATUS cisAironetCapShow (void)    {    UINT8 supportedRates [30];    UINT8 txPowerLevels [30];    UINT8 callerID [30];    UINT8 factoryAddr [30];    UINT8 anetAddr [30];    CAP_RID_T     cap;    CAP_RID_T *   pCap    = (CAP_RID_T *) &cap;    CARD_CTRL_T * pDriver = (CARD_CTRL_T *) cisAironetHwDrvIDGet ();            /* sanity check */    if (pDriver == NULL)        {        ANET_DEBUG(DEBUG_ERROR,                   ("cisAironetCapShow: error NULL pointer\n"));        return (ERROR);        }    /* Read the Capabilities RID */    if ( cisAironetHwRidCapGet (pDriver, (void *) pCap)         == ERROR )        {        ANET_DEBUG(DEBUG_ERROR,                   ("cisAironetCapShow: Error reading CAP RID\n"));        return (ERROR);        }    /* save the factory address */    sprintf ((char *) factoryAddr,              "0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x",              pCap->factoryAddr[0],             pCap->factoryAddr[1],             pCap->factoryAddr[2],             pCap->factoryAddr[3],             pCap->factoryAddr[4],             pCap->factoryAddr[5]);    /* save the anet address */    sprintf ((char *) anetAddr,              "0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x",              pCap->anetAddr[0],             pCap->anetAddr[1],             pCap->anetAddr[2],             pCap->anetAddr[3],             pCap->anetAddr[4],             pCap->anetAddr[5]);    /* save the supported rates */    sprintf ((char *) supportedRates, "%d:%d:%d:%d:%d:%d:%d:%d",              pCap->supportedRates[0],             pCap->supportedRates[1],             pCap->supportedRates[2],             pCap->supportedRates[3],             pCap->supportedRates[4],             pCap->supportedRates[5],             pCap->supportedRates[6],             pCap->supportedRates[7]);    /* save the tx power levels */    sprintf ((char *) txPowerLevels, "%d:%d:%d:%d:%d:%d:%d:%d",              pCap->txPowerLevels[0],             pCap->txPowerLevels[1],             pCap->txPowerLevels[2],             pCap->txPowerLevels[3],             pCap->txPowerLevels[4],             pCap->txPowerLevels[5],             pCap->txPowerLevels[6],             pCap->txPowerLevels[7]);        /* save the tx power levels */    sprintf ((char *) callerID, "%d:%d:%d:%d:%d:%d",              pCap->callid[0],             pCap->callid[1],             pCap->callid[2],             pCap->callid[3],             pCap->callid[4],             pCap->callid[5]);                /* dump the Capabilities structure */    printf ("\nAnet card capabilities:\n");    printf ("\tManufacturer name is   : %s\n", pCap->manName);    printf ("\tProduction name is     : %s\n", pCap->prodName);    printf ("\tProduction version is  : %s\n", pCap->prodVer);    printf ("\taironet address is     : %s\n", anetAddr);    printf ("\tfactory address is     : %s\n", factoryAddr);    printf ("\tsupportedRates are     : %s\n", supportedRates);    printf ("\ttxPowerLevels  are     : %s\n", txPowerLevels);    printf ("\tcaller id is           : %s\n", callerID);    printf ("\tRadio type is          : %d\n", pCap->radioType);    printf ("\tDomain is              : %d\n", pCap->regDomain);        printf ("\tHardware version is    : %x\n", pCap->hardVer);    printf ("\tHardware Capabilities  : $%04x\n", pCap->hardCap);    printf ("\tTemperature range is   : %d\n", pCap->tempRange);        printf ("\tSoftware version is    : %x\n", pCap->softVer);     printf ("\tSoftware Sub version is: %d\n", pCap->softSubVer);    printf ("\tInterface version is   : %d\n", pCap->interfaceVer);    printf ("\trxDiversity            : %d\n", pCap->rxDiversity);    printf ("\ttxDiversity            : %d\n", pCap->txDiversity);    printf ("\tsoftCap                : %d\n", pCap->txDiversity);    printf ("\tbootBlockVer           : %d\n", pCap->txDiversity);    printf ("\trequiredHard           : %d\n", pCap->txDiversity);    /* return - status */    return (OK);    }/**************************************************************************** cisAironetEtherEncapShow - Displays the contents of the card *                            protocol encapsulation rid.* Displays the contents of the card protocol encapsulation rid.** RETURNS : OK or ERROR on NULL pointer passed as parameter.** ERRNO : N/A** SEE ALSO: Cisco Aironet 340/350 Driver Programmer's Manual*/STATUS cisAironetEtherEncapShow (void)    {    UINT8 i;    PROT_RID_T    enetEncap;    PROT_RID_T *  pEnetEncap = (PROT_RID_T *) &enetEncap;    CARD_CTRL_T * pDriver    = (CARD_CTRL_T *) cisAironetHwDrvIDGet ();            /* sanity check */    if (pDriver == NULL)        {        ANET_DEBUG(DEBUG_ERROR,                   ("cisAironetEtherEncapShow: error NULL pointer\n"));        return (ERROR);        }    /* Read the protocol encapsulation RID */    if ( cisAironetHwRidEncapGet (pDriver, (void *) pEnetEncap)         == ERROR )        {        ANET_DEBUG(DEBUG_ERROR,                    ("cisAironetEtherEncapShow: Error\n"));        return (ERROR);        }    /* dump the Capabilities structure */    printf ("\nAironet card ethernet encapsulation transformations:\n");    for (i = 0; i < sizeof (enetEncap.encap) / sizeof (enetEncap.encap[0]);          i++)        {        printf ("ethernet type (%d): $%04x\n",                 i, enetEncap.encap[i].etherType);        printf ("action        (%d): $%04x\n",                 i, enetEncap.encap[i].action);        }    /* return - status */    return (OK);    }

⌨️ 快捷键说明

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