Browse Source

qcacld-3.0: Send partner link info during peer_assoc_cmd

Send partner link info during peer_assoc_cmd

Change-Id: I64b7b6c9aee8d436ec813ae2b0eac025c985d212
CRs-Fixed: 3530233
Deeksha Gupta 1 year ago
parent
commit
4941611135

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

@@ -43,6 +43,7 @@
 #include "wlan_t2lm_api.h"
 #include "wlan_mlo_t2lm.h"
 #include "wlan_mlo_link_force.h"
+#include "wlan_mlo_mgr_link_switch.h"
 
 #ifdef WLAN_FEATURE_FILS_SK
 void cm_update_hlp_info(struct wlan_objmgr_vdev *vdev,
@@ -1177,12 +1178,41 @@ cm_get_ml_partner_info(struct scan_cache_entry *scan_entry,
 
 	partner_info->num_partner_links = j;
 	mlme_debug("sta and ap integrate link num: %d", j);
-
 	wlan_objmgr_psoc_release_ref(psoc, WLAN_MLME_CM_ID);
 
 	return QDF_STATUS_SUCCESS;
 }
 
+static void cm_update_mlo_mgr_info(struct wlan_objmgr_vdev *vdev,
+				   struct cm_vdev_join_req *join_req)
+{
+	struct qdf_mac_addr link_addr;
+	uint8_t link_id, i;
+	struct wlan_channel channel = {0};
+	struct mlo_partner_info *partner_info;
+
+	if (wlan_vdev_mlme_is_mlo_link_vdev(vdev))
+		return;
+
+	link_id = join_req->entry->ml_info.self_link_id;
+	qdf_mem_copy(link_addr.bytes, join_req->entry->bssid.bytes,
+		     QDF_MAC_ADDR_SIZE);
+
+	/* Update the AP self link info */
+	mlo_mgr_update_ap_link_info(vdev, link_id, link_addr.bytes, channel);
+
+	partner_info = &join_req->partner_info;
+	for (i = 0; i < partner_info->num_partner_links; i++) {
+		link_id = partner_info->partner_link_info[i].link_id;
+		qdf_mem_copy(link_addr.bytes,
+			     partner_info->partner_link_info[i].link_addr.bytes,
+			     QDF_MAC_ADDR_SIZE);
+		/* Updating AP partner link info */
+		mlo_mgr_update_ap_link_info(vdev, link_id, link_addr.bytes,
+					    channel);
+	}
+}
+
 static void
 cm_copy_join_req_info_from_cm_connect_req(struct wlan_objmgr_vdev *vdev,
 					  struct cm_vdev_join_req *join_req,
@@ -1200,6 +1230,8 @@ cm_copy_join_req_info_from_cm_connect_req(struct wlan_objmgr_vdev *vdev,
 	mlme_debug("Num of partner links %d assoc_link_id:%d",
 		   join_req->partner_info.num_partner_links,
 		   join_req->assoc_link_id);
+
+	cm_update_mlo_mgr_info(vdev, join_req);
 }
 #else
 static inline void

+ 1 - 0
core/mac/src/pe/lim/lim_assoc_utils.c

@@ -3994,6 +3994,7 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp
 	}
 
 	lim_extract_per_link_id(pe_session, pAddBssParams, pAssocRsp);
+	lim_extract_ml_partner_info(pe_session, pAddBssParams, pAssocRsp);
 	lim_intersect_ap_emlsr_caps(mac, pe_session, pAddBssParams, pAssocRsp);
 	lim_extract_msd_caps(mac, pe_session, pAddBssParams, pAssocRsp);
 

+ 25 - 0
core/mac/src/pe/lim/lim_utils.c

@@ -81,6 +81,7 @@
 #include <wlan_cm_api.h>
 #include <wlan_vdev_mgr_utils_api.h>
 #include "parser_api.h"
+#include "wlan_mlo_mgr_link_switch.h"
 
 /** -------------------------------------------------------------
    \fn lim_delete_dialogue_token_list
@@ -9294,6 +9295,30 @@ void lim_extract_per_link_id(struct pe_session *session,
 	pe_debug("vdev: %d, link id: %d", vdev_id, add_bss->staContext.link_id);
 }
 
+void lim_extract_ml_partner_info(struct pe_session *session,
+				 struct bss_params *add_bss,
+				 tpSirAssocRsp assoc_rsp)
+{
+	uint8_t num_partner_link, i, link_id;
+	struct mlo_partner_info ml_partner_info;
+	struct mlo_link_info *link_info;
+
+	if (wlan_vdev_mlme_is_mlo_link_vdev(session->vdev) ||
+	    !assoc_rsp->mlo_ie.mlo_ie_present)
+		return;
+
+	ml_partner_info = session->ml_partner_info;
+	num_partner_link = ml_partner_info.num_partner_links;
+
+	for (i = 0; i < num_partner_link; i++) {
+		link_id = ml_partner_info.partner_link_info[i].link_id;
+		link_info =
+			mlo_mgr_get_ap_link_by_link_id(session->vdev, link_id);
+		if (!link_info)
+			return;
+	}
+}
+
 void lim_intersect_ap_emlsr_caps(struct mac_context *mac_ctx,
 				 struct pe_session *session,
 				 struct bss_params *add_bss,

+ 19 - 0
core/mac/src/pe/lim/lim_utils.h

@@ -2300,6 +2300,18 @@ void lim_extract_per_link_id(struct pe_session *session,
 			     struct bss_params *add_bss,
 			     tpSirAssocRsp assoc_rsp);
 
+/**
+ * lim_extract_ml_partner_info() - Extract ML partner info and share with FW
+ * @session: pointer to PE session
+ * @add_bss: pointer to ADD BSS params
+ * @assoc_rsp: pointer to assoc response
+ *
+ * Return: None
+ */
+void lim_extract_ml_partner_info(struct pe_session *session,
+				 struct bss_params *add_bss,
+				 tpSirAssocRsp assoc_rsp);
+
 /**
  * lim_intersect_ap_emlsr_caps() - Intersect AP and self STA EML capabilities
  * @mac_ctx: Global MAC context
@@ -2336,6 +2348,13 @@ lim_extract_per_link_id(struct pe_session *session,
 {
 }
 
+static inline void
+lim_extract_ml_partner_info(struct pe_session *session,
+			    struct bss_params *add_bss,
+			    tpSirAssocRsp assoc_rsp)
+{
+}
+
 static inline void
 lim_intersect_ap_emlsr_caps(struct mac_context *mac_ctx,
 			    struct pe_session *session,

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

@@ -59,6 +59,7 @@
 #include "wlan_epcs_api.h"
 #include <wlan_mlo_t2lm.h>
 #endif
+#include "wlan_mlo_mgr_link_switch.h"
 
 #define RSN_OUI_SIZE 4
 /* ////////////////////////////////////////////////////////////////////// */
@@ -3835,7 +3836,7 @@ sir_convert_assoc_resp_frame2_mlo_struct(struct mac_context *mac,
 			}
 
 			ml_ie_info->num_sta_profile =
-			       session_entry->ml_partner_info.num_partner_links;
+			      session_entry->ml_partner_info.num_partner_links;
 			ml_ie_info->link_id_info_present = link_id_found;
 			ml_ie_info->link_id = link_id;
 			pe_debug("Partner link count: %d, Link id: %d, MLD mac addr: " QDF_MAC_ADDR_FMT,
@@ -11656,7 +11657,6 @@ QDF_STATUS populate_dot11f_assoc_req_mlo_ie(struct mac_context *mac_ctx,
 	struct mlo_partner_info *partner_info;
 	struct qdf_mac_addr *mld_addr;
 	struct wlan_mlo_dev_context *mlo_dev_ctx;
-	struct wlan_objmgr_vdev *vdev = NULL;
 	tSirMacRateSet b_rates;
 	tSirMacRateSet e_rates;
 	uint8_t non_inher_len;
@@ -11843,19 +11843,20 @@ QDF_STATUS populate_dot11f_assoc_req_mlo_ie(struct mac_context *mac_ctx,
 	for (link = 0;
 	     link < total_sta_prof && total_sta_prof != num_sta_prof;
 	     link++) {
+		struct mlo_link_info *ml_link_info;
+
 		if (!partner_info->num_partner_links)
 			continue;
 
-		vdev = mlo_dev_ctx->wlan_vdev_list[1];
-		if (!vdev) {
-			pe_err("vdev is null");
-			return QDF_STATUS_E_NULL_VALUE;
-		}
-
 		sta_prof = &mlo_ie->sta_profile[num_sta_prof];
 		link_info = &partner_info->partner_link_info[link];
 		p_sta_prof = sta_prof->data;
 		len_remaining = sizeof(sta_prof->data);
+		ml_link_info =
+			mlo_mgr_get_ap_link_by_link_id(pe_session->vdev,
+						       link_info->link_id);
+		if (!ml_link_info)
+			continue;
 
 		/* subelement ID 0, length(sta_prof->num_data - 2) */
 		*p_sta_prof++ = WLAN_ML_LINFO_SUBELEMID_PERSTAPROFILE;
@@ -11895,13 +11896,13 @@ QDF_STATUS populate_dot11f_assoc_req_mlo_ie(struct mac_context *mac_ctx,
 			WLAN_ML_BV_LINFO_PERSTAPROF_STAINFO_LENGTH_SIZE;
 
 		/* Copying sta mac address in sta info field */
-		qdf_mem_copy(p_sta_prof, vdev->vdev_mlme.macaddr,
+		qdf_mem_copy(p_sta_prof, ml_link_info->link_addr.bytes,
 			     QDF_MAC_ADDR_SIZE);
 		p_sta_prof += QDF_MAC_ADDR_SIZE;
 		len_remaining -= QDF_MAC_ADDR_SIZE;
 
 		pe_debug("Sta profile mac: " QDF_MAC_ADDR_FMT,
-			 vdev->vdev_mlme.macaddr);
+			QDF_MAC_ADDR_REF(ml_link_info->link_addr.bytes));
 
 		/* TBD : populate beacon_interval, dtim_info
 		 * nstr_link_pair_present, nstr_bitmap_size

+ 15 - 0
core/wma/inc/wma_if.h

@@ -135,6 +135,20 @@ struct med_sync_delay {
 	uint16_t med_sync_max_txop_num:4;
 };
 
+/**
+ * struct ml_partner_link_info: partner link info
+ * @link_id: partner link ID
+ * @link_addr: partner link address
+ * @ch_freq:Channel in Mhz
+ * @ch_phymode: Channel phymode
+ */
+struct ml_partner_link_info {
+	uint8_t link_id;
+	struct qdf_mac_addr link_addr;
+	uint8_t ch_freq;
+	enum wlan_phymode ch_phymode;
+};
+
 /**
  * struct tAddStaParams - add sta related parameters
  * @bssId: bssid of sta
@@ -286,6 +300,7 @@ typedef struct {
 	bool msd_caps_present;
 	uint8_t link_id;
 	uint16_t emlsr_trans_timeout;
+	struct ml_partner_link_info ml_partner_info[MLD_MAX_LINKS - 1];
 #endif
 } tAddStaParams, *tpAddStaParams;
 

+ 15 - 0
core/wma/src/wma_mgmt.c

@@ -1334,6 +1334,14 @@ static void wma_set_mlo_capability(tp_wma_handle wma,
 	}
 	wlan_objmgr_peer_release_ref(peer, WLAN_LEGACY_WMA_ID);
 }
+
+static void wma_set_mlo_assoc_vdev(struct wlan_objmgr_vdev *vdev,
+				   struct peer_assoc_params *req)
+{
+	if (wlan_vdev_mlme_is_mlo_vdev(vdev) &&
+	    !wlan_vdev_mlme_is_mlo_link_vdev(vdev))
+		req->is_assoc_vdev = true;
+}
 #else
 static inline void wma_set_mlo_capability(tp_wma_handle wma,
 					  struct wlan_objmgr_vdev *vdev,
@@ -1341,6 +1349,11 @@ static inline void wma_set_mlo_capability(tp_wma_handle wma,
 					  struct peer_assoc_params *req)
 {
 }
+
+static inline void wma_set_mlo_assoc_vdev(struct wlan_objmgr_vdev *vdev,
+					  struct peer_assoc_params *req)
+{
+}
 #endif
 
 /**
@@ -1683,6 +1696,8 @@ QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma,
 
 	wma_set_mlo_capability(wma, intr->vdev, params, cmd);
 
+	wma_set_mlo_assoc_vdev(intr->vdev, cmd);
+
 	wma_debug("rx_max_rate %d, rx_mcs %x, tx_max_rate %d, tx_mcs: %x num rates %d need 4 way %d",
 		  cmd->rx_max_rate, cmd->rx_mcs_set, cmd->tx_max_rate,
 		  cmd->tx_mcs_set, peer_ht_rates.num_rates,