Эх сурвалжийг харах

qcacld-3.0: Fix connect failure due to scan stuck

Peer sta kickout ind was received from fw nine times
which resulted in queuing nine scan commands as part
of csr_scan_request_lost_link1 without checking for
max allowed scans. The ninth scan cmd is not released
as fw did not send completion event resulting in
subsequent connect to fail.

Fix is to
1) check for max allowed scans before
queuing scan command.
2) check for lim sme state to avoid invoking tear
down link with ap multiple times on receiving
multiple peer sta kickout ind from fw.
3) don't invoke csr_scan_request_lost_link1 as part
of csr_roam_lost_link as supplicant will issue scan
after successful disconnection.

Change-Id: I850fd336fc73e4b2c2362dfd11db433b68ccd1fb
CRs-Fixed: 2031342
yeshwanth sriram guntuka 8 жил өмнө
parent
commit
7f4cb34431

+ 10 - 4
core/mac/src/pe/lim/lim_link_monitoring_algo.c

@@ -222,11 +222,17 @@ void lim_delete_sta_context(tpAniSirGlobal mac_ctx,
 	switch (msg->reasonCode) {
 	case HAL_DEL_STA_REASON_CODE_KEEP_ALIVE:
 		if (LIM_IS_STA_ROLE(session_entry) && !msg->is_tdls) {
-			if (session_entry->limMlmState !=
-			    eLIM_MLM_LINK_ESTABLISHED_STATE) {
-				pe_err("Do not process in limMlmState %s(%x)",
+			if (!((session_entry->limMlmState ==
+			    eLIM_MLM_LINK_ESTABLISHED_STATE) &&
+			    (session_entry->limSmeState !=
+			    eLIM_SME_WT_DISASSOC_STATE) &&
+			    (session_entry->limSmeState !=
+			    eLIM_SME_WT_DEAUTH_STATE))) {
+				pe_err("Do not process in limMlmState %s(%x) limSmeState %s(%x)",
 				  lim_mlm_state_str(session_entry->limMlmState),
-				  session_entry->limMlmState);
+				  session_entry->limMlmState,
+				  lim_mlm_state_str(session_entry->limSmeState),
+				  session_entry->limSmeState);
 				qdf_mem_free(msg);
 				return;
 			}

+ 11 - 8
core/sme/src/csr/csr_api_roam.c

@@ -11976,17 +11976,12 @@ QDF_STATUS csr_roam_lost_link(tpAniSirGlobal pMac, uint32_t sessionId,
 	tSirSmeDisassocInd *pDisassocIndMsg = NULL;
 	eCsrRoamResult result = eCSR_ROAM_RESULT_LOSTLINK;
 	tCsrRoamInfo roamInfo;
-	bool fToRoam;
 	tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId);
 
 	if (!pSession) {
 		sme_err("session: %d not found", sessionId);
 		return QDF_STATUS_E_FAILURE;
 	}
-	/* Only need to roam for infra station. In this case P2P client will
-	 * roam as well
-	 */
-	fToRoam = CSR_IS_INFRASTRUCTURE(&pSession->connectedProfile);
 #ifndef NAPIER_SCAN
 	pSession->fCancelRoaming = false;
 #endif
@@ -12018,9 +12013,6 @@ QDF_STATUS csr_roam_lost_link(tpAniSirGlobal pMac, uint32_t sessionId,
 	else if (eWNI_SME_DEAUTH_IND == type)
 		status = csr_send_mb_deauth_cnf_msg(pMac, pDeauthIndMsg);
 
-	if (!QDF_IS_STATUS_SUCCESS(status))
-		/* If fail to send confirmation to PE, not to trigger roaming */
-		fToRoam = false;
 	/* prepare to tell HDD to disconnect */
 	qdf_mem_set(&roamInfo, sizeof(tCsrRoamInfo), 0);
 	roamInfo.statusCode = (tSirResultCodes) pSession->roamingStatusCode;
@@ -18750,6 +18742,17 @@ QDF_STATUS csr_queue_sme_command(tpAniSirGlobal mac_ctx, tSmeCmd *sme_cmd,
 		}
 	}
 
+	if ((eSmeCommandScan == sme_cmd->command) ||
+	    (sme_cmd->command == eSmeCommandRemainOnChannel)) {
+		if (csr_scan_active_ll_count(mac_ctx) >=
+		    mac_ctx->scan.max_scan_count) {
+			sme_err("Max scan reached");
+			csr_scan_call_callback(mac_ctx, sme_cmd,
+					       eCSR_SCAN_ABORT);
+			return QDF_STATUS_E_FAILURE;
+		}
+	}
+
 	qdf_mem_zero(&cmd, sizeof(struct wlan_serialization_command));
 	status = csr_set_serialization_params_to_cmd(mac_ctx, sme_cmd,
 					&cmd, high_priority);