Parcourir la source

qcacld-3.0: Cleanup CSR/LIM for Roam sync indication failure in CSR

Currently, failure in csr_roam_synch_cb is not handled, therefore
failure during roam sync indication processing in CSR, leads to
out-of-sync between LIM and CSR sessions.

Handle the failure in csr_roam_synch_cb, by aborting the
roam complete notification to FW, and then process HO failure from
FW to cleanup LIM and CSR which will hold different BSSID profile.

Use vdev id instead of BSSID to retrieve/delete the LIM session.

Change-Id: I5ff2280e7ba1a8cb8e44c0c6b70647bf12b6ef31
CRs-Fixed: 3046370
Surya Prakash Sivaraj il y a 3 ans
Parent
commit
2846627650

+ 6 - 1
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_fw_sync.c

@@ -798,7 +798,12 @@ cm_fw_roam_sync_propagation(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 	cm_update_scan_db_on_roam_success(vdev, connect_rsp,
 					  roam_synch_data, cm_id);
 
-	cm_csr_connect_rsp(vdev, rsp);
+	status = cm_csr_connect_rsp(vdev, rsp);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		mlme_err("Roam sync propagation failed, abort roaming");
+		goto error;
+	}
+
 	cm_process_roam_keys(vdev, rsp, cm_id);
 
 	mlme_cm_osif_connect_complete(vdev, connect_rsp);

+ 4 - 0
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c

@@ -3613,6 +3613,10 @@ cm_roam_switch_to_rso_enable(struct wlan_objmgr_pdev *pdev,
 
 		return QDF_STATUS_SUCCESS;
 	case WLAN_ROAM_SYNCH_IN_PROG:
+		if (reason == REASON_ROAM_ABORT) {
+			mlme_debug("Roam synch in progress, drop Roam abort");
+			return QDF_STATUS_SUCCESS;
+		}
 		/*
 		 * After roam sych propagation is complete, send
 		 * RSO start command to firmware to update AP profile,

+ 11 - 2
core/mac/src/pe/lim/lim_api.c

@@ -2064,11 +2064,16 @@ lim_roam_fill_bss_descr(struct mac_context *mac,
 		qdf_mem_free(parsed_frm_ptr);
 		return QDF_STATUS_E_FAILURE;
 	}
-	pe_debug("LFR3:Beacon/Prb Rsp: %d bssid "QDF_MAC_ADDR_FMT" beacon "QDF_MAC_ADDR_FMT,
+	pe_debug("LFR3:Beacon/Prb Rsp: %d len %d bssid "QDF_MAC_ADDR_FMT" beacon "QDF_MAC_ADDR_FMT,
 		 roam_synch_ind_ptr->isBeacon,
+		 roam_synch_ind_ptr->beaconProbeRespLength,
 		 QDF_MAC_ADDR_REF(roam_synch_ind_ptr->bssid.bytes),
 		 QDF_MAC_ADDR_REF(mac_hdr->bssId));
 
+	QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
+			   bcn_proberesp_ptr,
+			   roam_synch_ind_ptr->beaconProbeRespLength);
+
 	status = lim_roam_gen_beacon_descr(mac,
 					   roam_synch_ind_ptr,
 					   parsed_frm_ptr,
@@ -2149,12 +2154,16 @@ lim_roam_fill_bss_descr(struct mac_context *mac,
 	pe_debug("chan: %d rssi: %d ie_len %d",
 		 bss_desc_ptr->chan_freq,
 		 bss_desc_ptr->rssi, ie_len);
+
+	qdf_mem_free(parsed_frm_ptr);
 	if (ie_len) {
 		qdf_mem_copy(&bss_desc_ptr->ieFields,
 			     ie, ie_len);
 		qdf_mem_free(ie);
+	} else {
+		pe_err("Beacon/Probe rsp doesn't have any IEs");
+		return QDF_STATUS_E_FAILURE;
 	}
-	qdf_mem_free(parsed_frm_ptr);
 	return QDF_STATUS_SUCCESS;
 }
 

+ 6 - 3
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -7897,13 +7897,16 @@ QDF_STATUS wlan_parse_bss_description_ies(struct mac_context *mac_ctx,
 {
 	int ie_len = wlan_get_ielen_from_bss_description(bss_desc);
 
-	if (ie_len <= 0 || !ie_struct)
+	if (ie_len <= 0 || !ie_struct) {
+		pe_err("BSS description has invalid IE : %d", ie_len);
 		return QDF_STATUS_E_FAILURE;
-
+	}
 	if (DOT11F_FAILED(dot11f_unpack_beacon_i_es
 			  (mac_ctx, (uint8_t *)bss_desc->ieFields,
-			  ie_len, ie_struct, false)))
+			  ie_len, ie_struct, false))) {
+		pe_err("Beacon IE parsing failed");
 		return QDF_STATUS_E_FAILURE;
+	}
 
 	return QDF_STATUS_SUCCESS;
 }

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

@@ -4415,7 +4415,6 @@ csr_roam_chk_lnk_disassoc_ind(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr)
 {
 	struct csr_roam_session *session;
 	uint32_t sessionId = WLAN_UMAC_VDEV_ID_MAX;
-	QDF_STATUS status;
 	struct disassoc_ind *pDisassocInd;
 
 	/*
@@ -4424,11 +4423,14 @@ csr_roam_chk_lnk_disassoc_ind(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr)
 	 * the WmStatusChange requests is pushed and processed
 	 */
 	pDisassocInd = (struct disassoc_ind *)msg_ptr;
-	status = csr_roam_get_session_id_from_bssid(mac_ctx,
-				&pDisassocInd->bssid, &sessionId);
-	if (!QDF_IS_STATUS_SUCCESS(status)) {
-		sme_err("Session Id not found for BSSID "QDF_MAC_ADDR_FMT,
-			QDF_MAC_ADDR_REF(pDisassocInd->bssid.bytes));
+	sessionId = pDisassocInd->vdev_id;
+	sme_debug("Disassoc Indication from MAC for vdev_id %d bssid " QDF_MAC_ADDR_FMT,
+		  pDisassocInd->vdev_id,
+		  QDF_MAC_ADDR_REF(pDisassocInd->bssid.bytes));
+
+	if (!CSR_IS_SESSION_VALID(mac_ctx, sessionId)) {
+		sme_err("vdev:%d Invalid session. BSSID: " QDF_MAC_ADDR_FMT,
+			sessionId, QDF_MAC_ADDR_REF(pDisassocInd->bssid.bytes));
 
 		return;
 	}
@@ -4460,7 +4462,6 @@ csr_roam_chk_lnk_deauth_ind(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr)
 {
 	struct csr_roam_session *session;
 	uint32_t sessionId = WLAN_UMAC_VDEV_ID_MAX;
-	QDF_STATUS status;
 	struct deauth_ind *pDeauthInd;
 
 	pDeauthInd = (struct deauth_ind *)msg_ptr;
@@ -4468,11 +4469,13 @@ csr_roam_chk_lnk_deauth_ind(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr)
 		  pDeauthInd->vdev_id,
 		  QDF_MAC_ADDR_REF(pDeauthInd->bssid.bytes));
 
-	status = csr_roam_get_session_id_from_bssid(mac_ctx,
-						   &pDeauthInd->bssid,
-						   &sessionId);
-	if (!QDF_IS_STATUS_SUCCESS(status))
+	sessionId = pDeauthInd->vdev_id;
+	if (!CSR_IS_SESSION_VALID(mac_ctx, sessionId)) {
+		sme_err("vdev %d: Invalid session BSSID: " QDF_MAC_ADDR_FMT,
+			pDeauthInd->vdev_id,
+			QDF_MAC_ADDR_REF(pDeauthInd->bssid.bytes));
 		return;
+	}
 
 	if (csr_is_deauth_disassoc_already_active(mac_ctx, sessionId,
 	    pDeauthInd->peer_macaddr))