瀏覽代碼

qcacld-3.0: Notify peer disconnection to MLO when connection fails

MLO link peer fails to be detached if MLO peer state isn't set as
ML_PEER_DISCONN_INITIATED.
Notify peer disconnection to MLO when connection fails, which updates
MLO peer state to ML_PEER_DISCONN_INITIATED.

Change-Id: I0f044d12d7a8412757b76e1baccd71e146538afe
CRs-Fixed: 3053729
Bing Sun 3 年之前
父節點
當前提交
0a9fb23665

+ 2 - 0
core/mac/src/pe/lim/lim_api.c

@@ -79,6 +79,7 @@
 #include <qdf_hang_event_notifier.h>
 #include <qdf_notifier.h>
 #include "wlan_pkt_capture_ucfg_api.h"
+#include <lim_mlo.h>
 
 struct pe_hang_event_fixed_param {
 	uint16_t tlv_header;
@@ -2664,6 +2665,7 @@ pe_roam_synch_callback(struct mac_context *mac_ctx,
 		return status;
 	}
 	session_ptr->limSmeState = eLIM_SME_IDLE_STATE;
+	lim_mlo_notify_peer_disconn(session_ptr, curr_sta_ds);
 	lim_cleanup_rx_path(mac_ctx, curr_sta_ds, session_ptr, false);
 	lim_delete_dph_hash_entry(mac_ctx, curr_sta_ds->staAddr, aid,
 				  session_ptr);

+ 30 - 1
core/mac/src/pe/lim/lim_mlo.c

@@ -283,7 +283,7 @@ void lim_mlo_notify_peer_disconn(struct pe_session *pe_session,
 		return;
 	}
 
-	if (lim_is_mlo_conn(pe_session, sta_ds)) {
+	if (wlan_peer_mlme_flag_ext_get(peer, WLAN_PEER_FEXT_MLO)) {
 		if (wlan_vdev_mlme_is_mlo_ap(pe_session->vdev))
 			lim_mlo_update_cleanup_trigger(
 					pe_session, sta_ds,
@@ -294,6 +294,35 @@ void lim_mlo_notify_peer_disconn(struct pe_session *pe_session,
 	wlan_objmgr_peer_release_ref(peer, WLAN_LEGACY_MAC_ID);
 }
 
+void lim_mlo_sta_notify_peer_disconn(struct pe_session *pe_session)
+{
+	struct wlan_objmgr_peer *peer;
+	struct mac_context *mac_ctx;
+
+	if (!pe_session) {
+		pe_err("pe session is null");
+		return;
+	}
+	mac_ctx = pe_session->mac_ctx;
+	if (!mac_ctx) {
+		pe_err("mac context is null");
+		return;
+	}
+
+	peer = wlan_objmgr_get_peer_by_mac(mac_ctx->psoc,
+					   pe_session->bssId,
+					   WLAN_LEGACY_MAC_ID);
+	if (!peer) {
+		pe_err("peer is null");
+		return;
+	}
+
+	if (wlan_peer_mlme_flag_ext_get(peer, WLAN_PEER_FEXT_MLO))
+		wlan_mlo_partner_peer_disconnect_notify(peer);
+
+	wlan_objmgr_peer_release_ref(peer, WLAN_LEGACY_MAC_ID);
+}
+
 void lim_mlo_cleanup_partner_peer(struct wlan_objmgr_peer *peer)
 {
 	struct mac_context *mac_ctx;

+ 14 - 0
core/mac/src/pe/lim/lim_mlo.h

@@ -81,6 +81,15 @@ void lim_get_mlo_vdev_list(struct pe_session *session, uint16_t *vdev_count,
 void lim_mlo_notify_peer_disconn(struct pe_session *pe_session,
 				 tpDphHashNode sta_ds);
 
+/**
+ * lim_mlo_sta_notify_peer_disconn - trigger mlo to delete partner peer
+ *                                   This API is only for MLO STA.
+ * @pe_session: pe session
+ *
+ * Return: void
+ */
+void lim_mlo_sta_notify_peer_disconn(struct pe_session *pe_session);
+
 /**
  * lim_mlo_cleanup_partner_peer() - cleanup given peer which is partner peer
  *                                  of mlo connection.
@@ -226,6 +235,11 @@ static inline void lim_mlo_notify_peer_disconn(struct pe_session *pe_session,
 {
 }
 
+static inline void lim_mlo_sta_notify_peer_disconn(
+						struct pe_session *pe_session)
+{
+}
+
 static inline void lim_mlo_set_mld_mac_peer(
 				tpDphHashNode sta_ds,
 				uint8_t peer_mld_addr[QDF_MAC_ADDR_SIZE])

+ 2 - 0
core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c

@@ -45,6 +45,7 @@
 #include "wlan_mlme_twt_api.h"
 #include "wlan_mlme_ucfg_api.h"
 #include "wlan_connectivity_logging.h"
+#include <lim_mlo.h>
 
 /**
  * lim_update_stads_htcap() - Updates station Descriptor HT capability
@@ -1254,6 +1255,7 @@ lim_process_assoc_rsp_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_info,
 			session_entry->gUapsdPerAcDeliveryEnableMask = 0;
 			session_entry->gUapsdPerAcTriggerEnableMask = 0;
 
+			lim_mlo_notify_peer_disconn(session_entry, sta_ds);
 			if (lim_cleanup_rx_path(mac_ctx, sta_ds, session_entry,
 						true) != QDF_STATUS_SUCCESS) {
 				pe_err("Could not cleanup the rx path");

+ 2 - 0
core/mac/src/pe/lim/lim_process_mlm_host_roam.c

@@ -43,6 +43,7 @@
 #include "wma_if.h"
 #include "rrm_api.h"
 #include "wma.h"
+#include <lim_mlo.h>
 
 static void lim_handle_sme_reaasoc_result(struct mac_context *, tSirResultCodes,
 		uint16_t, struct pe_session *);
@@ -187,6 +188,7 @@ static void lim_handle_sme_reaasoc_result(struct mac_context *mac,
 				eLIM_JOIN_FAILURE;
 			sta->mlmStaContext.resultCode = resultCode;
 			sta->mlmStaContext.protStatusCode = protStatusCode;
+			lim_mlo_notify_peer_disconn(pe_session, sta);
 			lim_cleanup_rx_path(mac, sta, pe_session, true);
 			/* Cleanup if add bss failed */
 			if (pe_session->add_bss_failed) {

+ 3 - 0
core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c

@@ -1291,6 +1291,7 @@ QDF_STATUS lim_sta_handle_connect_fail(join_params *param)
 		 * make sure PE is sending eWNI_SME_JOIN_RSP
 		 * to SME
 		 */
+		lim_mlo_notify_peer_disconn(session, sta_ds);
 		lim_cleanup_rx_path(mac_ctx, sta_ds, session, true);
 		qdf_mem_free(session->lim_join_req);
 		session->lim_join_req = NULL;
@@ -1302,6 +1303,8 @@ QDF_STATUS lim_sta_handle_connect_fail(join_params *param)
 			goto error;
 		}
 		return QDF_STATUS_SUCCESS;
+	} else {
+		lim_mlo_sta_notify_peer_disconn(session);
 	}
 	qdf_mem_free(session->lim_join_req);
 	session->lim_join_req = NULL;

+ 1 - 0
core/wma/src/wma_dev_if.c

@@ -1926,6 +1926,7 @@ QDF_STATUS wma_add_peer(tp_wma_handle wma,
 	 */
 	if (peer_mld_addr &&
 	    !qdf_is_macaddr_zero((struct qdf_mac_addr *)peer_mld_addr)) {
+		wlan_peer_mlme_flag_ext_set(obj_peer, WLAN_PEER_FEXT_MLO);
 		wma_debug("peer " QDF_MAC_ADDR_FMT "is_assoc_peer%d mld mac " QDF_MAC_ADDR_FMT,
 			  QDF_MAC_ADDR_REF(peer_addr), is_assoc_peer,
 			  QDF_MAC_ADDR_REF(peer_mld_addr));