wlan: Ensure pre-auth is processed before invoking HDD callbacks.
This fix addresses a race condition between roaming engine trying to
pre-auth and PE/LIM trying to disconnect/tear down the link due to
heartbeat failure. In this scenario, we clear our state machine upon
receiving the disconnect indication. Then, the pre-auth to the new AP is
sent by the PE to which we get a successful response. When the pre-auth
response notification reaches SME (in particular, CSR neighbor roaming
code), we are continuing to process and triggering a roam even though we
have disconnected and are in INIT state.
This is addressed by having csrNeighborRoamPreauthRspHandler routine
return a status whether the pre-auth has been processed. If it is not
even processed (because we received the pre-auth in a wrong state), then
we need to silently drop it.
Change-Id: I480828ddc9687a78adba3729997a0b67ac15e7a8
CR-Fixed: 412041
diff --git a/CORE/SME/src/csr/csrNeighborRoam.c b/CORE/SME/src/csr/csrNeighborRoam.c
index 64c7314..3a1da2c 100644
--- a/CORE/SME/src/csr/csrNeighborRoam.c
+++ b/CORE/SME/src/csr/csrNeighborRoam.c
@@ -766,13 +766,15 @@
\param pMac - The handle returned by macOpen.
vosStatus - VOS_STATUS_SUCCESS/FAILURE/TIMEOUT status from PE
- \return VOID
+ \return eHAL_STATUS_SUCCESS on success (i.e. pre-auth processed),
+ eHAL_STATUS_FAILURE otherwise
---------------------------------------------------------------------------*/
-void csrNeighborRoamPreauthRspHandler(tpAniSirGlobal pMac, VOS_STATUS vosStatus)
+eHalStatus csrNeighborRoamPreauthRspHandler(tpAniSirGlobal pMac, VOS_STATUS vosStatus)
{
tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo;
eHalStatus status = eHAL_STATUS_SUCCESS;
+ eHalStatus preauthProcessed = eHAL_STATUS_SUCCESS;
tpCsrNeighborRoamBSSInfo pPreauthRspNode = NULL;
if (eANI_BOOLEAN_FALSE == pNeighborRoamInfo->FTRoamInfo.preauthRspPending)
@@ -786,6 +788,7 @@
NEIGHBOR_ROAM_DEBUG(pMac, LOGW,
FL("Unexpected pre-auth response in state %d\n"),
pNeighborRoamInfo->neighborRoamState);
+ preauthProcessed = eHAL_STATUS_FAILURE;
goto DEQ_PREAUTH;
}
@@ -795,6 +798,7 @@
{
NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("Preauth response received in state %d\n"),
pNeighborRoamInfo->neighborRoamState);
+ preauthProcessed = eHAL_STATUS_FAILURE;
goto DEQ_PREAUTH;
}
@@ -869,7 +873,7 @@
DEQ_PREAUTH:
csrRoamDequeuePreauth(pMac);
- return;
+ return preauthProcessed;
}
#endif /* WLAN_FEATURE_NEIGHBOR_ROAMING */