Jelajahi Sumber

qcacld-3.0: Parse and save t2lm ie

Adds support to parse and save t2lm ie from beacon or
probe response in t2lm database

Change-Id: Ieea735200ab0ae120c01b632687a82ca972459dc
CRs-Fixed: 3337174
Amruta Kulkarni 2 tahun lalu
induk
melakukan
a9850cfe67

+ 1 - 0
Kbuild

@@ -1379,6 +1379,7 @@ UMAC_MLO_MGR_OBJS := $(UMAC_MLO_MGR_CMN_DIR)/src/wlan_mlo_mgr_main.o \
 			  $(MLO_MGR_TARGET_IF_DIR)/src/target_if_mlo_mgr.o \
 			  $(UMAC_MLO_MGR_CLD_DIR)/src/wlan_mlo_mgr_roam.o \
 			  $(UMAC_MLO_MGR_CLD_DIR)/src/wlan_t2lm_api.o \
+			  $(UMAC_MLO_MGR_CMN_DIR)/src/wlan_mlo_t2lm.o \
 
 $(call add-wlan-objs,umac_mlomgr,$(UMAC_MLO_MGR_OBJS))
 endif

+ 1 - 0
core/mac/src/include/parser_api.h

@@ -311,6 +311,7 @@ typedef struct sSirProbeRespBeacon {
 	uint8_t ap_power_type;
 #ifdef WLAN_FEATURE_11BE_MLO
 	struct sir_multi_link_ie mlo_ie;
+	struct wlan_t2lm_context t2lm_ctx;
 #endif
 	tDot11fIEWMMParams wmm_params;
 } tSirProbeRespBeacon, *tpSirProbeRespBeacon;

+ 35 - 0
core/mac/src/pe/lim/lim_process_beacon_frame.c

@@ -44,6 +44,40 @@
 #endif
 
 #ifdef WLAN_FEATURE_11BE_MLO
+void lim_process_bcn_prb_rsp_t2lm(struct mac_context *mac_ctx,
+				  struct pe_session *session,
+				  tpSirProbeRespBeacon bcn_ptr)
+{
+	struct wlan_objmgr_vdev *vdev;
+	struct wlan_mlo_dev_context *mlo_ctx;
+
+	if (!session || !bcn_ptr || !mac_ctx) {
+		pe_err("invalid input parameters");
+		return;
+	}
+
+	vdev = session->vdev;
+	if (!vdev || !wlan_vdev_mlme_is_mlo_vdev(vdev))
+		return;
+
+	mlo_ctx = vdev->mlo_dev_ctx;
+	if (!mlo_ctx) {
+		pe_err("null mlo_dev_ctx");
+		return;
+	}
+
+	if (!bcn_ptr->t2lm_ctx.num_of_t2lm_ie) {
+		pe_debug("tid to link mapping ie not present in beacon/prb rsp");
+		return;
+	}
+
+	mlo_ctx->t2lm_ctx.num_of_t2lm_ie = bcn_ptr->t2lm_ctx.num_of_t2lm_ie;
+	qdf_mem_copy(&mlo_ctx->t2lm_ctx.t2lm_ie,
+		     &bcn_ptr->t2lm_ctx.t2lm_ie,
+		     sizeof(struct wlan_mlo_t2lm_ie) *
+		     mlo_ctx->t2lm_ctx.num_of_t2lm_ie);
+}
+
 void lim_process_beacon_mlo(struct mac_context *mac_ctx,
 			    struct pe_session *session,
 			    tSchBeaconStruct *bcn_ptr)
@@ -391,6 +425,7 @@ lim_process_beacon_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_info,
 		goto end;
 
 	lim_process_beacon_eht(mac_ctx, session, bcn_ptr);
+	lim_process_bcn_prb_rsp_t2lm(mac_ctx, session, bcn_ptr);
 
 	/*
 	 * during scanning, when any session is active, and

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

@@ -157,6 +157,7 @@ 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_process_bcn_prb_rsp_t2lm(mac_ctx, session_entry, probe_rsp);
 	lim_gen_link_specific_probe_rsp(mac_ctx, session_entry,
 					probe_rsp,
 					body,

+ 20 - 0
core/mac/src/pe/lim/lim_types.h

@@ -427,6 +427,19 @@ void lim_cleanup_mlm(struct mac_context *);
 /* Management frame handling functions */
 
 #ifdef WLAN_FEATURE_11BE
+/**
+ * lim_process_bcn_prb_rsp_t2lm() - process beacon/probe response
+ * 11be t2lm IE
+ * @mac_ctx: global mac context
+ * @session: pe session
+ * @bcn_ptr: pointer to tpSirProbeRespBeacon
+ *
+ * Return none
+ */
+void lim_process_bcn_prb_rsp_t2lm(struct mac_context *mac_ctx,
+				  struct pe_session *session,
+				  tpSirProbeRespBeacon bcn_ptr);
+
 /**
  * lim_process_beacon_eht() - process beacon 11be IE
  * @mac_ctx: global mac context
@@ -461,6 +474,13 @@ void lim_process_beacon_eht_op(struct pe_session *session,
 			       tDot11fIEeht_op *eht_op)
 {
 }
+
+static inline
+void lim_process_bcn_prb_rsp_t2lm(struct mac_context *mac_ctx,
+				  struct pe_session *session,
+				  tpSirProbeRespBeacon bcn_ptr)
+{
+}
 #endif
 
 #ifdef WLAN_FEATURE_11BE_MLO

+ 68 - 1
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -55,6 +55,9 @@
 #include <lim_mlo.h>
 #include <utils_mlo.h>
 #endif
+#ifdef WLAN_FEATURE_11BE
+#include <wlan_mlo_t2lm.h>
+#endif
 
 #if defined(WLAN_SUPPORT_TWT) && defined(WLAN_FEATURE_11AX) && \
 	defined(WLAN_TWT_CONV_SUPPORTED)
@@ -2815,6 +2818,37 @@ sir_convert_probe_frame2_mlo_struct(uint8_t *pframe,
 }
 #endif
 
+#ifdef WLAN_FEATURE_11BE_MLO
+static QDF_STATUS
+sir_convert_probe_frame2_t2lm_struct(tDot11fProbeResponse *pr,
+				     tpSirProbeRespBeacon bcn_struct)
+{
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+	uint8_t i;
+
+	if (!pr->num_t2lm_ie) {
+		pe_debug("T2LM IEs not present");
+		return status;
+	}
+	bcn_struct->t2lm_ctx.num_of_t2lm_ie = pr->num_t2lm_ie;
+	pe_debug("Number of T2LM IEs in probe rsp %d", pr->num_t2lm_ie);
+	for (i = 0; i < pr->num_t2lm_ie; i++) {
+		status = wlan_mlo_parse_bcn_prbresp_t2lm_ie(&bcn_struct->t2lm_ctx,
+							    &pr->t2lm_ie[i].data[0]);
+		if (QDF_IS_STATUS_ERROR(status))
+			return status;
+	}
+	return status;
+}
+#else
+static inline QDF_STATUS
+sir_convert_probe_frame2_t2lm_struct(tDot11fProbeResponse *pr,
+				     tpSirProbeRespBeacon bcn_struct)
+{
+	return QDF_STATUS_SUCCESS;
+}
+#endif
+
 QDF_STATUS sir_convert_probe_frame2_struct(struct mac_context *mac,
 					      uint8_t *pFrame,
 					      uint32_t nFrame,
@@ -3085,6 +3119,7 @@ QDF_STATUS sir_convert_probe_frame2_struct(struct mac_context *mac,
 	sir_convert_probe_frame2_eht_struct(pr, pProbeResp);
 	update_bss_color_change_ie_from_probe_rsp(pr, pProbeResp);
 	sir_convert_probe_frame2_mlo_struct(pFrame, nFrame, pr, pProbeResp);
+	sir_convert_probe_frame2_t2lm_struct(pr, pProbeResp);
 
 	qdf_mem_free(pr);
 	return QDF_STATUS_SUCCESS;
@@ -4927,6 +4962,38 @@ static inline void convert_bcon_bss_color_change_ie(tDot11fBeacon *bcn_frm,
 {}
 #endif
 
+#ifdef WLAN_FEATURE_11BE_MLO
+static QDF_STATUS
+sir_convert_beacon_frame2_t2lm_struct(tDot11fBeacon *bcn_frm,
+				      tpSirProbeRespBeacon bcn_struct)
+{
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+	uint8_t i;
+
+	if (!bcn_frm->num_t2lm_ie) {
+		pe_debug("T2LM IEs not present");
+		return status;
+	}
+
+	bcn_struct->t2lm_ctx.num_of_t2lm_ie = bcn_frm->num_t2lm_ie;
+	pe_debug("Number of T2LM IEs in probe rsp %d", bcn_frm->num_t2lm_ie);
+	for (i = 0; i < bcn_frm->num_t2lm_ie; i++) {
+		status = wlan_mlo_parse_bcn_prbresp_t2lm_ie(&bcn_struct->t2lm_ctx,
+							    &bcn_frm->t2lm_ie[i].data[0]);
+		if (QDF_IS_STATUS_ERROR(status))
+			return status;
+	}
+	return status;
+}
+#else
+static inline QDF_STATUS
+sir_convert_beacon_frame2_t2lm_struct(tDot11fBeacon *bcn_frm,
+				      tpSirProbeRespBeacon bcn_struct)
+{
+	return QDF_STATUS_SUCCESS;
+}
+#endif
+
 #ifdef WLAN_FEATURE_11BE_MLO
 static QDF_STATUS
 sir_convert_beacon_frame2_mlo_struct(uint8_t *pframe, uint32_t nframe,
@@ -5230,7 +5297,6 @@ sir_convert_beacon_frame2_struct(struct mac_context *mac,
 								     MobilityDomain.
 								     resourceReqCap
 								     << 1));
-
 	}
 
 #ifdef FEATURE_WLAN_ESE
@@ -5365,6 +5431,7 @@ sir_convert_beacon_frame2_struct(struct mac_context *mac,
 	convert_bcon_bss_color_change_ie(pBeacon, pBeaconStruct);
 	sir_convert_beacon_frame2_mlo_struct(pPayload, nPayload, pBeacon,
 					     pBeaconStruct);
+	sir_convert_beacon_frame2_t2lm_struct(pBeacon, pBeaconStruct);
 
 	qdf_mem_free(pBeacon);
 	return QDF_STATUS_SUCCESS;