فهرست منبع

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
Will Huang 7 سال پیش
والد
کامیت
9913277e97
1فایلهای تغییر یافته به همراه7 افزوده شده و 0 حذف شده
  1. 7 0
      core/sap/src/sap_fsm.c

+ 7 - 0
core/sap/src/sap_fsm.c

@@ -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;