linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wifi: ath12k: fix tx power, max reg power update to firmware
@ 2024-09-09  7:30 Santhosh Ramesh
  2024-09-09  8:20 ` Nicolas Escande
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Santhosh Ramesh @ 2024-09-09  7:30 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Sathishkumar Muruganandam, Santhosh Ramesh

From: Sathishkumar Muruganandam <quic_murugana@quicinc.com>

Currently, when the vdev start WMI cmd is sent from host, vdev related
parameters such as max_reg_power, max_power, and max_antenna_gain are
multiplied by 2 before being sent to the firmware. This is incorrect
because the firmware uses 1 dBm steps for power calculations.

This leads to incorrect power values being used in the firmware and
radio, potentially causing incorrect behavior.

Fix the update of max_reg_power, max_power, and max_antenna_gain values
in the ath12k_mac_vdev_start_restart function, ensuring accurate
power settings in the firmware by sending these values as-is,
without multiplication.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00214-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: Sathishkumar Muruganandam <quic_murugana@quicinc.com>
Signed-off-by: Santhosh Ramesh <quic_santrame@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/mac.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 137394c36460..6d7a005d83b4 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -7217,9 +7217,9 @@ ath12k_mac_vdev_start_restart(struct ath12k_vif *arvif,
 							chandef->chan->band,
 							arvif->vif->type);
 	arg.min_power = 0;
-	arg.max_power = chandef->chan->max_power * 2;
-	arg.max_reg_power = chandef->chan->max_reg_power * 2;
-	arg.max_antenna_gain = chandef->chan->max_antenna_gain * 2;
+	arg.max_power = chandef->chan->max_power;
+	arg.max_reg_power = chandef->chan->max_reg_power;
+	arg.max_antenna_gain = chandef->chan->max_antenna_gain;
 
 	arg.pref_tx_streams = ar->num_tx_chains;
 	arg.pref_rx_streams = ar->num_rx_chains;

base-commit: 903aaf66edc97dd5b9e3118d19677291051a9c40
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-01-08  0:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-09  7:30 [PATCH] wifi: ath12k: fix tx power, max reg power update to firmware Santhosh Ramesh
2024-09-09  8:20 ` Nicolas Escande
2024-09-09  9:07   ` Kalle Valo
2024-09-09 10:23     ` Nicolas Escande
2024-09-09 11:15       ` Kalle Valo
2024-09-09 12:55         ` Nicolas Escande
     [not found]   ` <93d580b4-cf7a-471f-8f3a-673d456f726f@quicinc.com>
2024-09-20  4:43     ` Santhosh Ramesh
2024-09-20  7:15       ` Nicolas Escande
2024-12-13  8:42       ` Nicolas Escande
2024-12-12 14:37 ` Kalle Valo
2025-01-07  1:27 ` Aditya Kumar Singh
2025-01-08  0:32 ` Jeff Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).