mirror of https://lore.kernel.org/ath12k/
 help / color / mirror / Atom feed
From: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
To: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>,
	ath12k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org, Baochen Qiang <quic_bqiang@quicinc.com>
Subject: Re: [PATCH ath-next V15 5/9] wifi: ath12k: fix TX and RX MCS rate configurations in HE mode
Date: Tue, 1 Jul 2025 10:14:21 +0800	[thread overview]
Message-ID: <ac2398f4-4720-4e15-bf8c-c588c7315960@oss.qualcomm.com> (raw)
In-Reply-To: <20250701010408.1257201-6-quic_pradeepc@quicinc.com>



On 7/1/2025 9:04 AM, Pradeep Kumar Chitrapu wrote:
> Currently, the TX and RX MCS rate configurations per peer are
> reversed when sent to the firmware. As a result, RX MCS rates
> are configured for TX, and vice versa. This commit rectifies
> the configuration to match what the firmware expects.

Please mention that you are rectifying only for AP mode. For STA, current code is good.

> 
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
> 
> Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>

I don't see the need to add my S-O-B here, better drop it.

> Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
> ---
>  drivers/net/wireless/ath/ath12k/wmi.c | 19 +++++++++++++++++--
>  drivers/net/wireless/ath/ath12k/wmi.h |  2 ++
>  2 files changed, 19 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
> index 6c6354b3e18e..cdf3406302ee 100644
> --- a/drivers/net/wireless/ath/ath12k/wmi.c
> +++ b/drivers/net/wireless/ath/ath12k/wmi.c
> @@ -2183,6 +2183,8 @@ int ath12k_wmi_send_peer_assoc_cmd(struct ath12k *ar,
>  				   struct ath12k_wmi_peer_assoc_arg *arg)
>  {
>  	struct ath12k_wmi_pdev *wmi = ar->wmi;
> +	struct ath12k_base *ab = ar->ab;
> +	struct ath12k_link_vif *arvif;
>  	struct wmi_peer_assoc_complete_cmd *cmd;
>  	struct ath12k_wmi_vht_rate_set_params *mcs;
>  	struct ath12k_wmi_he_rate_set_params *he_mcs;
> @@ -2198,6 +2200,13 @@ int ath12k_wmi_send_peer_assoc_cmd(struct ath12k *ar,
>  	u16 eml_cap;
>  	__le32 v;
>  
> +	arvif = ath12k_mac_get_arvif(ar, arg->vdev_id);
> +	if (!arvif) {
> +		ath12k_warn(ab, "failed to find arvif with vdev id %d\n",
> +			    arg->vdev_id);
> +		return -EINVAL;
> +	}
> +
>  	peer_legacy_rates_align = roundup(arg->peer_legacy_rates.num_rates,
>  					  sizeof(u32));
>  	peer_ht_rates_align = roundup(arg->peer_ht_rates.num_rates,
> @@ -2333,8 +2342,14 @@ int ath12k_wmi_send_peer_assoc_cmd(struct ath12k *ar,
>  		he_mcs->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_HE_RATE_SET,
>  							    sizeof(*he_mcs));
>  
> -		he_mcs->rx_mcs_set = cpu_to_le32(arg->peer_he_rx_mcs_set[i]);
> -		he_mcs->tx_mcs_set = cpu_to_le32(arg->peer_he_tx_mcs_set[i]);
> +		if (arvif->ahvif->vdev_type == WMI_VDEV_TYPE_STA) {
> +			he_mcs->rx_mcs_set = cpu_to_le32(arg->peer_he_rx_mcs_set[i]);
> +			he_mcs->tx_mcs_set = cpu_to_le32(arg->peer_he_tx_mcs_set[i]);
> +
> +		} else {
> +			he_mcs->rx_mcs_set = cpu_to_le32(arg->peer_he_tx_mcs_set[i]);
> +			he_mcs->tx_mcs_set = cpu_to_le32(arg->peer_he_rx_mcs_set[i]);
> +		}
>  		ptr += sizeof(*he_mcs);
>  	}
>  
> diff --git a/drivers/net/wireless/ath/ath12k/wmi.h b/drivers/net/wireless/ath/ath12k/wmi.h
> index 0964ca03069a..7ad84624600d 100644
> --- a/drivers/net/wireless/ath/ath12k/wmi.h
> +++ b/drivers/net/wireless/ath/ath12k/wmi.h
> @@ -4162,7 +4162,9 @@ struct ath12k_wmi_vht_rate_set_params {
>  
>  struct ath12k_wmi_he_rate_set_params {
>  	__le32 tlv_header;
> +	/* MCS at which the peer can receive */
>  	__le32 rx_mcs_set;
> +	/* MCS at which the peer can transmit */
>  	__le32 tx_mcs_set;
>  } __packed;
>  



  reply	other threads:[~2025-07-01  2:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-01  1:03 [PATCH ath-next V15 0/9] wifi: ath12k: add MU-MIMO and 160 MHz bandwidth support Pradeep Kumar Chitrapu
2025-07-01  1:04 ` [PATCH ath-next V15 1/9] wifi: ath12k: push HE MU-MIMO params to hardware Pradeep Kumar Chitrapu
2025-07-01  1:04 ` [PATCH ath-next V15 2/9] wifi: ath12k: push EHT " Pradeep Kumar Chitrapu
2025-07-01  1:04 ` [PATCH ath-next V15 3/9] wifi: ath12k: move HE MCS mapper to a separate function Pradeep Kumar Chitrapu
2025-07-01  1:04 ` [PATCH ath-next V15 4/9] wifi: ath12k: generate rx and tx mcs maps for supported HE mcs Pradeep Kumar Chitrapu
2025-07-01  1:04 ` [PATCH ath-next V15 5/9] wifi: ath12k: fix TX and RX MCS rate configurations in HE mode Pradeep Kumar Chitrapu
2025-07-01  2:14   ` Baochen Qiang [this message]
2025-07-01  5:37     ` Pradeep Kumar Chitrapu
2025-07-01  1:04 ` [PATCH ath-next V15 6/9] wifi: ath12k: add support for setting fixed HE rate/GI/LTF Pradeep Kumar Chitrapu
2025-07-01  1:04 ` [PATCH ath-next V15 7/9] wifi: ath12k: clean up 80P80 support Pradeep Kumar Chitrapu
2025-07-01  1:04 ` [PATCH ath-next V15 8/9] wifi: ath12k: add support for 160 MHz bandwidth Pradeep Kumar Chitrapu
2025-07-01  1:04 ` [PATCH ath-next V15 9/9] wifi: ath12k: add extended NSS bandwidth support for 160 MHz Pradeep Kumar Chitrapu
2025-07-01  2:16 ` [PATCH ath-next V15 0/9] wifi: ath12k: add MU-MIMO and 160 MHz bandwidth support Baochen Qiang
2025-07-01 17:11 ` Jeff Johnson
2025-07-02 14:05 ` (subset) " 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=ac2398f4-4720-4e15-bf8c-c588c7315960@oss.qualcomm.com \
    --to=baochen.qiang@oss.qualcomm.com \
    --cc=ath12k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=quic_bqiang@quicinc.com \
    --cc=quic_pradeepc@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