Ver Fonte

qcacld-3.0: Add cfg for MLO preference percentage

Add support to boost or reduce MLO scoring with
mlo_tp_preference_percentage ini.

Change-Id: I0a1280fe259d9e65e5f0f991d456f650b9d1be69
CRs-Fixed: 3456412
Sheenam Monga há 2 anos atrás
pai
commit
102d99de96

+ 2 - 0
components/mlme/core/src/wlan_mlme_main.c

@@ -2338,6 +2338,8 @@ static void mlme_init_sta_mlo_cfg(struct wlan_objmgr_psoc *psoc,
 		cfg_default(CFG_MLO_SUPPORT_LINK_BAND);
 	sta->mlo_max_simultaneous_links =
 		cfg_default(CFG_MLO_MAX_SIMULTANEOUS_LINKS);
+	sta->mlo_prefer_percentage =
+		cfg_get(psoc, CFG_MLO_PREFER_PERCENTAGE);
 }
 
 static bool

+ 30 - 2
components/mlme/dispatcher/inc/cfg_mlme_sta.h

@@ -657,12 +657,39 @@
 			"supported mlo link band")
 
 #define CFG_MLO_SUPPORT_LINK_BAND_CFG CFG(CFG_MLO_SUPPORT_LINK_BAND)
+/*
+ * <cfg>
+ * RoamCommon_Mlo_TpPrefer - percentage to boost mlo scoring
+ *
+ * @Min: -20
+ * @Max: +20
+ * @Default: 10
+ *
+ * This cfg is used to boost/reduce the mlo weightage with configured
+ * value.
+ *
+ * Supported Feature: STA
+ *
+ * Usage: External
+ *
+ * </cfg>
+ */
+#define CFG_MLO_PREFER_PERCENTAGE CFG_INI_INT(\
+			"RoamCommon_Mlo_TpPrefer", \
+			-20, \
+			20, \
+			10,\
+			CFG_VALUE_OR_DEFAULT, \
+			"mlo prefer percentage")
+
+#define CFG_MLO_PREFER_PERCENTAGE_CFG CFG(CFG_MLO_PREFER_PERCENTAGE)
+
 #else
 #define CFG_MLO_SUPPORT_LINK_NUM_CFG
 #define CFG_MLO_SUPPORT_LINK_BAND_CFG
 #define CFG_MLO_MAX_SIMULTANEOUS_LINKS_CFG
+#define CFG_MLO_PREFER_PERCENTAGE_CFG
 #endif
-
 #define CFG_STA_ALL \
 	CFG(CFG_INFRA_STA_KEEP_ALIVE_PERIOD) \
 	CFG(CFG_STA_BSS_MAX_IDLE_PERIOD) \
@@ -686,6 +713,7 @@
 	CFG(CFG_MAX_LI_MODULATED_DTIM_MS) \
 	CFG_MLO_SUPPORT_LINK_NUM_CFG \
 	CFG_MLO_MAX_SIMULTANEOUS_LINKS_CFG \
-	CFG_MLO_SUPPORT_LINK_BAND_CFG
+	CFG_MLO_SUPPORT_LINK_BAND_CFG \
+	CFG_MLO_PREFER_PERCENTAGE_CFG
 
 #endif /* CFG_MLME_STA_H__ */

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

@@ -2660,6 +2660,17 @@ wlan_mlme_get_t2lm_negotiation_supported(struct wlan_objmgr_psoc *psoc);
 QDF_STATUS
 wlan_mlme_set_t2lm_negotiation_supported(struct wlan_objmgr_psoc *psoc,
 					 uint8_t value);
+
+/*
+ * wlan_mlme_get_mlo_prefer_percentage() - get MLO preference percentage
+ * @psoc: pointer to psoc object
+ *
+ * Return: void
+ */
+void
+wlan_mlme_get_mlo_prefer_percentage(
+				struct wlan_objmgr_psoc *psoc,
+				int8_t *mlo_prefer_percentage);
 #else
 static inline QDF_STATUS
 wlan_mlme_get_eht_mode(struct wlan_objmgr_psoc *psoc, enum wlan_eht_mode *value)
@@ -2716,6 +2727,12 @@ wlan_mlme_set_t2lm_negotiation_supported(struct wlan_objmgr_psoc *psoc,
 {
 	return QDF_STATUS_E_NOSUPPORT;
 }
+
+static inline void
+wlan_mlme_get_mlo_prefer_percentage(
+				struct wlan_objmgr_psoc *psoc,
+				int8_t *mlo_prefer_percentage)
+{}
 #endif
 
 /**

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

@@ -1723,6 +1723,7 @@ enum station_prefer_bw {
  * @mlo_support_link_num:           max number of links that sta mlo supports
  * @mlo_support_link_band:          band bitmap that sta mlo supports
  * @mlo_max_simultaneous_links:     number of simultaneous links
+ * @mlo_prefer_percentage:          percentage to boost/reduce mlo scoring
  * @usr_disable_eht:                user disable the eht for STA
  */
 struct wlan_mlme_sta_cfg {
@@ -1755,6 +1756,7 @@ struct wlan_mlme_sta_cfg {
 	uint8_t mlo_support_link_num;
 	uint8_t mlo_support_link_band;
 	uint8_t mlo_max_simultaneous_links;
+	int8_t mlo_prefer_percentage;
 #endif
 #ifdef WLAN_FEATURE_11BE
 	bool usr_disable_eht;

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

@@ -1296,6 +1296,22 @@ QDF_STATUS wlan_mlme_set_sta_mlo_conn_band_bmp(struct wlan_objmgr_psoc *psoc,
 
 	return QDF_STATUS_SUCCESS;
 }
+
+void
+wlan_mlme_get_mlo_prefer_percentage(struct wlan_objmgr_psoc *psoc,
+				    int8_t *mlo_prefer_percentage)
+{
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_ext_obj(psoc);
+	if (!mlme_obj) {
+		mlme_legacy_err("invalid mlo object");
+		return;
+	}
+
+	*mlo_prefer_percentage = mlme_obj->cfg.sta.mlo_prefer_percentage;
+	mlme_legacy_debug("mlo_prefer_percentage %d", *mlo_prefer_percentage);
+}
 #endif
 
 QDF_STATUS wlan_mlme_get_num_11b_tx_chains(struct wlan_objmgr_psoc *psoc,