* [PATCH RFT rtw-next v2 1/2] wifi: rtw88: use the rate, bandwidth and GI of injected frames
2026-11-27 8:59 [PATCH RFT rtw-next v2 0/2] wifi: rtw88: honour rate, retries and bandwidth of injected frames Ahmet Zeren via B4 Relay
@ 2026-11-27 8:59 ` Ahmet Zeren via B4 Relay
2026-11-27 9:00 ` [PATCH RFT rtw-next v2 2/2] wifi: rtw88: honour the retry count and NO_ACK " Ahmet Zeren via B4 Relay
2026-11-27 15:19 ` [PATCH RFT rtw-next v2 0/2] wifi: rtw88: honour rate, retries and bandwidth " martin
2 siblings, 0 replies; 8+ messages in thread
From: Ahmet Zeren via B4 Relay @ 2026-11-27 8:59 UTC (permalink / raw)
To: Ping-Ke Shih
Cc: linux-wireless, Luka Gejak, Bitterblue Smith, linux-kernel, Ahmet Zeren
From: Ahmet Zeren <niko3x@proton.me>
Injected frames ignore the rate, bandwidth and guard interval requested
in their radiotap header. Data frames have no station, so USE_RATE is not
set and the firmware rate adaptation picks the rate. Management frames
are sent at the lowest basic rate.
Use the injected rate, bandwidth and guard interval and disable rate
fallback, like rtw89 does since commit e96abe4fd7cd ("wifi: rtw89:
consider data rate/bandwidth/GI for injected packets"). Injected frames
without a radiotap rate are unchanged.
Signed-off-by: Ahmet Zeren <niko3x@proton.me>
---
drivers/net/wireless/realtek/rtw88/tx.c | 35 +++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw88/tx.c b/drivers/net/wireless/realtek/rtw88/tx.c
index 701ed7c4f3f..dd5537d0cf1 100644
--- a/drivers/net/wireless/realtek/rtw88/tx.c
+++ b/drivers/net/wireless/realtek/rtw88/tx.c
@@ -405,6 +405,38 @@ out:
}
}
+static void rtw_tx_injected_pkt_info_update(struct rtw_dev *rtwdev,
+ struct rtw_tx_pkt_info *pkt_info,
+ struct ieee80211_tx_info *info)
+{
+ struct ieee80211_tx_rate *rate = &info->control.rates[0];
+ u8 nss, mcs;
+
+ if (!(info->control.flags & IEEE80211_TX_CTRL_RATE_INJECT))
+ return;
+
+ if (rate->flags & IEEE80211_TX_RC_VHT_MCS) {
+ nss = ieee80211_rate_get_vht_nss(rate);
+ mcs = ieee80211_rate_get_vht_mcs(rate);
+ pkt_info->rate = DESC_RATEVHT1SS_MCS0 + (nss - 1) * 10 + mcs;
+ } else if (rate->flags & IEEE80211_TX_RC_MCS) {
+ pkt_info->rate = DESC_RATEMCS0 + rate->idx;
+ } else {
+ pkt_info->rate = ieee80211_get_tx_rate(rtwdev->hw, info)->hw_value;
+ }
+
+ if (rate->flags & IEEE80211_TX_RC_80_MHZ_WIDTH)
+ pkt_info->bw = RTW_CHANNEL_WIDTH_80;
+ else if (rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
+ pkt_info->bw = RTW_CHANNEL_WIDTH_40;
+ else
+ pkt_info->bw = RTW_CHANNEL_WIDTH_20;
+
+ pkt_info->short_gi = rate->flags & IEEE80211_TX_RC_SHORT_GI;
+ pkt_info->use_rate = true;
+ pkt_info->dis_rate_fallback = true;
+}
+
void rtw_tx_pkt_info_update(struct rtw_dev *rtwdev,
struct rtw_tx_pkt_info *pkt_info,
struct ieee80211_sta *sta,
@@ -432,6 +464,9 @@ void rtw_tx_pkt_info_update(struct rtw_dev *rtwdev,
else if (ieee80211_is_data(fc))
rtw_tx_data_pkt_info_update(rtwdev, pkt_info, sta, skb);
+ if (unlikely(info->flags & IEEE80211_TX_CTL_INJECTED))
+ rtw_tx_injected_pkt_info_update(rtwdev, pkt_info, info);
+
bmc = is_broadcast_ether_addr(hdr->addr1) ||
is_multicast_ether_addr(hdr->addr1);
--
2.56.1
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH RFT rtw-next v2 2/2] wifi: rtw88: honour the retry count and NO_ACK of injected frames
2026-11-27 8:59 [PATCH RFT rtw-next v2 0/2] wifi: rtw88: honour rate, retries and bandwidth of injected frames Ahmet Zeren via B4 Relay
2026-11-27 8:59 ` [PATCH RFT rtw-next v2 1/2] wifi: rtw88: use the rate, bandwidth and GI " Ahmet Zeren via B4 Relay
@ 2026-11-27 9:00 ` Ahmet Zeren via B4 Relay
2026-11-27 11:59 ` Luka Gejak
2026-11-27 15:19 ` [PATCH RFT rtw-next v2 0/2] wifi: rtw88: honour rate, retries and bandwidth " martin
2 siblings, 1 reply; 8+ messages in thread
From: Ahmet Zeren via B4 Relay @ 2026-11-27 9:00 UTC (permalink / raw)
To: Ping-Ke Shih
Cc: linux-wireless, Luka Gejak, Bitterblue Smith, linux-kernel, Ahmet Zeren
From: Ahmet Zeren <niko3x@proton.me>
max_rate_tries is not set, so mac80211 clamps the radiotap retry count
of injected frames to zero, and the TX descriptor retry limit is never
programmed. Injected unicast frames, even NO_ACK ones, are retried up to
the default limit, so frames to an absent station stall injection. The
TX report path also reports NO_ACK frames as not acked.
Limit max_rate_tries by both the TX descriptor retry limit and
IEEE80211_MAX_TX_RETRY, and program the descriptor retry limit for
injected frames: no retries for NO_ACK frames, otherwise the radiotap
retry count if the frame has a usable radiotap rate. In the TX report,
report NO_ACK frames that were sent as IEEE80211_TX_STAT_NOACK_TRANSMITTED
rather than acked; this includes group addressed frames.
rtw89 got similar changes in commit 92608bb5f14f ("wifi: rtw89: honor
ASSIGN_SEQ, retries, and NO_ACK for injected frames"). The retry limit
fields are at the same place as TXDESC40_RETRY_LIMIT_* in the
RTL8192EU/RTL8723BU TX descriptor of rtl8xxxu.
Signed-off-by: Ahmet Zeren <niko3x@proton.me>
---
drivers/net/wireless/realtek/rtw88/main.c | 1 +
drivers/net/wireless/realtek/rtw88/main.h | 3 +++
drivers/net/wireless/realtek/rtw88/tx.c | 16 ++++++++++++++--
drivers/net/wireless/realtek/rtw88/tx.h | 2 ++
4 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index 826e1bc3724..c715a6e86a1 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -2273,6 +2273,7 @@ int rtw_register_hw(struct rtw_dev *rtwdev, struct ieee80211_hw *hw)
max_tx_headroom += RTW_SDIO_DATA_PTR_ALIGN;
hw->extra_tx_headroom = max_tx_headroom;
+ hw->max_rate_tries = min(RTW_TX_DATA_RTY_LMT_MAX + 1, IEEE80211_MAX_TX_RETRY);
hw->queues = IEEE80211_NUM_ACS;
hw->txq_data_size = sizeof(struct rtw_txq);
hw->sta_data_size = sizeof(struct rtw_sta_info);
diff --git a/drivers/net/wireless/realtek/rtw88/main.h b/drivers/net/wireless/realtek/rtw88/main.h
index 525f17590ad..7888033376c 100644
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -625,6 +625,9 @@ struct rtw_tx_pkt_info {
bool stbc;
bool ldpc;
bool dis_rate_fallback;
+ bool rty_lmt_en;
+ u8 data_rty_lmt;
+#define RTW_TX_DATA_RTY_LMT_MAX 0x3f
bool bmc;
bool use_rate;
bool ls;
diff --git a/drivers/net/wireless/realtek/rtw88/tx.c b/drivers/net/wireless/realtek/rtw88/tx.c
index dd5537d0cf1..32621b5c4fa 100644
--- a/drivers/net/wireless/realtek/rtw88/tx.c
+++ b/drivers/net/wireless/realtek/rtw88/tx.c
@@ -66,7 +66,9 @@ void rtw_tx_fill_tx_desc(struct rtw_dev *rtwdev,
le32_encode_bits(pkt_info->nav_use_hdr, RTW_TX_DESC_W3_NAVUSEHDR) |
le32_encode_bits(pkt_info->ampdu_factor, RTW_TX_DESC_W3_MAX_AGG_NUM);
- tx_desc->w4 = le32_encode_bits(pkt_info->rate, RTW_TX_DESC_W4_DATARATE);
+ tx_desc->w4 = le32_encode_bits(pkt_info->rate, RTW_TX_DESC_W4_DATARATE) |
+ le32_encode_bits(pkt_info->rty_lmt_en, RTW_TX_DESC_W4_RTY_LMT_EN) |
+ le32_encode_bits(pkt_info->data_rty_lmt, RTW_TX_DESC_W4_DATA_RTY_LMT);
if (rtwdev->chip->old_datarate_fb_limit)
tx_desc->w4 |= le32_encode_bits(0x1f, RTW_TX_DESC_W4_DATARATE_FB_LIMIT);
@@ -224,7 +226,9 @@ static void rtw_tx_report_tx_status(struct rtw_dev *rtwdev,
info = IEEE80211_SKB_CB(skb);
ieee80211_tx_info_clear_status(info);
- if (acked)
+ if (acked && info->flags & IEEE80211_TX_CTL_NO_ACK)
+ info->flags |= IEEE80211_TX_STAT_NOACK_TRANSMITTED;
+ else if (acked)
info->flags |= IEEE80211_TX_STAT_ACK;
else
info->flags &= ~IEEE80211_TX_STAT_ACK;
@@ -412,6 +416,14 @@ static void rtw_tx_injected_pkt_info_update(struct rtw_dev *rtwdev,
struct ieee80211_tx_rate *rate = &info->control.rates[0];
u8 nss, mcs;
+ if (info->flags & IEEE80211_TX_CTL_NO_ACK) {
+ pkt_info->rty_lmt_en = true;
+ pkt_info->data_rty_lmt = 0;
+ } else if (info->control.flags & IEEE80211_TX_CTRL_RATE_INJECT) {
+ pkt_info->rty_lmt_en = true;
+ pkt_info->data_rty_lmt = rate->count - 1;
+ }
+
if (!(info->control.flags & IEEE80211_TX_CTRL_RATE_INJECT))
return;
diff --git a/drivers/net/wireless/realtek/rtw88/tx.h b/drivers/net/wireless/realtek/rtw88/tx.h
index 168f48e8785..b6c687d33db 100644
--- a/drivers/net/wireless/realtek/rtw88/tx.h
+++ b/drivers/net/wireless/realtek/rtw88/tx.h
@@ -46,6 +46,8 @@ struct rtw_tx_desc {
#define RTW_TX_DESC_W3_MAX_AGG_NUM GENMASK(21, 17)
#define RTW_TX_DESC_W4_DATARATE GENMASK(6, 0)
#define RTW_TX_DESC_W4_DATARATE_FB_LIMIT GENMASK(12, 8)
+#define RTW_TX_DESC_W4_RTY_LMT_EN BIT(17)
+#define RTW_TX_DESC_W4_DATA_RTY_LMT GENMASK(23, 18)
#define RTW_TX_DESC_W4_RTSRATE GENMASK(28, 24)
#define RTW_TX_DESC_W5_DATA_SHORT BIT(4)
#define RTW_TX_DESC_W5_DATA_BW GENMASK(6, 5)
--
2.56.1
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH RFT rtw-next v2 2/2] wifi: rtw88: honour the retry count and NO_ACK of injected frames
2026-11-27 9:00 ` [PATCH RFT rtw-next v2 2/2] wifi: rtw88: honour the retry count and NO_ACK " Ahmet Zeren via B4 Relay
@ 2026-11-27 11:59 ` Luka Gejak
2026-11-27 12:24 ` Ahmet Zeren
0 siblings, 1 reply; 8+ messages in thread
From: Luka Gejak @ 2026-11-27 11:59 UTC (permalink / raw)
To: Ping-Ke Shih
Cc: linux-wireless, Luka Gejak, Bitterblue Smith, linux-kernel, Ahmet Zeren
Hi Ahmet,
Thanks for the update. One comment below.
On November 27, 2026 12:00:00 PM GMT+03:00, Ahmet Zeren
<niko3x@proton.me> wrote:
[ ... ]
> info = IEEE80211_SKB_CB(skb);
> ieee80211_tx_info_clear_status(info);
> - if (acked)
> + if (acked && info->flags & IEEE80211_TX_CTL_NO_ACK)
> + info->flags |= IEEE80211_TX_STAT_NOACK_TRANSMITTED;
> + else if (acked)
> info->flags |= IEEE80211_TX_STAT_ACK;
As far as I can see, ieee80211_add_tx_radiotap_header() sets
IEEE80211_RADIOTAP_F_TX_FAIL for a unicast frame whenever
IEEE80211_TX_STAT_ACK is clear. So with this change the monitor capture
can show a failed transmission even when CCX reports success.
Could we check for IEEE80211_TX_STAT_NOACK_TRANSMITTED there too? For the
test in the cover letter, I think we need the raw CCX result to tell
whether the firmware actually reported retry exhaustion.
Best regards,
Luka Gejak
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH RFT rtw-next v2 2/2] wifi: rtw88: honour the retry count and NO_ACK of injected frames
2026-11-27 11:59 ` Luka Gejak
@ 2026-11-27 12:24 ` Ahmet Zeren
0 siblings, 0 replies; 8+ messages in thread
From: Ahmet Zeren @ 2026-11-27 12:24 UTC (permalink / raw)
To: Luka Gejak; +Cc: Ping-Ke Shih, linux-wireless, Bitterblue Smith, linux-kernel
Hi Luka,
> As far as I can see, ieee80211_add_tx_radiotap_header() sets
> IEEE80211_RADIOTAP_F_TX_FAIL for a unicast frame whenever
> IEEE80211_TX_STAT_ACK is clear.
Yes I missed that. It also affects rtl8xxxu, which already reports
NO_ACK frames as IEEE80211_TX_STAT_NOACK_TRANSMITTED. I think it's
better fixed in mac80211, so that TX_FAIL is not set when
IEEE80211_TX_STAT_NOACK_TRANSMITTED is. I'll send a separate patch for
that, tested with rtl8xxxu.
> For the test in the cover letter, I think we need the raw CCX result to
> tell whether the firmware actually reported retry exhaustion.
Agreed. For testing only, this prints it with CONFIG_RTW88_DEBUG and
rtw88_core debug_mask=0x2:
--- a/drivers/net/wireless/realtek/rtw88/tx.c
+++ b/drivers/net/wireless/realtek/rtw88/tx.c
@@ void rtw_tx_report_handle(struct rtw_dev *rtwdev, struct sk_buff *skb, int src)
st = GET_CCX_REPORT_STATUS_V1(c2h->payload);
}
+ rtw_dbg(rtwdev, RTW_DBG_TX, "tx report: sn %u status 0x%02x\n", sn, st);
+
spin_lock_irqsave(&tx_report->q_lock, flags);
Thanks,
Ahmet
Sent with Proton Mail secure email.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH RFT rtw-next v2 0/2] wifi: rtw88: honour rate, retries and bandwidth of injected frames
2026-11-27 8:59 [PATCH RFT rtw-next v2 0/2] wifi: rtw88: honour rate, retries and bandwidth of injected frames Ahmet Zeren via B4 Relay
2026-11-27 8:59 ` [PATCH RFT rtw-next v2 1/2] wifi: rtw88: use the rate, bandwidth and GI " Ahmet Zeren via B4 Relay
2026-11-27 9:00 ` [PATCH RFT rtw-next v2 2/2] wifi: rtw88: honour the retry count and NO_ACK " Ahmet Zeren via B4 Relay
@ 2026-11-27 15:19 ` martin
2026-11-27 18:56 ` Ahmet Zeren
2 siblings, 1 reply; 8+ messages in thread
From: martin @ 2026-11-27 15:19 UTC (permalink / raw)
To: niko3x
Cc: Ping-Ke Shih, linux-wireless, Luka Gejak, Bitterblue Smith, linux-kernel
Hi Ahmet,
I tested v2 on an RTL8812AU (rtw88_8812au, USB, firmware 52.14.0),
5 GHz channel 36 at 80 MHz (5180/5210), kernel 7.0.0-43 (Ubuntu), with
both patches applied to the Ubuntu source (offsets only). Sniffer is an
mt7921u on the same channel and width. Each case was run with an
unpatched build from the same source and with v2.
Without the patches every injected frame went out at 6 Mbit/s and,
to an absent station, about 49 times. With v2:
- rate: legacy 6/24/54, HT MCS0 and MCS7 (long and short GI) and
VHT MCS0 at 80 MHz arrived as requested, one copy each
- bandwidth: HT MCS7 at 20/40 MHz and VHT MCS7 at 20/40/80 MHz on the
80 MHz channel arrived with the requested width; VHT 80 MHz with the
monitor on a 40 MHz channel was dropped (also without the patches)
- retries, unicast to an absent station, 6 Mbit/s: retries 0, 6 and 40
gave 1, 7 and at most 31 copies; NO_ACK gave 1 copy; retries 6
without a rate kept the old behaviour (about 49); a rate without a
retries field gave 1 copy
- station mode on an own test AP still works (ping 10/10)
Three cases arrived with no frames at all at the sniffer: HT MCS15,
VHT MCS9 at 80 MHz with short GI and VHT MCS7 NSS2 at 80 MHz. The two
adapters were next to each other (about -15 dBm), so this may be the
sniffer, not the sender; I'll repeat those with more distance.
> Luka, could you check the TX status of injected NO_ACK frames to an
> absent station?
With your debug line (debug_mask=0x2), injected unicast frames to an
absent station report CCX status 0x80, both with NO_ACK and with
retries 0, with and without the patches. So such a NO_ACK frame comes
back as not acked here as well.
Thanks,
Martin
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH RFT rtw-next v2 0/2] wifi: rtw88: honour rate, retries and bandwidth of injected frames
2026-11-27 15:19 ` [PATCH RFT rtw-next v2 0/2] wifi: rtw88: honour rate, retries and bandwidth " martin
@ 2026-11-27 18:56 ` Ahmet Zeren
2026-11-27 19:18 ` martin
0 siblings, 1 reply; 8+ messages in thread
From: Ahmet Zeren @ 2026-11-27 18:56 UTC (permalink / raw)
To: martin
Cc: Ping-Ke Shih, linux-wireless, Luka Gejak, Bitterblue Smith, linux-kernel
Hi Martin,
Thanks a lot for testing, and for comparing against an unpatched build.
> Three cases arrived with no frames at all at the sniffer: HT MCS15,
> VHT MCS9 at 80 MHz with short GI and VHT MCS7 NSS2 at 80 MHz.
Thanks, let me know how the repeat goes. If the two-stream rates still
don't show up with more distance, it's probably something in rtw88
rather than the sniffer, and I'll look into it.
> With your debug line (debug_mask=0x2), injected unicast frames to an
> absent station report CCX status 0x80, both with NO_ACK and with
> retries 0, with and without the patches.
That answers the open question in the cover letter, so in v3 I'll
report a NO_ACK frame with that status as
IEEE80211_TX_STAT_NOACK_TRANSMITTED instead of failed.
Ping-Ke, do you know what the two CCX status bits (0x40 and 0x80) mean
on rtw88? I'd like to name the value properly instead of using 0x80.
Martin, may I add your Tested-by to v3?
Thanks,
Ahmet
Sent with Proton Mail secure email.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH RFT rtw-next v2 0/2] wifi: rtw88: honour rate, retries and bandwidth of injected frames
2026-11-27 18:56 ` Ahmet Zeren
@ 2026-11-27 19:18 ` martin
0 siblings, 0 replies; 8+ messages in thread
From: martin @ 2026-11-27 19:18 UTC (permalink / raw)
To: Ahmet Zeren
Cc: Ping-Ke Shih, linux-wireless, Luka Gejak, Bitterblue Smith, linux-kernel
Hi Ahmet,
> Thanks, let me know how the repeat goes.
I repeated them with the two adapters apart (sniffer levels about -40
to -60 dBm) and three sniffers: mt7921u, RTL8814AU and RTL8822BU. The
RTL8812AU has both antennas connected and reports VHT MCS 0-9 for 1
and 2 streams.
- HT MCS15 and VHT MCS7 NSS2 at 80 MHz do arrive with the requested
rate, but only at the RTL8814AU (17 and 18 of 50, one copy each, no
retry bit); the other two sniffers don't decode them. So the two
stream rates are sent, and last time it was the sniffer.
- MCS8, MCS12 and VHT MCS0 NSS2 at 80 MHz arrive at all three.
- VHT MCS8 and MCS9 at 80 MHz (short and long GI) arrived at none of
them, not even at -38 dBm on the RTL8822BU, which gets all VHT MCS7
80 MHz frames. I can't tell whether the RTL8812AU doesn't send them
or sends them so badly that nothing decodes them, and I have no other
VHT MCS9 transmitter to compare with. Without the patches they all
go out at 6 Mbit/s, so this is no regression.
> Martin, may I add your Tested-by to v3?
Yes, for rate, bandwidth and GI up to VHT MCS7 (1 and 2 streams), the
retry count and NO_ACK, on RTL8812AU, USB, 5 GHz:
Tested-by: Martin <martin@rfdeck.de>
Since v3 changes the NO_ACK status, I'm happy to run the NO_ACK and
retries part again on v3.
Thanks,
Martin
^ permalink raw reply [flat|nested] 8+ messages in thread