Selaa lähdekoodia

qcacld-3.0: Add ini support to send oce subnet id scoring

Introduce an INI "oce_subnet_id_weightage" to indicate firmware
about oce subnet id weightage so that firmware can use subnet id
weightage to calculate candidate AP's score.

Change-Id: Iaf3be1947f8966a2e2c34162d251a31950058231
CRs-Fixed: 2674596
Abhishek Ambure 5 vuotta sitten
vanhempi
sitoutus
94d53d68a7

+ 6 - 1
components/mlme/core/src/wlan_mlme_main.c

@@ -1772,6 +1772,8 @@ static void mlme_init_scoring_cfg(struct wlan_objmgr_psoc *psoc,
 		cfg_get(psoc, CFG_SCORING_OCE_WAN_WEIGHTAGE);
 	scoring_cfg->weight_cfg.oce_ap_tx_pwr_weightage =
 				cfg_get(psoc, CFG_OCE_AP_TX_PWR_WEIGHTAGE);
+	scoring_cfg->weight_cfg.oce_subnet_id_weightage =
+				cfg_get(psoc, CFG_OCE_SUBNET_ID_WEIGHTAGE);
 
 	total_weight =  scoring_cfg->weight_cfg.rssi_weightage +
 			scoring_cfg->weight_cfg.ht_caps_weightage +
@@ -1784,7 +1786,8 @@ static void mlme_init_scoring_cfg(struct wlan_objmgr_psoc *psoc,
 			scoring_cfg->weight_cfg.pcl_weightage +
 			scoring_cfg->weight_cfg.channel_congestion_weightage +
 			scoring_cfg->weight_cfg.oce_wan_weightage +
-			scoring_cfg->weight_cfg.oce_ap_tx_pwr_weightage;
+			scoring_cfg->weight_cfg.oce_ap_tx_pwr_weightage +
+			scoring_cfg->weight_cfg.oce_subnet_id_weightage;
 
 	/*
 	 * If configured weights are greater than max weight,
@@ -1812,6 +1815,8 @@ static void mlme_init_scoring_cfg(struct wlan_objmgr_psoc *psoc,
 		scoring_cfg->weight_cfg.oce_wan_weightage = OCE_WAN_WEIGHTAGE;
 		scoring_cfg->weight_cfg.oce_ap_tx_pwr_weightage =
 			OCE_AP_TX_POWER_WEIGHTAGE;
+		scoring_cfg->weight_cfg.oce_subnet_id_weightage =
+			OCE_SUBNET_ID_WEIGHTAGE;
 	}
 
 	scoring_cfg->rssi_score.best_rssi_threshold =

+ 38 - 1
components/mlme/dispatcher/inc/cfg_mlme_scoring.h

@@ -1262,7 +1262,7 @@
 
 /*
  * <ini>
- * CFG_OCE_AP_TX_PWR_WEIGHTAGE - update scoring param based on ap tx power
+ * oce_ap_tx_pwr_weightage - update scoring param based on ap tx power
  * @Min: 0
  * @Max: 10
  * @Default: 5
@@ -1285,6 +1285,42 @@
 		CFG_VALUE_OR_DEFAULT,\
 		"AP weigtage for OCE ap tx power")
 
+/*
+ * <ini>
+ * oce_subnet_id_weightage - update scoring param based on subnet id
+ * @Min: 0
+ * @Max: 10
+ * @Default: 3
+ *
+ * This ini is used to calculate subnet id weightage in roam score.
+ * If the MBO-OCE ie has "IP subnet indication attribute", then host
+ * considers 50% of the "oce_subnet_id_weightage" value to calculate
+ * roam score for the initial connection and 100% of the
+ * "oce_subnet_id_weightage" value to calculate roam score for roaming
+ * case.
+ * "oce_ap_tx_pwr_weightage" adds a small amount of percentage advantage
+ * in roam score while selection of an AP candidate within the same subnet
+ * ID. If "oce_ap_tx_pwr_weightage" value is 0(min), roam score doesn't
+ * include percentage weightage for subnet id and if "oce_ap_tx_pwr_weightage"
+ * value is 10(max), then the weightage given because of same subnet ID is
+ * more in roam score. This ini is also used for WFA certification.
+ *
+ * Related: None
+ *
+ * Supported Feature: STA
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_OCE_SUBNET_ID_WEIGHTAGE CFG_INI_UINT( \
+		"oce_subnet_id_weightage", \
+		0, \
+		10, \
+		3, \
+		CFG_VALUE_OR_DEFAULT,\
+		"AP weigtage for OCE subnet id")
+
 #define CFG_SCORING_ALL \
 	CFG(CFG_SCORING_RSSI_WEIGHTAGE) \
 	CFG(CFG_SCORING_HT_CAPS_WEIGHTAGE) \
@@ -1329,5 +1365,6 @@
 	CFG(CFG_BTM_ROAM_SCORE_DELTA) \
 	CFG(CFG_VENDOR_ROAM_SCORE_ALGORITHM) \
 	CFG(CFG_OCE_AP_TX_PWR_WEIGHTAGE) \
+	CFG(CFG_OCE_SUBNET_ID_WEIGHTAGE) \
 
 #endif /* __CFG_MLME_SCORING_H */

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

@@ -1818,7 +1818,6 @@ struct wlan_mlme_wmm_params {
 /**
  * struct wlan_mlme_weight_config - weight params to
  * calculate best candidate
- *
  * @rssi_weightage: RSSI weightage
  * @ht_caps_weightage: HT caps weightage
  * @vht_caps_weightage: VHT caps weightage
@@ -1831,6 +1830,7 @@ struct wlan_mlme_wmm_params {
  * @channel_congestion_weightage: channel congestion weightage
  * @oce_wan_weightage: OCE WAN metrics weightage
  * @oce_ap_tx_pwr_weightage: weightage based on ap tx power
+ * @oce_subnet_id_weightage: weightage based on subnet id
  */
 struct  wlan_mlme_weight_config {
 	uint8_t rssi_weightage;
@@ -1845,12 +1845,12 @@ struct  wlan_mlme_weight_config {
 	uint8_t channel_congestion_weightage;
 	uint8_t oce_wan_weightage;
 	uint8_t oce_ap_tx_pwr_weightage;
+	uint8_t oce_subnet_id_weightage;
 };
 
 /**
  * struct wlan_mlme_rssi_cfg_score - RSSI params to
  * calculate best candidate
- *
  * @best_rssi_threshold: Best RSSI threshold
  * @good_rssi_threshold: Good RSSI threshold
  * @bad_rssi_threshold: Bad RSSI threshold

+ 2 - 0
core/sme/src/common/sme_api.c

@@ -15206,6 +15206,8 @@ void sme_update_score_config(mac_handle_t mac_handle,
 		mlme_scoring_cfg->weight_cfg.oce_wan_weightage;
 	score_config->weight_cfg.oce_ap_tx_pwr_weightage =
 		mlme_scoring_cfg->weight_cfg.oce_ap_tx_pwr_weightage;
+	score_config->weight_cfg.oce_subnet_id_weightage =
+		mlme_scoring_cfg->weight_cfg.oce_subnet_id_weightage;
 
 	score_config->bandwidth_weight_per_index =
 		mlme_scoring_cfg->bandwidth_weight_per_index;

+ 2 - 0
core/sme/src/csr/csr_api_roam.c

@@ -18340,6 +18340,8 @@ static void csr_update_score_params(struct mac_context *mac_ctx,
 	req_score_params->oce_wan_weightage = weight_config->oce_wan_weightage;
 	req_score_params->oce_ap_tx_pwr_weightage =
 		weight_config->oce_ap_tx_pwr_weightage;
+	req_score_params->oce_subnet_id_weightage =
+		weight_config->oce_subnet_id_weightage;
 
 	req_score_params->bw_index_score =
 		bss_score_params->bandwidth_weight_per_index;