Browse Source

qcacld-3.0: Fix whunt reassoc TC with ROAM_OFFLOAD_V1

Fix whunt reassoc TC with ROAM_OFFLOAD_V1.

Change-Id: I020b9c7f5a0da8ae8cf17e875bf1f40db240ca0c
CRs-Fixed: 2769761
Abhishek Singh 4 years ago
parent
commit
8d182461d5

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

@@ -1172,7 +1172,6 @@ cm_roam_switch_to_roam_sync(struct wlan_objmgr_pdev *pdev,
 			    uint8_t reason)
 {
 	struct wlan_objmgr_psoc *psoc = wlan_pdev_get_psoc(pdev);
-	struct wlan_objmgr_vdev *vdev;
 	enum roam_offload_state cur_state = mlme_get_roam_state(psoc, vdev_id);
 
 	switch (cur_state) {
@@ -1183,9 +1182,7 @@ cm_roam_switch_to_roam_sync(struct wlan_objmgr_pdev *pdev,
 		 * deauth roam trigger to stop data path queues
 		 */
 	case WLAN_ROAMING_IN_PROG:
-		vdev = wlan_objmgr_get_vdev_by_id_from_pdev(pdev, vdev_id,
-							    WLAN_MLME_NB_ID);
-		if (!wlan_vdev_is_up(vdev)) {
+		if (!wlan_cm_is_sta_connected(vdev_id)) {
 			mlme_err("ROAM: STA not in connected state");
 			return QDF_STATUS_E_FAILURE;
 		}

+ 9 - 0
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_api.h

@@ -140,6 +140,15 @@ void wlan_cm_send_beacon_miss(uint8_t vdev_id, int32_t rssi);
  */
 QDF_STATUS
 wlan_cm_roam_neighbor_proceed_with_handoff_req(uint8_t vdev_id);
+
+/**
+ * wlan_cm_is_sta_connected() - check if STA is connected
+ * @vdev_id: vdev id
+ *
+ * Return: bool
+ */
+bool wlan_cm_is_sta_connected(uint8_t vdev_id);
+
 #else
 static inline QDF_STATUS
 wlan_cm_enable_roaming_on_connected_sta(struct wlan_objmgr_pdev *pdev,

+ 9 - 3
components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_roam_api.c

@@ -477,6 +477,7 @@ QDF_STATUS wlan_cm_roam_cfg_get_value(struct wlan_objmgr_psoc *psoc,
 	struct wlan_objmgr_vdev *vdev;
 	struct mlme_legacy_priv *mlme_priv;
 	struct wlan_cm_rso_configs *src_config;
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
 						    WLAN_MLME_NB_ID);
@@ -505,12 +506,13 @@ QDF_STATUS wlan_cm_roam_cfg_get_value(struct wlan_objmgr_psoc *psoc,
 		break;
 	default:
 		mlme_err("Invalid roam config requested:%d", roam_cfg_type);
-		return QDF_STATUS_E_FAILURE;
+		status = QDF_STATUS_E_FAILURE;
+		break;
 	}
 
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
 
-	return QDF_STATUS_E_FAILURE;
+	return status;
 }
 
 QDF_STATUS
@@ -521,6 +523,7 @@ wlan_cm_roam_cfg_set_value(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 	struct wlan_objmgr_vdev *vdev;
 	struct mlme_legacy_priv *mlme_priv;
 	struct wlan_cm_rso_configs *dst_config;
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
 						    WLAN_MLME_NB_ID);
@@ -549,10 +552,13 @@ wlan_cm_roam_cfg_set_value(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 		break;
 	default:
 		mlme_err("Invalid roam config requested:%d", roam_cfg_type);
+		status = QDF_STATUS_E_FAILURE;
+		break;
 	}
+
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
 
-	return QDF_STATUS_SUCCESS;
+	return status;
 }
 #endif
 

+ 19 - 0
core/sme/src/csr/csr_api_roam.c

@@ -20753,6 +20753,11 @@ csr_cm_roam_offload_11k_params(struct mac_context *mac_ctx,
 	csr_update_11k_offload_params(mac_ctx, session, params, enabled);
 }
 
+/*
+ * Below wlan_cm_roam_* and all csr_cm_roam_* APIs will move to component once
+ * conenction manager is converged.
+ */
+
 QDF_STATUS
 wlan_cm_roam_fill_start_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 			    struct wlan_roam_start_config *req, uint8_t reason)
@@ -20941,6 +20946,20 @@ wlan_cm_roam_neighbor_proceed_with_handoff_req(uint8_t vdev_id)
 
 	return csr_neighbor_roam_proceed_with_handoff_req(mac_ctx, vdev_id);
 }
+
+bool wlan_cm_is_sta_connected(uint8_t vdev_id)
+{
+	struct mac_context *mac_ctx;
+
+	mac_ctx = sme_get_mac_context();
+	if (!mac_ctx) {
+		sme_err("mac_ctx is NULL");
+		return false;
+	}
+
+	return CSR_IS_ROAM_JOINED(mac_ctx, vdev_id);
+}
+
 #endif
 
 QDF_STATUS