Browse Source

qcacld-3.0: Add ini support to send ap tx power scoring

Introduce an INI "ap_tx_pwr_scoring" to indicate firmware about ap tx
power weightage so that firmware can use ap tx power weightage to
calculate candidate AP's score.

Change-Id: I8831c571162f044f4ae204ef0edfc59942f36837
CRs-Fixed: 2647115
sheenam monga 5 years ago
parent
commit
7475e4b3d7

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

@@ -1798,6 +1798,8 @@ static void mlme_init_scoring_cfg(struct wlan_objmgr_psoc *psoc,
 		cfg_get(psoc, CFG_SCORING_CHAN_CONGESTION_WEIGHTAGE);
 	scoring_cfg->weight_cfg.oce_wan_weightage =
 		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);
 
 	total_weight =  scoring_cfg->weight_cfg.rssi_weightage +
 			scoring_cfg->weight_cfg.ht_caps_weightage +
@@ -1809,7 +1811,8 @@ static void mlme_init_scoring_cfg(struct wlan_objmgr_psoc *psoc,
 			scoring_cfg->weight_cfg.beamforming_cap_weightage +
 			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_wan_weightage +
+			scoring_cfg->weight_cfg.oce_ap_tx_pwr_weightage;
 
 	/*
 	 * If configured weights are greater than max weight,
@@ -1835,6 +1838,8 @@ static void mlme_init_scoring_cfg(struct wlan_objmgr_psoc *psoc,
 		scoring_cfg->weight_cfg.channel_congestion_weightage =
 						CHANNEL_CONGESTION_WEIGHTAGE;
 		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->rssi_score.best_rssi_threshold =

+ 26 - 0
components/mlme/dispatcher/inc/cfg_mlme_scoring.h

@@ -1255,6 +1255,31 @@
 	CFG_VALUE_OR_DEFAULT, \
 	"Roam candidate selection score algorithm")
 
+/*
+ * <ini>
+ * CFG_OCE_AP_TX_PWR_WEIGHTAGE - update scoring param based on ap tx power
+ * @Min: 0
+ * @Max: 10
+ * @Default: 5
+ *
+ * This ini is used to store calculate weightage based on ap tx power.
+ *
+ * Related: None
+ *
+ * Supported Feature: STA
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_OCE_AP_TX_PWR_WEIGHTAGE CFG_INI_UINT( \
+		"oce_ap_tx_pwr_weightage", \
+		0, \
+		10, \
+		5, \
+		CFG_VALUE_OR_DEFAULT,\
+		"AP weigtage for OCE ap tx power")
+
 #define CFG_SCORING_ALL \
 	CFG(CFG_SCORING_RSSI_WEIGHTAGE) \
 	CFG(CFG_SCORING_HT_CAPS_WEIGHTAGE) \
@@ -1298,5 +1323,6 @@
 	CFG(CFG_IDLE_ROAM_SCORE_DELTA) \
 	CFG(CFG_BTM_ROAM_SCORE_DELTA) \
 	CFG(CFG_VENDOR_ROAM_SCORE_ALGORITHM) \
+	CFG(CFG_OCE_AP_TX_PWR_WEIGHTAGE) \
 
 #endif /* __CFG_MLME_SCORING_H */

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

@@ -1811,6 +1811,7 @@ struct wlan_mlme_wmm_params {
  * @pcl_weightage: PCL weightage
  * @channel_congestion_weightage: channel congestion weightage
  * @oce_wan_weightage: OCE WAN metrics weightage
+ * @oce_ap_tx_pwr_weightage: weightage based on ap tx power
  */
 struct  wlan_mlme_weight_config {
 	uint8_t rssi_weightage;
@@ -1824,6 +1825,7 @@ struct  wlan_mlme_weight_config {
 	uint8_t pcl_weightage;
 	uint8_t channel_congestion_weightage;
 	uint8_t oce_wan_weightage;
+	uint8_t oce_ap_tx_pwr_weightage;
 };
 
 /**

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

@@ -15536,6 +15536,8 @@ void sme_update_score_config(mac_handle_t mac_handle,
 		mlme_scoring_cfg->weight_cfg.channel_congestion_weightage;
 	score_config->weight_cfg.oce_wan_weightage =
 		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->bandwidth_weight_per_index =
 		mlme_scoring_cfg->bandwidth_weight_per_index;

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

@@ -18908,6 +18908,8 @@ static void csr_update_score_params(struct mac_context *mac_ctx,
 	req_score_params->pcl_weightage =
 		weight_config->pcl_weightage;
 	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->bw_index_score =
 		bss_score_params->bandwidth_weight_per_index;