Parcourir la source

qcacld-3.0: Handle MLO STA disconnect from south

Currently, southbound MLO disconnects are not handled properly because
the partner link is not being disconnected. To fix this, update
current calls to cm_disconnect to use mlo_disconnect instead, because it
can handle both legacy and MLO disconnections.

Change-Id: If908e2391290fd4a328f3d7d213c5ef6c1f5452c
CRs-fixed: 3029864
Lincoln Tran il y a 3 ans
Parent
commit
e3a6adfe58

+ 8 - 10
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_fw_sync.c

@@ -43,6 +43,7 @@
 #include "connection_mgr/core/src/wlan_cm_roam.h"
 #include "connection_mgr/core/src/wlan_cm_main.h"
 #include "connection_mgr/core/src/wlan_cm_sm.h"
+#include <wlan_mlo_mgr_sta.h>
 
 QDF_STATUS cm_fw_roam_sync_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 			       void *event, uint32_t event_data_len)
@@ -880,8 +881,8 @@ QDF_STATUS cm_fw_roam_complete(struct cnx_mgr *cm_ctx, void *data)
 	 * or disconnect the AP.
 	 */
 	if (wlan_reg_is_disable_for_freq(pdev, roam_synch_data->chan_freq)) {
-		cm_disconnect(psoc, vdev_id, CM_ROAM_DISCONNECT,
-			      REASON_OPER_CHANNEL_BAND_CHANGE, NULL);
+		mlo_disconnect(cm_ctx->vdev, CM_ROAM_DISCONNECT,
+			       REASON_OPER_CHANNEL_BAND_CHANGE, NULL);
 		status = QDF_STATUS_E_FAILURE;
 		goto end;
 	}
@@ -987,10 +988,9 @@ QDF_STATUS cm_fw_roam_invoke_fail(struct wlan_objmgr_psoc *psoc,
 
 	if (source == CM_ROAMING_HOST ||
 	    source == CM_ROAMING_NUD_FAILURE)
-		status = cm_disconnect(psoc, vdev_id,
-				       CM_ROAM_DISCONNECT,
-				       REASON_USER_TRIGGERED_ROAM_FAILURE,
-				       NULL);
+		status = mlo_disconnect(vdev, CM_ROAM_DISCONNECT,
+					REASON_USER_TRIGGERED_ROAM_FAILURE,
+					NULL);
 
 error:
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_SB_ID);
@@ -1086,10 +1086,8 @@ static QDF_STATUS cm_handle_ho_fail(struct scheduler_msg *msg)
 			    DEBUG_ROAM_SYNCH_FAIL,
 			    DEBUG_INVALID_PEER_ID, NULL, NULL, 0, 0);
 
-	status = cm_disconnect(ind->psoc, ind->vdev_id,
-			       CM_MLME_DISCONNECT,
-			       REASON_FW_TRIGGERED_ROAM_FAILURE,
-			       NULL);
+	status = mlo_disconnect(vdev, CM_MLME_DISCONNECT,
+				REASON_FW_TRIGGERED_ROAM_FAILURE, NULL);
 
 	if (mlme_obj->cfg.gen.fatal_event_trigger)
 		cds_flush_logs(WLAN_LOG_TYPE_FATAL,

+ 2 - 2
components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_connect.c

@@ -33,6 +33,7 @@
 #include "wlan_logging_sock_svc.h"
 #include "cfg_ucfg_api.h"
 #include "wlan_roam_debug.h"
+#include "wlan_mlo_mgr_sta.h"
 
 #ifdef WLAN_FEATURE_FILS_SK
 void cm_update_hlp_info(struct wlan_objmgr_vdev *vdev,
@@ -87,8 +88,7 @@ static void
 wlan_cm_disconnect_on_wait_key_timeout(struct wlan_objmgr_psoc *psoc,
 				       struct wlan_objmgr_vdev *vdev)
 {
-	cm_disconnect(psoc, vdev->vdev_objmgr.vdev_id, CM_MLME_DISCONNECT,
-		      REASON_KEY_TIMEOUT, NULL);
+	mlo_disconnect(vdev, CM_MLME_DISCONNECT, REASON_KEY_TIMEOUT, NULL);
 }
 
 void cm_wait_for_key_time_out_handler(void *data)

+ 16 - 4
components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_disconnect.c

@@ -31,6 +31,7 @@
 #include <wlan_cm_roam_api.h>
 #include "wni_api.h"
 #include "connection_mgr/core/src/wlan_cm_roam.h"
+#include <wlan_mlo_mgr_sta.h>
 
 static void cm_abort_connect_request_timers(struct wlan_objmgr_vdev *vdev)
 {
@@ -286,17 +287,28 @@ QDF_STATUS cm_send_sb_disconnect_req(struct scheduler_msg *msg)
 {
 	struct cm_vdev_discon_ind *ind;
 	QDF_STATUS status;
+	struct wlan_objmgr_vdev *vdev;
 
 	if (!msg || !msg->bodyptr)
 		return QDF_STATUS_E_FAILURE;
 
 	ind = msg->bodyptr;
 
-	status = cm_disconnect(ind->psoc, ind->disconnect_param.vdev_id,
-			       ind->disconnect_param.source,
-			       ind->disconnect_param.reason_code,
-			       &ind->disconnect_param.bssid);
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(ind->psoc,
+						ind->disconnect_param.vdev_id,
+						WLAN_MLME_CM_ID);
+
+	if (!vdev) {
+		mlme_err("vdev_id: %d: vdev not found",
+			 ind->disconnect_param.vdev_id);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	status = mlo_disconnect(vdev, ind->disconnect_param.source,
+				ind->disconnect_param.reason_code,
+				&ind->disconnect_param.bssid);
 	qdf_mem_free(ind);
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
 
 	return status;
 }

+ 13 - 2
core/sme/src/common/sme_api.c

@@ -76,6 +76,7 @@
 #include <wlan_mlme_twt_api.h>
 #include "wlan_cm_roam_ucfg_api.h"
 #include <cm_utf.h>
+#include <wlan_mlo_mgr_sta.h>
 
 static QDF_STATUS init_sme_cmd_list(struct mac_context *mac);
 
@@ -5594,6 +5595,7 @@ static void sme_disconnect_connected_sessions(struct mac_context *mac_ctx,
 	uint8_t vdev_id, found = false;
 	qdf_freq_t chan_freq;
 	enum QDF_OPMODE op_mode;
+	struct wlan_objmgr_vdev *vdev;
 
 	for (vdev_id = 0; vdev_id < WLAN_MAX_VDEVS; vdev_id++) {
 		op_mode = wlan_get_opmode_from_vdev_id(mac_ctx->pdev, vdev_id);
@@ -5613,8 +5615,17 @@ static void sme_disconnect_connected_sessions(struct mac_context *mac_ctx,
 		if (!found) {
 			sme_debug("Disconnect Session: %d", vdev_id);
 			/* do not call cm disconnect while holding Sme lock */
-			cm_disconnect(mac_ctx->psoc, vdev_id,
-				      CM_MLME_DISCONNECT, reason, NULL);
+			vdev = wlan_objmgr_get_vdev_by_id_from_psoc(
+							mac_ctx->psoc,
+							vdev_id,
+							WLAN_LEGACY_SME_ID);
+			if (!vdev) {
+				sme_err("vdev object is NULL for vdev_id %d",
+					vdev_id);
+				return;
+			}
+			mlo_disconnect(vdev, CM_MLME_DISCONNECT, reason, NULL);
+			wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
 		}
 	}
 }