Currently, 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. Firmware reports the final TX power in firmware pdev stats which falls under fw_stats. But currently, fw_stats is under debugfs. Add support for get_txpower mac ops to get the TX power from firmware leveraging fw_stats and return it accordingly. Also, move fw_stats out of debugfs so that get_txpower mac ops can function properly even when debugfs is disabled. v2: - In PACTH 1/2 * added sanity check for stats pointer in ath12k_wmi_tlv_fw_stats_data_parse() * Moved ath12k_debugfs_fw_stats_reset to core.c * Removed ath12k_debugfs_fw_stats_request() and reused ath12k_mac_get_fw_stats() of mac.h as both are serving same purpose - In PATCH 2/2 * Modified ATH12K_PDEV_TX_POWER_INVALID to hold u32 max * Saved power in dbm units in ar->chan_tx_pwr Aditya Kumar Singh (2): wifi: ath12k: move firmware stats out of debugfs wifi: ath12k: add get_txpower mac ops drivers/net/wireless/ath/ath12k/core.c | 53 ++++++ drivers/net/wireless/ath/ath12k/core.h | 5 + drivers/net/wireless/ath/ath12k/debugfs.c | 112 +------------ drivers/net/wireless/ath/ath12k/debugfs.h | 5 - drivers/net/wireless/ath/ath12k/mac.c | 188 +++++++++++++++++----- drivers/net/wireless/ath/ath12k/mac.h | 4 + drivers/net/wireless/ath/ath12k/wmi.c | 99 +++++++++--- 7 files changed, 294 insertions(+), 172 deletions(-) base-commit: a10b8b584b8bcb7559f068ce247fc27d0c4850ca -- 2.34.1