public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Bitterblue Smith <rtl8821cerfe2@gmail.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: Jes Sorensen <Jes.Sorensen@gmail.com>
Subject: RE: [PATCH rtw-next 4/5] wifi: rtl8xxxu: Fix RX channel width reported by RTL8192FU
Date: Tue, 18 Nov 2025 02:59:26 +0000	[thread overview]
Message-ID: <988bfe53bd5b42bbb411745f34114db1@realtek.com> (raw)
In-Reply-To: <afd60ba6-4af8-4944-a915-4e2b814bbed3@gmail.com>


Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> The other chips report the RX channel width in the RX descriptor,
> but this one doesn't.
> 
> Get the RX channel width from the PHY status.
> 
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>

Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>


> ---
>  drivers/net/wireless/realtek/rtl8xxxu/core.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/core.c
> b/drivers/net/wireless/realtek/rtl8xxxu/core.c
> index 739456640ca8..668018229f7c 100644
> --- a/drivers/net/wireless/realtek/rtl8xxxu/core.c
> +++ b/drivers/net/wireless/realtek/rtl8xxxu/core.c
> @@ -5701,7 +5701,7 @@ static void jaguar2_rx_parse_phystats_type1(struct rtl8xxxu_priv *priv,
>                          !rtl8xxxu_is_sta_sta(priv) &&
>                          (rtl8xxxu_is_packet_match_bssid(priv, hdr, 0) ||
>                           rtl8xxxu_is_packet_match_bssid(priv, hdr, 1));
> -       u8 pwdb_max = 0;
> +       u8 pwdb_max = 0, rxsc;
>         int rx_path;
> 
>         if (parse_cfo) {
> @@ -5716,6 +5716,16 @@ static void jaguar2_rx_parse_phystats_type1(struct rtl8xxxu_priv *priv,
>                 pwdb_max = max(pwdb_max, phy_stats1->pwdb[rx_path]);
> 
>         rx_status->signal = pwdb_max - 110;
> +
> +       if (rxmcs > DESC_RATE_11M && rxmcs < DESC_RATE_MCS0)

Nit: would it be clear that ' if (rxmcs >= DESC_RATE_6M && rxmcs <= DESC_RATE_54M)' ?

> +               rxsc = phy_stats1->l_rxsc;
> +       else
> +               rxsc = phy_stats1->ht_rxsc;
> +
> +       if (phy_stats1->rf_mode == 0 || rxsc == 1 || rxsc == 2)
> +               rx_status->bw = RATE_INFO_BW_20;
> +       else
> +               rx_status->bw = RATE_INFO_BW_40;
>  }
> 
>  static void jaguar2_rx_parse_phystats_type2(struct rtl8xxxu_priv *priv,
> --
> 2.51.1


  reply	other threads:[~2025-11-18  2:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-16 20:25 [PATCH rtw-next 0/5] wifi: rtl8xxxu: 40 MHz fixes Bitterblue Smith
2025-11-16 20:27 ` [PATCH rtw-next 1/5] wifi: rtl8xxxu: Fix HT40 channel config for RTL8192CU, RTL8723AU Bitterblue Smith
2025-11-18  2:44   ` Ping-Ke Shih
2025-11-16 20:28 ` [PATCH rtw-next 2/5] wifi: rtl8xxxu: Make RTL8192CU, RTL8723AU TX with 40 MHz width Bitterblue Smith
2025-11-18  2:46   ` Ping-Ke Shih
2025-11-16 20:29 ` [PATCH rtw-next 3/5] wifi: rtl8xxxu: Fix the 40 MHz subchannel for RTL8192EU, RTL8723BU Bitterblue Smith
2025-11-18  2:55   ` Ping-Ke Shih
2025-11-16 20:30 ` [PATCH rtw-next 4/5] wifi: rtl8xxxu: Fix RX channel width reported by RTL8192FU Bitterblue Smith
2025-11-18  2:59   ` Ping-Ke Shih [this message]
2025-11-18  3:02     ` Ping-Ke Shih
2025-11-18 17:33       ` Bitterblue Smith
2025-11-19  0:28         ` Ping-Ke Shih
2025-11-16 20:31 ` [PATCH rtw-next 5/5] wifi: rtl8xxxu: Enable 40 MHz width by default Bitterblue Smith
2025-11-18  3:01   ` Ping-Ke Shih

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=988bfe53bd5b42bbb411745f34114db1@realtek.com \
    --to=pkshih@realtek.com \
    --cc=Jes.Sorensen@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rtl8821cerfe2@gmail.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