wifi: ath11k: fix txpower in ap mode for 6 Ghz
PATCH v3 1/1 wifi: ath11k: fix txpower in ap mode for 6 Ghz
there is an issue which has been discovered a while ago while testing which killed txpower to 0 dBm once scanning is triggered in AP mode on QCN9074 based chipsets if 6 GHz is in use. ath11k_wmi_send_vdev_set_tpc_power must be set in AP mode in the same way is it is for STA as it is implemented in ath12k and in the qsdk version for ath11k.
this patch must be considered to be backported (i discovered that issue already 2 years ago)
(wifi: ath11k: use WMI_VDEV_SET_TPC_POWER_CMDID when EXT_TPC_REG_SUPPORT for 6 GHz)
changes:
v2: code formating fixes, take care about LPI setting in AP mode
v3: fix typo in email annotation
--- drivers/net/wireless/ath/ath11k/mac.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +14 -7
@@ -3497,13 +3497,13 @@ static int ath11k_mac_config_obss_pd(struct ath11k *ar,return 0 ; } -static bool ath11k_mac_supports_station_tpc (struct ath11k *ar, -struct ath11k_vif *arvif, -const struct cfg80211_chan_def *chandef) +static bool ath11k_mac_supports_tpc (struct ath11k *ar,struct ath11k_vif *arvif, +const struct cfg80211_chan_def *chandef) {return ath11k_wmi_supports_6ghz_cc_ext (ar) &&test_bit (WMI_TLV_SERVICE_EXT_TPC_REG_SUPPORT , ar->ab->wmi_ab.svc_map) && - arvif->vdev_type ==WMI_VDEV_TYPE_STA && + (arvif->vdev_type ==WMI_VDEV_TYPE_STA || + arvif->vdev_type ==WMI_VDEV_TYPE_AP ) && arvif->vdev_subtype ==WMI_VDEV_SUBTYPE_NONE && chandef->chan && chandef->chan->band ==NL80211_BAND_6GHZ ;
@@ -7647,8 +7647,8 @@ ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif,/* TODO: For now we only set TPC power here. However when * channel changes, say CSA, it should be updated again. */ -if (ath11k_mac_supports_station_tpc (ar, arvif, chandef)) { -ath11k_mac_fill_reg_tpc_info (ar, arvif->vif, &arvif->chanctx); +if (ath11k_mac_supports_tpc (ar, arvif, chandef)) { +ath11k_mac_fill_reg_tpc_info (ar, arvif->vif, ctx);ath11k_wmi_send_vdev_set_tpc_power (ar, arvif->vdev_id, &arvif->reg_tpc_info); }
@@ -8155,6 +8155,7 @@ void ath11k_mac_fill_reg_tpc_info(struct ath11k *ar, psd_power, tx_power;s8 eirp_power =0 ;u16 start_freq, center_freq; +u8 reg_6ghz_power_mode; chan = ctx->def.chan; start_freq =ath11k_mac_get_6ghz_start_frequency (&ctx->def);
@@ -8311,8 +8312,14 @@ void ath11k_mac_fill_reg_tpc_info(struct ath11k *ar, reg_tpc_info->num_pwr_levels = num_pwr_levels; reg_tpc_info->is_psd_power = is_psd_power; reg_tpc_info->eirp_power = eirp_power; +if (arvif->vdev_type ==WMI_VDEV_TYPE_STA ) + reg_6ghz_power_mode = vif->bss_conf.power_type; +else +/* For now, LPI is the only supported AP power mode */ + reg_6ghz_power_mode =IEEE80211_REG_LPI_AP ; + reg_tpc_info->ap_power_type = -ath11k_reg_ap_pwr_convert (vif->bss_conf.power_type); +ath11k_reg_ap_pwr_convert (reg_6ghz_power_mode); } static void ath11k_mac_parse_tx_pwr_env(struct ath11k *ar,
Signature · 1 line
2.51.0
Quoted 11 lines · Sebastian Gottschall
there is an issue which has been discovered a while ago while testing which killed txpower to 0 dBm once scanning is triggered in AP mode on QCN9074 based chipsets if 6 GHz is in use.
ath11k_wmi_send_vdev_set_tpc_powermust be set in AP mode in the same way is it is for STA as it is implemented in ath12k and in the qsdk version for ath11k.
this patch must be considered to be backported (i discovered that issue already 2 years ago)Fixes 74ef2d05ede63fd6416aa635aa8972dff901325f(wifi: ath11k: use
WMI_VDEV_SET_TPC_POWER_CMDIDwhenEXT_TPC_REG_SUPPORTfor 6 GHz)
checkpatch errors on this. Three problems: (1) it must be Fixes: (capital F), not fixes:;
(2) the SHA should be truncated to 12 chars with the title in parentheses on the same line, not split across two lines with the full 40-char SHA; (3) the tag belongs in the trailer block just above Signed-off-by, not buried in the body separated by a blank line. Correct form:
EXT_TPC_REG_SUPPORT for 6 GHz")
Quoted 4 lines
changes:
v2: code formating fixes, take care about LPI setting in AP mode
v3: fix typo in email annotation
The changes: / v2: / v3: block sits above the --- line, so git am would commit it into git history. It should go below the --- scissors (after Signed-off-by, before the diff), so it stays in the mail and is stripped from the final commit.
Quoted 15 lines
Signed-off-by Sebastian Gottschall <[email protected]>--- drivers/net/wireless/ath/ath11k/mac.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)drivers/net/wireless/ath/ath11k/mac.c +0
-1@@ -3497,13 +3497,13 @@ static int ath11k_mac_config_obss_pd(struct ath11k *ar,return 0 ; } -static bool ath11k_mac_supports_station_tpc(struct ath11k *ar,
drivers/net/wireless/ath/ath11k/mac.c static int ath11k_mac_config_obss_pd(struct ath11k *ar, · line 3506
Quoted 10 lines
drivers/net/wireless/ath/ath11k/mac.c +4
-3- struct ath11k_vif *arvif, - const struct cfg80211_chan_def *chandef) +static bool ath11k_mac_supports_tpc (struct ath11k *ar,struct ath11k_vif *arvif, +const struct cfg80211_chan_def *chandef) {return ath11k_wmi_supports_6ghz_cc_ext (ar) &&test_bit (WMI_TLV_SERVICE_EXT_TPC_REG_SUPPORT , ar->ab->wmi_ab.svc_map) && - arvif->vdev_type == WMI_VDEV_TYPE_STA && + (arvif->vdev_type ==WMI_VDEV_TYPE_STA || + arvif->vdev_type == WMI_VDEV_TYPE_AP) &&
The continuation arvif->vdev_type == WMI_VDEV_TYPE_AP should align to the char after the open paren.
Quoted 23 lines
drivers/net/wireless/ath/ath11k/mac.c +3
-2arvif->vdev_subtype ==WMI_VDEV_SUBTYPE_NONE && chandef->chan && chandef->chan->band ==NL80211_BAND_6GHZ ;@@ -7647,8 +7647,8 @@ ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif,/* TODO: For now we only set TPC power here. However when * channel changes, say CSA, it should be updated again. */ -if (ath11k_mac_supports_station_tpc (ar, arvif, chandef)) { -ath11k_mac_fill_reg_tpc_info (ar, arvif->vif, &arvif->chanctx); +if (ath11k_mac_supports_tpc (ar, arvif, chandef)) { +ath11k_mac_fill_reg_tpc_info (ar, arvif->vif, ctx);ath11k_wmi_send_vdev_set_tpc_power (ar, arvif->vdev_id, &arvif->reg_tpc_info); }@@ -8155,6 +8155,7 @@ void ath11k_mac_fill_reg_tpc_info(struct ath11k *ar, psd_power, tx_power;s8 eirp_power =0 ;u16 start_freq, center_freq; +u8 reg_6ghz_power_mode; chan = ctx->def.chan; start_freq =ath11k_mac_get_6ghz_start_frequency (&ctx->def);
drivers/net/wireless/ath/ath11k/mac.c void ath11k_mac_fill_reg_tpc_info(struct ath11k *ar, · line 8316
Quoted 5 lines
drivers/net/wireless/ath/ath11k/mac.c +2
-0@@ -8311,8 +8312,14 @@ void ath11k_mac_fill_reg_tpc_info(struct ath11k *ar, reg_tpc_info->num_pwr_levels = num_pwr_levels; reg_tpc_info->is_psd_power = is_psd_power; reg_tpc_info->eirp_power = eirp_power; +if (arvif->vdev_type ==WMI_VDEV_TYPE_STA ) + reg_6ghz_power_mode = vif->bss_conf.power_type;
The function already has struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; use it.
Quoted 10 lines
drivers/net/wireless/ath/ath11k/mac.c +5
-1+else +/* For now, LPI is the only supported AP power mode */ + reg_6ghz_power_mode =IEEE80211_REG_LPI_AP ; + reg_tpc_info->ap_power_type = -ath11k_reg_ap_pwr_convert (vif->bss_conf.power_type); +ath11k_reg_ap_pwr_convert (reg_6ghz_power_mode); } static void ath11k_mac_parse_tx_pwr_env(struct ath11k *ar,
Quoted 4 lines · Baochen Qiang
Quoted 2 lines · Sebastian Gottschall
Fixes 74ef2d05ede63fd6416aa635aa8972dff901325f(wifi: ath11k: use
WMI_VDEV_SET_TPC_POWER_CMDIDwhenEXT_TPC_REG_SUPPORTfor 6 GHz)
Quoted 8 lines
checkpatch errors on this. Three problems: (1) it must be Fixes: (capital F), not fixes:;
(2) the SHA should be truncated to 12 chars with the title in parentheses on the same line, not split across two lines with the full 40-char SHA; (3) the tag belongs in the trailer block just above Signed-off-by, not buried in the body separated by a blank line. Correct form:Fixes 74ef2d05ede6 ("wifi: ath11k: use WMI_VDEV_SET_TPC_POWER_CMDID when
EXT_TPC_REG_SUPPORTfor 6 GHz")
I bet Baochen's e-mail client split this when it shouldn't have.
Should be:
(The "Toggle Line Wrap" plugin for Thunderbird is invaluable)
/jeff
Quoted 8 lines · Sebastian Gottschall
there is an issue which has been discovered a while ago while testing which killed txpower to 0 dBm once scanning is triggered in AP mode on QCN9074 based chipsets if 6 GHz is in use.
ath11k_wmi_send_vdev_set_tpc_powermust be set in AP mode in the same way is it is for STA as it is implemented in ath12k and in the qsdk version for ath11k.
this patch must be considered to be backported (i discovered that issue already 2 years ago)
In addition to Baochen's comments my comment is that this doesn't clearly describe the problem and the solution.
The Submitting Patches document tells us to "Describe your changes [...] as if you are giving orders to the codebase to change its behaviour."
Also a subject nit: s/Ghz/GHz/ for proper SI representation
/jeff