From 206b4348fc4eb277ec25ca3effd9ebf25ca76994 Mon Sep 17 00:00:00 2001 From: Arif Alam Date: Mon, 4 Mar 2024 20:57:16 -0500 Subject: [PATCH] ath11k: add support to set txpower for 6GHz via iw Signed-off-by: Arif Alam --- .../pending/315-set_6G_txpower_via_iw.patch | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 feeds/ipq807x_v5.4/mac80211/patches/pending/315-set_6G_txpower_via_iw.patch diff --git a/feeds/ipq807x_v5.4/mac80211/patches/pending/315-set_6G_txpower_via_iw.patch b/feeds/ipq807x_v5.4/mac80211/patches/pending/315-set_6G_txpower_via_iw.patch new file mode 100644 index 000000000..12de85ff0 --- /dev/null +++ b/feeds/ipq807x_v5.4/mac80211/patches/pending/315-set_6G_txpower_via_iw.patch @@ -0,0 +1,58 @@ +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -786,6 +786,7 @@ struct ath11k { + u32 max_tx_power; + u32 txpower_limit_2g; + u32 txpower_limit_5g; ++ u32 txpower_limit_6g; + u32 txpower_scale; + u32 power_scale; + u32 chan_tx_pwr; +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -633,6 +633,7 @@ static void ath11k_pdev_caps_update(stru + + ar->txpower_limit_2g = ar->max_tx_power; + ar->txpower_limit_5g = ar->max_tx_power; ++ ar->txpower_limit_6g = ar->max_tx_power; + ar->txpower_scale = WMI_HOST_TP_SCALE_MAX; + } + +@@ -803,6 +804,16 @@ static int ath11k_mac_txpower_recalc(str + ar->txpower_limit_5g = txpower; + } + ++ if ((ar->hw->wiphy->bands[NL80211_BAND_6GHZ]) && ++ ar->txpower_limit_6g != txpower) { ++ param = WMI_PDEV_PARAM_TXPOWER_LIMIT5G; ++ ret = ath11k_wmi_pdev_set_param(ar, param, ++ txpower, ar->pdev->pdev_id); ++ if (ret) ++ goto fail; ++ ar->txpower_limit_6g = txpower; ++ } ++ + return 0; + + fail: +@@ -3542,18 +3553,8 @@ static void ath11k_mac_op_bss_info_chang + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac vdev_id %i txpower %d\n", + arvif->vdev_id, info->txpower); + +- if (ar->supports_6ghz && info->chandef.chan && +- info->chandef.chan->band == NL80211_BAND_6GHZ && +- (arvif->vdev_type == WMI_VDEV_TYPE_STA || +- arvif->vdev_type == WMI_VDEV_TYPE_AP) && +- test_bit(WMI_TLV_SERVICE_EXT_TPC_REG_SUPPORT, +- ar->ab->wmi_ab.svc_map)) { +- ath11k_dbg(ar->ab, ATH11K_DBG_MAC, +- "discard tx power, change to set TPC power\n"); +- } else { +- arvif->txpower = info->txpower; +- ath11k_mac_txpower_recalc(ar); +- } ++ arvif->txpower = info->txpower; ++ ath11k_mac_txpower_recalc(ar); + } + + if (changed & BSS_CHANGED_MCAST_RATE &&