diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index 0967c29714..87ff8650f8 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -414,6 +414,7 @@ static void mlme_init_generic_cfg(struct wlan_objmgr_psoc *psoc, cfg_get(psoc, CFG_SAE_CONNECION_RETRIES); gen->monitor_mode_concurrency = cfg_get(psoc, CFG_MONITOR_MODE_CONCURRENCY); + gen->tx_retry_multiplier = cfg_get(psoc, CFG_TX_RETRY_MULTIPLIER); mlme_init_wds_config_cfg(psoc, gen); } diff --git a/components/mlme/dispatcher/inc/cfg_mlme_generic.h b/components/mlme/dispatcher/inc/cfg_mlme_generic.h index f5edeaeb38..d1ead6f62b 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_generic.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_generic.h @@ -876,6 +876,31 @@ enum wlan_wds_mode { #define CFG_WDS_MODE_ALL #endif +/* + * + * tx_retry_multiplier - TX retry multiplier + * @Min: 0 + * @Max: 500 + * @Default: 0 + * + * This ini is used to indicate percentage to max retry limit to fw + * which can further be used by fw to multiply counter by + * tx_retry_multiplier percent. + * + * Supported Feature: STA/SAP + * + * Usage: External + * + * + */ +#define CFG_TX_RETRY_MULTIPLIER CFG_INI_UINT( \ + "tx_retry_multiplier", \ + 0, \ + 500, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "percentage of max retry limit") + #define CFG_GENERIC_ALL \ CFG(CFG_ENABLE_DEBUG_PACKET_LOG) \ CFG(CFG_PMF_SA_QUERY_MAX_RETRIES) \ @@ -910,5 +935,6 @@ enum wlan_wds_mode { CFG(CFG_WLS_6GHZ_CAPABLE) \ CFG(CFG_MONITOR_MODE_CONCURRENCY) \ CFG(CFG_RF_TEST_MODE_SUPP_ENABLED) \ - CFG_WDS_MODE_ALL + CFG_WDS_MODE_ALL \ + CFG(CFG_TX_RETRY_MULTIPLIER) #endif /* __CFG_MLME_GENERIC_H */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h index 9a41c7f862..3a1088fe74 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -3395,4 +3396,17 @@ wlan_mlme_get_p2p_p2p_conc_support(struct wlan_objmgr_psoc *psoc) * Return: vht channel width */ enum phy_ch_width mlme_get_vht_ch_width(void); + +/** + * wlan_mlme_get_tx_retry_multiplier() - Get the tx retry multiplier percentage + * + * @psoc: pointer to psoc object + * @tx_retry_multiplier: pointer to hold user config value of + * tx_retry_multiplier + * + * Return: QDF Status + */ +QDF_STATUS +wlan_mlme_get_tx_retry_multiplier(struct wlan_objmgr_psoc *psoc, + uint32_t *tx_retry_multiplier); #endif /* _WLAN_MLME_API_H_ */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index bac85c884b..df268f96a8 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -1323,6 +1323,7 @@ struct dual_sta_policy { * @ocv_support: FW supports OCV or not * @wds_mode: wds mode supported * @dual_sta_policy_cfg: Dual STA policies configuration + * @tx_retry_multiplier: TX xretry extension parameter */ struct wlan_mlme_generic { uint32_t band_capability; @@ -1368,6 +1369,7 @@ struct wlan_mlme_generic { bool ocv_support; enum wlan_wds_mode wds_mode; struct dual_sta_policy dual_sta_policy; + uint32_t tx_retry_multiplier; }; /* diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c index 5d81dc7fd5..df3b2e0315 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -5288,3 +5289,21 @@ enum phy_ch_width mlme_get_vht_ch_width(void) return bandwidth; } + +QDF_STATUS +wlan_mlme_get_tx_retry_multiplier(struct wlan_objmgr_psoc *psoc, + uint32_t *tx_retry_multiplier) +{ + struct wlan_mlme_psoc_ext_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_ext_obj(psoc); + + if (!mlme_obj) { + *tx_retry_multiplier = + cfg_default(CFG_TX_RETRY_MULTIPLIER); + return QDF_STATUS_E_FAILURE; + } + + *tx_retry_multiplier = mlme_obj->cfg.gen.tx_retry_multiplier; + return QDF_STATUS_SUCCESS; +} diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 80ab72ae8a..8ba3c12ce3 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -13634,6 +13634,7 @@ static int hdd_pre_enable_configure(struct hdd_context *hdd_ctx) int ret; uint8_t val = 0; uint8_t max_retry = 0; + uint32_t tx_retry_multiplier; QDF_STATUS status; void *soc = cds_get_context(QDF_MODULE_ID_SOC); @@ -13684,6 +13685,16 @@ static int hdd_pre_enable_configure(struct hdd_context *hdd_ctx) goto out; } + wlan_mlme_get_tx_retry_multiplier(hdd_ctx->psoc, + &tx_retry_multiplier); + ret = sme_cli_set_command(0, WMI_PDEV_PARAM_PDEV_STATS_TX_XRETRY_EXT, + tx_retry_multiplier, PDEV_CMD); + if (0 != ret) { + hdd_err("WMI_PDEV_PARAM_PDEV_STATS_TX_XRETRY_EXT failed %d", + ret); + goto out; + } + ret = hdd_set_smart_chainmask_enabled(hdd_ctx); if (ret) goto out;