diff options
| author | Naveen Rawat <nrawat@qca.qualcomm.com> | 2014-04-24 12:06:06 -0700 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-04-26 19:24:29 -0700 |
| commit | 81ca7a0387fe752a8fbf341a45e9b7bccbb06adb (patch) | |
| tree | 161e430584369d46f255e4fa4cf8257ec6932fc6 | |
| parent | b23c2e6ef4c30de1acaf29909fe5ff2c6e3b85a7 (diff) | |
qcacld: Fix for delayed ASSOC event with getRSSI
In case getRSSI coincides with roaming/joining getRSSI
takes HDD lock and causes HDD to delay sending ASSOC
event to supplicant. Supplicant receives M1 and wait
100ms for ASSOC event arrive and since the arrival of
ASSOC event is delayed more than 100ms, Supplicant drops
M1 packet causing AP to resend M1 and increase roam delay
Fix: when getRSSI is called in wrong state, instead of
dropping message immediately call RSSI callback function
with last read RSSI value.
Change-Id: I549858a85b22608fbaf446b9c08767f760f24857
CRs-fixed: 651199
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_wext.c | 2 | ||||
| -rw-r--r-- | CORE/MAC/inc/sirApi.h | 3 | ||||
| -rw-r--r-- | CORE/SME/inc/csrInternal.h | 20 | ||||
| -rw-r--r-- | CORE/SME/inc/sme_Api.h | 20 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrApiRoam.c | 45 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrCmdProcess.c | 21 | ||||
| -rw-r--r-- | CORE/SME/src/sme_common/sme_Api.c | 14 |
7 files changed, 108 insertions, 17 deletions
diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c index be2092513e43..e12b98f15c16 100644 --- a/CORE/HDD/src/wlan_hdd_wext.c +++ b/CORE/HDD/src/wlan_hdd_wext.c @@ -987,7 +987,7 @@ VOS_STATUS wlan_hdd_get_rssi(hdd_adapter_t *pAdapter, v_S7_t *rssi_value) hstatus = sme_GetRssi(pHddCtx->hHal, hdd_GetRssiCB, pHddStaCtx->conn_info.staId[ 0 ], - pHddStaCtx->conn_info.bssId, + pHddStaCtx->conn_info.bssId, pAdapter->rssi, &context, pHddCtx->pvosContext); if (eHAL_STATUS_SUCCESS != hstatus) { diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index 8bf81bf404d1..e370ddf7b82a 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -2176,9 +2176,10 @@ typedef struct sAniGetRssiReq { // Common for all types are requests tANI_U16 msgType; // message type is same as the request type - tANI_U16 msgLen; // length of the entire request + tANI_U16 msgLen; // length of the entire request tANI_U8 sessionId; tANI_U8 staId; + tANI_S8 lastRSSI; // in case of error, return last RSSI void *rssiCallback; void *pDevContext; //device context void *pVosContext; //voss context diff --git a/CORE/SME/inc/csrInternal.h b/CORE/SME/inc/csrInternal.h index b0bb48cbb1c2..aaf019b3141e 100644 --- a/CORE/SME/inc/csrInternal.h +++ b/CORE/SME/inc/csrInternal.h @@ -1263,7 +1263,25 @@ eHalStatus csrGetStatistics(tpAniSirGlobal pMac, eCsrStatsRequesterType requeste ---------------------------------------------------------------------------*/ tANI_U16 csrGetTLSTAState(tpAniSirGlobal pMac, tANI_U8 staId); -eHalStatus csrGetRssi(tpAniSirGlobal pMac,tCsrRssiCallback callback,tANI_U8 staId,tCsrBssid bssId,void * pContext,void * pVosContext); +/* --------------------------------------------------------------------------- + \fn csrGetRssi + \ creates SME req packet for getRSSI and post to Self + + \param pMac - global MAC context + \param callback - hdd callback function to be called once FW returns the + RSSI value + \param staId - The staID to be passed to the TL to get the relevant + TL STA State + \param bssID - bssid for which RSSI is requested + \param lastRSSI - RSSI value at time of request. In case request cannot + be sent to firmware, do not hold up but return this value. + \param pContext - user context to be passed back along with the callback + \param pVosContext - vos conext + \return the state as tANI_U16 + ---------------------------------------------------------------------------*/ +eHalStatus csrGetRssi(tpAniSirGlobal pMac,tCsrRssiCallback callback, + tANI_U8 staId, tCsrBssid bssId, tANI_S8 lastRSSI, + void * pContext,void * pVosContext); /* --------------------------------------------------------------------------- \fn csrGetSnr diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h index 2c8df703e33a..d838eba70356 100644 --- a/CORE/SME/inc/sme_Api.h +++ b/CORE/SME/inc/sme_Api.h @@ -923,9 +923,25 @@ eHalStatus sme_GetStatistics(tHalHandle hHal, eCsrStatsRequesterType requesterId ---------------------------------------------------------------------------*/ tANI_U16 smeGetTLSTAState(tHalHandle hHal, tANI_U8 staId); +/* --------------------------------------------------------------------------- + \fn sme_GetRssi + \brief a wrapper function that client calls to register a callback to get + RSSI + + \param hHal - HAL handle for device + \param callback - SME sends back the requested stats using the callback + \param staId - The station ID for which the stats is requested for + \param bssid - The bssid of the connected session + \param lastRSSI - RSSI value at time of request. In case fw cannot provide + RSSI, do not hold up but return this value. + \param pContext - user context to be passed back along with the callback + \param pVosContext - vos context + \return eHalStatus + ---------------------------------------------------------------------------*/ eHalStatus sme_GetRssi(tHalHandle hHal, - tCsrRssiCallback callback, - tANI_U8 staId, tCsrBssid bssId, void *pContext, void* pVosContext); + tCsrRssiCallback callback, + tANI_U8 staId, tCsrBssid bssId, tANI_S8 lastRSSI, + void *pContext, void* pVosContext); /* --------------------------------------------------------------------------- \fn sme_GetSnr diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c index 0335dd918c6d..ee8d04f537e1 100644 --- a/CORE/SME/src/csr/csrApiRoam.c +++ b/CORE/SME/src/csr/csrApiRoam.c @@ -8436,6 +8436,22 @@ void csrRoamingStateMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf ) eCSR_ROAM_CONNECT_STATUS_UPDATE, eCSR_ROAM_RESULT_IBSS_PEER_DEPARTED); break; + case eWNI_SME_GET_RSSI_REQ: + { + tAniGetRssiReq *pGetRssiReq = (tAniGetRssiReq*)pMsgBuf; + if (NULL != pGetRssiReq->rssiCallback) + { + ((tCsrRssiCallback)(pGetRssiReq->rssiCallback))( pGetRssiReq->lastRSSI, + pGetRssiReq->staId, + pGetRssiReq->pDevContext); + } + else + { + smsLog(pMac, LOGE, FL("pGetRssiReq->rssiCallback is NULL")); + } + } + break; + default: smsLog(pMac, LOG1, FL("Unexpected message type = %d[0x%X] received in substate %s"), @@ -9223,15 +9239,13 @@ void csrRoamRssiRspProcessor(tpAniSirGlobal pMac, void* pMsg) if (NULL != pRoamRssiRsp) { - /* Get roam Rssi request is backed up and passed back to the response, - Extract the request message to fetch callback */ + /* Get roam Rssi request is backed up and passed back to the response, + Extract the request message to fetch callback */ tpAniGetRssiReq reqBkp = (tAniGetRssiReq*)pRoamRssiRsp->rssiReq; v_S7_t rssi = pRoamRssiRsp->rssi; - if ((NULL != reqBkp) && (NULL != reqBkp->rssiCallback)) { ((tCsrRssiCallback)(reqBkp->rssiCallback))(rssi, pRoamRssiRsp->staId, reqBkp->pDevContext); - reqBkp->rssiCallback = NULL; vos_mem_free(reqBkp); pRoamRssiRsp->rssiReq = NULL; } @@ -15446,8 +15460,12 @@ tCsrPeStatsReqInfo * csrRoamInsertEntryIntoPeStatsReqList( tpAniSirGlobal pMac, return pNewStaEntry; } eHalStatus csrGetRssi(tpAniSirGlobal pMac, - tCsrRssiCallback callback, - tANI_U8 staId, tCsrBssid bssId, void *pContext, void* pVosContext) + tCsrRssiCallback callback, + tANI_U8 staId, + tCsrBssid bssId, + tANI_S8 lastRSSI, + void *pContext, + void* pVosContext) { eHalStatus status = eHAL_STATUS_SUCCESS; vos_msg_t msg; @@ -15455,13 +15473,21 @@ eHalStatus csrGetRssi(tpAniSirGlobal pMac, tAniGetRssiReq *pMsg; smsLog(pMac, LOG2, FL("called")); + + status = csrRoamGetSessionIdFromBSSID(pMac, (tCsrBssid *)bssId, &sessionId); + if (!HAL_STATUS_SUCCESS(status)) + { + callback(lastRSSI, staId, pContext); + smsLog(pMac, LOGE, FL("Failed to get SessionId")); + return eHAL_STATUS_FAILURE; + } + pMsg = vos_mem_malloc(sizeof(tAniGetRssiReq)); if ( NULL == pMsg ) { smsLog(pMac, LOGE, " csrGetRssi: failed to allocate mem for req "); return eHAL_STATUS_FAILURE; } - csrRoamGetSessionIdFromBSSID(pMac, (tCsrBssid *)bssId, &sessionId); pMsg->msgType = pal_cpu_to_be16((tANI_U16)eWNI_SME_GET_RSSI_REQ); pMsg->msgLen = (tANI_U16)sizeof(tAniGetRssiReq); @@ -15470,6 +15496,11 @@ eHalStatus csrGetRssi(tpAniSirGlobal pMac, pMsg->rssiCallback = callback; pMsg->pDevContext = pContext; pMsg->pVosContext = pVosContext; + /* + * store RSSI at time of calling, so that if RSSI request cannot + * be sent to firmware, this value can be used to return immediately + */ + pMsg->lastRSSI = lastRSSI; msg.type = eWNI_SME_GET_RSSI_REQ; msg.bodyptr = pMsg; msg.reserved = 0; diff --git a/CORE/SME/src/csr/csrCmdProcess.c b/CORE/SME/src/csr/csrCmdProcess.c index 49ca8eae976b..dfba380e4cb1 100644 --- a/CORE/SME/src/csr/csrCmdProcess.c +++ b/CORE/SME/src/csr/csrCmdProcess.c @@ -54,7 +54,7 @@ eHalStatus csrMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf ) #endif smsLog(pMac, LOG2, FL("Message %d[0x%04X] received in curState %s" - "and substate %s"), + " and substate %s"), pSmeRsp->messageType, pSmeRsp->messageType, macTraceGetcsrRoamState(pMac->roam.curState[pSmeRsp->sessionId]), macTraceGetcsrRoamSubState( @@ -135,6 +135,25 @@ eHalStatus csrMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf ) smsLog(pMac, LOGW, FL(" handling msg 0x%X CSR state is %d"), pSmeRsp->messageType, pMac->roam.curState[pSmeRsp->sessionId]); csrRoamCheckForLinkStatusChange(pMac, pSmeRsp); } + else if(eWNI_SME_GET_RSSI_REQ == pSmeRsp->messageType) + { + tAniGetRssiReq *pGetRssiReq = (tAniGetRssiReq*)pMsgBuf; + if(NULL != pGetRssiReq->rssiCallback) + { + smsLog(pMac, + LOGW, + FL("Message eWNI_SME_GET_RSSI_REQ is not handled" + " by CSR in state %d. calling RSSI callback"), + pMac->roam.curState[pSmeRsp->sessionId]); + ((tCsrRssiCallback)(pGetRssiReq->rssiCallback))(pGetRssiReq->lastRSSI, + pGetRssiReq->staId, + pGetRssiReq->pDevContext); + } + else + { + smsLog(pMac, LOGE, FL("pGetRssiReq->rssiCallback is NULL")); + } + } else { smsLog(pMac, LOGW, " Message 0x%04X is not handled by CSR. CSR state is %d ", pSmeRsp->messageType, pMac->roam.curState[pSmeRsp->sessionId]); diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index 26456a244a43..e7655aaa3c4c 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -4970,17 +4970,22 @@ eHalStatus sme_RoamRemoveKey(tHalHandle hHal, tANI_U8 sessionId, /* --------------------------------------------------------------------------- \fn sme_GetRssi - \brief a wrapper function that client calls to register a callback to get RSSI + \brief a wrapper function that client calls to register a callback to get + RSSI + \param hHal - HAL handle for device \param callback - SME sends back the requested stats using the callback - \param staId - The station ID for which the stats is requested for + \param staId - The station ID for which the stats is requested for + \param bssid - The bssid of the connected session + \param lastRSSI - RSSI value at time of request. In case fw cannot provide + RSSI, do not hold up but return this value. \param pContext - user context to be passed back along with the callback \param pVosContext - vos context \return eHalStatus ---------------------------------------------------------------------------*/ eHalStatus sme_GetRssi(tHalHandle hHal, tCsrRssiCallback callback, - tANI_U8 staId, tCsrBssid bssId, + tANI_U8 staId, tCsrBssid bssId, tANI_S8 lastRSSI, void *pContext, void* pVosContext) { eHalStatus status = eHAL_STATUS_FAILURE; @@ -4992,7 +4997,8 @@ eHalStatus sme_GetRssi(tHalHandle hHal, if ( HAL_STATUS_SUCCESS( status ) ) { status = csrGetRssi( pMac, callback, - staId, bssId, pContext, pVosContext); + staId, bssId, lastRSSI, + pContext, pVosContext); sme_ReleaseGlobalLock( &pMac->sme ); } return (status); |
