-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ath11k: add support to set txpower for 6GHz via iw
Signed-off-by: Arif Alam <[email protected]>
- Loading branch information
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
feeds/ipq807x_v5.4/mac80211/patches/pending/315-set_6G_txpower_via_iw.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 && |