summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhishek Singh <absingh@codeaurora.org>2016-08-24 10:42:07 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2016-09-11 22:56:04 -0700
commitb60d53e38fa307ea00834e7c5a6a083f24c8ea9f (patch)
tree59d58473884b744eee0793e0bea85c4db31015c4
parentfa40aecf59743289e07a94f603ebf4f27941067d (diff)
qcacld-2.0: Disconnect is dropped due to invalid csr roam state
pronto to qcacld-2.0 propagation The csr roam state is moved to joined after connection but on receiving disconnect the state is changed to idle state even before the disconnect indication is sent to SME. This lead to dropping of the disconnect indication in SME as it is not processed in idle state. Fixed it by moving csr roam state to idle state after disconnect done indication. Change-Id: Ic31a2d8a0d68eaf0f4d8c6456344c78d4635f161 CRs-Fixed: 1058611
-rw-r--r--CORE/SME/inc/csrInternal.h2
-rw-r--r--CORE/SME/src/csr/csrApiRoam.c10
-rw-r--r--CORE/SME/src/csr/csrApiScan.c31
3 files changed, 32 insertions, 11 deletions
diff --git a/CORE/SME/inc/csrInternal.h b/CORE/SME/inc/csrInternal.h
index b5e91a46c0b0..8bace1ac2bb0 100644
--- a/CORE/SME/inc/csrInternal.h
+++ b/CORE/SME/inc/csrInternal.h
@@ -397,7 +397,6 @@ typedef struct tagScanCmd
csrScanCompleteCallback callback;
void *pContext;
eCsrScanReason reason;
- eCsrRoamState lastRoamState[CSR_ROAM_SESSION_MAX];
tCsrRoamProfile *pToRoamProfile;
tANI_U32 roamId; //this is the ID related to the pToRoamProfile
union
@@ -1077,6 +1076,7 @@ typedef struct tagCsrRoamStruct
tCsrChannel base40MHzChannels; //center channels for 40MHz channels
eCsrRoamState curState[CSR_ROAM_SESSION_MAX];
eCsrRoamSubState curSubState[CSR_ROAM_SESSION_MAX];
+ eCsrRoamState prev_state[CSR_ROAM_SESSION_MAX];
//This may or may not have the up-to-date valid channel list
//It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c
index 8f26d91b82b5..494b9ca4ab77 100644
--- a/CORE/SME/src/csr/csrApiRoam.c
+++ b/CORE/SME/src/csr/csrApiRoam.c
@@ -10567,6 +10567,13 @@ void csrRoamCheckForLinkStatusChange( tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg )
&roamInfo, 0,
eCSR_ROAM_LOSTLINK,
eCSR_ROAM_RESULT_DISASSOC_IND);
+ pSession = CSR_GET_SESSION(pMac,
+ pDisConDoneInd->sessionId);
+ if (pSession &&
+ !CSR_IS_INFRA_AP(&pSession->connectedProfile))
+ csrRoamStateChange(pMac,
+ eCSR_ROAMING_STATE_IDLE,
+ pDisConDoneInd->sessionId);
}
else
{
@@ -11673,9 +11680,6 @@ eHalStatus csrRoamLostLink( tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 ty
if(!CSR_IS_INFRA_AP(&pSession->connectedProfile))
{
csrRoamCallCallback(pMac, sessionId, NULL, 0, eCSR_ROAM_LOSTLINK_DETECTED, result);
- /*Move the state to Idle after disconnection*/
- csrRoamStateChange( pMac, eCSR_ROAMING_STATE_IDLE, sessionId );
-
}
if ( eWNI_SME_DISASSOC_IND == type )
diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c
index eda414d44dc3..b2ffc49e78e5 100644
--- a/CORE/SME/src/csr/csrApiScan.c
+++ b/CORE/SME/src/csr/csrApiScan.c
@@ -2839,6 +2839,7 @@ eHalStatus csrScanningStateMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf )
tSirMbMsg *pMsg = (tSirMbMsg *)pMsgBuf;
tSirSmeDisConDoneInd *pDisConDoneInd;
tCsrRoamInfo roamInfo = {0};
+ tCsrRoamSession *pSession;
if ((eWNI_SME_SCAN_RSP == pMsg->type) ||
(eWNI_SME_GET_SCANNED_CHANNEL_RSP == pMsg->type)) {
@@ -2847,7 +2848,6 @@ eHalStatus csrScanningStateMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf )
switch (pMsg->type) {
case eWNI_SME_UPPER_LAYER_ASSOC_CNF:
{
- tCsrRoamSession *pSession;
tSirSmeAssocIndToUpperLayerCnf *pUpperLayerAssocCnf;
tCsrRoamInfo *pRoamInfo = NULL;
tANI_U32 sessionId;
@@ -2934,6 +2934,22 @@ eHalStatus csrScanningStateMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf )
&roamInfo, 0,
eCSR_ROAM_LOSTLINK,
eCSR_ROAM_RESULT_DISASSOC_IND);
+
+ pSession = CSR_GET_SESSION(pMac,
+ pDisConDoneInd->sessionId);
+
+ /*
+ * Update the previous state if
+ * previous to eCSR_ROAMING_STATE_IDLE
+ * as we are disconnected and
+ * currunt state is scanning
+ */
+ if (pSession &&
+ !CSR_IS_INFRA_AP(
+ &pSession->connectedProfile))
+ pMac->roam.prev_state[
+ pDisConDoneInd->sessionId] =
+ eCSR_ROAMING_STATE_IDLE;
}
else
{
@@ -6183,21 +6199,21 @@ eHalStatus csrProcessScanCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand )
{
for( i = 0; i < CSR_ROAM_SESSION_MAX; i++ )
{
- pCommand->u.scanCmd.lastRoamState[i] =
+ pMac->roam.prev_state[i]=
csrRoamStateChange( pMac, eCSR_ROAMING_STATE_SCANNING, i);
smsLog( pMac, LOG3, "starting SCAN command from %d state...."
- " reason is %d", pCommand->u.scanCmd.lastRoamState[i],
+ " reason is %d", pMac->roam.prev_state[i],
pCommand->u.scanCmd.reason );
}
}
else
{
- pCommand->u.scanCmd.lastRoamState[pCommand->sessionId] =
+ pMac->roam.prev_state[pCommand->sessionId] =
csrRoamStateChange(pMac, eCSR_ROAMING_STATE_SCANNING,
pCommand->sessionId);
smsLog( pMac, LOG3,
"starting SCAN command from %d state.... reason is %d",
- pCommand->u.scanCmd.lastRoamState[pCommand->sessionId],
+ pMac->roam.prev_state[pCommand->sessionId],
pCommand->u.scanCmd.reason );
}
@@ -7423,12 +7439,13 @@ void csrReleaseScanCommand(tpAniSirGlobal pMac, tSmeCmd *pCommand, eCsrScanStatu
{
tANI_U32 i;
for(i = 0; i < CSR_ROAM_SESSION_MAX; i++)
- csrRoamStateChange(pMac, pCommand->u.scanCmd.lastRoamState[i], i);
+ csrRoamStateChange(pMac,
+ pMac->roam.prev_state[i], i);
}
else
{
csrRoamStateChange(pMac,
- pCommand->u.scanCmd.lastRoamState[pCommand->sessionId],
+ pMac->roam.prev_state[pCommand->sessionId],
pCommand->sessionId);
}