* [PATCH RFT rtw-next v3 1/2] wifi: rtw88: use the rate, bandwidth and GI of injected frames
2026-11-30 20:35 [PATCH RFT rtw-next v3 0/2] wifi: rtw88: honour rate, retries and bandwidth of injected frames Ahmet Zeren via B4 Relay
@ 2026-11-30 20:35 ` Ahmet Zeren via B4 Relay
2026-11-30 20:35 ` [PATCH RFT rtw-next v3 2/2] wifi: rtw88: honour the retry count and NO_ACK " Ahmet Zeren via B4 Relay
2026-11-30 21:16 ` [PATCH RFT rtw-next v3 0/2] wifi: rtw88: honour rate, retries and bandwidth " martin
2 siblings, 0 replies; 6+ messages in thread
From: Ahmet Zeren via B4 Relay @ 2026-11-30 20:35 UTC (permalink / raw)
To: Ping-Ke Shih
Cc: linux-wireless, Luka Gejak, Bitterblue Smith, Martin,
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.
Injected VHT frames also get the VHT rate ID that a station would get.
With the default legacy rate ID, injected VHT MCS8 frames never went
out on an RTL8812AU, while station frames fixed to VHT MCS8 did. Make
get_rate_id() non-static and rename it to rtw_get_rate_id() for this.
Signed-off-by: Ahmet Zeren <niko3x@proton.me>
---
drivers/net/wireless/realtek/rtw88/main.c | 4 ++--
drivers/net/wireless/realtek/rtw88/main.h | 1 +
drivers/net/wireless/realtek/rtw88/tx.c | 38 +++++++++++++++++++++++++++++++
3 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index e2d37c300f7..6eeb139b716 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -1037,7 +1037,7 @@ static u64 get_vht_ra_mask(struct ieee80211_sta *sta)
return ra_mask;
}
-static u8 get_rate_id(u8 wireless_set, enum rtw_bandwidth bw_mode, u8 tx_num)
+u8 rtw_get_rate_id(u8 wireless_set, enum rtw_bandwidth bw_mode, u8 tx_num)
{
u8 rate_id = 0;
@@ -1316,7 +1316,7 @@ void rtw_update_sta_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si,
sta->deflink.ht_cap.ht_supported)
tx_num = efuse->hw_cap.nss;
- rate_id = get_rate_id(wireless_set, bw_mode, tx_num);
+ rate_id = rtw_get_rate_id(wireless_set, bw_mode, tx_num);
ra_mask &= rtw_rate_mask_rssi(si, wireless_set);
ra_mask = rtw_rate_mask_recover(ra_mask, ra_mask_bak);
diff --git a/drivers/net/wireless/realtek/rtw88/main.h b/drivers/net/wireless/realtek/rtw88/main.h
index 44a1cd6bf74..c7402189294 100644
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -2261,6 +2261,7 @@ void rtw_chip_prepare_tx(struct rtw_dev *rtwdev);
void rtw_vif_port_config(struct rtw_dev *rtwdev, struct rtw_vif *rtwvif,
u32 config);
void rtw_tx_report_purge_timer(struct timer_list *t);
+u8 rtw_get_rate_id(u8 wireless_set, enum rtw_bandwidth bw_mode, u8 tx_num);
void rtw_update_sta_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si,
bool reset_ra_mask);
void rtw_core_scan_start(struct rtw_dev *rtwdev, struct rtw_vif *rtwvif,
diff --git a/drivers/net/wireless/realtek/rtw88/tx.c b/drivers/net/wireless/realtek/rtw88/tx.c
index 82c1af94f1c..e41c2724a16 100644
--- a/drivers/net/wireless/realtek/rtw88/tx.c
+++ b/drivers/net/wireless/realtek/rtw88/tx.c
@@ -407,6 +407,41 @@ 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_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;
+
+ 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;
+ pkt_info->rate_id = rtw_get_rate_id(WIRELESS_OFDM | WIRELESS_VHT,
+ pkt_info->bw,
+ rtwdev->efuse.hw_cap.nss);
+ } 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;
+ }
+
+ 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,
@@ -434,6 +469,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] 6+ messages in thread* [PATCH RFT rtw-next v3 2/2] wifi: rtw88: honour the retry count and NO_ACK of injected frames
2026-11-30 20:35 [PATCH RFT rtw-next v3 0/2] wifi: rtw88: honour rate, retries and bandwidth of injected frames Ahmet Zeren via B4 Relay
2026-11-30 20:35 ` [PATCH RFT rtw-next v3 1/2] wifi: rtw88: use the rate, bandwidth and GI " Ahmet Zeren via B4 Relay
@ 2026-11-30 20:35 ` Ahmet Zeren via B4 Relay
2026-11-30 21:16 ` [PATCH RFT rtw-next v3 0/2] wifi: rtw88: honour rate, retries and bandwidth " martin
2 siblings, 0 replies; 6+ messages in thread
From: Ahmet Zeren via B4 Relay @ 2026-11-30 20:35 UTC (permalink / raw)
To: Ping-Ke Shih
Cc: linux-wireless, Luka Gejak, Bitterblue Smith, Martin,
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 reports NO_ACK frames as acked or failed rather than
IEEE80211_TX_STAT_NOACK_TRANSMITTED.
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,
including non-injected group addressed frames. An unacked unicast NO_ACK
frame is reported as "retry over" in the V0 report, and going by the
report format as "retry drop" in V1, so count those as sent too, but
not frames dropped for their life time or by the MAC.
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/fw.h | 2 ++
drivers/net/wireless/realtek/rtw88/main.c | 1 +
drivers/net/wireless/realtek/rtw88/main.h | 3 +++
drivers/net/wireless/realtek/rtw88/tx.c | 24 ++++++++++++++++++++----
drivers/net/wireless/realtek/rtw88/tx.h | 2 ++
5 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw88/fw.h b/drivers/net/wireless/realtek/rtw88/fw.h
index 48ad9ceab6e..acbc332260a 100644
--- a/drivers/net/wireless/realtek/rtw88/fw.h
+++ b/drivers/net/wireless/realtek/rtw88/fw.h
@@ -369,8 +369,10 @@ struct rtw_fw_hdr_legacy {
/* C2H */
#define GET_CCX_REPORT_SEQNUM_V0(c2h_payload) (c2h_payload[6] & 0xfc)
#define GET_CCX_REPORT_STATUS_V0(c2h_payload) (c2h_payload[0] & 0xc0)
+#define CCX_REPORT_STATUS_V0_RETRY_OVER BIT(7)
#define GET_CCX_REPORT_SEQNUM_V1(c2h_payload) (c2h_payload[8] & 0xfc)
#define GET_CCX_REPORT_STATUS_V1(c2h_payload) (c2h_payload[9] & 0xc0)
+#define CCX_REPORT_STATUS_V1_RETRY_DROP 0x40
#define GET_SCAN_REPORT_RETURN_CODE(c2h_payload) (c2h_payload[2] & 0xff)
diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index 6eeb139b716..34d65f73de2 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -2276,6 +2276,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 c7402189294..0acc6b4d4f2 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 e41c2724a16..d7760732ba1 100644
--- a/drivers/net/wireless/realtek/rtw88/tx.c
+++ b/drivers/net/wireless/realtek/rtw88/tx.c
@@ -68,7 +68,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);
@@ -220,13 +222,15 @@ void rtw_tx_report_enqueue(struct rtw_dev *rtwdev, struct sk_buff *skb, u8 sn)
EXPORT_SYMBOL(rtw_tx_report_enqueue);
static void rtw_tx_report_tx_status(struct rtw_dev *rtwdev,
- struct sk_buff *skb, bool acked)
+ struct sk_buff *skb, bool acked, bool sent)
{
struct ieee80211_tx_info *info;
info = IEEE80211_SKB_CB(skb);
ieee80211_tx_info_clear_status(info);
- if (acked)
+ if (sent && 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;
@@ -240,6 +244,7 @@ void rtw_tx_report_handle(struct rtw_dev *rtwdev, struct sk_buff *skb, int src)
struct rtw_c2h_cmd *c2h;
struct sk_buff *cur, *tmp;
unsigned long flags;
+ bool retry_over;
u8 sn, st;
u8 *n;
@@ -248,9 +253,11 @@ void rtw_tx_report_handle(struct rtw_dev *rtwdev, struct sk_buff *skb, int src)
if (src == C2H_CCX_TX_RPT) {
sn = GET_CCX_REPORT_SEQNUM_V0(c2h->payload);
st = GET_CCX_REPORT_STATUS_V0(c2h->payload);
+ retry_over = st == CCX_REPORT_STATUS_V0_RETRY_OVER;
} else {
sn = GET_CCX_REPORT_SEQNUM_V1(c2h->payload);
st = GET_CCX_REPORT_STATUS_V1(c2h->payload);
+ retry_over = st == CCX_REPORT_STATUS_V1_RETRY_DROP;
}
spin_lock_irqsave(&tx_report->q_lock, flags);
@@ -258,7 +265,8 @@ void rtw_tx_report_handle(struct rtw_dev *rtwdev, struct sk_buff *skb, int src)
n = (u8 *)IEEE80211_SKB_CB(cur)->status.status_driver_data;
if (*n == sn) {
__skb_unlink(cur, &tx_report->queue);
- rtw_tx_report_tx_status(rtwdev, cur, st == 0);
+ rtw_tx_report_tx_status(rtwdev, cur, st == 0,
+ st == 0 || retry_over);
break;
}
}
@@ -414,6 +422,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 a68ba3b1215..d2489a5bbb4 100644
--- a/drivers/net/wireless/realtek/rtw88/tx.h
+++ b/drivers/net/wireless/realtek/rtw88/tx.h
@@ -49,6 +49,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] 6+ messages in thread* Re: [PATCH RFT rtw-next v3 0/2] wifi: rtw88: honour rate, retries and bandwidth of injected frames
2026-11-30 20:35 [PATCH RFT rtw-next v3 0/2] wifi: rtw88: honour rate, retries and bandwidth of injected frames Ahmet Zeren via B4 Relay
2026-11-30 20:35 ` [PATCH RFT rtw-next v3 1/2] wifi: rtw88: use the rate, bandwidth and GI " Ahmet Zeren via B4 Relay
2026-11-30 20:35 ` [PATCH RFT rtw-next v3 2/2] wifi: rtw88: honour the retry count and NO_ACK " Ahmet Zeren via B4 Relay
@ 2026-11-30 21:16 ` martin
2026-11-30 22:05 ` Ahmet Zeren
2 siblings, 1 reply; 6+ messages in thread
From: martin @ 2026-11-30 21:16 UTC (permalink / raw)
To: niko3x
Cc: Ping-Ke Shih, linux-wireless, Luka Gejak, Bitterblue Smith, linux-kernel
Ahmet Zeren <niko3x@proton.me> wrote:
> Testing the v3 changes on any rtw88 chip is welcome: injected VHT MCS8
> and MCS9 frames, and the TX status of injected NO_ACK frames to an
> absent station, which should now be reported as sent.
Tested v3 on the RTL8812AU (rtw88_8812au, USB, firmware 52.14.0,
Ubuntu 7.0.0-43), injecting unicast to an absent address on channel 36
at 80 MHz, 50 frames per run, with an MT7921AU receiver. I did not try
MCS9.
Patch 1:
- VHT MCS8 NSS1 now goes out. At 40 MHz every run, with or without a
radiotap retry count.
- At 80 MHz only with a retry count: with --retries 3 the frames arrive
as VHT MCS8 NSS1 80 MHz, also with short GI, and most first attempts
are among them. Without a retry count, i.e. a retry limit of 0, no
frame reached the receiver, although the TX report says retry over
for each one.
- VHT MCS7 NSS2 and MCS8 NSS2 were not seen by this receiver. With v2
only the RTL8814AU saw NSS2 frames, and I did not use it this time.
- Legacy, HT MCS7, VHT MCS7 with short GI, --retries 3 and NO_ACK
behave as with v2.
Patch 2 (with a debug print of the CCX status in
rtw_tx_report_handle()):
- with NO_ACK: 50 of 50 reports "status 0x80", reported as
IEEE80211_TX_STAT_NOACK_TRANSMITTED
- without NO_ACK: 50 of 50 "status 0x80", reported as failed
- The TX status frames on the monitor interface still carry TX_FAIL
for NO_ACK frames; that is mac80211 without your patch.
Tested-by: Martin <martin@rfdeck.de>
Martin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH RFT rtw-next v3 0/2] wifi: rtw88: honour rate, retries and bandwidth of injected frames
2026-11-30 21:16 ` [PATCH RFT rtw-next v3 0/2] wifi: rtw88: honour rate, retries and bandwidth " martin
@ 2026-11-30 22:05 ` Ahmet Zeren
2026-12-01 2:56 ` Ping-Ke Shih
0 siblings, 1 reply; 6+ messages in thread
From: Ahmet Zeren @ 2026-11-30 22:05 UTC (permalink / raw)
To: martin
Cc: Ping-Ke Shih, linux-wireless, Luka Gejak, Bitterblue Smith, linux-kernel
Hi Martin,
Thanks for testing v3 so quickly, and for the Tested-by.
> - At 80 MHz only with a retry count: with --retries 3 the frames arrive
> as VHT MCS8 NSS1 80 MHz, also with short GI, and most first attempts
> are among them. Without a retry count, i.e. a retry limit of 0, no
> frame reached the receiver, although the TX report says retry over
> for each one.
That's odd, since with retries the first attempts do arrive. Ping-Ke,
do you know of anything on the 8812A that behaves differently with a
retry limit of 0 at 80 MHz? Before this series VHT MCS8 didn't go out
at all, so I'd leave it as it is unless there's a known cause.
Ahmet
Sent with Proton Mail secure email.
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH RFT rtw-next v3 0/2] wifi: rtw88: honour rate, retries and bandwidth of injected frames
2026-11-30 22:05 ` Ahmet Zeren
@ 2026-12-01 2:56 ` Ping-Ke Shih
0 siblings, 0 replies; 6+ messages in thread
From: Ping-Ke Shih @ 2026-12-01 2:56 UTC (permalink / raw)
To: Ahmet Zeren, martin
Cc: linux-wireless, Luka Gejak, Bitterblue Smith, linux-kernel
Ahmet Zeren <niko3x@proton.me> wrote:
> Hi Martin,
>
> Thanks for testing v3 so quickly, and for the Tested-by.
>
> > - At 80 MHz only with a retry count: with --retries 3 the frames arrive
> > as VHT MCS8 NSS1 80 MHz, also with short GI, and most first attempts
> > are among them. Without a retry count, i.e. a retry limit of 0, no
> > frame reached the receiver, although the TX report says retry over
> > for each one.
>
> That's odd, since with retries the first attempts do arrive. Ping-Ke,
> do you know of anything on the 8812A that behaves differently with a
> retry limit of 0 at 80 MHz? Before this series VHT MCS8 didn't go out
> at all, so I'd leave it as it is unless there's a known cause.
I have not heard about that. How about setting retry limit to 1, not 0?
Have you seen VHT MCS8 in station mode with RA?
Ping-Ke
^ permalink raw reply [flat|nested] 6+ messages in thread