qcacld-3.0: Use HW MODE ID to find HW mode info

Firmware reports HW mode ID during HW mode change,
use Policy mgr API to get HW mode Info.

Change-Id: I01c7e346a5c2292490705690bc8261b41d0a8127
CRs-Fixed: 2256189
This commit is contained in:
Liangwei Dong 2018-05-22 22:14:37 -04:00 • committed by nshrivas
commit 0f9c75d562
2 changed files with 21 additions and 10 deletions

View file

@ -6946,6 +6946,7 @@ static int iw_get_policy_manager_ut_ops(struct hdd_context *hdd_ctx,
HW_MODE_SS_2x2,
HW_MODE_80_MHZ,
HW_MODE_SS_0x0, HW_MODE_BW_NONE,
HW_MODE_MAC_BAND_NONE,
HW_MODE_DBS_NONE,
HW_MODE_AGILE_DFS_NONE,
HW_MODE_SBS_NONE,
@ -6957,6 +6958,7 @@ static int iw_get_policy_manager_ut_ops(struct hdd_context *hdd_ctx,
HW_MODE_SS_1x1,
HW_MODE_80_MHZ,
HW_MODE_SS_1x1, HW_MODE_40_MHZ,
HW_MODE_MAC_BAND_NONE,
HW_MODE_DBS,
HW_MODE_AGILE_DFS_NONE,
HW_MODE_SBS_NONE,

View file

@ -4165,7 +4165,8 @@ 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;
struct policy_mgr_hw_mode_params hw_mode;
QDF_STATUS status;
wma = cds_get_context(QDF_MODULE_ID_WMA);
if (!wma) {
@ -4178,24 +4179,32 @@ 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__);
status = policy_mgr_get_hw_mode_from_idx(wma->psoc, cfgd_hw_mode_index,
&hw_mode);
if (!QDF_IS_STATUS_SUCCESS(status)) {
WMA_LOGE("%s: cfgd_hw_mode_index %d not found", __func__,
cfgd_hw_mode_index);
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 =
WMA_HW_MODE_MAC0_TX_STREAMS_GET(param);
hw_mode.mac0_tx_ss;
wma->interfaces[vdev_id].rx_streams =
WMA_HW_MODE_MAC0_RX_STREAMS_GET(param);
hw_mode.mac0_rx_ss;
} else {
wma->interfaces[vdev_id].tx_streams =
WMA_HW_MODE_MAC1_TX_STREAMS_GET(param);
hw_mode.mac1_tx_ss;
wma->interfaces[vdev_id].rx_streams =
WMA_HW_MODE_MAC1_RX_STREAMS_GET(param);
hw_mode.mac1_tx_ss;
}
WMA_LOGD("%s: vdev %d, update tx ss:%d rx ss:%d mac %d hw_mode_id %d",
__func__,
vdev_id,
wma->interfaces[vdev_id].tx_streams,
wma->interfaces[vdev_id].rx_streams,
mac_id,
cfgd_hw_mode_index);
}
/**