From 22ff4c6aa878516e18c58579e330375feee11f58 Mon Sep 17 00:00:00 2001 From: Sourav Mohapatra Date: Thu, 16 May 2019 12:04:59 +0530 Subject: [PATCH] qcacld-3.0: Rectify the max rates being sent Currently in the driver, the max rates that are being sent to the userspace do not take into account the value of the ini enable_vht20_mcs9. This ini state that the connection doesn't support MCS9 rates for vht20. As this is not taken into account, the rates being sent are incorrect. Add a check inside hdd_report_max_rate to check the value of the ini before filling up the max MCS index. Change-Id: I39742b7cc6a18c3d7693a6efef05987ec0e80cec CRs-Fixed: 2453759 --- core/hdd/src/wlan_hdd_stats.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index 51a288c0e27c..fadb995d4d15 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -3945,6 +3945,7 @@ bool hdd_report_max_rate(mac_handle_t mac_handle, uint8_t i, j, rssidx; uint16_t max_rate = 0; uint32_t vht_mcs_map; + bool is_vht20_mcs9 = false; uint16_t current_rate = 0; qdf_size_t or_leng = CSR_DOT11_SUPPORTED_RATES_MAX; uint8_t operational_rates[CSR_DOT11_SUPPORTED_RATES_MAX]; @@ -4056,6 +4057,7 @@ bool hdd_report_max_rate(mac_handle_t mac_handle, * Only if we are connected in non legacy mode and not reporting * actual speed */ + if ((3 != rssidx) && !(rate_flags & TX_RATE_LEGACY)) { if (0 != ucfg_mlme_get_current_mcs_set(hdd_ctx->psoc, mcs_rates, @@ -4085,6 +4087,12 @@ bool hdd_report_max_rate(mac_handle_t mac_handle, &vht_mcs_map); if (QDF_IS_STATUS_ERROR(stat)) hdd_err("failed to get tx_mcs_map"); + + stat = ucfg_mlme_get_vht20_mcs9(hdd_ctx->psoc, + &is_vht20_mcs9); + if (QDF_IS_STATUS_ERROR(stat)) + hdd_err("Failed to get VHT20 MCS9 enable val"); + vht_max_mcs = (enum data_rate_11ac_max_mcs) (vht_mcs_map & DATA_RATE_11AC_MCS_MASK); if (rate_flags & TX_RATE_SGI) @@ -4095,7 +4103,16 @@ bool hdd_report_max_rate(mac_handle_t mac_handle, } else if (DATA_RATE_11AC_MAX_MCS_8 == vht_max_mcs) { max_mcs_idx = 8; } else if (DATA_RATE_11AC_MAX_MCS_9 == vht_max_mcs) { - max_mcs_idx = 9; + /* + * If the ini enable_vht20_mcs9 is disabled, + * then max mcs index should not be set to 9 + * for TX_RATE_VHT20 + */ + if (!is_vht20_mcs9 && + (rate_flags & TX_RATE_VHT20)) + max_mcs_idx = 8; + else + max_mcs_idx = 9; } if (rssidx != 0) {