diff options
| -rw-r--r-- | core/hdd/inc/wlan_hdd_cfg.h | 179 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_cfg.c | 80 | ||||
| -rw-r--r-- | core/mac/inc/sir_api.h | 3 | ||||
| -rw-r--r-- | core/mac/src/include/parser_api.h | 2 | ||||
| -rw-r--r-- | core/mac/src/pe/lim/lim_scan_result_utils.c | 5 | ||||
| -rw-r--r-- | core/mac/src/sys/legacy/src/utils/src/parser_api.c | 11 | ||||
| -rw-r--r-- | core/sme/src/csr/csr_api_roam.c | 2 | ||||
| -rw-r--r-- | core/sme/src/csr/csr_api_scan.c | 127 | ||||
| -rw-r--r-- | core/sme/src/csr/csr_inside_api.h | 19 |
9 files changed, 376 insertions, 52 deletions
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 6ea01d75273f..9c0dc9690005 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -12275,6 +12275,30 @@ enum hw_filter_mode { /* * <ini> + * oce_wan_weightage - OCE WAN DL capacity Weightage to calculate best candidate + * @Min: 0 + * @Max: 100 + * @Default: 0 + * + * This ini is used to increase/decrease OCE WAN caps weightage in best + * candidate selection. If AP have OCE WAN information, give weightage depending + * on the downaload available capacity. + * + * Related: num_oce_wan_slots + * + * Supported Feature: STA Candidate selection + * + * Usage: External + * + * </ini> + */ +#define CFG_OCE_WAN_WEIGHTAGE_NAME "oce_wan_weightage" +#define CFG_OCE_WAN_WEIGHTAGE_DEFAULT (0) +#define CFG_OCE_WAN_WEIGHTAGE_MIN (0) +#define CFG_OCE_WAN_WEIGHTAGE_MAX (100) + +/* + * <ini> * best_rssi_threshold - Best Rssi for score calculation * @Min: 0 * @Max: 96 @@ -12705,6 +12729,155 @@ enum hw_filter_mode { /* * <ini> + * num_oce_wan_slots - number of slots in which the oce wan metrics will + * be divided + * + * @Min: 1 + * @Max: 15 + * @Default: 8 + * + * Number of slots in which the oce wan metrics will be divided. Max 15. index 0 + * is used for not_present. Num_slot will equally divide 100. e.g, if + * num_slot = 4 slot 1 = 0-3 DL CAP, slot 2 = 4-7 DL CAP, slot 3 = 8-11 DL CAP, + * slot 4 = 12-15 DL CAP. Remaining unused index can be 0. + * + * Related: oce_wan_weightage + * + * Usage: External + * + * </ini> + */ +#define CFG_OCE_WAN_SLOTS_NAME "num_oce_wan_slots" +#define CFG_OCE_WAN_SLOTS_DEFAULT (8) +#define CFG_OCE_WAN_SLOTS_MIN (1) +#define CFG_OCE_WAN_SLOTS_MAX (15) + +/* + * <ini> + * oce_wan_score_idx3_to_0 - percentage for OCE WAN metrics score for slots 0-3 + * @Min: 0x00000000 + * @Max: 0x64646464 + * @Default: 0x00000000 + * + * This INI give percentage value of OCE WAN metrics DL CAP, to be used as + * index in which the DL CAP value falls. Index 0 is for percentage when + * OCE WAN metrics DL CAP is not present. + * + * Indexes are defined in this way. + * 0 Index (BITS 0-7): when OCE WAN metrics DL CAP is not present + * 1 Index (BITS 8-15): SLOT_1 + * 2 Index (BITS 16-23): SLOT_2 + * 3 Index (BITS 24-31): SLOT_3 + * These percentage values are stored in HEX. For any index max value, can be 64 + * + * Related: num_oce_wan_slots, oce_wan_weightage + * + * Supported Feature: STA Candidate selection + * + * Usage: External + * + * </ini> + */ +#define CFG_OCE_WAN_SCORE_IDX3_TO_0_NAME "oce_wan_score_idx3_to_0" +#define CFG_OCE_WAN_SCORE_IDX3_TO_0_DEFAULT (0x00000000) +#define CFG_OCE_WAN_SCORE_IDX3_TO_0_MIN (0x00000000) +#define CFG_OCE_WAN_SCORE_IDX3_TO_0_MAX (0x64646464) + +/* + * <ini> + * oce_wan_score_idx7_to_4 - percentage for OCE WAN metrics score for slots 4-7 + * @Min: 0x00000000 + * @Max: 0x64646464 + * @Default: 0x64640000 + * + * This INI give percentage value of OCE WAN metrics DL CAP, to be used as + * index in which the DL CAP value falls. Used only if num_oce_wan_slots is + * greater than 3. + * + * Indexes are defined in this way. + * 0 Index (BITS 0-7): SLOT_4 + * 1 Index (BITS 8-15): SLOT_5 + * 2 Index (BITS 16-23): SLOT_6 + * 3 Index (BITS 24-31): SLOT_7 + * These percentage values are stored in HEX. For any index max value, can be 64 + * + * Related: num_oce_wan_slots, oce_wan_weightage + * + * Supported Feature: STA Candidate selection + * + * Usage: External + * + * </ini> + */ +#define CFG_OCE_WAN_SCORE_IDX7_TO_4_NAME "oce_wan_score_idx7_to_4" +#define CFG_OCE_WAN_SCORE_IDX7_TO_4_DEFAULT (0x64640000) +#define CFG_OCE_WAN_SCORE_IDX7_TO_4_MIN (0x00000000) +#define CFG_OCE_WAN_SCORE_IDX7_TO_4_MAX (0x64646464) + +/* + * <ini> + * oce_wan_score_idx11_to_8 - percentage for OCE WAN metrics score for slot 8-11 + * @Min: 0x00000000 + * @Max: 0x64646464 + * @Default: 0x00000064 + * + * This INI give percentage value of OCE WAN metrics DL CAP, to be used as + * index in which the DL CAP value falls. Used only if num_oce_wan_slots is + * greater than 7. + * + * Indexes are defined in this way. + * 0 Index (BITS 0-7): SLOT_8 + * 1 Index (BITS 8-15): SLOT_9 + * 2 Index (BITS 16-23): SLOT_10 + * 3 Index (BITS 24-31): SLOT_11 + * These percentage values are stored in HEX. For any index max value, can be 64 + * + * Related: num_oce_wan_slots, oce_wan_weightage + * + * Supported Feature: STA Candidate selection + * + * Usage: External + * + * </ini> + */ +#define CFG_OCE_WAN_SCORE_IDX11_TO_8_NAME "oce_wan_score_idx11_to_8" +#define CFG_OCE_WAN_SCORE_IDX11_TO_8_DEFAULT (0x00000064) +#define CFG_OCE_WAN_SCORE_IDX11_TO_8_MIN (0x00000000) +#define CFG_OCE_WAN_SCORE_IDX11_TO_8_MAX (0x64646464) + +/* + * <ini> + * oce_wan_score_idx15_to_12 - % for OCE WAN metrics score for slot 12-15 + * @Min: 0x00000000 + * @Max: 0x64646464 + * @Default: 0x00000000 + * + * This INI give percentage value of OCE WAN metrics DL CAP, to be used as + * index in which the DL CAP value falls. Used only if num_oce_wan_slots is + * greater than 11. + * + * Indexes are defined in this way. + * 0 Index (BITS 0-7): SLOT_12 + * 1 Index (BITS 8-15): SLOT_13 + * 2 Index (BITS 16-23): SLOT_14 + * 3 Index (BITS 24-31): SLOT_15 + * These percentage values are stored in HEX. For any index max value, can be 64 + * + * Related: num_oce_wan_slots, oce_wan_weightage + * + * Supported Feature: STA Candidate selection + * + * Usage: External + * + * </ini> + */ +#define CFG_OCE_WAN_SCORE_IDX15_TO_12_NAME "oce_wan_score_idx15_to_12" +#define CFG_OCE_WAN_SCORE_IDX15_TO_12_DEFAULT (0x00000000) +#define CFG_OCE_WAN_SCORE_IDX15_TO_12_MIN (0x00000000) +#define CFG_OCE_WAN_SCORE_IDX15_TO_12_MAX (0x64646464) + +/* + * <ini> * enable_scoring_for_roam - enable/disable scoring logic in FW for candidate * selection during roaming * @@ -13589,6 +13762,7 @@ struct hdd_config { uint8_t beamforming_cap_weightage; uint8_t pcl_weightage; uint8_t channel_congestion_weightage; + uint8_t oce_wan_weightage; uint32_t bandwidth_weight_per_index; uint32_t nss_weight_per_index; uint32_t band_weight_per_index; @@ -13605,6 +13779,11 @@ struct hdd_config { uint32_t esp_qbss_score_slots7_to_4; uint32_t esp_qbss_score_slots11_to_8; uint32_t esp_qbss_score_slots15_to_12; + uint8_t num_oce_wan_slots; + uint32_t oce_wan_score_slots3_to_0; + uint32_t oce_wan_score_slots7_to_4; + uint32_t oce_wan_score_slots11_to_8; + uint32_t oce_wan_score_slots15_to_12; bool enable_scoring_for_roam; bool chan_switch_hostapd_rate_enabled; }; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 885033a626ed..5ab7d5ede8dd 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -5050,6 +5050,13 @@ struct reg_table_entry g_registry_table[] = { CFG_CHANNEL_CONGESTION_WEIGHTAGE_MIN, CFG_CHANNEL_CONGESTION_WEIGHTAGE_MAX), + REG_VARIABLE(CFG_OCE_WAN_WEIGHTAGE_NAME, WLAN_PARAM_Integer, + struct hdd_config, oce_wan_weightage, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_OCE_WAN_WEIGHTAGE_DEFAULT, + CFG_OCE_WAN_WEIGHTAGE_MIN, + CFG_OCE_WAN_WEIGHTAGE_MAX), + REG_VARIABLE(CFG_BEST_RSSI_THRESHOLD_NAME, WLAN_PARAM_Integer, struct hdd_config, best_rssi_threshold, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -5163,6 +5170,41 @@ struct reg_table_entry g_registry_table[] = { CFG_ESP_QBSS_SCORE_IDX15_TO_12_MIN, CFG_ESP_QBSS_SCORE_IDX15_TO_12_MAX), + REG_VARIABLE(CFG_OCE_WAN_SLOTS_NAME, WLAN_PARAM_Integer, + struct hdd_config, num_oce_wan_slots, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_OCE_WAN_SLOTS_DEFAULT, + CFG_OCE_WAN_SLOTS_MIN, + CFG_OCE_WAN_SLOTS_MAX), + + REG_VARIABLE(CFG_OCE_WAN_SCORE_IDX3_TO_0_NAME, WLAN_PARAM_HexInteger, + struct hdd_config, oce_wan_score_slots3_to_0, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_OCE_WAN_SCORE_IDX3_TO_0_DEFAULT, + CFG_OCE_WAN_SCORE_IDX3_TO_0_MIN, + CFG_OCE_WAN_SCORE_IDX3_TO_0_MAX), + + REG_VARIABLE(CFG_OCE_WAN_SCORE_IDX7_TO_4_NAME, WLAN_PARAM_HexInteger, + struct hdd_config, oce_wan_score_slots7_to_4, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_OCE_WAN_SCORE_IDX7_TO_4_DEFAULT, + CFG_OCE_WAN_SCORE_IDX7_TO_4_MIN, + CFG_OCE_WAN_SCORE_IDX7_TO_4_MAX), + + REG_VARIABLE(CFG_OCE_WAN_SCORE_IDX11_TO_8_NAME, WLAN_PARAM_HexInteger, + struct hdd_config, oce_wan_score_slots11_to_8, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_OCE_WAN_SCORE_IDX11_TO_8_DEFAULT, + CFG_OCE_WAN_SCORE_IDX11_TO_8_MIN, + CFG_OCE_WAN_SCORE_IDX11_TO_8_MAX), + + REG_VARIABLE(CFG_OCE_WAN_SCORE_IDX15_TO_12_NAME, WLAN_PARAM_HexInteger, + struct hdd_config, oce_wan_score_slots15_to_12, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_OCE_WAN_SCORE_IDX15_TO_12_DEFAULT, + CFG_OCE_WAN_SCORE_IDX15_TO_12_MIN, + CFG_OCE_WAN_SCORE_IDX15_TO_12_MAX), + REG_VARIABLE(CFG_ENABLE_SCORING_FOR_ROAM_NAME, WLAN_PARAM_Integer, struct hdd_config, enable_scoring_for_roam, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -6882,6 +6924,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) CFG_CHANNEL_CONGESTION_WEIGHTAGE_NAME, pHddCtx->config->channel_congestion_weightage); hdd_debug("Name = [%s] value = [%u]", + CFG_OCE_WAN_WEIGHTAGE_NAME, + pHddCtx->config->oce_wan_weightage); + hdd_debug("Name = [%s] value = [%u]", CFG_BAND_WIDTH_WEIGHT_PER_INDEX_NAME, pHddCtx->config->bandwidth_weight_per_index); hdd_debug("Name = [%s] value = [%u]", @@ -6934,6 +6979,22 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) pHddCtx->config->enable_scoring_for_roam); hdd_debug("Name = [%s] value = [%u]", + CFG_OCE_WAN_SLOTS_NAME, + pHddCtx->config->num_oce_wan_slots); + hdd_debug("Name = [%s] value = [%u]", + CFG_OCE_WAN_SCORE_IDX3_TO_0_NAME, + pHddCtx->config->oce_wan_score_slots3_to_0); + hdd_debug("Name = [%s] value = [%u]", + CFG_OCE_WAN_SCORE_IDX7_TO_4_NAME, + pHddCtx->config->oce_wan_score_slots7_to_4); + hdd_debug("Name = [%s] value = [%u]", + CFG_OCE_WAN_SCORE_IDX11_TO_8_NAME, + pHddCtx->config->oce_wan_score_slots11_to_8); + hdd_debug("Name = [%s] value = [%u]", + CFG_OCE_WAN_SCORE_IDX15_TO_12_NAME, + pHddCtx->config->oce_wan_score_slots15_to_12); + + hdd_debug("Name = [%s] value = [%u]", CFG_DOT11P_MODE_NAME, pHddCtx->config->dot11p_mode); hdd_debug("Name = [%s] value = [%u]", @@ -8252,6 +8313,7 @@ static void hdd_update_bss_score_params(struct hdd_config *config, score_params->weight_cfg.pcl_weightage = config->pcl_weightage; score_params->weight_cfg.channel_congestion_weightage = config->channel_congestion_weightage; + score_params->weight_cfg.oce_wan_weightage = config->oce_wan_weightage; total_weight = score_params->weight_cfg.rssi_weightage + score_params->weight_cfg.ht_caps_weightage + @@ -8261,7 +8323,8 @@ static void hdd_update_bss_score_params(struct hdd_config *config, score_params->weight_cfg.nss_weightage + score_params->weight_cfg.beamforming_cap_weightage + score_params->weight_cfg.pcl_weightage + - score_params->weight_cfg.channel_congestion_weightage; + score_params->weight_cfg.channel_congestion_weightage + + score_params->weight_cfg.oce_wan_weightage; if (total_weight > BEST_CANDIDATE_MAX_WEIGHT) { @@ -8282,6 +8345,7 @@ static void hdd_update_bss_score_params(struct hdd_config *config, score_params->weight_cfg.pcl_weightage = PCL_WEIGHT; score_params->weight_cfg.channel_congestion_weightage = CHANNEL_CONGESTION_WEIGHTAGE; + score_params->weight_cfg.oce_wan_weightage = OCE_WAN_WEIGHTAGE; } score_params->bandwidth_weight_per_index = @@ -8320,6 +8384,20 @@ static void hdd_update_bss_score_params(struct hdd_config *config, score_params->esp_qbss_scoring.score_pcnt15_to_12 = hdd_limit_max_per_index_score( config->esp_qbss_score_slots15_to_12); + + score_params->oce_wan_scoring.num_slot = config->num_oce_wan_slots; + score_params->oce_wan_scoring.score_pcnt3_to_0 = + hdd_limit_max_per_index_score( + config->oce_wan_score_slots3_to_0); + score_params->oce_wan_scoring.score_pcnt7_to_4 = + hdd_limit_max_per_index_score( + config->oce_wan_score_slots7_to_4); + score_params->oce_wan_scoring.score_pcnt11_to_8 = + hdd_limit_max_per_index_score( + config->oce_wan_score_slots11_to_8); + score_params->oce_wan_scoring.score_pcnt15_to_12 = + hdd_limit_max_per_index_score( + config->oce_wan_score_slots15_to_12); } /** diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 9ea3b6f39d07..a5ceaadfbb50 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -822,7 +822,8 @@ typedef struct sSirBssDescription { #endif uint8_t air_time_fraction; uint8_t nss; - uint16_t reservedPadding3; + uint8_t oce_wan_present; + uint8_t oce_wan_down_cap; /* Please keep the structure 4 bytes aligned above the ieFields */ uint32_t ieFields[1]; diff --git a/core/mac/src/include/parser_api.h b/core/mac/src/include/parser_api.h index 3fcbaca5db8c..8affc7789f8c 100644 --- a/core/mac/src/include/parser_api.h +++ b/core/mac/src/include/parser_api.h @@ -351,6 +351,8 @@ typedef struct sSirProbeRespBeacon { uint8_t MBO_capability; bool assoc_disallowed; uint8_t assoc_disallowed_reason; + bool oce_wan_present; + uint8_t oce_wan_downlink_av_cap; tSirQCNIE QCN_IE; #ifdef WLAN_FEATURE_FILS_SK struct sir_fils_indication fils_ind; diff --git a/core/mac/src/pe/lim/lim_scan_result_utils.c b/core/mac/src/pe/lim/lim_scan_result_utils.c index 9ab751978488..c45eb0b169c4 100644 --- a/core/mac/src/pe/lim/lim_scan_result_utils.c +++ b/core/mac/src/pe/lim/lim_scan_result_utils.c @@ -337,6 +337,11 @@ lim_collect_bss_description(tpAniSirGlobal pMac, } populate_qbss_load_status(pBssDescr, pBPR); + + if (pBPR->oce_wan_present) { + pBssDescr->oce_wan_present = 1; + pBssDescr->oce_wan_down_cap = pBPR->oce_wan_downlink_av_cap; + } lim_update_bss_with_fils_data(pBPR, pBssDescr); /* Copy IE fields */ qdf_mem_copy((uint8_t *) &pBssDescr->ieFields, diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index a8abf6f8b7e3..4389c72d6f68 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -2705,6 +2705,11 @@ tSirRetStatus sir_convert_probe_frame2_struct(tpAniSirGlobal pMac, pProbeResp->assoc_disallowed_reason = pr->MBO_IE.assoc_disallowed.reason_code; } + if (pr->MBO_IE.reduced_wan_metrics.present) { + pProbeResp->oce_wan_present = true; + pProbeResp->oce_wan_downlink_av_cap = + pr->MBO_IE.reduced_wan_metrics.downlink_av_cap; + } } if (pr->QCN_IE.present) { @@ -4394,6 +4399,12 @@ sir_convert_beacon_frame2_struct(tpAniSirGlobal pMac, pBeaconStruct->assoc_disallowed_reason = pBeacon->MBO_IE.assoc_disallowed.reason_code; } + if (pBeacon->MBO_IE.reduced_wan_metrics.present) { + pBeaconStruct->oce_wan_present = true; + pBeaconStruct->oce_wan_downlink_av_cap = + pBeacon->MBO_IE. + reduced_wan_metrics.downlink_av_cap; + } } if (pBeacon->QCN_IE.present) { diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 9c9de8fdda7a..f2c5a1a018e3 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -1732,6 +1732,8 @@ static void init_config_param(tpAniSirGlobal pMac) PCL_WEIGHT; pMac->roam.configParam.bss_score_params.weight_cfg. channel_congestion_weightage = CHANNEL_CONGESTION_WEIGHTAGE; + pMac->roam.configParam.bss_score_params.weight_cfg.oce_wan_weightage = + OCE_WAN_WEIGHTAGE; } eCsrBand csr_get_current_band(tHalHandle hHal) diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 4fdae5da03f6..07a333992704 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -1951,41 +1951,35 @@ static int32_t csr_calculate_bandwidth_score(tpAniSirGlobal mac_ctx, } /** - * csr_get_congestion_score_for_index () - get congetion score for the given + * csr_get_score_for_index () - get score for the given * index * @index: index for which we need the score - * @bss_score_params: bss score params + * @weightage: weigtage for the param + * @score: per slot score * - * Return : congestion score for the index + * Return : score for the index */ -static int32_t csr_get_congestion_score_for_index(uint8_t index, - struct sir_score_config *bss_score_params) -{ - if (index <= WLAN_ESP_QBSS_INDEX_3) - return bss_score_params->weight_cfg. - channel_congestion_weightage * - WLAN_GET_SCORE_PERCENTAGE( - bss_score_params->esp_qbss_scoring.score_pcnt3_to_0, - index); - else if (index <= WLAN_ESP_QBSS_INDEX_7) - return bss_score_params->weight_cfg. - channel_congestion_weightage * - WLAN_GET_SCORE_PERCENTAGE( - bss_score_params->esp_qbss_scoring.score_pcnt7_to_4, - index - WLAN_ESP_QBSS_OFFSET_INDEX_7_4); - else if (index <= WLAN_ESP_QBSS_INDEX_11) - return bss_score_params->weight_cfg. - channel_congestion_weightage * - WLAN_GET_SCORE_PERCENTAGE( - bss_score_params->esp_qbss_scoring.score_pcnt11_to_8, - index - WLAN_ESP_QBSS_OFFSET_INDEX_11_8); +static int32_t csr_get_score_for_index(uint8_t index, uint8_t weightage, + struct sir_per_slot_scoring *score) +{ + if (index <= WLAN_SCORE_INDEX_3) + return weightage * WLAN_GET_SCORE_PERCENTAGE( + score->score_pcnt3_to_0, + index); + else if (index <= WLAN_SCORE_INDEX_7) + return weightage * WLAN_GET_SCORE_PERCENTAGE( + score->score_pcnt7_to_4, + index - WLAN_SCORE_OFFSET_INDEX_7_4); + else if (index <= WLAN_SCORE_INDEX_11) + return weightage * WLAN_GET_SCORE_PERCENTAGE( + score->score_pcnt11_to_8, + index - WLAN_SCORE_OFFSET_INDEX_11_8); else - return bss_score_params->weight_cfg. - channel_congestion_weightage * - WLAN_GET_SCORE_PERCENTAGE( - bss_score_params->esp_qbss_scoring.score_pcnt15_to_12, - index - WLAN_ESP_QBSS_OFFSET_INDEX_15_12); + return weightage * WLAN_GET_SCORE_PERCENTAGE( + score->score_pcnt15_to_12, + index - WLAN_SCORE_OFFSET_INDEX_15_12); } + /** * csr_calculate_congestion_score () - Calculate congestion score * @mac_ctx: Pointer to mac context @@ -2009,18 +2003,20 @@ static int32_t csr_calculate_congestion_score(tpAniSirGlobal mac_ctx, return 0; if (bss_score_params->esp_qbss_scoring.num_slot > - WLAN_ESP_QBSS_MAX_INDEX) + WLAN_SCORE_MAX_INDEX) bss_score_params->esp_qbss_scoring.num_slot = - WLAN_ESP_QBSS_MAX_INDEX; + WLAN_SCORE_MAX_INDEX; good_rssi_threshold = bss_score_params->rssi_score.good_rssi_threshold * (-1); /* For bad zone rssi get score from last index */ if (bss_info->rssi < good_rssi_threshold) - return csr_get_congestion_score_for_index( - bss_score_params->esp_qbss_scoring.num_slot, - bss_score_params); + return csr_get_score_for_index( + bss_score_params->esp_qbss_scoring.num_slot, + bss_score_params->weight_cfg. + channel_congestion_weightage, + &bss_score_params->esp_qbss_scoring); if (bss_info->air_time_fraction) { /* Convert 0-255 range to percentage */ @@ -2046,10 +2042,10 @@ static int32_t csr_calculate_congestion_score(tpAniSirGlobal mac_ctx, congestion = qdf_do_div(ap_load, MAX_AP_LOAD); } else { return bss_score_params->weight_cfg. - channel_congestion_weightage * + channel_congestion_weightage * WLAN_GET_SCORE_PERCENTAGE( bss_score_params->esp_qbss_scoring.score_pcnt3_to_0, - WLAN_ESP_QBSS_INDEX_0); + WLAN_SCORE_INDEX_0); } window_size = BEST_CANDIDATE_MAX_WEIGHT / @@ -2061,7 +2057,49 @@ static int32_t csr_calculate_congestion_score(tpAniSirGlobal mac_ctx, if (index > bss_score_params->esp_qbss_scoring.num_slot) index = bss_score_params->esp_qbss_scoring.num_slot; - return csr_get_congestion_score_for_index(index, bss_score_params); + return csr_get_score_for_index(index, bss_score_params->weight_cfg. + channel_congestion_weightage, + &bss_score_params->esp_qbss_scoring); +} + +/** + * csr_calculate_oce_wan_score () - Calculate oce wan score + * @mac_ctx: Pointer to mac context + * @bss_info: bss information + * @bss_score_params: bss score params + * + * Return : oce wan score + */ +static int32_t csr_calculate_oce_wan_score(tpAniSirGlobal mac_ctx, + tSirBssDescription *bss_info, + struct sir_score_config *bss_score_params) +{ + uint32_t window_size; + uint8_t index; + + if (!bss_score_params->oce_wan_scoring.num_slot) + return 0; + + if (bss_score_params->oce_wan_scoring.num_slot > + WLAN_SCORE_MAX_INDEX) + bss_score_params->oce_wan_scoring.num_slot = + WLAN_SCORE_MAX_INDEX; + + window_size = MAX_OCE_WAN_DL_CAP/ + bss_score_params->oce_wan_scoring.num_slot; + + if (bss_info->oce_wan_present) + /* Desired values are from 1 to 15, as 0 is for not present */ + index = qdf_do_div(bss_info->oce_wan_down_cap, window_size) + 1; + else + index = WLAN_SCORE_INDEX_0; + + if (index > bss_score_params->oce_wan_scoring.num_slot) + index = bss_score_params->oce_wan_scoring.num_slot; + + return csr_get_score_for_index(index, + bss_score_params->weight_cfg.oce_wan_weightage, + &bss_score_params->oce_wan_scoring); } /** @@ -2130,6 +2168,7 @@ static int32_t _csr_calculate_bss_score(tpAniSirGlobal mac_ctx, int32_t pcl_score = 0; int32_t bandwidth_score = 0; int32_t band_score = 0; + int32_t oce_wan_score = 0; struct sir_weight_config *weight_config; uint32_t beamformee_cap; uint32_t dot11mode; @@ -2239,7 +2278,11 @@ static int32_t _csr_calculate_bss_score(tpAniSirGlobal mac_ctx, weight_config->nss_weightage, prorated_pcnt); score += nss_score; - sme_debug("BSSID:"MAC_ADDRESS_STR" rssi=%d dot11mode %d htcaps=%d vht=%d enableVhtFor24GHz %d AP bw=%d channel=%d self beamformee %d AP beamforming %d air time fraction %d qbss load %d ap_NSS %d sta nss %d", + oce_wan_score = csr_calculate_oce_wan_score(mac_ctx, bss_info, + bss_score_params); + score += oce_wan_score; + + sme_debug("BSSID:"MAC_ADDRESS_STR" rssi=%d dot11mode %d htcaps=%d vht=%d enableVhtFor24GHz %d AP bw=%d channel=%d self beamformee %d AP beamforming %d air time fraction %d qbss load %d ap_NSS %d sta nss %d oce_wan_present %d oce_wan_down_cap %d", MAC_ADDR_ARRAY(bss_info->bssId), bss_info->rssi, dot11mode, bss_info->ht_caps_present, bss_info->vht_caps_present, @@ -2249,12 +2292,14 @@ static int32_t _csr_calculate_bss_score(tpAniSirGlobal mac_ctx, bss_info->beacomforming_capable, bss_info->air_time_fraction, bss_info->qbss_chan_load, - bss_info->nss, sta_nss); + bss_info->nss, sta_nss, + bss_info->oce_wan_present, + bss_info->oce_wan_down_cap); - sme_debug("Scores : rssi %d pcl %d prorated_pcnt %d ht %d vht %d beamformee %d bw %d band %d congestion %d nss %d TOTAL score %d", + sme_debug("Scores : rssi %d pcl %d prorated_pcnt %d ht %d vht %d beamformee %d bw %d band %d congestion %d nss %d oce wan %d TOTAL score %d", rssi_score, pcl_score, prorated_pcnt, ht_score, vht_score, beamformee_score, bandwidth_score, band_score, - congestion_score, nss_score, score); + congestion_score, nss_score, oce_wan_score, score); return score; } diff --git a/core/sme/src/csr/csr_inside_api.h b/core/sme/src/csr/csr_inside_api.h index 802cd2af754c..c0e5ccb76a37 100644 --- a/core/sme/src/csr/csr_inside_api.h +++ b/core/sme/src/csr/csr_inside_api.h @@ -154,15 +154,16 @@ bool csr_is_supported_channel(tpAniSirGlobal pMac, uint8_t channelId); /* 2 and 3 are reserved */ #define WLAN_MAX_BAND_INDEX 4 -#define WLAN_ESP_QBSS_INDEX_0 0 -#define WLAN_ESP_QBSS_INDEX_3 3 -#define WLAN_ESP_QBSS_INDEX_7 7 -#define WLAN_ESP_QBSS_OFFSET_INDEX_7_4 4 -#define WLAN_ESP_QBSS_INDEX_11 11 -#define WLAN_ESP_QBSS_OFFSET_INDEX_11_8 8 -#define WLAN_ESP_QBSS_MAX_INDEX 15 -#define WLAN_ESP_QBSS_OFFSET_INDEX_15_12 12 - +#define WLAN_SCORE_INDEX_0 0 +#define WLAN_SCORE_INDEX_3 3 +#define WLAN_SCORE_INDEX_7 7 +#define WLAN_SCORE_OFFSET_INDEX_7_4 4 +#define WLAN_SCORE_INDEX_11 11 +#define WLAN_SCORE_OFFSET_INDEX_11_8 8 +#define WLAN_SCORE_MAX_INDEX 15 +#define WLAN_SCORE_OFFSET_INDEX_15_12 12 + +#define MAX_OCE_WAN_DL_CAP 16 enum csr_scancomplete_nextcommand { eCsrNextScanNothing, |
