Browse Source

qcacld-3.0: Fix HO fail handling when received without roam start

If HO fail/ roam abort is received without any roam start indication
the roam command will not be present in connection manager, so
continue with cleanup even when roam command is not present in these
cases.

Change-Id: I0ff3307b4d4ba96cc3b0c413fd0a41be47e9c588
CRs-Fixed: 2948064
Utkarsh Bhatnagar 3 years ago
parent
commit
919f560858

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

@@ -944,7 +944,7 @@ static QDF_STATUS cm_handle_ho_fail(struct scheduler_msg *msg)
 	struct wlan_objmgr_vdev *vdev;
 	struct wlan_objmgr_pdev *pdev;
 	struct cnx_mgr *cm_ctx;
-	wlan_cm_id cm_id;
+	wlan_cm_id cm_id = CM_ID_INVALID;
 	struct reject_ap_info ap_info;
 	struct cm_roam_req *roam_req = NULL;
 
@@ -975,13 +975,11 @@ static QDF_STATUS cm_handle_ho_fail(struct scheduler_msg *msg)
 	}
 
 	roam_req = cm_get_first_roam_command(vdev);
-	if (!roam_req) {
-		mlme_err("Failed to find roam req from list");
-		status = QDF_STATUS_E_FAILURE;
-		goto error;
+	if (roam_req) {
+		mlme_debug("Roam req found, get cm id to remove it, before disconnect");
+		cm_id = roam_req->cm_id;
 	}
 
-	cm_id = roam_req->cm_id;
 	cm_sm_deliver_event(vdev, WLAN_CM_SM_EV_ROAM_HO_FAIL,
 			    sizeof(wlan_cm_id), &cm_id);
 

+ 15 - 23
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload_event.c

@@ -298,9 +298,9 @@ QDF_STATUS cm_fw_roam_abort_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id)
 	struct wlan_objmgr_pdev *pdev;
 	struct wlan_objmgr_vdev *vdev;
 	struct cnx_mgr *cm_ctx;
-	QDF_STATUS status;
+	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 	struct cm_roam_req *roam_req = NULL;
-	wlan_cm_id cm_id;
+	wlan_cm_id cm_id = CM_ID_INVALID;
 
 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
 						    WLAN_MLME_SB_ID);
@@ -309,33 +309,25 @@ QDF_STATUS cm_fw_roam_abort_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id)
 		return QDF_STATUS_E_NULL_VALUE;
 	}
 
-	cm_ctx = cm_get_cm_ctx(vdev);
-	if (!cm_ctx) {
-		status = QDF_STATUS_E_FAILURE;
-		goto rel_ref;
-	}
-	roam_req = cm_get_first_roam_command(vdev);
-	if (!roam_req) {
-		mlme_err("Failed to find roam req from list");
-		cm_id = CM_ID_INVALID;
-		status = QDF_STATUS_E_FAILURE;
-		goto end;
-	}
-
-	cm_id = roam_req->cm_id;
 	pdev = wlan_vdev_get_pdev(vdev);
 	if (!pdev) {
 		mlme_err("Failed to find pdev for vdev id %d",
-			 roam_req->req.vdev_id);
-		status = QDF_STATUS_E_FAILURE;
-		goto end;
+			 vdev_id);
+		goto rel_ref;
 	}
 
-	status = wlan_cm_roam_state_change(pdev,
-					   roam_req->req.vdev_id,
-					   WLAN_ROAM_RSO_ENABLED,
+	cm_ctx = cm_get_cm_ctx(vdev);
+	if (!cm_ctx)
+		goto rel_ref;
+
+	roam_req = cm_get_first_roam_command(vdev);
+	if (roam_req)
+		cm_id = roam_req->cm_id;
+
+	/* continue even if no roam command is found */
+	status = wlan_cm_roam_state_change(pdev, vdev_id, WLAN_ROAM_RSO_ENABLED,
 					   REASON_ROAM_ABORT);
-end:
+
 	cm_abort_fw_roam(cm_ctx, cm_id);
 rel_ref:
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_SB_ID);