qcacld-3.0: Clear mac_ctx->sap.sapCtxList for SAP if SSR happen

While SSR happen, hdd_reset_all_adapters will not clear
mac_ctx->sap.sapCtxList[sapctx->sessionId].pSapContext, and later the
sapctx will assign new sessionId after SSR restart SAP and update to
mac_ctx->sap.sapCtxList. So sapctx/old sessionId still can be
referenced by like wlan_sap_is_pre_cac_active and call pre cac cleanup
on unexpected port.

When SAP restart and set global sapCtxList in sap_set_session_param(),
find matched sapctx and clear it before assigning updated value.

Change-Id: Id02733cb22267ac0c1899d8caf9ac47c65e24a88
CRs-Fixed: 2232398
This commit is contained in:
Will Huang 2018-05-03 15:19:46 +08:00 • committed by nshrivas
commit 9913277e97

View file

@ -1200,11 +1200,18 @@ QDF_STATUS sap_set_session_param(tHalHandle hal, struct sap_context *sapctx,
uint32_t session_id)
{
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
int i;
sapctx->sessionId = session_id;
sapctx->is_pre_cac_on = false;
sapctx->pre_cac_complete = false;
sapctx->chan_before_pre_cac = 0;
/* When SSR, SAP will restart, clear the old context,sessionId */
for (i = 0; i < SAP_MAX_NUM_SESSION; i++) {
if (mac_ctx->sap.sapCtxList[i].pSapContext == sapctx)
mac_ctx->sap.sapCtxList[i].pSapContext = NULL;
}
mac_ctx->sap.sapCtxList[sapctx->sessionId].sessionID =
sapctx->sessionId;
mac_ctx->sap.sapCtxList[sapctx->sessionId].pSapContext = sapctx;