• Aditya Kumar Singh's avatar
    wifi: ath11k: add get_txpower mac ops · 9a2aa68a
    Aditya Kumar Singh authored
    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: default avatarAditya Kumar Singh <quic_adisi@quicinc.com>
    Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
    Link: https://lore.kernel.org/r/20220603082814.31466-3-quic_adisi@quicinc.com
    9a2aa68a
mac.c 243 KB