Parcourir la source

qcacld-3.0: Fix few roaming issue for wake lock and scan

Reset scan reject params on roam abort and also if connect
lead to roam invoke release the wake lock as we do in legacy
case, if required roam invoke can use new wake lock.

Change-Id: Ieb870e2598687a1418e896d761f19a198a03a98f
CRs-Fixed: 2929311
Utkarsh Bhatnagar il y a 4 ans
Parent
commit
955173c481

+ 7 - 4
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload_event.c

@@ -36,6 +36,7 @@
 #include "connection_mgr/core/src/wlan_cm_roam.h"
 #include "connection_mgr/core/src/wlan_cm_sm.h"
 #include "connection_mgr/core/src/wlan_cm_main_api.h"
+
 #define FW_ROAM_SYNC_TIMEOUT 7000
 
 static QDF_STATUS
@@ -89,6 +90,7 @@ QDF_STATUS cm_abort_fw_roam(struct cnx_mgr *cm_ctx,
 {
 	QDF_STATUS status;
 
+	mlme_cm_osif_roam_abort_ind(cm_ctx->vdev);
 	status = cm_sm_deliver_event(cm_ctx->vdev,
 				     WLAN_CM_SM_EV_ROAM_ABORT,
 				     sizeof(wlan_cm_id), &cm_id);
@@ -308,6 +310,10 @@ QDF_STATUS cm_fw_roam_abort_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id)
 	}
 
 	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");
@@ -325,16 +331,13 @@ QDF_STATUS cm_fw_roam_abort_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id)
 		goto end;
 	}
 
-	mlme_cm_osif_roam_abort_ind(cm_ctx->vdev);
 	status = wlan_cm_roam_state_change(pdev,
 					   roam_req->req.vdev_id,
 					   WLAN_ROAM_RSO_ENABLED,
 					   REASON_ROAM_ABORT);
-
-	if (QDF_IS_STATUS_ERROR(status))
-		goto end;
 end:
 	cm_abort_fw_roam(cm_ctx, cm_id);
+rel_ref:
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_SB_ID);
 
 	return status;

+ 8 - 1
components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_roam_api.c

@@ -295,8 +295,10 @@ release_ref:
 
 bool wlan_cm_roaming_in_progress(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id)
 {
+#ifndef FEATURE_CM_ENABLE
 	struct wlan_objmgr_psoc *psoc = wlan_pdev_get_psoc(pdev);
 	QDF_STATUS status;
+#endif
 	bool roaming_in_progress = false;
 	struct wlan_objmgr_vdev *vdev;
 
@@ -307,6 +309,10 @@ bool wlan_cm_roaming_in_progress(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id)
 		return roaming_in_progress;
 	}
 
+	/* this is temp change will be removed in near future */
+#ifdef FEATURE_CM_ENABLE
+	roaming_in_progress = wlan_cm_is_vdev_roaming(vdev);
+#else
 	status = cm_roam_acquire_lock(vdev);
 	if (QDF_IS_STATUS_ERROR(status))
 		goto release_ref;
@@ -318,8 +324,9 @@ bool wlan_cm_roaming_in_progress(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id)
 		roaming_in_progress = true;
 
 	cm_roam_release_lock(vdev);
-
 release_ref:
+#endif
+
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
 
 	return roaming_in_progress;

+ 8 - 3
core/hdd/src/wlan_hdd_cm_connect.c

@@ -405,9 +405,14 @@ int wlan_hdd_cm_connect(struct wiphy *wiphy,
 
 	status = osif_cm_connect(ndev, vdev, req, &params);
 
-	if (status) {
-		hdd_err("Vdev %d connect failed status %d",
-			adapter->vdev_id, status);
+	if (status || ucfg_cm_is_vdev_roaming(vdev)) {
+		/* Release suspend and wake lock for failure or roam invoke */
+		if (status)
+			hdd_err("Vdev %d connect failed status %d",
+				adapter->vdev_id, status);
+		else
+			hdd_debug("Vdev %d: connect lead to roam invoke",
+				  adapter->vdev_id);
 		qdf_runtime_pm_allow_suspend(&hdd_ctx->runtime_context.connect);
 		hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_CONNECT);
 	}

+ 6 - 0
core/hdd/src/wlan_hdd_cm_disconnect.c

@@ -366,8 +366,14 @@ QDF_STATUS hdd_cm_netif_queue_control(struct wlan_objmgr_vdev *vdev,
 
 QDF_STATUS hdd_cm_napi_serialize_control(bool action)
 {
+	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
+
 	hdd_napi_serialize(action);
 
+	/* reinit scan reject parms for napi off (roam abort/ho fail) */
+	if (!action)
+		hdd_init_scan_reject_params(hdd_ctx);
+
 	return QDF_STATUS_SUCCESS;
 }