diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index bd8102ee8c2f..d4d7d62ea348 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/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 = diff --git a/components/mlme/dispatcher/inc/cfg_mlme_scoring.h b/components/mlme/dispatcher/inc/cfg_mlme_scoring.h index 49e792d8ff8f..e11e31341a96 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_scoring.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_scoring.h @@ -1262,7 +1262,7 @@ /* * - * 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") +/* + * + * 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 + * + * + */ +#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 */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 2d779ff00994..b53c5391cbfa 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/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 diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index c3c32bd08421..d822a40272f0 100644 --- a/core/sme/src/common/sme_api.c +++ b/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; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index e30abeb64f28..103c3b26e7ec 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/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;