From 4d1f4ccf885548fd3a2f7da41e44262ec2835f4a Mon Sep 17 00:00:00 2001 From: Sourav Mohapatra Date: Mon, 21 Oct 2019 16:43:49 +0530 Subject: [PATCH] qcacld-3.0: Populate and send correct max rate to the userspace When the ini gReportMaxLinkSpeed is set, it indicates that the rates provided to the userspace should give the maximum possible rate for the given connected parameters. But currently in the driver, the max rate that is being sent to the userspace is dependent on the NSS at which the tx/rx is being done. The NSS is calculated by taking the union of the value from assoc req and from the rate table using MCS index/rates from firmware. The rates fluctuate as per the tx/rx by firmware which subsequently affects the NSS in the host. To keep the max rate independent of this changing NSS, decouple the NSS calculation to contain the value from only the assoc req when reporting max rate. Change-Id: I03d10e397fca6853d05b4812a2adeac0110bc517 CRs-Fixed: 2548498 --- core/hdd/src/wlan_hdd_stats.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index 71966da4bc93..4ae0476b5db9 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -4548,14 +4548,16 @@ static int wlan_hdd_get_sta_stats(struct wiphy *wiphy, tx_rate_flags, tx_mcs_index, my_tx_rate, - tx_nss); + wlan_vdev_mlme_get_nss( + adapter->vdev)); rx_rate_calc = hdd_report_max_rate(mac_handle, &sinfo->rxrate, sinfo->signal, rx_rate_flags, rx_mcs_index, my_rx_rate, - rx_nss); + wlan_vdev_mlme_get_nss( + adapter->vdev)); if (!tx_rate_calc || !rx_rate_calc) /* Keep GUI happy */