Browse Source

qcacld-3.0: Fill peer partner link info in peer_assoc_params struct

Below changes are handled as a part of this
1. After receiving the Probe response frame from AP,
   driver will update the links channel_info into the
   mlo_mgr context.

2. Fill the AP partner link info in struct peer_assoc_params.

Change-Id: Ibdc3c82707e2acd8bd1ad1610703077bc506bf65
CRs-Fixed: 3530280
Deeksha Gupta 1 year ago
parent
commit
96c4e8aaeb

+ 26 - 0
core/mac/src/pe/include/lim_api.h

@@ -620,6 +620,23 @@ lim_fill_pe_session(struct mac_context *mac_ctx,
 		    struct bss_description *bss_desc);
 
 #ifdef WLAN_FEATURE_11BE_MLO
+/**
+ * lim_update_mlo_mgr_info() - API to update mlo_mgr link info
+ * @mac_ctx: Pointer to mac context
+ * @vdev: vdev
+ * @link_addr: link address
+ * @link_id: Link id
+ * @freq: chan freq
+ *
+ * This api will update link sp[ecific info into mlo_mgr
+ *
+ * Return: qdf_status
+ */
+QDF_STATUS
+lim_update_mlo_mgr_info(struct mac_context *mac_ctx,
+			struct wlan_objmgr_vdev *vdev,
+			struct qdf_mac_addr *link_addr, uint8_t link_id,
+			uint16_t freq);
 /**
  * lim_gen_link_specific_probe_rsp() - Generate link specific prb response
  * @mac_ctx: Pointer to mac context
@@ -680,6 +697,15 @@ lim_gen_link_probe_rsp_roam(struct mac_context *mac_ctx,
 			    struct pe_session *session_entry,
 			    struct roam_offload_synch_ind *roam_sync_ind);
 #else
+static inline QDF_STATUS
+lim_update_mlo_mgr_info(struct mac_context *mac_ctx,
+			struct wlan_objmgr_vdev *vdev,
+			struct qdf_mac_addr *link_addr, uint8_t link_id,
+			uint16_t freq)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
 static inline QDF_STATUS
 lim_gen_link_specific_probe_rsp(struct mac_context *mac_ctx,
 				struct pe_session *session_entry,

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

@@ -87,6 +87,7 @@
 #include "wlan_mlo_mgr_peer.h"
 #include <wlan_twt_api.h>
 #include "wlan_tdls_api.h"
+#include "wlan_mlo_mgr_link_switch.h"
 
 struct pe_hang_event_fixed_param {
 	uint16_t tlv_header;
@@ -3985,6 +3986,48 @@ free_cache_entry:
 	qdf_mem_free(cache_entry);
 	return status;
 }
+
+QDF_STATUS lim_update_mlo_mgr_info(struct mac_context *mac_ctx,
+				   struct wlan_objmgr_vdev *vdev,
+				   struct qdf_mac_addr *link_addr,
+				   uint8_t link_id, uint16_t freq)
+{
+	struct wlan_objmgr_pdev *pdev;
+	struct scan_cache_entry *cache_entry;
+	QDF_STATUS status = QDF_STATUS_E_FAILURE;
+	struct wlan_channel channel;
+
+	pdev = mac_ctx->pdev;
+	if (!pdev) {
+		pe_err("pdev is NULL");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	cache_entry = qdf_mem_malloc(sizeof(struct scan_cache_entry));
+	if (!cache_entry)
+		return QDF_STATUS_E_FAILURE;
+
+	status = wlan_scan_get_scan_entry_by_mac_freq(pdev, link_addr, freq,
+						      cache_entry);
+
+	if (!QDF_IS_STATUS_SUCCESS(status)) {
+		status = QDF_STATUS_E_FAILURE;
+		goto free_cache_entry;
+	}
+
+	channel.ch_freq = cache_entry->channel.chan_freq;
+	channel.ch_ieee = wlan_reg_freq_to_chan(pdev, channel.ch_freq);
+	channel.ch_phymode = cache_entry->phy_mode;
+	channel.ch_cfreq1 = cache_entry->channel.cfreq0;
+	channel.ch_cfreq2 = cache_entry->channel.cfreq1;
+
+	mlo_mgr_update_ap_channel_info(vdev, link_id, (uint8_t *)link_addr,
+				       channel);
+
+free_cache_entry:
+	qdf_mem_free(cache_entry);
+	return status;
+}
 #else
 static inline void
 lim_clear_ml_partner_info(struct pe_session *session_entry)
@@ -4159,6 +4202,22 @@ lim_gen_link_specific_probe_rsp(struct mac_context *mac_ctx,
 
 				goto end;
 			}
+
+			status = lim_update_mlo_mgr_info(mac_ctx,
+							 session_entry->vdev,
+							 &link_info->link_addr,
+							 link_info->link_id,
+							 link_info->chan_freq);
+			if (QDF_IS_STATUS_ERROR(status)) {
+				pe_err("failed to update mlo_mgr %d", status);
+				status =
+				   lim_check_scan_db_for_join_req_partner_info(
+					session_entry, mac_ctx);
+				if (QDF_IS_STATUS_ERROR(status))
+					lim_clear_ml_partner_info(session_entry);
+
+				goto end;
+			}
 		}
 	} else if (session_entry->lim_join_req->is_ml_probe_req_sent &&
 		   !rcvd_probe_resp->mlo_ie.mlo_ie_present) {

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

@@ -3994,7 +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_extract_ml_info(pe_session, pAddBssParams, pAssocRsp);
 	lim_intersect_ap_emlsr_caps(mac, pe_session, pAddBssParams, pAssocRsp);
 	lim_extract_msd_caps(mac, pe_session, pAddBssParams, pAssocRsp);
 

+ 30 - 0
core/mac/src/pe/lim/lim_process_probe_rsp_frame.c

@@ -207,6 +207,32 @@ void lim_process_gen_probe_rsp_frame(struct mac_context *mac_ctx,
 	qdf_mem_free(probe_rsp);
 }
 
+#ifdef WLAN_FEATURE_11BE_MLO
+static
+void lim_update_mlo_mgr_prb_info(struct mac_context *mac_ctx,
+				 struct pe_session *session_entry,
+				 struct qdf_mac_addr *mac_addr,
+				 tpSirProbeRespBeacon probe_rsp)
+{
+	if (!(session_entry->lim_join_req &&
+	      session_entry->lim_join_req->is_ml_probe_req_sent &&
+	      probe_rsp->mlo_ie.mlo_ie_present))
+		return;
+
+	lim_update_mlo_mgr_info(mac_ctx, session_entry->vdev, mac_addr,
+				session_entry->lim_join_req->assoc_link_id,
+				probe_rsp->chan_freq);
+}
+#else
+static inline
+void lim_update_mlo_mgr_prb_info(struct mac_context *mac_ctx,
+				 struct pe_session *session_entry,
+				 struct qdf_mac_addr *mac_addr,
+				 tpSirProbeRespBeacon probe_rsp)
+{
+}
+#endif
+
 /**
  * lim_process_probe_rsp_frame() - processes received Probe Response frame
  * @mac_ctx: Pointer to Global MAC structure
@@ -277,6 +303,10 @@ lim_process_probe_rsp_frame(struct mac_context *mac_ctx, uint8_t *rx_Packet_info
 	qdf_trace_hex_dump(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, body,
 			   frame_len);
 
+	lim_update_mlo_mgr_prb_info(mac_ctx, session_entry,
+				    (struct qdf_mac_addr *)header->bssId,
+				    probe_rsp);
+
 	lim_process_bcn_prb_rsp_t2lm(mac_ctx, session_entry, probe_rsp);
 	lim_gen_link_specific_probe_rsp(mac_ctx, session_entry,
 					probe_rsp,

+ 46 - 14
core/mac/src/pe/lim/lim_utils.c

@@ -9295,28 +9295,60 @@ 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)
+void lim_extract_ml_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;
+	uint8_t i, link_id, partner_idx = 0;
+	struct mlo_partner_info *ml_partner_info;
 	struct mlo_link_info *link_info;
+	struct peer_ml_info *ml_link;
 
-	if (wlan_vdev_mlme_is_mlo_link_vdev(session->vdev) ||
-	    !assoc_rsp->mlo_ie.mlo_ie_present)
+	if (!wlan_vdev_mlme_is_mlo_vdev(session->vdev))
 		return;
 
-	ml_partner_info = session->ml_partner_info;
-	num_partner_link = ml_partner_info.num_partner_links;
+	ml_link = &add_bss->staContext.ml_info;
+	ml_partner_info = &session->ml_partner_info;
+
+	ml_link->vdev_id = wlan_vdev_get_id(session->vdev);
+	ml_link->link_id = wlan_vdev_get_link_id(session->vdev);
+	link_info = mlo_mgr_get_ap_link_by_link_id(session->vdev,
+						   ml_link->link_id);
+	if (!link_info)
+		return;
+
+	qdf_mem_copy(&ml_link->channel_info, link_info->link_chan_info,
+		     sizeof(ml_link->channel_info));
+	qdf_mem_copy(&ml_link->link_addr, &link_info->ap_link_addr,
+		     QDF_MAC_ADDR_SIZE);
+	qdf_mem_copy(&ml_link->self_mac_addr, &link_info->link_addr,
+		     QDF_MAC_ADDR_SIZE);
+
+	if (wlan_vdev_mlme_is_mlo_link_vdev(session->vdev))
+		return;
 
-	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);
+	for (i = 0; i < ml_partner_info->num_partner_links; 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;
+			continue;
+
+		ml_link->partner_info[partner_idx].vdev_id = link_info->vdev_id;
+		ml_link->partner_info[partner_idx].link_id = link_info->link_id;
+		qdf_mem_copy(&ml_link->partner_info[partner_idx].channel_info,
+			     link_info->link_chan_info,
+			     sizeof(ml_link->partner_info[partner_idx].channel_info));
+		qdf_mem_copy(&ml_link->partner_info[partner_idx].link_addr,
+			     &link_info->ap_link_addr, QDF_MAC_ADDR_SIZE);
+		qdf_mem_copy(&ml_link->partner_info[partner_idx].self_mac_addr,
+			     &link_info->link_addr, QDF_MAC_ADDR_SIZE);
+
+		partner_idx++;
 	}
+
+	ml_link->num_links = partner_idx;
+	pe_debug("Num of partner links: %d", ml_link->num_links);
 }
 
 void lim_intersect_ap_emlsr_caps(struct mac_context *mac_ctx,

+ 7 - 7
core/mac/src/pe/lim/lim_utils.h

@@ -2301,16 +2301,16 @@ void lim_extract_per_link_id(struct pe_session *session,
 			     tpSirAssocRsp assoc_rsp);
 
 /**
- * lim_extract_ml_partner_info() - Extract ML partner info and share with FW
+ * lim_extract_ml_info() - Extract ML info and send 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);
+void lim_extract_ml_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
@@ -2349,9 +2349,9 @@ 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)
+lim_extract_ml_info(struct pe_session *session,
+		    struct bss_params *add_bss,
+		    tpSirAssocRsp assoc_rsp)
 {
 }
 

+ 16 - 2
core/wma/inc/wma_if.h

@@ -135,6 +135,7 @@ struct med_sync_delay {
 	uint16_t med_sync_max_txop_num:4;
 };
 
+#ifdef WLAN_FEATURE_11BE_MLO
 /**
  * struct ml_partner_link_info: partner link info
  * @link_id: partner link ID
@@ -143,12 +144,24 @@ struct med_sync_delay {
  * @ch_phymode: Channel phymode
  */
 struct ml_partner_link_info {
+	uint8_t vdev_id;
 	uint8_t link_id;
 	struct qdf_mac_addr link_addr;
-	uint8_t ch_freq;
-	enum wlan_phymode ch_phymode;
+	struct qdf_mac_addr self_mac_addr;
+	struct wlan_channel channel_info;
 };
 
+struct peer_ml_info {
+	uint32_t vdev_id;
+	uint32_t link_id;
+	struct qdf_mac_addr link_addr;
+	struct wlan_channel channel_info;
+	struct qdf_mac_addr self_mac_addr;
+	uint8_t num_links;
+	struct ml_partner_link_info partner_info[MLD_MAX_LINKS - 1];
+};
+#endif
+
 /**
  * struct tAddStaParams - add sta related parameters
  * @bssId: bssid of sta
@@ -301,6 +314,7 @@ typedef struct {
 	uint8_t link_id;
 	uint16_t emlsr_trans_timeout;
 	struct ml_partner_link_info ml_partner_info[MLD_MAX_LINKS - 1];
+	struct peer_ml_info ml_info;
 #endif
 } tAddStaParams, *tpAddStaParams;
 

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

@@ -1135,11 +1135,57 @@ static void wma_populate_peer_puncture(struct peer_assoc_params *peer,
 	peer->puncture_bitmap = des_chan->puncture_bitmap;
 	wma_debug("Peer EHT puncture bitmap %d", peer->puncture_bitmap);
 }
+
+static void wma_populate_peer_mlo_cap(struct peer_assoc_params *peer,
+				      tpAddStaParams params)
+{
+	struct peer_assoc_ml_partner_links *ml_links;
+	struct peer_assoc_mlo_params *mlo_params;
+	struct peer_ml_info *ml_info;
+	uint8_t i;
+
+	ml_info = &params->ml_info;
+	mlo_params = &peer->mlo_params;
+	ml_links = &peer->ml_links;
+
+	/* Assoc link info */
+	mlo_params->vdev_id = ml_info->vdev_id;
+	mlo_params->ieee_link_id = ml_info->link_id;
+	qdf_mem_copy(&mlo_params->chan, &ml_info->channel_info,
+		     sizeof(struct wlan_channel));
+	qdf_mem_copy(&mlo_params->bssid, &ml_info->link_addr,
+		     QDF_MAC_ADDR_SIZE);
+	qdf_mem_copy(&mlo_params->mac_addr, &ml_info->self_mac_addr,
+		     QDF_MAC_ADDR_SIZE);
+
+	/* Fill partner link info */
+	ml_links->num_links = ml_info->num_links;
+	for (i = 0; i < ml_links->num_links; i++) {
+		ml_links->partner_info[i].vdev_id =
+					ml_info->partner_info[i].vdev_id;
+		ml_links->partner_info[i].link_id =
+					ml_info->partner_info[i].link_id;
+		qdf_mem_copy(&ml_links->partner_info[i].chan,
+			     &ml_info->partner_info[i].channel_info,
+			     sizeof(struct wlan_channel));
+		qdf_mem_copy(&ml_links->partner_info[i].bssid,
+			     &ml_info->partner_info[i].link_addr,
+			     QDF_MAC_ADDR_SIZE);
+		qdf_mem_copy(&ml_links->partner_info[i].mac_addr,
+			     &ml_info->partner_info[i].self_mac_addr,
+			     QDF_MAC_ADDR_SIZE);
+	}
+}
 #else
 static void wma_populate_peer_puncture(struct peer_assoc_params *peer,
 				       struct wlan_channel *des_chan)
 {
 }
+
+static void wma_populate_peer_mlo_cap(struct peer_assoc_params *peer,
+				      tpAddStaParams params)
+{
+}
 #endif
 
 void wma_objmgr_set_peer_mlme_nss(tp_wma_handle wma, uint8_t *mac_addr,
@@ -1715,6 +1761,7 @@ QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma,
 	wma_populate_peer_he_cap(cmd, params);
 	wma_populate_peer_eht_cap(cmd, params);
 	wma_populate_peer_puncture(cmd, des_chan);
+	wma_populate_peer_mlo_cap(cmd, params);
 	if (!wma_is_vdev_in_ap_mode(wma, params->smesessionId))
 		intr->nss = cmd->peer_nss;
 	wma_objmgr_set_peer_mlme_nss(wma, cmd->peer_mac, cmd->peer_nss);