Răsfoiți Sursa

qcacld-3.0: MLO connection

Fixes for Mlo connection.

Change-Id: Ieb879245cab340a952a6f89265fb01960fa8c691
CRs-Fixed: 3029685
Bapiraju Alla 3 ani în urmă
părinte
comite
ec1b963bb9

+ 3 - 3
core/mac/src/pe/lim/lim_mlo.c

@@ -99,7 +99,7 @@ struct pe_session *pe_find_partner_session_by_link_id(
 		return NULL;
 	}
 
-	vdev = mlo_get_partner_vdev_by_link_id(session->vdev, link_id);
+	vdev = mlo_get_vdev_by_link_id(session->vdev, link_id);
 
 	if (!vdev) {
 		pe_err("vdev is null");
@@ -515,7 +515,7 @@ void lim_mlo_ap_sta_assoc_suc(struct wlan_objmgr_peer *peer)
 	}
 	sta = dph_lookup_hash_entry(mac, peer->macaddr, &aid,
 				    &pe_session->dph.dphHashTable);
-	if (!sta_ds) {
+	if (!sta) {
 		pe_err("sta ds is null");
 		return;
 	}
@@ -644,7 +644,7 @@ void lim_mlo_ap_sta_assoc_fail(struct wlan_objmgr_peer *peer)
 	}
 	sta = dph_lookup_hash_entry(mac, peer->macaddr, &aid,
 				    &pe_session->dph.dphHashTable);
-	if (!sta_ds) {
+	if (!sta) {
 		pe_err("sta ds is null");
 		return;
 	}

+ 3 - 8
core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c

@@ -752,10 +752,12 @@ static void lim_update_ml_partner_info(struct pe_session *session_entry,
 	if (!assoc_rsp || !session_entry)
 		return;
 
+	session_entry->ml_partner_info.num_partner_links =
+				     assoc_rsp->mlo_ie.mlo_ie.num_sta_profile;
 	ie = assoc_rsp->mlo_ie.mlo_ie;
 	partner_info = session_entry->ml_partner_info;
 
-	partner_info.num_partner_links = mlo_ie.num_sta_profile;
+	partner_info.num_partner_links = ie.num_sta_profile;
 	pe_err("copying partner info from join req to join rsp, num_partner_links %d",
 	       partner_info.num_partner_links);
 
@@ -1289,13 +1291,6 @@ lim_process_assoc_rsp_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_info,
 			beacon,
 			&session_entry->lim_join_req->bssDescription, true,
 			 session_entry)) {
-#ifdef WLAN_FEATURE_11BE_MLO
-		if (wlan_vdev_mlme_is_mlo_link_vdev(session_entry->vdev)) {
-			pe_err("sending assoc cnf for MLO link vdev");
-			lim_post_sme_message(mac_ctx, LIM_MLM_ASSOC_CNF,
-					     (uint32_t *)&assoc_cnf);
-		}
-#endif
 		clean_up_ft_sha384(assoc_rsp, sha384_akm);
 		qdf_mem_free(assoc_rsp);
 		qdf_mem_free(beacon);

+ 7 - 2
core/mac/src/pe/lim/lim_process_mlm_req_messages.c

@@ -45,6 +45,7 @@
 #include "wlan_objmgr_vdev_obj.h"
 #include <wlan_cm_api.h>
 #include <lim_mlo.h>
+#include "wlan_mlo_mgr_peer.h"
 
 static void lim_process_mlm_auth_req(struct mac_context *, uint32_t *);
 static void lim_process_mlm_assoc_req(struct mac_context *, uint32_t *);
@@ -389,7 +390,7 @@ void lim_send_peer_create_resp(struct mac_context *mac, uint8_t vdev_id,
 {
 	struct wlan_objmgr_vdev *vdev;
 #ifdef WLAN_FEATURE_11BE_MLO
-	struct wlan_objmgr_peer *link_peer;
+	struct wlan_objmgr_peer *link_peer = NULL;
 	uint8_t link_id;
 	struct mlo_partner_info partner_info;
 #endif
@@ -411,6 +412,9 @@ void lim_send_peer_create_resp(struct mac_context *mac, uint8_t vdev_id,
 		     vdev->vdev_mlme.macaddr,
 		     QDF_MAC_ADDR_SIZE);
 	partner_info.partner_link_info[0].link_id = link_id;
+	pe_debug("link_addr " QDF_MAC_ADDR_FMT,
+		 QDF_MAC_ADDR_REF(
+			partner_info.partner_link_info[0].link_addr.bytes));
 
 	if (QDF_IS_STATUS_SUCCESS(status)) {
 		/* Get the bss peer obj */
@@ -428,9 +432,10 @@ void lim_send_peer_create_resp(struct mac_context *mac, uint8_t vdev_id,
 
 		if (QDF_IS_STATUS_ERROR(status))
 			pe_err("Peer creation failed");
+
+		wlan_objmgr_peer_release_ref(link_peer, WLAN_LEGACY_MAC_ID);
 	}
 end:
-	wlan_objmgr_peer_release_ref(link_peer, WLAN_LEGACY_MAC_ID);
 #endif
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID);
 }

+ 25 - 12
core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c

@@ -1505,6 +1505,15 @@ void lim_process_sta_mlm_add_sta_rsp(struct mac_context *mac_ctx,
 		MTRACE(mac_trace(mac_ctx, TRACE_CODE_MLM_STATE,
 			session_entry->peSessionId,
 			session_entry->limMlmState));
+#ifdef WLAN_FEATURE_11BE_MLO
+		if (wlan_vdev_mlme_is_mlo_link_vdev(session_entry->vdev)) {
+			pe_err("sending assoc cnf for MLO link vdev");
+			mlm_assoc_cnf.resultCode = eSIR_SME_SUCCESS;
+			mlm_assoc_cnf.sessionId = session_entry->peSessionId;
+			lim_post_sme_message(mac_ctx, LIM_MLM_ASSOC_CNF,
+					     (uint32_t *)&mlm_assoc_cnf);
+		}
+#endif
 
 #ifdef WLAN_DEBUG
 		mac_ctx->lim.gLimNumLinkEsts++;
@@ -2731,14 +2740,16 @@ static void lim_process_switch_channel_join_req(
  */
 #ifdef WLAN_FEATURE_11BE_MLO
 	if (wlan_vdev_mlme_is_mlo_link_vdev(session_entry->vdev)) {
-		struct element_info *assoc_rsp = NULL;
+		struct element_info assoc_rsp;
 		struct qdf_mac_addr sta_link_addr;
 
+		pe_err("sta_link_addr" QDF_MAC_ADDR_FMT,
+		       QDF_MAC_ADDR_REF(&sta_link_addr));
+		assoc_rsp.len = 0;
 		mlo_get_assoc_rsp(session_entry->vdev, &assoc_rsp);
-		if (!assoc_rsp)
-			goto error;
 
-		if (!session_entry->ml_partner_info.num_partner_links) {
+		if (!session_entry->lim_join_req->
+					partner_info.num_partner_links) {
 			pe_debug("MLO: num_partner_links is 0");
 			goto error;
 		}
@@ -2746,8 +2757,6 @@ static void lim_process_switch_channel_join_req(
 		qdf_mem_copy(&sta_link_addr, session_entry->self_mac_addr,
 			     QDF_MAC_ADDR_SIZE);
 
-		pe_debug("MLO: assoc rsp len %d ", assoc_rsp.len);
-
 		if (assoc_rsp.len) {
 			struct element_info link_assoc_rsp;
 			tLimMlmJoinCnf mlm_join_cnf;
@@ -2766,20 +2775,24 @@ static void lim_process_switch_channel_join_req(
 			link_assoc_rsp.ptr = qdf_mem_malloc(assoc_rsp.len);
 			if (!link_assoc_rsp.ptr)
 				return;
-			link_assoc_rsp.len = assoc_rsp.len;
+
+			link_assoc_rsp.len = assoc_rsp.len + 24;
 			session_entry->limMlmState = eLIM_MLM_WT_ASSOC_RSP_STATE;
 			pe_debug("MLO: Generate and process assoc rsp for link vdev");
 
-			if (QDF_IS_STATUS_SUCCESS(util_gen_link_assoc_rsp(assoc_rsp.ptr,
-									  assoc_rsp.len,
-									  sta_link_addr,
-									  link_assoc_rsp.ptr)))
+			if (QDF_IS_STATUS_SUCCESS(
+				util_gen_link_assoc_rsp(assoc_rsp.ptr,
+							assoc_rsp.len,
+							sta_link_addr,
+							link_assoc_rsp.ptr))) {
+				pe_debug("MLO: process assoc rsp for link vdev");
 				lim_process_assoc_rsp_frame(mac_ctx,
 							    link_assoc_rsp.ptr,
 							    link_assoc_rsp.len,
 							    LIM_ASSOC,
 							    session_entry);
-			qdf_mem_free(link_assoc_rsp.ptr);
+				qdf_mem_free(link_assoc_rsp.ptr);
+			}
 		}
 		return;
 	}

+ 7 - 0
core/mac/src/pe/lim/lim_send_management_frames.c

@@ -437,6 +437,8 @@ lim_send_probe_req_mgmt_frame(struct mac_context *mac_ctx,
 		      vdev_id, mac_ctx->mgmtSeqNum,
 		      QDF_MAC_ADDR_REF(bssid),
 		      (int)sizeof(tSirMacMgmtHdr) + payload);
+	qdf_trace_hex_dump(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, frame,
+			   sizeof(tSirMacMgmtHdr) + payload);
 
 	/* If this probe request is sent during P2P Search State, then we need
 	 * to send it at OFDM rate.
@@ -1585,6 +1587,11 @@ lim_send_assoc_rsp_mgmt_frame(struct mac_context *mac_ctx,
 						      &frm.eht_op);
 		}
 
+#ifdef WLAN_FEATURE_11BE_MLO
+		populate_dot11f_assoc_rsp_mlo_ie(mac_ctx, pe_session,
+						 sta, &frm);
+ #endif
+
 		if (status_code == STATUS_ASSOC_REJECTED_TEMPORARILY) {
 			max_retries =
 			mac_ctx->mlme_cfg->gen.pmf_sa_query_max_retries;

+ 11 - 10
core/mac/src/pe/lim/lim_send_sme_rsp_messages.c

@@ -388,19 +388,20 @@ static void lim_copy_ml_partner_info(struct cm_vdev_join_rsp *rsp,
 				     struct pe_session *pe_session)
 {
 	int i;
-	struct mlo_partner_info partner_info;
-	struct mlo_partner_info rsp_partner_info;
+	struct mlo_partner_info *partner_info;
+	struct mlo_partner_info *rsp_partner_info;
 
-	partner_info = pe_session->ml_partner_info;
-	rsp_partner_info = rsp->connect_rsp.ml_parnter_info;
+	partner_info = &pe_session->ml_partner_info;
+	rsp_partner_info = &rsp->connect_rsp.ml_parnter_info;
 
-	rsp_partner_info.num_partner_links = partner_info.num_partner_links;
+	rsp_partner_info->num_partner_links = partner_info->num_partner_links;
 
-	for (i = 0; i < rsp_partner_info.num_partner_links; i++) {
-		rsp_partner_info.partner_link_info[i].link_id =
-			partner_info.partner_link_info[i].link_id;
-		qdf_copy_macaddr(&rsp_partner_info.partner_link_info[i].link_addr,
-				 &partner_info.partner_link_info[i].link_addr);
+	for (i = 0; i < rsp_partner_info->num_partner_links; i++) {
+		rsp_partner_info->partner_link_info[i].link_id =
+			partner_info->partner_link_info[i].link_id;
+		qdf_copy_macaddr(
+			&rsp_partner_info->partner_link_info[i].link_addr,
+			&partner_info->partner_link_info[i].link_addr);
 	}
 }
 #endif

+ 1 - 1
core/mac/src/pe/sch/sch_api.c

@@ -73,7 +73,7 @@ static void lim_notify_link_info(struct pe_session *pe_session)
 	for (link = 0; link < vdev_count; link++) {
 		if (!wlan_vdev_list[link])
 			continue;
-		if (wlan_vdev_list[link] == session->vdev) {
+		if (wlan_vdev_list[link] == pe_session->vdev) {
 			lim_mlo_release_vdev_ref(wlan_vdev_list[link]);
 			continue;
 		}

+ 11 - 32
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -7095,8 +7095,8 @@ QDF_STATUS populate_dot11f_assoc_rsp_mlo_ie(struct mac_context *mac_ctx,
 
 	qdf_mem_zero(non_inher_ie_lists, 255);
 	qdf_mem_zero(non_inher_ext_ie_lists, 255);
-	qdf_mem_zero(supp_rates, sizeof(tDot11fIESuppRates));
-	qdf_mem_zero(ext_supp_rates, sizeof(tDot11fIEExtSuppRates));
+	qdf_mem_zero(&supp_rates, sizeof(tDot11fIESuppRates));
+	qdf_mem_zero(&ext_supp_rates, sizeof(tDot11fIEExtSuppRates));
 	mlo_ie->present = 1;
 	mlo_ie->mld_mac_addr_present = 1;
 	mlo_ie->type = 0;
@@ -7142,7 +7142,7 @@ QDF_STATUS populate_dot11f_assoc_rsp_mlo_ie(struct mac_context *mac_ctx,
 		qdf_mem_copy(
 			sta_pro->sta_mac_addr.info.sta_mac_addr,
 			link_session->self_mac_addr,
-			sizeof(sta_pro->sta_mac_addr.info.sta_mac_addr));
+			QDF_MAC_ADDR_SIZE);
 
 		/* Capabilities */
 		sta_pro->mlo_capabilities.present = true;
@@ -7549,6 +7549,7 @@ QDF_STATUS populate_dot11f_bcn_mlo_ie(struct mac_context *mac_ctx,
 
 	lim_get_mlo_vdev_list(session, &vdev_count, wlan_vdev_list);
 	for (link = 0; link < vdev_count; link++) {
+		pe_err("on link %d", link);
 		if (!wlan_vdev_list[link])
 			continue;
 		if (wlan_vdev_list[link] == session->vdev) {
@@ -7598,6 +7599,7 @@ QDF_STATUS populate_dot11f_bcn_mlo_ie(struct mac_context *mac_ctx,
 				     sizeof(tSirMacAddr));
 			num_sta_pro++;
 		}
+		pe_err("copied data for link %d", link);
 		lim_mlo_release_vdev_ref(wlan_vdev_list[link]);
 	}
 	mlo_ie->num_sta_profile = num_sta_pro;
@@ -7689,12 +7691,6 @@ populate_dot11f_probe_req_mlo_ie(struct mac_context *mac_ctx,
 				 struct pe_session *session,
 				 tDot11fIEmlo_ie *mlo_ie)
 {
-	int link = 0, num_sta_pro = 0;
-	tDot11fIEsta_profile *sta_pro;
-	struct mlo_partner_info *link_info;
-	uint16_t vdev_count;
-	struct wlan_objmgr_vdev *wlan_vdev_list[WLAN_UMAC_MLO_MAX_VDEVS];
-	struct pe_session *link_session;
 	uint8_t *mld_addr;
 
 	mlo_ie->present = 1;
@@ -7705,23 +7701,6 @@ populate_dot11f_probe_req_mlo_ie(struct mac_context *mac_ctx,
 		     sizeof(mlo_ie->mld_mac_addr.info.mld_mac_addr));
 	mlo_ie->link_id_info_present = 1;
 
-
-	lim_get_mlo_vdev_list(session, &vdev_count, wlan_vdev_list);
-	link_session = pe_find_session_by_vdev_id(
-			mac_ctx, wlan_vdev_list[link]->vdev_objmgr.vdev_id);
-	sta_pro = &mlo_ie->sta_profile[num_sta_pro];
-	link_info = &link_session->lim_join_req->partner_info;
-	sta_pro->present = 1;
-	sta_pro->complete_profile = 1;
-	sta_pro->sta_mac_addr_present = 1;
-	qdf_mem_copy(&sta_pro->sta_mac_addr.info.sta_mac_addr,
-		     &link_info->partner_link_info[0].link_addr.bytes,
-		     QDF_MAC_ADDR_SIZE);
-	mlo_ie->link_id_info.info.link_id =
-			link_info->partner_link_info[0].link_id;
-
-	mlo_ie->num_sta_profile = num_sta_pro;
-
 	return QDF_STATUS_SUCCESS;
 }
 
@@ -7827,7 +7806,7 @@ sir_convert_mlo_probe_rsp_frame2_struct(tDot11fProbeResponse *pr,
 
 	return QDF_STATUS_SUCCESS;
 }
-#endif /* WLAN_FEATURE_11BE_MLO */
+#endif
 
 #if defined(WLAN_FEATURE_11AX) && defined(WLAN_SUPPORT_TWT)
 QDF_STATUS populate_dot11f_twt_extended_caps(struct mac_context *mac_ctx,
@@ -8715,8 +8694,6 @@ QDF_STATUS populate_dot11f_assoc_req_mlo_ie(struct mac_context *mac_ctx,
 		     mld_addr,
 		     QDF_MAC_ADDR_SIZE);
 	mlo_ie->link_id_info_present = 0;
-	mlo_ie->link_id_info.info.link_id =
-				pe_session->lim_join_req->assoc_link_id;
 
 	mlo_ie->bss_param_change_cnt_present = 0;
 	mlo_ie->medium_sync_delay_info_present = 0;
@@ -8724,7 +8701,7 @@ QDF_STATUS populate_dot11f_assoc_req_mlo_ie(struct mac_context *mac_ctx,
 	mlo_ie->mld_capab_present = 0;
 
 	/* find out number of links from bcn or prb rsp */
-	total_sta_prof = 2;
+	total_sta_prof = 1;
 	partner_info = &pe_session->lim_join_req->partner_info;
 
 	mlo_dev_ctx = pe_session->vdev->mlo_dev_ctx;
@@ -8797,8 +8774,9 @@ QDF_STATUS populate_dot11f_assoc_req_mlo_ie(struct mac_context *mac_ctx,
 			       QDF_MAC_ADDR_REF(link_info->link_addr.bytes));
 			continue;
 		}
-		chan_freq = wlan_reg_chan_opclass_to_freq(chan, op_class,
-							  false);
+		//chan_freq = wlan_reg_chan_opclass_to_freq(chan, op_class,
+		//					  false);
+		chan_freq = wlan_reg_legacy_chan_to_freq(mac_ctx->pdev, chan);
 		if (WLAN_REG_IS_24GHZ_CH_FREQ(chan_freq)) {
 			wlan_populate_basic_rates(&b_rates, false, true);
 			wlan_populate_basic_rates(&e_rates, true, false);
@@ -8974,6 +8952,7 @@ mlo_ie_convert_assoc_rsp_frame2_struct(tDot11fAssocResponse *ar,
 	pMloIe->mlo_ie.link_id_info_present = ar->mlo_ie.link_id_info_present;
 	pMloIe->mlo_ie.link_id_info.info.link_id =
 		ar->mlo_ie.link_id_info.info.link_id;
+	pe_debug("ar->mlo_ie.num_sta_profile:%d", ar->mlo_ie.num_sta_profile);
 	pMloIe->mlo_ie.num_sta_profile = ar->mlo_ie.num_sta_profile;
 	for (sta_index = 0, num_sta_prof = 0;
 	     sta_index < ar->mlo_ie.num_sta_profile;

+ 5 - 2
core/wma/src/wma_dev_if.c

@@ -93,6 +93,7 @@
 #include <wlan_cm_api.h>
 #include <../../core/src/wlan_cm_vdev_api.h>
 #include "wlan_nan_api.h"
+#include "wlan_mlo_mgr_peer.h"
 #ifdef DCS_INTERFERENCE_DETECTION
 #include <wlan_dcs_ucfg_api.h>
 #endif
@@ -2363,10 +2364,12 @@ wma_delete_peer_on_vdev_stop(tp_wma_handle wma, uint8_t vdev_id)
 	}
 
 #ifdef WLAN_FEATURE_11BE_MLO
-	peer = wlan_objmgr_get_peer_by_mac(wma.psoc, &bssid.bytes,
+	peer = wlan_objmgr_get_peer_by_mac(wma->psoc, bssid.bytes,
 					   WLAN_LEGACY_WMA_ID);
-	if (peer)
+	if (peer) {
 		wlan_mlo_link_peer_delete(peer);
+		wlan_objmgr_peer_release_ref(peer, WLAN_LEGACY_WMA_ID);
+	}
 #endif
 
 	vdev_stop_resp = qdf_mem_malloc(sizeof(*vdev_stop_resp));