From 0e478c6829c7964d10a3ebce6fc65fa5d893e41f Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Tue, 10 Nov 2015 15:20:06 -0800 Subject: [PATCH] qcacld-3.0: wma_update_intf_hw_mode_params to call tx & rx ss macros correctly The Tx & Rx SS macros aren't called with correct parameter in wma_update_intf_hw_mode_params. Fix the calls to get the Tx & Rx SS values correctly. Change-Id: I4df4db549d4bb0c7d00a521de55165bfccf16a65 CRs-fixed: 935341 --- core/wma/src/wma_utils.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index b2f1fa5b7842..fd34f803a920 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -2925,6 +2925,7 @@ void wma_update_intf_hw_mode_params(uint32_t vdev_id, uint32_t mac_id, uint32_t cfgd_hw_mode_index) { tp_wma_handle wma; + uint32_t param; wma = cds_get_context(CDF_MODULE_ID_WMA); if (!wma) { @@ -2937,17 +2938,23 @@ void wma_update_intf_hw_mode_params(uint32_t vdev_id, uint32_t mac_id, return; } + if (cfgd_hw_mode_index > wma->num_dbs_hw_modes) { + WMA_LOGE("%s: Invalid index", __func__); + return; + } + + param = wma->hw_mode.hw_mode_list[cfgd_hw_mode_index]; wma->interfaces[vdev_id].mac_id = mac_id; if (mac_id == 0) { wma->interfaces[vdev_id].tx_streams = - WMI_DBS_HW_MODE_MAC0_TX_STREAMS_GET(cfgd_hw_mode_index); + WMI_DBS_HW_MODE_MAC0_TX_STREAMS_GET(param); wma->interfaces[vdev_id].rx_streams = - WMI_DBS_HW_MODE_MAC0_RX_STREAMS_GET(cfgd_hw_mode_index); + WMI_DBS_HW_MODE_MAC0_RX_STREAMS_GET(param); } else { wma->interfaces[vdev_id].tx_streams = - WMI_DBS_HW_MODE_MAC1_TX_STREAMS_GET(cfgd_hw_mode_index); + WMI_DBS_HW_MODE_MAC1_TX_STREAMS_GET(param); wma->interfaces[vdev_id].rx_streams = - WMI_DBS_HW_MODE_MAC1_RX_STREAMS_GET(cfgd_hw_mode_index); + WMI_DBS_HW_MODE_MAC1_RX_STREAMS_GET(param); } }