diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index 2c096d975578..c31aab5437ae 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/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 = diff --git a/components/mlme/dispatcher/inc/cfg_mlme_scoring.h b/components/mlme/dispatcher/inc/cfg_mlme_scoring.h index cfc85bf41a8b..70e54d674937 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_scoring.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_scoring.h @@ -1255,6 +1255,31 @@ CFG_VALUE_OR_DEFAULT, \ "Roam candidate selection score algorithm") +/* + * + * 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 + * + * + */ +#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 */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index f2d8463e4534..3918ceb94ef6 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/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; }; /** diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index d96f015369a2..63eb5796a883 100644 --- a/core/sme/src/common/sme_api.c +++ b/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; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 746ed7873081..77bb149006fa 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/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;