wifi: ath11k: add get_txpower mac ops
authorAditya Kumar Singh <quic_adisi@quicinc.com>
Tue, 20 Sep 2022 15:24:21 +0000 (18:24 +0300)
committerKalle Valo <quic_kvalo@quicinc.com>
Thu, 22 Sep 2022 07:28:21 +0000 (10:28 +0300)
commit9a2aa68afe3dd1cbb194523415410965deea6277
treed71c09da9b03d8b05421d70e073692294e1a69f7
parentec8918f922b8a40a12cb86793245026f08b79812
wifi: ath11k: add get_txpower mac ops

Driver does not support get_txpower mac ops because of which
cfg80211 returns vif->bss_conf.txpower to user space. bss_conf.txpower
gets its value from ieee80211_channel->max_reg_power. However, the final
txpower is dependent on few other parameters apart from max regulatory
supported power. It is the firmware which knows about all these
parameters and considers the minimum for each packet transmission.

All ath11k firmware reports the final tx power in firmware pdev stats
which falls under fw_stats.

Add get_txpower mac ops to get the tx power from firmware leveraging
fw_stats and return it accordingly.

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220603082814.31466-3-quic_adisi@quicinc.com
drivers/net/wireless/ath/ath11k/mac.c