Parcourir la source

qcacld-3.0: Populate ML assoc req with EMLSR padding delay

Add support to populate MLO assoc request with EMLSR
subfields like EMLSR padding delay, transition delay that
are extracted from FW during ext service ready event.

Change-Id: Id5def8da6bef92ff6bf2101a7b3e0d8fb0cf3050
CRs-Fixed: 3262939
Gururaj Pandurangi il y a 2 ans
Parent
commit
3814ee407b

+ 4 - 0
components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -1438,6 +1438,7 @@ QDF_STATUS policy_mgr_update_hw_mode_list(struct wlan_objmgr_psoc *psoc,
 					  struct target_psoc_info *tgt_hdl)
 {
 	struct wlan_psoc_host_mac_phy_caps *tmp;
+	struct wlan_psoc_host_mac_phy_caps_ext2 *cap;
 	uint32_t i, j = 0;
 	enum wmi_hw_mode_config_type hw_config_type;
 	uint32_t dbs_mode, sbs_mode;
@@ -1529,7 +1530,10 @@ QDF_STATUS policy_mgr_update_hw_mode_list(struct wlan_objmgr_psoc *psoc,
 		/* eMLSR mode */
 		if (WMI_BECAP_PHY_GET_HW_MODE_CFG(hw_config_type) ==
 				WMI_HW_MODE_EMLSR) {
+			hw_config_type = WMI_HW_MODE_EMLSR;
 			tmp = &info->mac_phy_cap[j++];
+			cap = &info->mac_phy_caps_ext2[i];
+			wlan_mlme_set_eml_params(psoc, cap);
 			policy_mgr_get_hw_mode_params(tmp, &mac1_ss_bw_info);
 			policy_mgr_update_mac_freq_info(psoc, pm_ctx,
 							hw_config_type,

+ 35 - 0
components/mlme/dispatcher/inc/wlan_mlme_api.h

@@ -2360,6 +2360,29 @@ wlan_mlme_get_emlsr_mode_enabled(struct wlan_objmgr_psoc *psoc, bool *value);
  */
 QDF_STATUS
 wlan_mlme_set_emlsr_mode_enabled(struct wlan_objmgr_psoc *psoc, bool value);
+
+/**
+ * wlan_mlme_set_eml_params() - Set EML subfields in psoc mlme obj that
+ * are received from FW
+ * @psoc: psoc context
+ * @cap: psoc mac/phy capability ptr
+ *
+ * Return: none
+ */
+void
+wlan_mlme_set_eml_params(struct wlan_objmgr_psoc *psoc,
+			 struct wlan_psoc_host_mac_phy_caps_ext2 *cap);
+
+/**
+ * wlan_mlme_get_eml_params() - Get EML subfields from psoc mlme obj
+ * @psoc: psoc context
+ * @cap: EML capability subfield ptr
+ *
+ * Return: none
+ */
+void
+wlan_mlme_get_eml_params(struct wlan_objmgr_psoc *psoc,
+			 struct wlan_mlo_eml_cap *cap);
 #else
 static inline QDF_STATUS
 wlan_mlme_get_emlsr_mode_enabled(struct wlan_objmgr_psoc *psoc, bool *value)
@@ -2373,6 +2396,18 @@ wlan_mlme_set_emlsr_mode_enabled(struct wlan_objmgr_psoc *psoc, bool value)
 {
 	return QDF_STATUS_SUCCESS;
 }
+
+static inline void
+wlan_mlme_set_eml_params(struct wlan_objmgr_psoc *psoc,
+			 struct wlan_psoc_host_mac_phy_caps_ext2 *cap)
+{
+}
+
+static inline void
+wlan_mlme_get_eml_params(struct wlan_objmgr_psoc *psoc,
+			 struct wlan_mlo_eml_cap *cap)
+{
+}
 #endif
 
 /**

+ 22 - 0
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -1556,6 +1556,26 @@ struct wlan_mlme_obss_ht40 {
 	bool bss_color_collision_det_sta;
 };
 
+/**
+ * struct wlan_mlme_eml_cap - EML capabilities of MLD
+ * @emlsr_supp: eMLSR Support
+ * @emlsr_pad_delay: eMLSR Padding Delay
+ * @emlsr_trans_delay: eMLSR transition delay
+ * @emlmr_supp: eMLMR Support
+ * @emlmr_delay: eMLMR Delay
+ * @trans_timeout: Transition Timeout
+ * @reserved: Reserved
+ */
+struct wlan_mlme_eml_cap {
+	uint16_t emlsr_supp:1,
+		 emlsr_pad_delay:3,
+		 emlsr_trans_delay:3,
+		 emlmr_supp:1,
+		 emlmr_delay:3,
+		 trans_timeout:4,
+		 reserved:1;
+};
+
 /**
  * enum dot11p_mode - The 802.11p mode of operation
  * @WLAN_HDD_11P_DISABLED:   802.11p mode is disabled
@@ -2619,6 +2639,7 @@ struct wlan_mlme_iot {
  * @iot: IOT related CFG items
  * @connection_roaming_ini_flag: To indicate whether connection_roaming related
  * ini file is present or not.
+ * @eml_cap: EML capability subfield present in ML IE common info
  */
 struct wlan_mlme_cfg {
 	struct wlan_mlme_chainmask chainmask_cfg;
@@ -2668,6 +2689,7 @@ struct wlan_mlme_cfg {
 	struct wlan_mlme_ratemask ratemask_cfg;
 	struct wlan_mlme_iot iot;
 	bool connection_roaming_ini_flag;
+	struct wlan_mlme_eml_cap eml_cap;
 };
 
 enum pkt_origin {

+ 39 - 0
components/mlme/dispatcher/src/wlan_mlme_api.c

@@ -3205,6 +3205,45 @@ wlan_mlme_set_emlsr_mode_enabled(struct wlan_objmgr_psoc *psoc, bool value)
 
 	return QDF_STATUS_SUCCESS;
 }
+
+void
+wlan_mlme_set_eml_params(struct wlan_objmgr_psoc *psoc,
+			 struct wlan_psoc_host_mac_phy_caps_ext2 *cap)
+{
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+
+	if (!cap->emlcap.emlsr_supp) {
+		mlme_legacy_debug("No EMLSR supp: %d", cap->emlcap.emlsr_supp);
+		return;
+	}
+
+	mlme_obj = mlme_get_psoc_ext_obj(psoc);
+	if (!mlme_obj) {
+		mlme_legacy_err("No psoc object");
+		return;
+	}
+	mlme_obj->cfg.eml_cap.emlsr_supp = cap->emlcap.emlsr_supp;
+	mlme_obj->cfg.eml_cap.emlsr_pad_delay = cap->emlcap.emlsr_pad_delay;
+	mlme_obj->cfg.eml_cap.emlsr_trans_delay = cap->emlcap.emlsr_trans_delay;
+	mlme_obj->cfg.eml_cap.emlmr_supp = cap->emlcap.emlmr_supp;
+}
+
+void
+wlan_mlme_get_eml_params(struct wlan_objmgr_psoc *psoc,
+			 struct wlan_mlo_eml_cap *cap)
+{
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_ext_obj(psoc);
+	if (!mlme_obj) {
+		mlme_legacy_err("No psoc object");
+		return;
+	}
+	cap->emlsr_supp = mlme_obj->cfg.eml_cap.emlsr_supp;
+	cap->emlsr_pad_delay = mlme_obj->cfg.eml_cap.emlsr_pad_delay;
+	cap->emlsr_trans_delay = mlme_obj->cfg.eml_cap.emlsr_trans_delay;
+	cap->emlmr_supp = mlme_obj->cfg.eml_cap.emlmr_supp;
+}
 #endif
 
 QDF_STATUS

+ 36 - 3
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -10993,6 +10993,7 @@ QDF_STATUS populate_dot11f_assoc_req_mlo_ie(struct mac_context *mac_ctx,
 	tDot11fIEeht_cap eht_caps;
 	tDot11fIESuppRates supp_rates;
 	tDot11fIEExtSuppRates ext_supp_rates;
+	struct wlan_mlo_eml_cap eml_cap;
 	uint16_t presence_bitmap = 0;
 	bool is_2g;
 
@@ -11039,13 +11040,19 @@ QDF_STATUS populate_dot11f_assoc_req_mlo_ie(struct mac_context *mac_ctx,
 	 */
 	if (wlan_vdev_mlme_cap_get(pe_session->vdev, WLAN_VDEV_C_EMLSR_CAP) &&
 	    !policy_mgr_get_connection_count(psoc)) {
+		wlan_mlme_get_eml_params(psoc, &eml_cap);
 		mlo_ie->eml_capab_present = 1;
 		presence_bitmap |= WLAN_ML_BV_CTRL_PBM_EMLCAP_P;
 		mlo_ie->common_info_length += WLAN_ML_BV_CINFO_EMLCAP_SIZE;
-		mlo_ie->eml_capabilities_info.emlsr_support = 1;
-		mlo_ie->eml_capabilities_info.emlmr_support = 0;
+		mlo_ie->eml_capabilities_info.emlsr_support =
+						eml_cap.emlsr_supp;
+		mlo_ie->eml_capabilities_info.emlmr_support =
+						eml_cap.emlmr_supp;
 		mlo_ie->eml_capabilities_info.transition_timeout = 0;
-		mlo_ie->eml_capabilities_info.emlsr_padding_delay = 0;
+		mlo_ie->eml_capabilities_info.emlsr_padding_delay =
+						eml_cap.emlsr_pad_delay;
+		mlo_ie->eml_capabilities_info.emlsr_transition_delay =
+						eml_cap.emlsr_trans_delay;
 	}
 
 	p_ml_ie = mlo_ie->data;
@@ -11079,10 +11086,36 @@ QDF_STATUS populate_dot11f_assoc_req_mlo_ie(struct mac_context *mac_ctx,
 		     WLAN_ML_BV_CINFO_EMLCAP_EMLSRSUPPORT_IDX,
 		     WLAN_ML_BV_CINFO_EMLCAP_EMLSRSUPPORT_BITS,
 		     mlo_ie->eml_capabilities_info.emlsr_support);
+		QDF_SET_BITS(*(uint16_t *)p_ml_ie,
+		     WLAN_ML_BV_CINFO_EMLCAP_EMLSR_PADDINGDELAY_IDX,
+		     WLAN_ML_BV_CINFO_EMLCAP_EMLSR_PADDINGDELAY_BITS,
+		     mlo_ie->eml_capabilities_info.emlsr_padding_delay);
+		QDF_SET_BITS(*(uint16_t *)p_ml_ie,
+		     WLAN_ML_BV_CINFO_EMLCAP_EMLSRTRANSDELAY_IDX,
+		     WLAN_ML_BV_CINFO_EMLCAP_EMLSRTRANSDELAY_BITS,
+		     mlo_ie->eml_capabilities_info.emlsr_transition_delay);
+		QDF_SET_BITS(*(uint16_t *)p_ml_ie,
+		     WLAN_ML_BV_CINFO_EMLCAP_EMLMRSUPPORT_IDX,
+		     WLAN_ML_BV_CINFO_EMLCAP_EMLMRSUPPORT_BITS,
+		     mlo_ie->eml_capabilities_info.emlmr_support);
+		QDF_SET_BITS(*(uint16_t *)p_ml_ie,
+		     WLAN_ML_BV_CINFO_EMLCAP_EMLMRDELAY_IDX,
+		     WLAN_ML_BV_CINFO_EMLCAP_EMLMRDELAY_BITS,
+		     mlo_ie->eml_capabilities_info.emlmr_delay);
+		QDF_SET_BITS(*(uint16_t *)p_ml_ie,
+		     WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_IDX,
+		     WLAN_ML_BV_CINFO_EMLCAP_TRANSTIMEOUT_BITS,
+		     mlo_ie->eml_capabilities_info.transition_timeout);
+
 		p_ml_ie += WLAN_ML_BV_CINFO_EMLCAP_SIZE;
 		len_remaining -= WLAN_ML_BV_CINFO_EMLCAP_SIZE;
 	}
 
+	pe_debug("EMLSR support: %d, padding delay: %d, transition delay: %d",
+		 mlo_ie->eml_capabilities_info.emlsr_support,
+		 mlo_ie->eml_capabilities_info.emlsr_padding_delay,
+		 mlo_ie->eml_capabilities_info.emlsr_transition_delay);
+
 	if (mlo_ie->mld_capab_and_op_present) {
 		QDF_SET_BITS(*(uint16_t *)p_ml_ie,
 		     WLAN_ML_BV_CINFO_MLDCAPANDOP_MAXSIMULLINKS_IDX,