Эх сурвалжийг харах

qcacld-3.0: Extract MSD caps from MLD AP to share with FW

Extract MSD capabilities from assoc response from MLD AP
and share the params with FW via peer assoc cmd on all MLO
links.

Change-Id: I301f56c37b6d0d2c56af13eec72d2e452a1508ed
CRs-Fixed: 3271116
Gururaj Pandurangi 2 жил өмнө
parent
commit
d144b95d6d

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

@@ -3897,6 +3897,7 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp
 	}
 
 	lim_intersect_ap_emlsr_caps(mac, pe_session, pAddBssParams, pAssocRsp);
+	lim_extract_msd_caps(mac, pe_session, pAddBssParams, pAssocRsp);
 
 	pAddBssParams->staContext.smesessionId =
 		pe_session->smeSessionId;

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

@@ -9009,6 +9009,71 @@ void lim_intersect_ap_emlsr_caps(struct mac_context *mac_ctx,
 		 add_bss->staContext.emlsr_support, add_bss->staContext.link_id,
 		 add_bss->staContext.emlsr_trans_timeout);
 }
+
+void lim_extract_msd_caps(struct mac_context *mac_ctx,
+			  struct pe_session *session,
+			  struct bss_params *add_bss,
+			  tpSirAssocRsp assoc_rsp)
+{
+	struct wlan_objmgr_peer *peer;
+	struct wlan_mlo_peer_context *mlo_peer_ctx;
+
+	peer = wlan_objmgr_get_peer_by_mac(mac_ctx->psoc, add_bss->bssId,
+					   WLAN_LEGACY_MAC_ID);
+	if (!peer) {
+		pe_err("peer is null");
+		return;
+	}
+
+	mlo_peer_ctx = peer->mlo_peer_ctx;
+	if (!mlo_peer_ctx) {
+		pe_err("mlo peer ctx is null");
+		wlan_objmgr_peer_release_ref(peer, WLAN_LEGACY_MAC_ID);
+		return;
+	}
+
+	if (wlan_vdev_mlme_is_mlo_link_vdev(session->vdev)) {
+		add_bss->staContext.msd_caps_present =
+			mlo_peer_ctx->msd_cap_present;
+		add_bss->staContext.msd_caps.med_sync_duration =
+			mlo_peer_ctx->mlpeer_msdcap.medium_sync_duration;
+		add_bss->staContext.msd_caps.med_sync_ofdm_ed_thresh =
+			mlo_peer_ctx->mlpeer_msdcap.medium_sync_ofdm_ed_thresh;
+		add_bss->staContext.msd_caps.med_sync_max_txop_num =
+			mlo_peer_ctx->mlpeer_msdcap.medium_sync_max_txop_num;
+	} else {
+		add_bss->staContext.msd_caps_present =
+			assoc_rsp->mlo_ie.mlo_ie.medium_sync_delay_info_present;
+		if (add_bss->staContext.msd_caps_present) {
+			add_bss->staContext.msd_caps.med_sync_duration =
+				assoc_rsp->mlo_ie.mlo_ie.medium_sync_delay_info.medium_sync_duration;
+			add_bss->staContext.msd_caps.med_sync_ofdm_ed_thresh =
+				assoc_rsp->mlo_ie.mlo_ie.medium_sync_delay_info.medium_sync_ofdm_ed_thresh;
+			add_bss->staContext.msd_caps.med_sync_max_txop_num =
+				assoc_rsp->mlo_ie.mlo_ie.medium_sync_delay_info.medium_sync_max_txop_num;
+		} else {
+			/* Fill MSD params with zeroes if MSD caps are absent */
+			add_bss->staContext.msd_caps.med_sync_duration = 0;
+			add_bss->staContext.msd_caps.med_sync_ofdm_ed_thresh = 0;
+			add_bss->staContext.msd_caps.med_sync_max_txop_num = 0;
+		}
+		mlo_peer_ctx->msd_cap_present =
+			add_bss->staContext.msd_caps_present;
+		mlo_peer_ctx->mlpeer_msdcap.medium_sync_duration =
+			add_bss->staContext.msd_caps.med_sync_duration;
+		mlo_peer_ctx->mlpeer_msdcap.medium_sync_ofdm_ed_thresh =
+			add_bss->staContext.msd_caps.med_sync_ofdm_ed_thresh;
+		mlo_peer_ctx->mlpeer_msdcap.medium_sync_max_txop_num =
+			add_bss->staContext.msd_caps.med_sync_max_txop_num;
+	}
+
+	wlan_objmgr_peer_release_ref(peer, WLAN_LEGACY_MAC_ID);
+	pe_debug("MSD caps: %d, Duration: %d, Threshold:%d, TXOP num: %d",
+		 add_bss->staContext.msd_caps_present,
+		 add_bss->staContext.msd_caps.med_sync_duration,
+		 add_bss->staContext.msd_caps.med_sync_ofdm_ed_thresh,
+		 add_bss->staContext.msd_caps.med_sync_max_txop_num);
+}
 #endif
 
 #if defined(CONFIG_BAND_6GHZ) && defined(WLAN_FEATURE_11AX)

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

@@ -2254,6 +2254,21 @@ void lim_intersect_ap_emlsr_caps(struct mac_context *mac_ctx,
 				 struct pe_session *session,
 				 struct bss_params *add_bss,
 				 tpSirAssocRsp assoc_rsp);
+
+/**
+ * lim_extract_msd_caps() - Extract MLD AP MSD capabilities and assign
+ * the same caps to link vdev
+ * @mac_ctx: Global MAC context
+ * @session: pointer to PE session
+ * @add_bss: pointer to ADD BSS params
+ * @assoc_rsp: pointer to assoc response
+ *
+ * Return: None
+ */
+void lim_extract_msd_caps(struct mac_context *mac_ctx,
+			  struct pe_session *session,
+			  struct bss_params *add_bss,
+			  tpSirAssocRsp assoc_rsp);
 #else
 static inline void
 lim_intersect_ap_emlsr_caps(struct mac_context *mac_ctx,
@@ -2262,6 +2277,14 @@ lim_intersect_ap_emlsr_caps(struct mac_context *mac_ctx,
 			    tpSirAssocRsp assoc_rsp)
 {
 }
+
+static inline void
+lim_extract_msd_caps(struct mac_context *mac_ctx,
+		     struct pe_session *session,
+		     struct bss_params *add_bss,
+		     tpSirAssocRsp assoc_rsp)
+{
+}
 #endif /* WLAN_FEATURE_11BE_MLO */
 
 #if defined(CONFIG_BAND_6GHZ) && defined(WLAN_FEATURE_11AX)

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

@@ -3606,8 +3606,9 @@ sir_convert_assoc_resp_frame2_mlo_struct(uint8_t *frame, uint32_t frame_len,
 	struct wlan_mlo_ie *ml_ie_info;
 	bool link_id_found;
 	uint8_t link_id;
-	bool eml_cap_found;
+	bool eml_cap_found, msd_cap_found;
 	uint16_t eml_cap;
+	uint16_t msd_cap;
 	struct qdf_mac_addr mld_mac_addr;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
@@ -3636,6 +3637,27 @@ sir_convert_assoc_resp_frame2_mlo_struct(uint8_t *frame, uint32_t frame_len,
 			util_get_bvmlie_primary_linkid(ml_ie, ml_ie_total_len,
 						       &link_id_found,
 						       &link_id);
+			util_get_bvmlie_msd_cap(ml_ie, ml_ie_total_len,
+						&msd_cap_found, &msd_cap);
+			if (msd_cap_found) {
+				ml_ie_info->medium_sync_delay_info_present =
+								msd_cap_found;
+				ml_ie_info->medium_sync_delay_info.medium_sync_duration =
+				  QDF_GET_BITS(
+				     msd_cap,
+				     WLAN_ML_BV_CINFO_MEDMSYNCDELAYINFO_DURATION_IDX,
+				     WLAN_ML_BV_CINFO_MEDMSYNCDELAYINFO_DURATION_BITS);
+				ml_ie_info->medium_sync_delay_info.medium_sync_ofdm_ed_thresh =
+				  QDF_GET_BITS(
+				     msd_cap,
+				     WLAN_ML_BV_CINFO_MEDMSYNCDELAYINFO_OFDMEDTHRESH_IDX,
+				     WLAN_ML_BV_CINFO_MEDMSYNCDELAYINFO_OFDMEDTHRESH_BITS);
+				ml_ie_info->medium_sync_delay_info.medium_sync_max_txop_num =
+				  QDF_GET_BITS(
+				     msd_cap,
+				     WLAN_ML_BV_CINFO_MEDMSYNCDELAYINFO_MAXTXOPS_IDX,
+				     WLAN_ML_BV_CINFO_MEDMSYNCDELAYINFO_MAXTXOPS_BITS);
+			}
 			util_get_bvmlie_eml_cap(ml_ie, ml_ie_total_len,
 						&eml_cap_found, &eml_cap);
 			if (eml_cap_found) {

+ 14 - 1
core/wma/inc/wma_if.h

@@ -120,6 +120,18 @@ struct sAniProbeRspStruct {
 	/* probeRsp body follows here */
 } qdf_packed;
 
+/**
+ * med_sync_delay - medium sync delay info
+ * @med_sync_duration: medium sync duration
+ * @med_sync_ofdm_ed_thresh: medium sync OFDM ED threshold
+ * @med_sync_max_txop_num: medium sync max txop num
+ */
+struct med_sync_delay {
+	uint16_t med_sync_duration:8;
+	uint16_t med_sync_ofdm_ed_thresh:4;
+	uint16_t med_sync_max_txop_num:4;
+};
+
 /**
  * struct tAddStaParams - add sta related parameters
  * @bssId: bssid of sta
@@ -259,13 +271,14 @@ typedef struct {
 	tDot11fIEeht_cap eht_config;
 	tDot11fIEeht_op eht_op;
 #endif
+	struct med_sync_delay msd_caps;
 #ifdef WLAN_FEATURE_11BE_MLO
 	uint8_t mld_mac_addr[QDF_MAC_ADDR_SIZE];
 	bool is_assoc_peer;
 	bool emlsr_support;
+	bool msd_caps_present;
 	uint8_t link_id;
 	uint16_t emlsr_trans_timeout;
-
 #endif
 } tAddStaParams, *tpAddStaParams;
 

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

@@ -1385,6 +1385,15 @@ static void wma_set_mlo_capability(tp_wma_handle wma,
 			req->mlo_params.trans_timeout_us =
 					params->emlsr_trans_timeout;
 		}
+		req->mlo_params.msd_cap_support = params->msd_caps_present;
+		if (req->mlo_params.msd_cap_support) {
+			req->mlo_params.medium_sync_duration =
+				params->msd_caps.med_sync_duration;
+			req->mlo_params.medium_sync_ofdm_ed_thresh =
+				params->msd_caps.med_sync_ofdm_ed_thresh;
+			req->mlo_params.medium_sync_max_txop_num =
+				params->msd_caps.med_sync_max_txop_num;
+		}
 	} else {
 		wma_debug("Peer MLO context is NULL");
 		req->mlo_params.mlo_enabled = false;