summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshish Kumar Dhanotiya <adhanoti@codeaurora.org>2020-03-16 14:20:26 +0530
committernshrivas <nshrivas@codeaurora.org>2020-04-13 08:32:59 -0700
commit4acb8b921fde76de5a3f3d32cb01d69e987b35f4 (patch)
tree6769d1a9e11d739a802bd673c24816a00ed69231
parent20c54d1e8d2234f58458df0dbc1c2d07dac61805 (diff)
qcacld-3.0: Update correct MCS parameters in wiphy
Currently MCS parameters are not getting correctly in wiphy which results in incorrect capabilities for iw list command output. To resolve above issue, update MCS parameters correctly in wiphy band capabilities. CRs-Fixed: 2633314 Change-Id: I830ad50aa4842bd2a79c97ed7b11b82c35148ff0
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c26
-rw-r--r--core/hdd/src/wlan_hdd_main.c77
-rw-r--r--core/mac/inc/sir_mac_prot_def.h7
-rw-r--r--core/mac/src/cfg/cfgUtil/cfg.txt8
4 files changed, 90 insertions, 28 deletions
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 0da2e57c8d53..6d077856b24c 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -14147,6 +14147,12 @@ static void wlan_hdd_update_band_cap(hdd_context_t *hdd_ctx)
uint16_t val16;
tSirMacHTCapabilityInfo *ht_cap_info;
QDF_STATUS status;
+ struct ieee80211_supported_band *band_2g;
+ struct ieee80211_supported_band *band_5g;
+ uint8_t i;
+
+ band_2g = hdd_ctx->wiphy->bands[HDD_NL80211_BAND_2GHZ];
+ band_5g = hdd_ctx->wiphy->bands[HDD_NL80211_BAND_5GHZ];
status = sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_HT_CAP_INFO, &val32);
if (QDF_STATUS_SUCCESS != status) {
@@ -14173,6 +14179,26 @@ static void wlan_hdd_update_band_cap(hdd_context_t *hdd_ctx)
vht_cap.vht_supported = 0;
hdd_ctx->wiphy->bands[HDD_NL80211_BAND_5GHZ]->vht_cap.cap = 0;
}
+ if (band_2g) {
+ for (i = 0; i < hdd_ctx->num_rf_chains; i++)
+ band_2g->ht_cap.mcs.rx_mask[i] = 0xff;
+ /*
+ * According to mcs_nss HT MCS parameters highest data
+ * rate for Nss = 1 is 150 Mbps
+ */
+ band_2g->ht_cap.mcs.rx_highest =
+ cpu_to_le16(150 * hdd_ctx->num_rf_chains);
+ }
+ if (band_5g) {
+ for (i = 0; i < hdd_ctx->num_rf_chains; i++)
+ band_5g->ht_cap.mcs.rx_mask[i] = 0xff;
+ /*
+ * According to mcs_nss HT MCS parameters highest data
+ * rate for Nss = 1 is 150 Mbps
+ */
+ band_5g->ht_cap.mcs.rx_highest =
+ cpu_to_le16(150 * hdd_ctx->num_rf_chains);
+ }
}
/*
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 8a4591825f7a..4aa922e2b903 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2020 The Linux Foundation. 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
@@ -1133,6 +1133,7 @@ static void hdd_update_wiphy_vhtcap(hdd_context_t *hdd_ctx)
struct ieee80211_supported_band *band_5g =
hdd_ctx->wiphy->bands[NL80211_BAND_5GHZ];
uint32_t val;
+ uint32_t value1;
if (!band_5g) {
hdd_debug("5GHz band disabled, skipping capability population");
@@ -1148,6 +1149,13 @@ static void hdd_update_wiphy_vhtcap(hdd_context_t *hdd_ctx)
hdd_debug("Updated wiphy vhtcap:0x%x, CSNAntSupp:%d, NumSoundDim:%d",
band_5g->vht_cap.cap, hdd_ctx->config->txBFCsnValue, val);
+
+ sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_RX_MCS_MAP, &value1);
+ band_5g->vht_cap.vht_mcs.rx_mcs_map = value1;
+
+ sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_TX_MCS_MAP, &value1);
+ band_5g->vht_cap.vht_mcs.tx_mcs_map = value1;
+
}
/**
@@ -1234,30 +1242,9 @@ static void hdd_update_tgt_ht_cap(hdd_context_t *hdd_ctx,
enable_tx_stbc = pconfig->enableTxSTBC;
- if (pconfig->enable2x2 && (cfg->num_rf_chains == 2)) {
+ if (pconfig->enable2x2 && (cfg->num_rf_chains == 2))
pconfig->enable2x2 = 1;
- } else {
- pconfig->enable2x2 = 0;
- enable_tx_stbc = 0;
- /* 1x1 */
- /* Update Rx Highest Long GI data Rate */
- if (sme_cfg_set_int(hdd_ctx->hHal,
- WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE,
- VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_1_1)
- == QDF_STATUS_E_FAILURE) {
- hdd_err("Could not pass on WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE to CCM");
- }
-
- /* Update Tx Highest Long GI data Rate */
- if (sme_cfg_set_int
- (hdd_ctx->hHal,
- WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE,
- VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_1_1) ==
- QDF_STATUS_E_FAILURE) {
- hdd_err("VHT_TX_HIGHEST_SUPP_RATE_1_1 to CCM fail");
- }
- }
if (!(cfg->ht_tx_stbc && pconfig->enable2x2))
enable_tx_stbc = 0;
phtCapInfo->txSTBC = enable_tx_stbc;
@@ -1303,12 +1290,54 @@ static void hdd_update_tgt_vht_cap(hdd_context_t *hdd_ctx,
uint32_t ch_width = eHT_CHANNEL_WIDTH_80MHZ;
uint32_t hw_rx_ldpc_enabled;
struct wma_caps_per_phy caps_per_phy;
+ uint32_t tx_highest_data_rate;
+ uint32_t rx_highest_data_rate;
if (!band_5g) {
hdd_debug("5GHz band disabled, skipping capability population");
return;
}
+ if (pconfig->enable2x2) {
+ if (cfg->vht_short_gi_80 & WMI_VHT_CAP_SGI_80MHZ) {
+ /* Update 2x2 Highest Short GI data rate */
+ tx_highest_data_rate =
+ VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_2_2_SGI80;
+ rx_highest_data_rate =
+ VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_2_2_SGI80;
+ } else {
+ /* Update 2x2 Rx Highest Long GI data Rate */
+ tx_highest_data_rate =
+ VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_2_2;
+ rx_highest_data_rate =
+ VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_2_2;
+ }
+ } else if (cfg->vht_short_gi_80 & WMI_VHT_CAP_SGI_80MHZ) {
+ /* Update 1x1 Highest Short GI data rate */
+ tx_highest_data_rate =
+ VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_1_1_SGI80;
+ rx_highest_data_rate =
+ VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_1_1_SGI80;
+ } else {
+ /* Update 1x1 Highest Long GI data rate */
+ tx_highest_data_rate = VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_1_1;
+ rx_highest_data_rate = VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_1_1;
+ }
+
+ status = sme_cfg_set_int(hdd_ctx->hHal,
+ WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE,
+ rx_highest_data_rate);
+
+ if (!QDF_IS_STATUS_SUCCESS(status))
+ hdd_err("Failed to set rx_supp_data_rate");
+
+ status = sme_cfg_set_int(hdd_ctx->hHal,
+ WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE,
+ tx_highest_data_rate);
+
+ if (!QDF_IS_STATUS_SUCCESS(status))
+ hdd_err("Failed to set tx_supp_data_rate");
+
/* Get the current MPDU length */
status =
sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_MAX_MPDU_LENGTH,
@@ -1654,6 +1683,8 @@ static void hdd_update_tgt_vht_cap(hdd_context_t *hdd_ctx,
if (cfg->vht_txop_ps & WMI_VHT_CAP_TXOP_PS)
band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_VHT_TXOP_PS;
+ band_5g->vht_cap.vht_mcs.rx_highest = cpu_to_le16(rx_highest_data_rate);
+ band_5g->vht_cap.vht_mcs.tx_highest = cpu_to_le16(tx_highest_data_rate);
}
/**
diff --git a/core/mac/inc/sir_mac_prot_def.h b/core/mac/inc/sir_mac_prot_def.h
index 724ac8e9ad3c..5f23432ec24b 100644
--- a/core/mac/inc/sir_mac_prot_def.h
+++ b/core/mac/inc/sir_mac_prot_def.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2020 The Linux Foundation. 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
@@ -399,6 +399,11 @@
#define VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_2_2 780
#define VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_2_2 780
+#define VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_1_1_SGI80 433
+#define VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_1_1_SGI80 433
+#define VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_2_2_SGI80 866
+#define VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_2_2_SGI80 866
+
#define VHT_CAP_80_SUPP 0
#define VHT_CAP_160_SUPP 1
#define VHT_CAP_160_AND_80P80_SUPP 2
diff --git a/core/mac/src/cfg/cfgUtil/cfg.txt b/core/mac/src/cfg/cfgUtil/cfg.txt
index 24aef950d09c..e6b312ea2fed 100644
--- a/core/mac/src/cfg/cfgUtil/cfg.txt
+++ b/core/mac/src/cfg/cfgUtil/cfg.txt
@@ -2754,10 +2754,10 @@ LIM
WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE I 4 19
V RW NP
LIM
-0 780 780
+0 866 866
V RW NP
LIM
-0 780 780
+0 866 866
*
* Tx Highest supported data rate.
@@ -2765,10 +2765,10 @@ LIM
WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE I 4 19
V RW NP
LIM
-0 780 780
+0 866 866
V RW NP
LIM
-0 780 780
+0 866 866
*
* Channel center freq Seg1