Пример #1
0
int logRtaiDump( tpAniSirGlobal pMac, tANI_U32 cmd, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, tANI_U8 *pBuf)
{
    char *p = (char *)pBuf;
    tANI_U32 i;
    tANI_U32 nItems = 0;
    tDumpFuncEntry *pEntry = NULL;

    pMac->gCurrentLogSize = 0;
    if (debug) {
        p += log_sprintf( pMac,p, "Cmd = %d Args (0x%x,0x%x,0x%x,0x%x)\n\n",
                cmd, arg1, arg2, arg3, arg4);
    }

    if( cmd == MAX_DUMP_CMD || cmd == 0 ) {
        pMac->menuCurrent = print_menu(pMac, p, pMac->menuCurrent);
        return pMac->gCurrentLogSize;
    }
    if(cmd <= HAL_LOG_DUMP_CMD_END)
    {
       WDA_HALDumpCmdReq(pMac, cmd, arg1, arg2, arg3, arg4, p);
    }
    else
    {
       for(i = 0; i < pMac->dumpTablecurrentId; i++) {
           if( (cmd > pMac->dumpTableEntry[i]->mindumpid) && (cmd <= pMac->dumpTableEntry[i]->maxdumpid)) {
               pEntry = pMac->dumpTableEntry[i]->dumpTable;
               nItems = pMac->dumpTableEntry[i]->nItems;
               break;
           } else {
               continue;
           }
       }

       if((nItems > 0) && (pEntry != NULL)) {
           for (i = 0; i < nItems; i++, pEntry++) {
               if( cmd == pEntry->id ) {
                   if ( pEntry->func != NULL ) {
                       pEntry->func(pMac, arg1, arg2, arg3, arg4, p);
                   } else {
                       p += log_sprintf( pMac,p, "Cmd not supported\n");
                   }
                   break;
               }
           }
       } else {
           p += log_sprintf( pMac,p, "Cmd not found \n");
       }
    }
    if (debug)
        p += log_sprintf( pMac,p, "Returned %d bytes\n", pMac->gCurrentLogSize);

    return pMac->gCurrentLogSize;

}
Пример #2
0
/*
 * print nItems from the menu list ponted to by m
 */
static tANI_U32 print_menu(tpAniSirGlobal pMac, char  *p, tANI_U32 startId)
{
    tANI_U32 currentId = 0;
    tANI_U32 i, j;
    tANI_S32 ret = 0;
    tDumpFuncEntry *pEntry = NULL;
    tANI_U32 nItems = 0;

    for(i = 0; i < pMac->dumpTablecurrentId; i++) {
        pEntry = pMac->dumpTableEntry[i]->dumpTable;
        nItems = pMac->dumpTableEntry[i]->nItems;

        for (j = 0; j < nItems; j++, pEntry++) {
            if (pEntry->description == NULL)
                continue;

            if (pEntry->id == 0) {
                ret = log_sprintf( pMac,p, "---- %s\n", pEntry->description);

                if (ret <= 0)
                    break;

                p += ret;
                continue;
            }

            if (pEntry->id < startId)
                continue;

            ret = log_sprintf(pMac, p, "%4d\t%s\n", pEntry->id, pEntry->description);

            if (ret <= 0)
                break;

            currentId = pEntry->id;
            p += ret;
        }

        if (ret <= 0)
            break;
    }

    return currentId;
}
Пример #3
0
static char * printMesgName(tpAniSirGlobal pMac, char *p, tANI_U32 type, tANI_U32 subType, tANI_U32 tcId)
{
    tLogdRegList *pEntry = NULL;
    tANI_U32 nEntries, i;

    switch (type)
    {
        case SIR_MAC_DATA_FRAME:
            pEntry   = &dataType[0];
            nEntries = sizeof(dataType)/sizeof(dataType[0]);
            break;
        case SIR_MAC_MGMT_FRAME:
            pEntry   = &mgmtType[0];
            nEntries = sizeof(mgmtType)/sizeof(mgmtType[0]);
            break;
        case SIR_MAC_CTRL_FRAME:
            pEntry   = &ctlType[0];
            nEntries = sizeof(ctlType)/sizeof(ctlType[0]);
            break;
        default:
            p += log_sprintf( pMac, p, "RESERVED ");
            return p;
    }

    for (i=0; i < nEntries; i++, pEntry++) {
        if (pEntry->addr == subType) {
            p += log_sprintf( pMac, p, "%s", pEntry->name);
            break;
        }
    }

    if (i >= nEntries)
        p += log_sprintf( pMac, p, "RESERVED ");

    if (type == SIR_MAC_DATA_FRAME)
        p += log_sprintf( pMac, p, "(%d) ", tcId);
    return p;
}
Пример #4
0
char * dump_cfg_group_get( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
{
    tANI_U32 i, startId, endId;

    (void) arg3; (void) arg4;

    if (arg1 < CFG_PARAM_MAX_NUM) {
        startId = arg1;
    } else {
        p += log_sprintf( pMac, p, "Start CFGID must be less than %d\n", CFG_PARAM_MAX_NUM);
        return p;
    }

    if ((arg2 == 0) || (arg2 > CFG_PARAM_MAX_NUM))
        arg2 = 30;

    endId = ((startId + arg2) < CFG_PARAM_MAX_NUM) ? (startId + arg2) : CFG_PARAM_MAX_NUM;

    for (i=startId; i < endId; i++)
        Log_getCfg(pMac, (tANI_U16) i);

    return p;
}
Пример #5
0
char* setLOGLevel( tpAniSirGlobal pMac, char *p, tANI_U32 module, tANI_U32 level )
{
    tANI_U32 i;

    if((module > SIR_LAST_MODULE_ID || module < SIR_FIRST_MODULE_ID) && module != 0xff ) {
        p += log_sprintf( pMac, p, "Invalid module id 0x%x\n", module );
        return p;
    }

    if( 0xff == module ) {
        for( i = SIR_FIRST_MODULE_ID; i <= SIR_LAST_MODULE_ID; i++ )
            pMac->utils.gLogDbgLevel[i - SIR_FIRST_MODULE_ID] = level;
    } else {
        pMac->utils.gLogDbgLevel[module - SIR_FIRST_MODULE_ID] = level;
    }

#ifdef ANI_PHY_DEBUG
    if (module == 0xff || module == SIR_PHY_MODULE_ID) {
        pMac->hphy.phy.phyDebugLogLevel = level;
    }
#endif

    return dumpLOG( pMac, p );
}
Пример #6
0
static char *
dump_pmc_state( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
{
    char *ptr = p;

    (void) arg1; (void) arg2; (void) arg3; (void) arg4;

    p += log_sprintf( pMac,p, "********  PMC State & Configuration ******** \n");
    p += log_sprintf( pMac,p, " PMC: IMPS Enabled? %d\n", pMac->pmc.impsEnabled);
    p += log_sprintf( pMac,p, " PMC: Auto BMPS Timer Enabled? %d\n", pMac->pmc.autoBmpsEntryEnabled);
    p += log_sprintf( pMac,p, " PMC: BMPS Enabled? %d\n", pMac->pmc.bmpsEnabled);
    p += log_sprintf( pMac,p, " PMC: UAPSD Enabled? %d\n", pMac->pmc.uapsdEnabled);
    p += log_sprintf( pMac,p, " PMC: WoWL Enabled? %d\n", pMac->pmc.wowlEnabled);
    p += log_sprintf( pMac,p, " PMC: Standby Enabled? %d\n", pMac->pmc.standbyEnabled);
    p += log_sprintf( pMac,p, " PMC: Auto BMPS timer period (ms): %d\n", pMac->pmc.bmpsConfig.trafficMeasurePeriod);
    p += log_sprintf( pMac,p, " PMC: BMPS Listen Interval (Beacon intervals): %d\n", pMac->pmc.bmpsConfig.bmpsPeriod);
    p += log_sprintf( pMac,p, " PMC: Device State = %s\n", pmcGetPmcStateStr(pMac->pmc.pmcState));
    p += log_sprintf( pMac,p, " PMC: RequestFullPowerPending = %d\n", pMac->pmc.requestFullPowerPending);
    p += log_sprintf( pMac,p, " PMC: UapsdSessionRequired = %d\n", pMac->pmc.uapsdSessionRequired);
    p += log_sprintf( pMac,p, " PMC: wowlModeRequired = %d\n\n", pMac->pmc.wowlModeRequired);

    pmcLog(pMac, LOGW, "\n%s", ptr);

    return p;
}
Пример #7
0
char* dumpLOG( tpAniSirGlobal pMac, char *p )
{
    tANI_U32 i;

    for( i = SIR_FIRST_MODULE_ID; i <= SIR_LAST_MODULE_ID; i++ ) {
        p += log_sprintf(pMac, p, "[0x%2x]", i);
        switch (i)
        {
            case SIR_HAL_MODULE_ID: p += log_sprintf( pMac, p, "HAL "); break;
            case SIR_CFG_MODULE_ID: p += log_sprintf( pMac, p, "CFG "); break;
            case SIR_LIM_MODULE_ID: p += log_sprintf( pMac, p, "LIM "); break;
            case SIR_ARQ_MODULE_ID: p += log_sprintf( pMac, p, "ARQ "); break;
            case SIR_SCH_MODULE_ID: p += log_sprintf( pMac, p, "SCH "); break;
            case SIR_PMM_MODULE_ID: p += log_sprintf( pMac, p, "PMM "); break;
            case SIR_MNT_MODULE_ID: p += log_sprintf( pMac, p, "MNT "); break;
            case SIR_DBG_MODULE_ID: p += log_sprintf( pMac, p, "DBG "); break;
            case SIR_DPH_MODULE_ID: p += log_sprintf( pMac, p, "DPH "); break;
            case SIR_SYS_MODULE_ID: p += log_sprintf( pMac, p, "SYS "); break;
            case SIR_PHY_MODULE_ID: p += log_sprintf( pMac, p, "PHY "); break;
            case SIR_DVT_MODULE_ID: p += log_sprintf( pMac, p, "DVT "); break;
            case SIR_SMS_MODULE_ID: p += log_sprintf( pMac, p, "SMS "); break;
            default: p += log_sprintf( pMac, p, "UNK ", i); break;
        }

        p += log_sprintf( pMac, p,
                ": debug level is [0x%x] ",
                pMac->utils.gLogDbgLevel[i - SIR_FIRST_MODULE_ID]);

        switch( pMac->utils.gLogDbgLevel[i - SIR_FIRST_MODULE_ID] )
        {
            case LOGOFF: p += log_sprintf( pMac, p, "LOG disabled\n"); break;
            case LOGP: p += log_sprintf( pMac, p, "LOGP(Panic only)\n"); break;
            case LOGE: p += log_sprintf( pMac, p, "LOGE(Errors only)\n"); break;
            case LOGW: p += log_sprintf( pMac, p, "LOGW(Warnings)\n"); break;
            case LOG1: p += log_sprintf( pMac, p, "LOG1(Minimal debug)\n"); break;
            case LOG2: p += log_sprintf( pMac, p, "LOG2(Verbose)\n"); break;
            case LOG3: p += log_sprintf( pMac, p, "LOG3(Very Verbose)\n"); break;
            case LOG4: p += log_sprintf( pMac, p, "LOG4(Very Very Verbose)\n"); break;
            default: p += log_sprintf( pMac, p, "Unknown\n"); break;
        }
    }

    return p;
}
Пример #8
0
char * dump_thread_info( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
{
    tANI_U32 i, j;

    p += log_sprintf( pMac, p, "\n**** BBT RECEIVE **** \n");
    p += log_sprintf( pMac, p, "\nBBT CRC errors received   : %d\n",
            pMac->sys.gSysBbtCrcFail);
    p += log_sprintf( pMac, p, "BBT duplicates received   : %d\n",
            pMac->sys.gSysBbtDuplicates);
    p += log_sprintf( pMac, p, "BBT total frames received : %d\n",
            pMac->sys.gSysBbtReceived);
    p += log_sprintf( pMac, p, "\tPosted to LIM : %d\n",
            pMac->sys.gSysBbtPostedToLim);
    p += log_sprintf( pMac, p, "\tPosted to SCH : %d\n",
            pMac->sys.gSysBbtPostedToSch);
    p += log_sprintf( pMac, p, "\tPosted to PMM : %d\n",
            pMac->sys.gSysBbtPostedToPmm);
    p += log_sprintf( pMac, p, "\tPosted to HAL : %d\n",
            pMac->sys.gSysBbtPostedToHal);
    p += log_sprintf( pMac, p, "\tDropped       : %d\n",
            pMac->sys.gSysBbtDropped);
    p += log_sprintf( pMac, p, "\t\tLearn mode frame out of learn mode : %d\n",
            pMac->sys.gSysBbtLearnFrameInv);
    p += log_sprintf( pMac, p, "\t\tNon-learn mode frame in learn mode : %d\n",
            pMac->sys.gSysBbtNonLearnFrameInv);

    p += log_sprintf( pMac, p, "\nMGMT RX frame counts\n");
    for (i = 0; i < 16; i++) {
        if (pMac->sys.gSysFrameCount[0][i]) {
            p += log_sprintf( pMac, p, "\t");
            p = printMesgName( pMac, p, 0, i, 0);
            p += log_sprintf( pMac, p, "[%d] %d\n", i, pMac->sys.gSysFrameCount[0][i]);
        }
    }

    p += log_sprintf( pMac, p, "CTRL RX frame counts\n");

    for (i = 0; i < 16; i++) {
        if (pMac->sys.gSysFrameCount[1][i]) {
            p += log_sprintf( pMac, p, "\t");
            p = printMesgName(pMac, p, 1, i, 0);
            p += log_sprintf( pMac, p, "[%d] %d\n", i, pMac->sys.gSysFrameCount[1][i]);
        }
    }

    p += log_sprintf( pMac, p, "DATA RX frame counts\n");
    for (i = 0; i < 16; i++) {
        if (pMac->sys.gSysFrameCount[2][i]) {
            p += log_sprintf( pMac, p, "\t");
            p = printMesgName(pMac, p, 2, i, 0);
            p += log_sprintf( pMac, p, "[%d] %d\n", i,
                    pMac->sys.gSysFrameCount[2][i]);
        }
    }

    if (pMac->sch.gSchBBXportRcvCnt) {
        p += log_sprintf( pMac, p, "\nSCH processed messages : %d\n",
                pMac->sch.gSchBBXportRcvCnt);
        p += log_sprintf( pMac, p, "\tBeacons  : %d\n", pMac->sch.gSchBcnRcvCnt);
        p += log_sprintf( pMac, p, "\t\tignored  : %d\n", pMac->sch.gSchBcnIgnored);
        p += log_sprintf( pMac, p, "\t\tin error : %d\n", pMac->sch.gSchBcnParseErrorCnt);
        p += log_sprintf( pMac, p, "\tQoS null : %d\n", pMac->sch.gSchRRRcvCnt);
        p += log_sprintf( pMac, p, "\tDropped  : %d\n", pMac->sch.gSchUnknownRcvCnt);
    }


    p += log_sprintf( pMac, p, "\nLIM processed messages : %d\n", pMac->lim.numTot);
    if (pMac->lim.numTot) {
        p += log_sprintf( pMac, p, "\tSME Messages (HDD) : %d\n", pMac->lim.numSme);
        p += log_sprintf( pMac, p, "\tMAC Messages (BBT) : %d\n", pMac->lim.numBbt);
        p += log_sprintf( pMac, p, "\t\tBad Protocol\t: %d\n", pMac->lim.numProtErr);
        p += log_sprintf( pMac, p, "\t\tIn Learn mode\t: %d (ignored %d)\n",
                pMac->lim.numLearn, pMac->lim.numLearnIgnore);

        for (i=0; i<4; i++) {
            for (j=0; j<16; j++) {
                if (pMac->lim.numMAC[i][j]) {
                    p += log_sprintf( pMac, p, "\t\t");
                    p = printMesgName(pMac, p, i, j, 0);
                    p += log_sprintf( pMac, p, "\t: %d\n", pMac->lim.numMAC[i][j]);
                }
            }
        }

        p += log_sprintf( pMac, p, "\tBeacons received : %d\n", pMac->lim.gLimNumBeaconsRcvd);
        p += log_sprintf( pMac, p, "\t\tIgnored : %d\n", pMac->lim.gLimNumBeaconsIgnored);
    }

    if (pMac->sys.gSysFrameCount[SIR_MAC_MGMT_FRAME][SIR_MAC_MGMT_PROBE_REQ]) {
        p += log_sprintf( pMac, p, "\nProbe Requests Received: %d\n",
                pMac->sys.gSysFrameCount[SIR_MAC_MGMT_FRAME][SIR_MAC_MGMT_PROBE_REQ]);
        p += log_sprintf( pMac, p, "\tIgnored  \t: %d\n", pMac->sys.probeIgnore);
        p += log_sprintf( pMac, p, "\tSSID miss\t: %d\n", pMac->sys.probeBadSsid);
        p += log_sprintf( pMac, p, "\tParse err\t: %d\n", pMac->sys.probeError);
        p += log_sprintf( pMac, p, "\tResponded\t: %d\n", pMac->sys.probeRespond);
    }

    return p;
}