From: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
To: Roopni Devanathan <quic_rdevanat@quicinc.com>,
ath12k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH ath-next] wifi: ath12k: Add support to set per-radio RTS threshold
Date: Wed, 17 Sep 2025 10:14:02 +0800 [thread overview]
Message-ID: <97ed8dfb-9abe-45e1-9545-ffafd8f98ffc@oss.qualcomm.com> (raw)
In-Reply-To: <20250826105714.1188131-1-quic_rdevanat@quicinc.com>
On 8/26/2025 6:57 PM, Roopni Devanathan wrote:
> Currently, command to set RTS threshold makes changes to the threshold of
> all radios in the multi-radio wiphy. But each radio in a multi-radio wiphy
> can have different RTS threshold requirements.
>
> To support this requirement, use the index of radio for which the RTS
> threshold needs to be changed from mac80211 - radio_idx. Based on the value
> passed, set the RTS threshold value for the corresponding radios. Following
> are the possible values of radio_idx and the corresponding behavior in
> multi-radio wiphys:
> 1. radio_idx is -1: consider RTS threshold as a global parameter, i.e.,
> make changes to all the radios in a wiphy. If setting RTS threshold
> fails for any radio, then the previous RTS threshold values of
> respective radios will be restored.
> 2. radio_idx denotes a specific radio: make changes in RTS threshold to
> that radio alone.
> 3. radio_idx is any other number: report it as an invalid number.
>
> In case of single-radio wiphys, continue with the existing behavior, i.e.,
> set the passed RTS threshold value to the radio present.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
>
> Signed-off-by: Roopni Devanathan <quic_rdevanat@quicinc.com>
> ---
> drivers/net/wireless/ath/ath12k/core.h | 3 +-
> drivers/net/wireless/ath/ath12k/mac.c | 50 ++++++++++++++++++++++----
> 2 files changed, 45 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
> index 519f826f56c8..da7e99f2ca0b 100644
> --- a/drivers/net/wireless/ath/ath12k/core.h
> +++ b/drivers/net/wireless/ath/ath12k/core.h
> @@ -1,7 +1,7 @@
> /* SPDX-License-Identifier: BSD-3-Clause-Clear */
> /*
> * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
> - * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
> + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
> */
>
> #ifndef ATH12K_CORE_H
> @@ -730,6 +730,7 @@ struct ath12k {
> u32 txpower_scale;
> u32 power_scale;
> u32 chan_tx_pwr;
> + u32 rts_threshold;
> u32 num_stations;
> u32 max_num_stations;
>
> diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
> index bd1ec3b2c084..c0e0423464e3 100644
> --- a/drivers/net/wireless/ath/ath12k/mac.c
> +++ b/drivers/net/wireless/ath/ath12k/mac.c
> @@ -1,7 +1,7 @@
> // SPDX-License-Identifier: BSD-3-Clause-Clear
> /*
> * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
> - * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
> + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
> */
>
> #include <net/mac80211.h>
> @@ -9848,6 +9848,7 @@ int ath12k_mac_vdev_create(struct ath12k *ar, struct ath12k_link_vif *arvif)
>
> param_id = WMI_VDEV_PARAM_RTS_THRESHOLD;
> param_value = hw->wiphy->rts_threshold;
> + ar->rts_threshold = param_value;
> ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id,
> param_id, param_value);
> if (ret) {
> @@ -11675,16 +11676,32 @@ static int ath12k_mac_op_set_rts_threshold(struct ieee80211_hw *hw,
> int radio_idx, u32 value)
> {
> struct ath12k_hw *ah = ath12k_hw_to_ah(hw);
> + struct wiphy *wiphy = hw->wiphy;
> struct ath12k *ar;
> - int param_id = WMI_VDEV_PARAM_RTS_THRESHOLD, ret = 0, i;
> + int param_id = WMI_VDEV_PARAM_RTS_THRESHOLD;
> + int ret = 0, ret_err, i;
>
> lockdep_assert_wiphy(hw->wiphy);
>
> - /* Currently we set the rts threshold value to all the vifs across
> - * all radios of the single wiphy.
> - * TODO Once support for vif specific RTS threshold in mac80211 is
> - * available, ath12k can make use of it.
> - */
> + if (radio_idx >= wiphy->n_radio || radio_idx < -1)
> + return -EINVAL;
> +
> + if (radio_idx != -1) {
> + /* Update RTS threshold in specified radio */
> + ar = ath12k_ah_to_ar(ah, radio_idx);
> + ret = ath12k_set_vdev_param_to_all_vifs(ar, param_id, value);
> + if (ret) {
> + ath12k_warn(ar->ab,
> + "failed to set RTS config for all vdevs of pdev %d",
> + ar->pdev->pdev_id);
> + return ret;
> + }
> +
> + ar->rts_threshold = value;
> + return 0;
> + }
> +
> + /* Radio_index passed is -1, so set RTS threshold for all radios. */
> for_each_ar(ah, ar, i) {
> ret = ath12k_set_vdev_param_to_all_vifs(ar, param_id, value);
> if (ret) {
> @@ -11693,6 +11710,25 @@ static int ath12k_mac_op_set_rts_threshold(struct ieee80211_hw *hw,
> break;
> }
> }
> + if (!ret) {
> + /* Setting new RTS threshold for vdevs of all radios passed, so update
> + * the RTS threshold value for all radios
> + */
> + for_each_ar(ah, ar, i)
> + ar->rts_threshold = value;
> + return 0;
> + }
> +
> + /* RTS threshold config failed, revert to the previous RTS threshold */
> + for (i = i - 1; i >= 0; i--) {
> + ar = ath12k_ah_to_ar(ah, i);
> + ret_err = ath12k_set_vdev_param_to_all_vifs(ar, param_id,
> + ar->rts_threshold);
> + if (ret_err)
> + ath12k_warn(ar->ab,
> + "failed to restore RTS threshold for all vdevs of pdev %d",
> + ar->pdev->pdev_id);
> + }
>
> return ret;
> }
>
> base-commit: 95bf875b89b48a95a82aca922eeaf19d52543028
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
next prev parent reply other threads:[~2025-09-17 2:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-26 10:57 [PATCH ath-next] wifi: ath12k: Add support to set per-radio RTS threshold Roopni Devanathan
2025-09-17 2:14 ` Baochen Qiang [this message]
2025-09-18 23:47 ` Jeff Johnson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=97ed8dfb-9abe-45e1-9545-ffafd8f98ffc@oss.qualcomm.com \
--to=baochen.qiang@oss.qualcomm.com \
--cc=ath12k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=quic_rdevanat@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox