Linux wireless drivers development
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: "niko3x@proton.me" <niko3x@proton.me>,
	Jes Sorensen <Jes.Sorensen@gmail.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH rtw-next 1/3] wifi: rtl8xxxu: honour the rate of injected frames on gen1 chips
Date: Sun, 22 Nov 2026 01:51:19 +0000	[thread overview]
Message-ID: <990225d3544d4965b80a70d4645b3733@realtek.com> (raw)
In-Reply-To: <20261120-b4-inject-v1-1-1e1693af0c6b@proton.me>

Ahmet Zeren via B4 Relay <devnull+niko3x.proton.me@kernel.org> wrote:
> From: Ahmet Zeren <niko3x@proton.me>
> 
> When a frame is injected with a rate in its radiotap header, the driver
> ignores it and leaves the choice to the firmware rate adaptation. On a
> RTL8192CU every injected frame went out at MCS 7, whatever was asked.
> 
> Use the injected rate and guard interval, and disable rate fallback so
> the frame is sent at exactly that rate.
> 
> Tested on RTL8192CU (0bda:8178) in monitor mode on 2.4 GHz: 1, 5.5, 6
> and 54 Mbps, MCS 0/7/8/15 with long and short GI were all received at
> the requested rate. Frames without a radiotap rate are unchanged.
> 
> Signed-off-by: Ahmet Zeren <niko3x@proton.me>

The comment is not unnecessary. Otherwise, looks good to me:

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

> ---
>  drivers/net/wireless/realtek/rtl8xxxu/core.c | 29 ++++++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
> 
> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/core.c
> b/drivers/net/wireless/realtek/rtl8xxxu/core.c
> index 604bb1e5b0..969875fd54 100644
> --- a/drivers/net/wireless/realtek/rtl8xxxu/core.c
> +++ b/drivers/net/wireless/realtek/rtl8xxxu/core.c
> @@ -5223,6 +5223,28 @@ static void rtl8xxxu_dump_action(struct device *dev,
>         }
>  }
> 
> +/*
> + * Use the rate from the radiotap header of an injected frame, if any.
> + * mac80211 has already checked it against what we advertise.
> + */

No need the comment. The code does as the comment.

> +static bool rtl8xxxu_tx_rate_inject(struct ieee80211_tx_info *tx_info,
> +                                   u32 *rate, bool *sgi)
> +{
> +       struct ieee80211_tx_rate *txrate = &tx_info->control.rates[0];
> +
> +       if (!(tx_info->control.flags & IEEE80211_TX_CTRL_RATE_INJECT))
> +               return false;
> +
> +       if (txrate->flags & IEEE80211_TX_RC_MCS)
> +               *rate = DESC_RATE_MCS0 + txrate->idx;
> +       else
> +               *rate = rtl8xxxu_legacy_ratetable[txrate->idx].hw_value;
> +
> +       *sgi = txrate->flags & IEEE80211_TX_RC_SHORT_GI;
> +
> +       return true;
> +}
> +



  reply	other threads:[~2026-11-22  1:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 22:09 [PATCH rtw-next 0/3] wifi: rtl8xxxu: honour rate, retries and bandwidth of injected frames Ahmet Zeren via B4 Relay
2026-11-19 22:09 ` [PATCH rtw-next 1/3] wifi: rtl8xxxu: honour the rate of injected frames on gen1 chips Ahmet Zeren via B4 Relay
2026-11-22  1:51   ` Ping-Ke Shih [this message]
2026-11-19 22:09 ` [PATCH rtw-next 2/3] wifi: rtl8xxxu: honour the retry count " Ahmet Zeren via B4 Relay
2026-11-22  2:00   ` Ping-Ke Shih
2026-11-19 22:09 ` [PATCH rtw-next 3/3] wifi: rtl8xxxu: honour the bandwidth " Ahmet Zeren via B4 Relay
2026-11-22  2:05   ` 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=990225d3544d4965b80a70d4645b3733@realtek.com \
    --to=pkshih@realtek.com \
    --cc=Jes.Sorensen@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=niko3x@proton.me \
    /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