diff options
| author | Abhishek Singh <absingh@qti.qualcomm.com> | 2014-03-31 10:42:00 -0700 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-04-04 11:24:17 -0700 |
| commit | 50ad04ab98ff9aeebf7115bb1a997ce4547e71e4 (patch) | |
| tree | 28de333b6c3e4bdff12073aa39fd7fb70dd96ebb | |
| parent | df9d11f004ff153928f2cd44b9a40a4a23236112 (diff) | |
wlan: Missing error and info logs in PE connect path (Part 2)
Adding missing error and info logs for connect path in
SmeJoinReq, assoc req and assoc rsp
Change-Id: I586071eb8875f0e802e42dda373ab5b3014969a7
CRs-Fixed: 641087
| -rw-r--r-- | CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c | 64 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limSendManagementFrames.c | 63 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limSerDesUtils.c | 105 |
3 files changed, 171 insertions, 61 deletions
diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c index e96b75a372cf..6ba76ee68d7a 100644 --- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c @@ -1648,7 +1648,8 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) pSmeJoinReq = vos_mem_malloc(nSize); if ( NULL == pSmeJoinReq ) { - limLog(pMac, LOGP, FL("call to AllocateMemory failed for pSmeJoinReq")); + limLog(pMac, LOGP, FL("call to AllocateMemory failed for " + "pSmeJoinReq")); retCode = eSIR_SME_RESOURCES_UNAVAILABLE; goto end; } @@ -1672,7 +1673,8 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) { if(peValidateBtJoinRequest(pMac)!= TRUE) { - limLog(pMac, LOGW, FL("Start Bss session not present::SME_JOIN_REQ in unexpected state")); + limLog(pMac, LOGW, FL("Start Bss session not present::" + "SME_JOIN_REQ in unexpected state")); retCode = eSIR_SME_UNEXPECTED_REQ_RESULT_CODE; psessionEntry = NULL; goto end; @@ -1684,7 +1686,10 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) if((psessionEntry = peFindSessionByBssid(pMac,pSmeJoinReq->bssDescription.bssId,&sessionId)) != NULL) { - limLog(pMac, LOGE, FL("Session Already exists for given BSSID")); + limLog(pMac, LOGE, FL("Session(%d) Already exists for BSSID: " + MAC_ADDRESS_STR" in limSmeState = %X"),sessionId, + MAC_ADDR_ARRAY(pSmeJoinReq->bssDescription.bssId), + psessionEntry->limSmeState); if(psessionEntry->limSmeState == eLIM_SME_LINK_EST_STATE && psessionEntry->smeSessionId == pSmeJoinReq->sessionId) @@ -1692,13 +1697,16 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) // Received eWNI_SME_JOIN_REQ for same // BSS as currently associated. // Log the event and send success - PELOGW(limLog(pMac, LOGW, FL("Received SME_JOIN_REQ for currently joined BSS"));) + PELOGW(limLog(pMac, LOGW, FL("Received SME_JOIN_REQ for " + "currently joined BSS"));) /// Send Join success response to host retCode = eSIR_SME_SUCCESS; goto end; } else { + PELOGE(limLog(pMac, LOGE, FL("SME_JOIN_REQ not for" + "currently joined BSS"));) retCode = eSIR_SME_REFUSED; psessionEntry = NULL; goto end; @@ -1770,17 +1778,20 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) if (cfgSetInt(pMac, WNI_CFG_VHT_SU_BEAMFORMEE_CAP, psessionEntry->txBFIniFeatureEnabled) != eSIR_SUCCESS) { - limLog(pMac, LOGP, FL("could not set WNI_CFG_VHT_SU_BEAMFORMEE_CAP at CFG")); + limLog(pMac, LOGP, FL("could not set " + "WNI_CFG_VHT_SU_BEAMFORMEE_CAP at CFG")); retCode = eSIR_LOGP_EXCEPTION; goto end; } VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO_MED, - "***__limProcessSmeJoinReq: txBFCsnValue=%d****", pSmeJoinReq->txBFCsnValue); + "***__limProcessSmeJoinReq: txBFCsnValue=%d****", + pSmeJoinReq->txBFCsnValue); if (cfgSetInt(pMac, WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED, pSmeJoinReq->txBFCsnValue) != eSIR_SUCCESS) { - limLog(pMac, LOGP, FL("could not set WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED at CFG")); + limLog(pMac, LOGP, FL("could not set " + "WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED at CFG")); retCode = eSIR_LOGP_EXCEPTION; goto end; } @@ -1817,7 +1828,8 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) /*Store Persona */ psessionEntry->pePersona = pSmeJoinReq->staPersona; VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - FL("PE PERSONA=%d cbMode %u"), psessionEntry->pePersona, pSmeJoinReq->cbMode); + FL("PE PERSONA=%d cbMode %u"), psessionEntry->pePersona, + pSmeJoinReq->cbMode); /* Copy the SSID from smejoinreq to session entry */ psessionEntry->ssId.length = pSmeJoinReq->ssId.length; @@ -1853,7 +1865,8 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) else { /* Throw an error and return and make sure to delete the session.*/ - limLog(pMac, LOGW, FL("received SME_JOIN_REQ with invalid bss type")); + limLog(pMac, LOGE, FL("received SME_JOIN_REQ with invalid" + " bss type %d"), psessionEntry->bssType); retCode = eSIR_SME_INVALID_PARAMETERS; goto end; } @@ -1874,7 +1887,8 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) pMlmJoinReq = vos_mem_malloc(val); if ( NULL == pMlmJoinReq ) { - limLog(pMac, LOGP, FL("call to AllocateMemory failed for mlmJoinReq")); + limLog(pMac, LOGP, FL("call to AllocateMemory " + "failed for mlmJoinReq")); return; } (void) vos_mem_set((void *) pMlmJoinReq, val, 0); @@ -1942,7 +1956,9 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) psessionEntry->maxTxPower = VOS_MIN( regMax, (localPowerConstraint) ); #endif #if defined WLAN_VOWIFI_DEBUG - limLog( pMac, LOGE, "Regulatory max = %d, local power constraint = %d, max tx = %d", regMax, localPowerConstraint, psessionEntry->maxTxPower ); + limLog( pMac, LOGE, "Regulatory max = %d, local power constraint = %d," + " max tx = %d", regMax, localPowerConstraint, + psessionEntry->maxTxPower ); #endif if(!pMac->psOffloadEnabled) @@ -1995,17 +2011,11 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) psessionEntry->limSmeState = eLIM_SME_WT_JOIN_STATE; MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); - PELOG1(limLog(pMac, LOG1, FL("SME JoinReq: SSID %d.%c%c%c%c%c%c"), - psessionEntry->ssId.length, - psessionEntry->ssId.ssId[0], - psessionEntry->ssId.ssId[1], - psessionEntry->ssId.ssId[2], - psessionEntry->ssId.ssId[3], - psessionEntry->ssId.ssId[4], - psessionEntry->ssId.ssId[5]); - limLog(pMac, LOG1, FL("Channel %d, BSSID "MAC_ADDRESS_STR), - psessionEntry->currentOperChannel, - MAC_ADDR_ARRAY(psessionEntry->bssId));) + limLog(pMac, LOG1, FL("SME JoinReq:Sessionid %d SSID len %d SSID : %s " + "Channel %d, BSSID "MAC_ADDRESS_STR), pMlmJoinReq->sessionId, + psessionEntry->ssId.length,psessionEntry->ssId.ssId, + psessionEntry->currentOperChannel, + MAC_ADDR_ARRAY(psessionEntry->bssId)); /* Indicate whether spectrum management is enabled*/ psessionEntry->spectrumMgtEnabled = @@ -2018,7 +2028,8 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) else { /* Received eWNI_SME_JOIN_REQ un expected state */ - limLog(pMac, LOGE, FL("received unexpected SME_JOIN_REQ in state %X"), pMac->lim.gLimSmeState); + limLog(pMac, LOGE, FL("received unexpected SME_JOIN_REQ " + "in state %X"), pMac->lim.gLimSmeState); limPrintSmeState(pMac, LOGE, pMac->lim.gLimSmeState); retCode = eSIR_SME_UNEXPECTED_REQ_RESULT_CODE; psessionEntry = NULL; @@ -2047,7 +2058,8 @@ end: psessionEntry = NULL; } } - + limLog(pMac, LOG1, FL("Sending failure status limSendSmeJoinReassocRsp" + "on sessionid: %d with retCode = %d"),smesessionId, retCode); limSendSmeJoinReassocRsp(pMac, eWNI_SME_JOIN_RSP, retCode, eSIR_MAC_UNSPEC_FAILURE_STATUS,psessionEntry,smesessionId,smetransactionId); } /*** end __limProcessSmeJoinReq() ***/ @@ -2235,7 +2247,9 @@ __limProcessSmeReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) psessionEntry->maxTxPower = VOS_MIN( regMax, (localPowerConstraint) ); #if defined WLAN_VOWIFI_DEBUG - limLog( pMac, LOGE, "Regulatory max = %d, local power constraint = %d, max tx = %d", regMax, localPowerConstraint, psessionEntry->maxTxPower ); + limLog( pMac, LOGE, "Regulatory max = %d, local power constraint " + "= %d, max tx = %d", regMax, localPowerConstraint, + psessionEntry->maxTxPower ); #endif { #if 0 diff --git a/CORE/MAC/src/pe/lim/limSendManagementFrames.c b/CORE/MAC/src/pe/lim/limSendManagementFrames.c index 8b63ecf97801..36b0a185e4e4 100644 --- a/CORE/MAC/src/pe/lim/limSendManagementFrames.c +++ b/CORE/MAC/src/pe/lim/limSendManagementFrames.c @@ -1464,6 +1464,7 @@ limSendAssocRspMgmtFrame(tpAniSirGlobal pMac, tANI_BOOLEAN extractedExtCapFlag = eANI_BOOLEAN_FALSE; if(NULL == psessionEntry) { + limLog( pMac, LOGE, FL("psessionEntry is NULL")); return; } @@ -1623,7 +1624,8 @@ limSendAssocRspMgmtFrame(tpAniSirGlobal pMac, if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOC_RSP_ADDNIE_FLAG, &addnIEPresent) != eSIR_SUCCESS) { - limLog(pMac, LOGP, FL("Unable to get WNI_CFG_ASSOC_RSP_ADDNIE_FLAG")); + limLog(pMac, LOGP, FL("Unable to get " + "WNI_CFG_ASSOC_RSP_ADDNIE_FLAG")); return; } @@ -1633,7 +1635,8 @@ limSendAssocRspMgmtFrame(tpAniSirGlobal pMac, if (wlan_cfgGetStrLen(pMac, WNI_CFG_ASSOC_RSP_ADDNIE_DATA, &addnIELen) != eSIR_SUCCESS) { - limLog(pMac, LOGP, FL("Unable to get WNI_CFG_ASSOC_RSP_ADDNIE_DATA length")); + limLog(pMac, LOGP, FL("Unable to get " + "WNI_CFG_ASSOC_RSP_ADDNIE_DATA length")); return; } @@ -1710,8 +1713,8 @@ limSendAssocRspMgmtFrame(tpAniSirGlobal pMac, nPayload, &nPayload ); if ( DOT11F_FAILED( nStatus ) ) { - limLog( pMac, LOGE, FL("Failed to pack an Association Response (0x%08x)."), - nStatus ); + limLog( pMac, LOGE, FL("Failed to pack an Association Response" + " (0x%08x)."), nStatus ); palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); return; // allocated! @@ -2259,19 +2262,14 @@ limSendAssocReqMgmtFrame(tpAniSirGlobal pMac, if(NULL == psessionEntry) { - return; - } - - smeSessionId = psessionEntry->smeSessionId; - - if(NULL == psessionEntry->pLimJoinReq) - { + limLog(pMac, LOGE, FL("psessionEntry is NULL") ); return; } /* check this early to avoid unncessary operation */ if(NULL == psessionEntry->pLimJoinReq) { + limLog(pMac, LOGE, FL("psessionEntry->pLimJoinReq is NULL") ); return; } nAddIELen = psessionEntry->pLimJoinReq->addIEAssoc.length; @@ -2280,7 +2278,7 @@ limSendAssocReqMgmtFrame(tpAniSirGlobal pMac, pFrm = vos_mem_malloc(sizeof(tDot11fAssocRequest)); if ( NULL == pFrm ) { - limLog(pMac, LOGE, FL("Unable to allocate memory in limSendAssocReqMgmtFrame") ); + limLog(pMac, LOGE, FL("Unable to allocate memory") ); return; } @@ -2440,7 +2438,8 @@ limSendAssocReqMgmtFrame(tpAniSirGlobal pMac, if( (psessionEntry->pLimJoinReq != NULL) && (!psessionEntry->pLimJoinReq->bssDescription.aniIndicator)) { - limLog( pMac, LOG1, FL("Sending Assoc Req to Non-TQ AP, Turning off Greenfield")); + limLog( pMac, LOG1, FL("Sending Assoc Req to Non-TQ AP," + " Turning off Greenfield")); pFrm->HTCaps.greenField = WNI_CFG_GREENFIELD_CAPABILITY_DISABLE; } #endif @@ -2559,13 +2558,14 @@ limSendAssocReqMgmtFrame(tpAniSirGlobal pMac, { limMergeExtCapIEStruct(&pFrm->ExtCap, &extractedExtCap); } - // That done, pack the Probe Request: + + // That done, pack the Assoc Request: nStatus = dot11fPackAssocRequest( pMac, pFrm, pFrame + sizeof(tSirMacMgmtHdr), nPayload, &nPayload ); if ( DOT11F_FAILED( nStatus ) ) { - limLog( pMac, LOGE, FL("Failed to pack a Probe Response (0x%0" + limLog( pMac, LOGE, FL("Failed to pack a Assoc Request (0x%0" "8x)."), nStatus ); palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, @@ -2575,8 +2575,8 @@ limSendAssocReqMgmtFrame(tpAniSirGlobal pMac, } else if ( DOT11F_WARNED( nStatus ) ) { - limLog( pMac, LOGW, FL("There were warnings while packing a P" - "robe Response (0x%08x)."), nStatus ); + limLog( pMac, LOGW, FL("There were warnings while packing a Assoc" + "Request (0x%08x)."), nStatus ); } PELOG1(limLog( pMac, LOG1, FL("*** Sending Association Request length %d" @@ -2601,7 +2601,8 @@ limSendAssocReqMgmtFrame(tpAniSirGlobal pMac, psessionEntry->assocReq = vos_mem_malloc(nPayload); if ( NULL == psessionEntry->assocReq ) { - PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store assoc request"));) + PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store " + "assoc request"));) } else { @@ -3507,8 +3508,12 @@ limSendAuthMgmtFrame(tpAniSirGlobal pMac, return; } - smeSessionId = psessionEntry->smeSessionId; - + limLog(pMac, LOG1, + FL("Sending Auth seq# %d status %d (%d) to "MAC_ADDRESS_STR), + pAuthFrameBody->authTransactionSeqNumber, + pAuthFrameBody->authStatusCode, + (pAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS), + MAC_ADDR_ARRAY(peerMacAddr)); if (wepBit == LIM_WEP_IN_FC) { /// Auth frame3 to be sent with encrypted framebody @@ -3551,7 +3556,8 @@ limSendAuthMgmtFrame(tpAniSirGlobal pMac, } else { - limLog(pMac, LOG3, FL("Auth frame, Does not contain FTIES!!!")); + limLog(pMac, LOG3, FL("Auth frame, Does not contain " + "FTIES!!!")); frameLen += (2+SIR_MDIE_SIZE); } } @@ -3642,6 +3648,8 @@ limSendAuthMgmtFrame(tpAniSirGlobal pMac, if (limPopulateMacHeader(pMac, pFrame, SIR_MAC_MGMT_FRAME, SIR_MAC_MGMT_AUTH, peerMacAddr,psessionEntry->selfMacAddr) != eSIR_SUCCESS) { + limLog(pMac, LOGE, FL("call to limPopulateMacHeader failed for " + "AUTH frame")); palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); return; } @@ -3665,11 +3673,11 @@ limSendAuthMgmtFrame(tpAniSirGlobal pMac, vos_mem_copy(pBody, (tANI_U8 *) pAuthFrameBody, bodyLen); PELOG1(limLog(pMac, LOG1, - FL("*** Sending Auth seq# 3 status %d (%d) to"), + FL("*** Sending Auth seq# 3 status %d (%d) to"MAC_ADDRESS_STR), pAuthFrameBody->authStatusCode, - (pAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS)); + (pAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS), + MAC_ADDR_ARRAY(pMacHdr->da));) - limPrintMacAddr(pMac, pMacHdr->da, LOG1);) } else { @@ -3728,12 +3736,11 @@ limSendAuthMgmtFrame(tpAniSirGlobal pMac, #endif PELOG1(limLog(pMac, LOG1, - FL("*** Sending Auth seq# %d status %d (%d) to "), + FL("*** Sending Auth seq# %d status %d (%d) to "MAC_ADDRESS_STR), pAuthFrameBody->authTransactionSeqNumber, pAuthFrameBody->authStatusCode, - (pAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS)); - - limPrintMacAddr(pMac, pMacHdr->da, LOG1);) + (pAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS), + MAC_ADDR_ARRAY(pMacHdr->da));) } PELOG2(sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG2, pFrame, frameLen);) diff --git a/CORE/MAC/src/pe/lim/limSerDesUtils.c b/CORE/MAC/src/pe/lim/limSerDesUtils.c index 34db4563b0b7..e7e4c0b54e74 100644 --- a/CORE/MAC/src/pe/lim/limSerDesUtils.c +++ b/CORE/MAC/src/pe/lim/limSerDesUtils.c @@ -862,7 +862,7 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) if (!pJoinReq || !pBuf) { - PELOGE(limLog(pMac, LOGE, FL("NULL ptr received"));) + PELOGE(limLog(pMac, LOGE, FL("pJoinReq or pBuf is NULL"));) return eSIR_FAILURE; } @@ -877,32 +877,40 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) if (pJoinReq->messageType == eWNI_SME_JOIN_REQ) PELOG1(limLog(pMac, LOG3, FL("SME_JOIN_REQ length %d bytes is:"), len);) else - PELOG1(limLog(pMac, LOG3, FL("SME_REASSOC_REQ length %d bytes is:"), len);) + PELOG1(limLog(pMac, LOG3, FL("SME_REASSOC_REQ length %d bytes is:"), + len);) PELOG1(sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG3, pTemp, len);) if (len < (tANI_S16) sizeof(tANI_U32)) { - PELOGE(limLog(pMac, LOGE, FL("len too short %d"), len);) + PELOGE(limLog(pMac, LOGE, FL("len %d is too short"), len);) return eSIR_FAILURE; } len -= sizeof(tANI_U32); // skip message header if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; - + } // Extract sessionId pJoinReq->sessionId = *pBuf++; len--; if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; - + } // Extract transactionId pJoinReq->transactionId = limGetU16(pBuf); pBuf += sizeof(tANI_U16); len -= sizeof(tANI_U16); if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } // Extract ssId pJoinReq->ssId.length = *pBuf++; @@ -911,45 +919,66 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) pBuf += pJoinReq->ssId.length; len -= pJoinReq->ssId.length; if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } // Extract selfMacAddr vos_mem_copy( pJoinReq->selfMacAddr, pBuf, sizeof(tSirMacAddr)); pBuf += sizeof(tSirMacAddr); len -= sizeof(tSirMacAddr); if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } // Extract bsstype pJoinReq->bsstype = (tSirBssType) limGetU32(pBuf); pBuf += sizeof(tANI_U32); len -= sizeof(tANI_U32); if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } // Extract dot11mode pJoinReq->dot11mode= *pBuf++; len--; if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } // Extract bssPersona pJoinReq->staPersona = *pBuf++; len--; if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } // Extract cbMode pJoinReq->cbMode = *pBuf++; len--; if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } // Extract uapsdPerAcBitmask pJoinReq->uapsdPerAcBitmask = *pBuf++; len--; if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } // Extract operationalRateSet @@ -962,7 +991,10 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) pBuf += pJoinReq->operationalRateSet.numRates; len -= pJoinReq->operationalRateSet.numRates; if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } } // Extract extendedRateSet @@ -974,7 +1006,10 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) pBuf += pJoinReq->extendedRateSet.numRates; len -= pJoinReq->extendedRateSet.numRates; if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } } // Extract RSN IE @@ -998,7 +1033,10 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) pBuf += pJoinReq->rsnIE.length; len -= pJoinReq->rsnIE.length; // skip RSN IE if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } } #ifdef FEATURE_WLAN_ESE @@ -1022,7 +1060,10 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) pBuf += pJoinReq->cckmIE.length; len -= pJoinReq->cckmIE.length; // skip CCKM IE if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } } #endif @@ -1047,7 +1088,10 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) pBuf += pJoinReq->addIEScan.length; len -= pJoinReq->addIEScan.length; // skip add IE if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } } pJoinReq->addIEAssoc.length = limGetU16(pBuf); @@ -1071,27 +1115,38 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) pBuf += pJoinReq->addIEAssoc.length; len -= pJoinReq->addIEAssoc.length; // skip add IE if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } } pJoinReq->UCEncryptionType = limGetU32(pBuf); pBuf += sizeof(tANI_U32); len -= sizeof(tANI_U32); if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } pJoinReq->MCEncryptionType = limGetU32(pBuf); pBuf += sizeof(tANI_U32); len -= sizeof(tANI_U32); if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; - + } #ifdef WLAN_FEATURE_11W pJoinReq->MgmtEncryptionType = limGetU32(pBuf); pBuf += sizeof(tANI_U32); len -= sizeof(tANI_U32); if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } #endif #ifdef WLAN_FEATURE_VOWIFI_11R @@ -1100,7 +1155,10 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) pBuf += sizeof(tAniBool); len -= sizeof(tAniBool); if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } #endif #ifdef FEATURE_WLAN_ESE @@ -1109,14 +1167,20 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) pBuf += sizeof(tAniBool); len -= sizeof(tAniBool); if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } //isESEconnection; pJoinReq->isESEconnection = (tAniBool)limGetU32(pBuf); pBuf += sizeof(tAniBool); len -= sizeof(tAniBool); if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } // TSPEC information pJoinReq->eseTspecInfo.numTspecs = *pBuf++; @@ -1126,7 +1190,10 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) pBuf += sizeof(tTspecInfo)*SIR_ESE_MAX_TSPEC_IES; len -= sizeof(tTspecInfo)*SIR_ESE_MAX_TSPEC_IES; if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } #endif #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) @@ -1135,7 +1202,10 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) pBuf += sizeof(tAniBool); len -= sizeof(tAniBool); if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } #endif #ifdef FEATURE_WLAN_LFR @@ -1144,14 +1214,20 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) pBuf += sizeof(tAniBool); len -= sizeof(tAniBool); if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } #endif //txLdpcIniFeatureEnabled pJoinReq->txLdpcIniFeatureEnabled= *pBuf++; len--; if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } //HT Config vos_mem_copy(&(pJoinReq->htConfig), pBuf, sizeof(tSirHTConfig)); @@ -1162,19 +1238,28 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) pJoinReq->txBFIniFeatureEnabled= *pBuf++; len--; if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } //txBFCsnValue pJoinReq->txBFCsnValue= *pBuf++; len--; if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } //MuBformee pJoinReq->txMuBformee= *pBuf++; len--; if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } //enableVhtpAid pJoinReq->enableVhtpAid= *pBuf++; @@ -1228,7 +1313,6 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) pJoinReq->powerCap.minTxPower = *pBuf++; pJoinReq->powerCap.maxTxPower = *pBuf++; len -=2; - limLog(pMac, LOG1, FL("Power Caps: Min power = %d, Max power = %d"), pJoinReq->powerCap.minTxPower, pJoinReq->powerCap.maxTxPower); pJoinReq->supportedChannels.numChnl = *pBuf++; len--; @@ -1247,7 +1331,10 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) pJoinReq->uapsdPerAcBitmask = *pBuf++; len--; if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; + } // // NOTE - tSirBssDescription is now moved to the end @@ -1260,7 +1347,9 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) PELOGE(limLog(pMac, LOGE, FL("get bss description failed"));) return eSIR_FAILURE; } - PELOG3(sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG3, (tANI_U8 *) &(pJoinReq->bssDescription), pJoinReq->bssDescription.length + 2);) + PELOG3(sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG3, + (tANI_U8 *) &(pJoinReq->bssDescription), + pJoinReq->bssDescription.length + 2);) pBuf += lenUsed; len -= lenUsed; |
