diff options
| author | Nishank Aggarwal <naggar@codeaurora.org> | 2017-03-22 15:40:56 +0530 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2017-03-24 19:07:51 -0700 |
| commit | bd492d7f108be02e1f9287891b3cfa0f59cec746 (patch) | |
| tree | 2b340877534abb0e892b4e40f62c37b1163b1eb2 | |
| parent | 3ee0be48f0597c2b8fe24b3d9e9a5d6d0d1f0665 (diff) | |
qcacld-3.0: Replace cfg_log() with pe_* log levels in cfg_proc_msg.c
Replace cfg_log() with pe_* appropriate log levels in cfg_proc_msg.c
Change-Id: I2576b089d57ae804289308f503632dd12857c305
CRs-Fixed: 1093093
| -rw-r--r-- | core/mac/src/cfg/cfg_proc_msg.c | 150 |
1 files changed, 40 insertions, 110 deletions
diff --git a/core/mac/src/cfg/cfg_proc_msg.c b/core/mac/src/cfg/cfg_proc_msg.c index 5726082d755a..3815ab191ad2 100644 --- a/core/mac/src/cfg/cfg_proc_msg.c +++ b/core/mac/src/cfg/cfg_proc_msg.c @@ -1481,18 +1481,16 @@ static void proc_dnld_rsp(tpAniSirGlobal pMac, uint16_t length, uint32_t *pParam tSirMsgQ mmhMsg; /* First Dword must contain the AP or STA magic dword */ - PELOGW(cfg_log(pMac, LOGW, FL("CFG size %d bytes MAGIC dword is 0x%x"), + pe_debug("CFG size: %d bytes MAGIC dword is: 0x%x", length, sir_read_u32_n((uint8_t *) pParam)); - ) + /* if the string is not correct, return failure */ if (*pParam == CFG_STA_MAGIC_DWORD) { } else { - PELOGE(cfg_log - (pMac, LOGE, FL("Invalid magic dword 0x%x"), + pe_warn("Invalid magic dword: 0x%x", sir_read_u32_n((uint8_t *) pParam)); - ) retVal = WNI_CFG_INVALID_LEN; goto end; } @@ -1503,40 +1501,29 @@ static void proc_dnld_rsp(tpAniSirGlobal pMac, uint16_t length, uint32_t *pParam /* Parse the Cfg header */ pHdr = (tpCfgBinHdr) pParam; pParam += (sizeof(tCfgBinHdr) >> 2); - PELOGW(cfg_log - (pMac, LOGW, - FL("CFG hdr totParams %d intParams %d strBufSize %d/%d"), + pe_debug("CFG hdr totParams: %d intParams: %d strBufSize: %d/%d", pHdr->controlSize, pHdr->iBufSize, pHdr->sBufSize, pMac->cfg.gCfgMaxSBufSize); - ) expLen = ((CFG_PARAM_MAX_NUM + 3 * pMac->cfg.gCfgMaxIBufSize) << 2) + pHdr->sBufSize + sizeof(tCfgBinHdr); if (length != expLen) { - PELOGE(cfg_log - (pMac, LOGE, - FL("<CFG> DNLD_RSP invalid length %d (exp %d)"), length, + pe_warn("<CFG> DNLD_RSP invalid length: %d (exp: %d)", length, expLen); - ) retVal = WNI_CFG_INVALID_LEN; goto end; } if (pHdr->controlSize != CFG_PARAM_MAX_NUM) { - PELOGE(cfg_log - (pMac, LOGE, FL("<CFG> Total parameter count mismatch")); - ) + pe_warn("<CFG> Total parameter count mismatch"); retVal = WNI_CFG_INVALID_LEN; goto end; } if (pHdr->iBufSize != pMac->cfg.gCfgMaxIBufSize) { - PELOGE(cfg_log - (pMac, LOGE, - FL("<CFG> Integer parameter count mismatch")); - ) + pe_warn("<CFG> Integer parameter count mismatch"); retVal = WNI_CFG_INVALID_LEN; goto end; } @@ -1571,13 +1558,10 @@ static void proc_dnld_rsp(tpAniSirGlobal pMac, uint16_t length, uint32_t *pParam for (i = 0; i < pMac->cfg.gCfgMaxIBufSize; i++) if (pMac->cfg.gCfgIBuf[i] < pMac->cfg.gCfgIBufMin[i] || pMac->cfg.gCfgIBuf[i] > pMac->cfg.gCfgIBufMax[i]) { - PELOGE(cfg_log - (pMac, LOGE, - FL("cfg id %d Invalid def value %d " - "min %d max %d"), i, pMac->cfg.gCfgIBuf[i], + pe_debug("cfg id: %d Invalid def value: %d min: %d max: %d", + i, pMac->cfg.gCfgIBuf[i], pMac->cfg.gCfgIBufMin[i], pMac->cfg.gCfgIBufMax[i]); - ) } /* Calculate max string buffer lengths for all string parameters */ bufEnd = pMac->cfg.gCfgMaxSBufSize; @@ -1592,11 +1576,8 @@ static void proc_dnld_rsp(tpAniSirGlobal pMac, uint16_t length, uint32_t *pParam pMac->cfg.gCfgSBuf[bufStart] = (uint8_t) (bufEnd - bufStart - 2); - PELOG1(cfg_log - (pMac, LOG1, FL("id %d max %d bufStart %d bufEnd %d"), i, + pe_debug("id: %d max: %d bufStart: %d bufEnd: %d", i, pMac->cfg.gCfgSBuf[bufStart], bufStart, bufEnd); - ) - bufEnd = bufStart; } @@ -1606,11 +1587,8 @@ static void proc_dnld_rsp(tpAniSirGlobal pMac, uint16_t length, uint32_t *pParam uint32_t paramId, paramLen, paramLenCeil4; if (strSize < 4) { - PELOGE(cfg_log - (pMac, LOGE, - FL("Error parsing str defaults, rem %d bytes"), + pe_warn("parsing str defaults, rem: %d bytes", strSize); - ) retVal = WNI_CFG_INVALID_LEN; goto end; } @@ -1621,15 +1599,10 @@ static void proc_dnld_rsp(tpAniSirGlobal pMac, uint16_t length, uint32_t *pParam paramLenCeil4 = ((paramLen + 3) >> 2); if (strSize < paramLenCeil4 << 2) { - PELOGE(cfg_log - (pMac, LOGE, - FL("Error parsing str defaults, rem %d bytes"), + pe_warn("parsing str defaults, rem: %d bytes", strSize); - ) - PELOGE(cfg_log - (pMac, LOGE, FL("param id %d len %d bytes"), - paramId, paramLen); - ) + pe_warn("param id: %d len: %d bytes", + paramId, paramLen); retVal = WNI_CFG_INVALID_LEN; goto end; } @@ -1643,18 +1616,12 @@ static void proc_dnld_rsp(tpAniSirGlobal pMac, uint16_t length, uint32_t *pParam strSize -= 4; } - PELOG1(cfg_log - (pMac, LOG1, FL("set str id %d len %d"), paramId, - paramLen); - ) + pe_debug("set str id: %d len: %d", paramId, paramLen); if (cfg_set_str(pMac, (uint16_t) paramId, pStr, paramLen) != eSIR_SUCCESS) { - PELOGE(cfg_log - (pMac, LOGE, - FL("Error setting str default param %d len %d"), + pe_warn("setting str default param %d len %d", paramId, paramLen); - ) retVal = WNI_CFG_INVALID_LEN; goto end; } @@ -1663,7 +1630,7 @@ static void proc_dnld_rsp(tpAniSirGlobal pMac, uint16_t length, uint32_t *pParam /* Set status to READY */ pMac->cfg.gCfgStatus = CFG_SUCCESS; retVal = WNI_CFG_SUCCESS; - PELOG1(cfg_log(pMac, LOG1, "<CFG> Completed successfully");) + pe_debug("<CFG> Completed successfully"); end : @@ -1682,7 +1649,7 @@ end : MTRACE(mac_trace_msg_tx(pMac, NO_SESSION, mmhMsg.type)); if (wma_post_ctrl_msg(pMac, &mmhMsg) != eSIR_SUCCESS) { - PELOGE(cfg_log(pMac, LOGE, FL("WMAPostMsgApi failed!"));) + pe_err("WMAPostMsgApi failed!"); } } /*** end procDnldRsp() ***/ @@ -1713,13 +1680,13 @@ static void proc_get_req(tpAniSirGlobal pMac, uint16_t length, uint32_t *pParam) uint32_t value, valueLen, result; uint32_t *pValue; - PELOG1(cfg_log(pMac, LOG1, FL("Rcvd cfg get request %d bytes"), length);) + pe_debug("Rcvd cfg get request %d bytes", length); for (i = 0; i < length / 4; i++) - PELOG2(cfg_log(pMac, LOG2, FL("[%2d] 0x%08x"), i, pParam[i]);) + pe_debug("[%2d] 0x%08x", i, pParam[i]); if (!pMac->cfg.gCfgStatus) { cfgId = (uint16_t) sir_read_u32_n((uint8_t *) pParam); - PELOGE(cfg_log(pMac, LOGE, FL("CFG not ready, param %d"), cfgId);) + pe_debug("CFG not ready, param %d", cfgId); pMac->cfg.gParamList[WNI_CFG_GET_RSP_RES] = WNI_CFG_NOT_READY; pMac->cfg.gParamList[WNI_CFG_GET_RSP_PID] = cfgId; @@ -1734,9 +1701,7 @@ static void proc_get_req(tpAniSirGlobal pMac, uint16_t length, uint32_t *pParam) pValue = 0; valueLen = 0; - PELOG1(cfg_log - (pMac, LOG1, FL("Cfg get param %d"), cfgId); - ) + pe_debug("Cfg get param %d", cfgId); /* Check for valid parameter ID, etc... */ if (check_param (pMac, cfgId, CFG_CTL_RE, WNI_CFG_WO_PARAM, @@ -1764,11 +1729,8 @@ static void proc_get_req(tpAniSirGlobal pMac, uint16_t length, uint32_t *pParam) (uint32_t *) pMac->cfg.gSBuffer; } } else { - PELOGE(cfg_log - (pMac, LOGE, - FL("Check param failed, param %d"), + pe_warn("Check param failed, param %d", cfgId); - ) result = WNI_CFG_INVALID_LEN; } @@ -1821,11 +1783,11 @@ proc_set_req_internal(tpAniSirGlobal pMac, uint16_t length, uint32_t *pParam, uint16_t cfgId, valueLen, valueLenRoundedUp4; uint32_t value, result; - PELOG1(cfg_log(pMac, LOGl, FL("Rcvd cfg set request %d bytes"), length);) + pe_debug("Rcvd cfg set request %d bytes", length); if (!pMac->cfg.gCfgStatus) { cfgId = (uint16_t) sir_read_u32_n((uint8_t *) pParam); - PELOG1(cfg_log(pMac, LOGW, FL("CFG not ready, param %d"), cfgId);) + pe_debug("CFG not ready, param %d", cfgId); pMac->cfg.gParamList[WNI_CFG_SET_CNF_RES] = WNI_CFG_NOT_READY; pMac->cfg.gParamList[WNI_CFG_SET_CNF_PID] = cfgId; @@ -1847,34 +1809,22 @@ proc_set_req_internal(tpAniSirGlobal pMac, uint16_t length, uint32_t *pParam, if (check_param (pMac, cfgId, CFG_CTL_WE, WNI_CFG_RO_PARAM, &result)) { - PELOG1(cfg_log - (pMac, LOGW, - (char *)g_cfg_param_name[cfgId]); - ) /* Process integer parameter */ if ((pMac->cfg.gCfgEntry[cfgId]. control & CFG_CTL_INT) != 0) { /* Set VALUE */ if (valueLen != sizeof(uint32_t)) { - PELOGE(cfg_log - (pMac, LOGE, - FL - ("Invalid value length %d in set param %d (tot %d)"), + pe_debug("Invalid value length: %d in set param: %d (tot: %d)", valueLen, cfgId, length); - ) result = WNI_CFG_INVALID_LEN; } else { value = *pParam; - PELOG1(cfg_log - (pMac, LOGW, - FL - ("Cfg set int %d len %d(%d) val %d"), + pe_debug("Cfg set int: %d len: %d(%d) val: %d", cfgId, valueLen, valueLenRoundedUp4, value); - ) result = (cfg_set_int (pMac, cfgId, @@ -1899,27 +1849,18 @@ proc_set_req_internal(tpAniSirGlobal pMac, uint16_t length, uint32_t *pParam, /* Process string parameter */ else { if (valueLenRoundedUp4 > length) { - PELOGE(cfg_log - (pMac, LOGE, - FL - ("Invalid string length %d" - "in set param %d (tot %d)"), + pe_debug("Invalid string length: %d in set param: %d (tot: %d)", valueLen, cfgId, length); - ) result = WNI_CFG_INVALID_LEN; } else { get_str_value((uint8_t *) pParam, pMac->cfg.gSBuffer, valueLen); - PELOG1(cfg_log - (pMac, LOGW, - FL - ("Cfg set str %d len %d(%d) bytes"), + pe_debug("Cfg set str: %d len: %d(%d) bytes", cfgId, valueLen, valueLenRoundedUp4); - ) result = (cfg_set_str (pMac, cfgId, @@ -1943,11 +1884,8 @@ proc_set_req_internal(tpAniSirGlobal pMac, uint16_t length, uint32_t *pParam, } } } else { - PELOGE(cfg_log - (pMac, LOGE, - FL("Check param failed, param %d"), - cfgId); - ) + pe_debug("Check param failed, param CFGID: %d", + cfgId); result = WNI_CFG_INVALID_LEN; } @@ -1960,9 +1898,7 @@ proc_set_req_internal(tpAniSirGlobal pMac, uint16_t length, uint32_t *pParam, WNI_CFG_SET_CNF_NUM, pMac->cfg.gParamList, 0, 0); } else { - PELOGW(cfg_log - (pMac, LOG2, " CFGID %d no rsp", cfgId); - ) + pe_debug("CFGID: %d no rsp", cfgId); } if (valueLenRoundedUp4 > length) @@ -2017,24 +1953,19 @@ check_param(tpAniSirGlobal pMac, uint16_t cfgId, uint32_t flag, { /* Check if parameter ID is out of bound */ if (cfgId >= CFG_PARAM_MAX_NUM) { - PELOGE(cfg_log(pMac, LOGE, FL("Invalid param id %d"), cfgId);) + pe_warn("Invalid param id: %d", cfgId); * pResult = WNI_CFG_INVALID_PID; } else { /* Check if parameter is valid */ if ((pMac->cfg.gCfgEntry[cfgId].control & CFG_CTL_VALID) == 0) { - PELOGE(cfg_log - (pMac, LOGE, FL("Param id %d not valid"), cfgId); - ) + pe_warn("Param id: %d not valid", cfgId); * pResult = WNI_CFG_INVALID_PID; } else { /* Check control field against flag */ if ((pMac->cfg.gCfgEntry[cfgId].control & flag) == 0) { - PELOGE(cfg_log - (pMac, LOGE, - FL("Param id %d wrong permissions %x"), + pe_debug("Param id: %d wrong permissions: %x", cfgId, pMac->cfg.gCfgEntry[cfgId].control); - ) * pResult = failedResult; } else return true; @@ -2110,9 +2041,8 @@ process_cfg_download_req(tpAniSirGlobal pMac) pStrCfg = (cfgstatic_string*)cfg_static[i]. pStrData; if (pStrCfg == NULL) { - PELOGE(cfg_log(pMac, LOGE, - FL("pStrCfg is NULL for CfigID : %d"), - i);) + pe_err("pStrCfg is NULL for CfigID : %d", + i); continue; } index = sCount & CFG_BUF_INDX_MASK; @@ -2139,9 +2069,9 @@ process_cfg_download_req(tpAniSirGlobal pMac) bufStart = pMac->cfg.gCfgEntry[i].control & CFG_BUF_INDX_MASK; pMac->cfg.gCfgSBuf[bufStart] = (uint8_t)(bufEnd - bufStart - 2); - PELOG1(cfgLog(pMac, LOG1, FL("id %d max %d bufStart %d bufEnd %d"), + pe_debug("id: %d max: %d bufStart: %d bufEnd: %d", i, pMac->cfg.gCfgSBuf[bufStart], - bufStart, bufEnd);) + bufStart, bufEnd); bufEnd = bufStart; } @@ -2181,7 +2111,7 @@ process_cfg_download_req(tpAniSirGlobal pMac) /* Set status to READY */ pMac->cfg.gCfgStatus = CFG_SUCCESS; retVal = WNI_CFG_SUCCESS; - PELOG1(cfg_log(pMac, LOG1, "<CFG> Completed successfully");) + pe_debug("<CFG> Completed successfully"); pMac->cfg.gParamList[WNI_CFG_DNLD_CNF_RES] = retVal; |
