Browse Source

qcacld-3.0: Use CM SM to get the roam sync state

Use the Connection Manager state machine to check if the
VDEV is currently in roam sync state. RSO states can be
changed dynamically based on the roaming configuration, whereas
the state machine would maintain the state.

Change-Id: Ic5c9a3a322febfe6b71f4684d5074dad599ecd37
CRs-Fixed: 3183191
Surya Prakash Sivaraj 2 years ago
parent
commit
f61aa78712

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

@@ -1052,6 +1052,16 @@ QDF_STATUS
 cm_roam_candidate_event_handler(struct wlan_objmgr_psoc *psoc,
 				struct roam_scan_candidate_frame *candidate);
 
+/** wlan_cm_is_roam_sync_in_progress() - Check if the vdev is in roam sync
+ * substate
+ *
+ * @psoc: psoc pointer
+ * @vdev_id: vdev_id
+ *
+ * Return: bool
+ */
+bool wlan_cm_is_roam_sync_in_progress(struct wlan_objmgr_psoc *psoc,
+				      uint8_t vdev_id);
 #else
 static inline
 void wlan_cm_roam_activate_pcl_per_vdev(struct wlan_objmgr_psoc *psoc,
@@ -1233,6 +1243,13 @@ cm_roam_sync_frame_event_handler(struct wlan_objmgr_psoc *psoc,
 {
 	return QDF_STATUS_SUCCESS;
 }
+
+static inline bool
+wlan_cm_is_roam_sync_in_progress(struct wlan_objmgr_psoc *psoc,
+				 uint8_t vdev_id)
+{
+	return false;
+}
 #endif /* WLAN_FEATURE_ROAM_OFFLOAD */
 
 #ifdef WLAN_FEATURE_FIPS

+ 19 - 0
components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_roam_api.c

@@ -3309,6 +3309,25 @@ err:
 	qdf_mem_free(stats_info);
 	return status;
 }
+
+bool wlan_cm_is_roam_sync_in_progress(struct wlan_objmgr_psoc *psoc,
+				      uint8_t vdev_id)
+{
+	struct wlan_objmgr_vdev *vdev;
+	bool ret;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
+						    WLAN_MLME_CM_ID);
+
+	if (!vdev)
+		return false;
+
+	ret = cm_is_vdev_roam_sync_inprogress(vdev);
+
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
+
+	return ret;
+}
 #else
 QDF_STATUS
 cm_roam_stats_event_handler(struct wlan_objmgr_psoc *psoc,

+ 1 - 1
core/hdd/src/wlan_hdd_assoc.c

@@ -1002,7 +1002,7 @@ void hdd_copy_he_operation(struct hdd_station_ctx *hdd_sta_ctx,
 
 bool hdd_is_roam_sync_in_progress(struct hdd_context *hdd_ctx, uint8_t vdev_id)
 {
-	return MLME_IS_ROAM_SYNCH_IN_PROGRESS(hdd_ctx->psoc, vdev_id);
+	return wlan_cm_is_roam_sync_in_progress(hdd_ctx->psoc, vdev_id);
 }
 
 void hdd_conn_remove_connect_info(struct hdd_station_ctx *sta_ctx)

+ 3 - 5
core/sme/src/qos/sme_qos.c

@@ -3564,9 +3564,7 @@ QDF_STATUS sme_qos_process_ft_reassoc_rsp_ev(struct mac_context *mac_ctx,
 				 csr_conn_info->nAssocReqLength +
 				 csr_conn_info->nAssocRspLength));
 
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	if (!MLME_IS_ROAM_SYNCH_IN_PROGRESS(mac_ctx->psoc, sessionid)) {
-#endif
+	if (!wlan_cm_is_roam_sync_in_progress(mac_ctx->psoc, sessionid)) {
 		for (ac = QCA_WLAN_AC_BE; ac < QCA_WLAN_AC_ALL; ac++) {
 			ac_info = &qos_session->ac_info[ac];
 			sme_qos_find_matching_tspec(mac_ctx, sessionid, ac,
@@ -3592,8 +3590,8 @@ QDF_STATUS sme_qos_process_ft_reassoc_rsp_ev(struct mac_context *mac_ctx,
 			}
 		} else
 			sme_debug("LFR3-11r ric_rsplen is zero or ric_data_desc is not present or wmmtspec is not present");
-	}
 #endif
+	}
 
 	/* Send the Aggregated QoS request to HAL */
 	status = sme_qos_ft_aggr_qos_req(mac_ctx, sessionid);
@@ -4486,7 +4484,7 @@ static bool sme_qos_ft_handoff_required(struct mac_context *mac,
 	csr_roam_session = CSR_GET_SESSION(mac, session_id);
 
 	if (csr_roam_session &&
-	    MLME_IS_ROAM_SYNCH_IN_PROGRESS(mac->psoc, session_id) &&
+	    wlan_cm_is_roam_sync_in_progress(mac->psoc, session_id) &&
 	    csr_roam_is_ese_assoc(mac, session_id) &&
 	    csr_roam_session->connectedInfo.nTspecIeLength)
 		return true;

+ 8 - 7
core/wma/src/wma_dev_if.c

@@ -1917,7 +1917,7 @@ QDF_STATUS wma_add_peer(tp_wma_handle wma,
 	if (peer_type == WMI_PEER_TYPE_TDLS)
 		cdp_peer_set_peer_as_tdls(dp_soc, vdev_id, peer_addr, true);
 
-	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma->psoc, vdev_id) ||
+	if (wlan_cm_is_roam_sync_in_progress(wma->psoc, vdev_id) ||
 	    MLME_IS_MLO_ROAM_SYNCH_IN_PROGRESS(wma->psoc, vdev_id)) {
 		wma_debug("LFR3: Created peer "QDF_MAC_ADDR_FMT" vdev_id %d, peer_count %d",
 			 QDF_MAC_ADDR_REF(peer_addr), vdev_id,
@@ -1996,7 +1996,7 @@ static void wma_cdp_peer_setup(tp_wma_handle wma,
 	    wlan_vdev_mlme_get_is_mlo_link(wma->psoc, vdev_id)) {
 		peer_info.is_first_link = 1;
 		peer_info.is_primary_link = 0;
-	} else if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma->psoc, vdev_id) &&
+	} else if (wlan_cm_is_roam_sync_in_progress(wma->psoc, vdev_id) &&
 		   wlan_vdev_mlme_get_is_mlo_vdev(wma->psoc, vdev_id)) {
 		peer_info.is_first_link = 0;
 		peer_info.is_primary_link = 1;
@@ -4851,8 +4851,8 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params)
 					      OL_TXRX_PEER_STATE_CONN);
 		}
 
-		if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma->psoc,
-						   params->smesessionId) ||
+		if (wlan_cm_is_roam_sync_in_progress(wma->psoc,
+						     params->smesessionId) ||
 		    MLME_IS_MLO_ROAM_SYNCH_IN_PROGRESS(wma->psoc,
 						       params->smesessionId)) {
 			/* iface->nss = params->nss; */
@@ -5050,7 +5050,8 @@ out:
 		  QDF_MAC_ADDR_REF(params->bssId), params->status);
 
 	/* Don't send a response during roam sync operation */
-	if (!MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma->psoc, params->smesessionId) &&
+	if (!wlan_cm_is_roam_sync_in_progress(wma->psoc,
+					      params->smesessionId) &&
 	    !MLME_IS_MLO_ROAM_SYNCH_IN_PROGRESS(wma->psoc,
 						params->smesessionId))
 		wma_send_msg_high_priority(wma, WMA_ADD_STA_RSP,
@@ -5450,7 +5451,7 @@ void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta)
 
 	switch (oper_mode) {
 	case BSS_OPERATIONAL_MODE_STA:
-		if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma->psoc, vdev_id) ||
+		if (wlan_cm_is_roam_sync_in_progress(wma->psoc, vdev_id) ||
 		    MLME_IS_MLO_ROAM_SYNCH_IN_PROGRESS(wma->psoc, vdev_id)) {
 			wma_debug("LFR3: Del STA on vdev_id %d", vdev_id);
 			qdf_mem_free(del_sta);
@@ -5729,7 +5730,7 @@ void wma_delete_bss(tp_wma_handle wma, uint8_t vdev_id)
 		qdf_mem_free(roam_scan_stats_req);
 	}
 
-	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma->psoc, vdev_id) ||
+	if (wlan_cm_is_roam_sync_in_progress(wma->psoc, vdev_id) ||
 	    MLME_IS_MLO_ROAM_SYNCH_IN_PROGRESS(wma->psoc, vdev_id)) {
 		roam_synch_in_progress = true;
 		wma_debug("LFR3: Setting vdev_up to FALSE for vdev:%d",

+ 2 - 2
core/wma/src/wma_features.c

@@ -3682,8 +3682,8 @@ int wma_update_tdls_peer_state(WMA_HANDLE handle,
 		goto end_tdls_peer_state;
 	}
 
-	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma_handle->psoc,
-					   peer_state->vdev_id)) {
+	if (wlan_cm_is_roam_sync_in_progress(wma_handle->psoc,
+					     peer_state->vdev_id)) {
 		wma_err("roaming in progress, reject peer update cmd!");
 		ret = -EPERM;
 		goto end_tdls_peer_state;