From 99728132d7816b358653c68b9822c727c0074968 Mon Sep 17 00:00:00 2001 From: Jingxiang Ge Date: Thu, 2 Jul 2020 15:46:02 +0800 Subject: [PATCH] qcacld-3.0: Fix set max power fail issue it will always return here if find vdev in wma_find_vdev_id_by_addr, as default value of ret is failure. Separate lookup vdev for sap/sta mode and check return value. Change-Id: Ic94c6b25d2a02f9e66ed469bec4cf297d696e2a8 CRs-Fixed: 2721825 --- core/wma/src/wma_power.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/wma/src/wma_power.c b/core/wma/src/wma_power.c index ed603ca033..8490ab9eea 100644 --- a/core/wma/src/wma_power.c +++ b/core/wma/src/wma_power.c @@ -361,9 +361,12 @@ void wma_set_max_tx_power(WMA_HANDLE handle, int8_t max_reg_power; struct wma_txrx_node *iface; - if (wma_find_vdev_id_by_addr(wma_handle, tx_pwr_params->bssId.bytes, - &vdev_id)) { - /* not in SAP array. Try the station/p2p array */ + if (tx_pwr_params->dev_mode == QDF_SAP_MODE || + tx_pwr_params->dev_mode == QDF_P2P_GO_MODE) { + ret = wma_find_vdev_id_by_addr(wma_handle, + tx_pwr_params->bssId.bytes, + &vdev_id); + } else { ret = wma_find_vdev_id_by_bssid(wma_handle, tx_pwr_params->bssId.bytes, &vdev_id);