Wen Gong <quic_wgong@xxxxxxxxxxx> writes: > When station is connected to a 6 GHz AP, it has 2 way to configure > the power limit to firmware. The first way is to send 2 wmi command > WMI_PDEV_PARAM_TXPOWER_LIMIT2G/WMI_PDEV_PARAM_TXPOWER_LIMIT5G to > firmware, the second way is to send WMI_VDEV_SET_TPC_POWER_CMDID to > firmware which include more parameters for power control. > > When firmware support SERVICE_EXT_TPC_REG, it means firmware support > the second way for WMI_VDEV_SET_TPC_POWER_CMDID, then ath11k discard > BSS_CHANGED_TXPOWER flag from mac80211 which is used to the first way > for 6 GHz band in this patch and select the second way in the subsequent > patch. > > Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 > > Signed-off-by: Wen Gong <quic_wgong@xxxxxxxxxxx> > --- > drivers/net/wireless/ath/ath11k/core.h | 6 ++++++ > drivers/net/wireless/ath/ath11k/mac.c | 19 +++++++++++++++++-- > 2 files changed, 23 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h > index 6969e0a6fc7b..6ef639975725 100644 > --- a/drivers/net/wireless/ath/ath11k/core.h > +++ b/drivers/net/wireless/ath/ath11k/core.h > @@ -1017,4 +1017,10 @@ static inline bool ath11k_support_6G_cc_ext(struct ath11k *ar) > return ath11k_support_cc_ext(ar->ab) && ar->supports_6ghz; > } > > +static inline bool ath11k_support_tpc_ext(struct ath11k *ar) > +{ > + return ath11k_support_6G_cc_ext(ar) && > + test_bit(WMI_TLV_SERVICE_EXT_TPC_REG_SUPPORT, ar->ab->wmi_ab.svc_map); > +} Move to hw.h and rename to: ath11k_hw_supports_tpc_ext() > --- a/drivers/net/wireless/ath/ath11k/mac.c > +++ b/drivers/net/wireless/ath/ath11k/mac.c > @@ -2170,6 +2170,16 @@ static int ath11k_mac_config_obss_pd(struct ath11k *ar, > return 0; > } > > +static bool ath11k_mac_station_support_tpc(struct ath11k *ar, > + struct ath11k_vif *arvif, > + struct cfg80211_chan_def *chandef) > +{ > + return ath11k_support_tpc_ext(ar) && > + arvif->vdev_type == WMI_VDEV_TYPE_STA && > + chandef->chan && > + chandef->chan->band == NL80211_BAND_6GHZ; > +} ath11k_mac_supports_station_tpc() -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches