On 2/3/2025 11:34 AM, Mahendran P wrote: > On 2/1/2025 1:07 AM, Rameshkumar Sundaram wrote: >> From: Aditya Kumar Singh <aditya.kumar.singh@xxxxxxxxxxxxxxxx> >> >> 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 ath12k 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. >> >> While at it, there is a possibility that repeated stats request WMI >> commands are queued to FW if mac80211/userspace does get tx power back >> to back(in Multiple BSS cases). This could potentially consume the WMI >> queue completely. Hence limit this by fetching the power only for every >> 5 seconds and reusing the value until the refresh timeout or when there >> is a change in channel. >> >> Also remove init_completion(&ar->fw_stats_complete) in >> ath12k_mac_hw_register() as ath12k_fw_stats_init() takes care of >> it for each ar. >> >> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-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: Aditya Kumar Singh <aditya.kumar.singh@xxxxxxxxxxxxxxxx> >> Signed-off-by: Rameshkumar Sundaram <rameshkumar.sundaram@xxxxxxxxxxxxxxxx> Reviewed-by: Mahendran P <quic_mahep@xxxxxxxxxxx>