From cbf1212230d22b9a2cf87d605dd4366673572c8a Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Sun, 18 Nov 2018 14:52:11 +0530 Subject: [PATCH] qcacld-3.0: Verify the nss config with rf chains supported The driver fills the nss chains params in the vdev during vdev create. The nss and chain params are filled by the user in the ini file, but it may happen that the user filled the nss param for that particular vdev as 2, and the number of supported rf chains are 1, which is sent to the driver by FW, so that would result in nss as 2, and chains as 1, which cannot be supported. Fix is to downgrade the nss to the number of chains supported by the FW. Change-Id: Ifa3ee74dbe5b8d19c6dc11ff64e42dbffadaa018 CRs-Fixed: 2354205 --- core/sme/src/common/sme_api.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 01231472a638..bbac5f82654d 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -4805,6 +4805,17 @@ static uint8_t sme_get_nss_chain_shift(enum QDF_OPMODE device_mode) } } +static void +sme_check_nss_chain_ini_param(struct wlan_mlme_nss_chains *vdev_ini_cfg, + uint8_t rf_chains_supported, + enum nss_chains_band_info band) +{ + vdev_ini_cfg->rx_nss[band] = QDF_MIN(vdev_ini_cfg->rx_nss[band], + rf_chains_supported); + vdev_ini_cfg->tx_nss[band] = QDF_MIN(vdev_ini_cfg->tx_nss[band], + rf_chains_supported); +} + static void sme_fill_nss_chain_params(struct mac_context *mac_ctx, struct wlan_mlme_nss_chains *vdev_ini_cfg, @@ -4864,6 +4875,14 @@ sme_fill_nss_chain_params(struct mac_context *mac_ctx, vdev_ini_cfg->disable_tx_mrc[band] = nss_chains_ini_cfg->disable_tx_mrc[band]; + /* + * Check whether the rx/tx nss is greater than the number of rf chains + * supported by FW, if so downgrade the nss to the number of chains + * supported, as higher nss cannot be supported with less chains. + */ + sme_check_nss_chain_ini_param(vdev_ini_cfg, rf_chains_supported, + band); + } void sme_populate_nss_chain_params(mac_handle_t mac_handle,