mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Enver Ikromov <owner@ph4ntom-rev.uz>
To: Ping-Ke Shih <pkshih@realtek.com>
Cc: linux-wireless@vger.kernel.org, Ahmet Zeren <niko3x@proton.me>,
	Luka Gejak <luka.gejak@linux.dev>,
	Bitterblue Smith <rtl8821cerfe2@gmail.com>,
	linux-kernel@vger.kernel.org,
	Enver Ikromov <owner@ph4ntom-rev.uz>
Subject: [PATCH rtw-next 2/2] wifi: rtw89: pci: fix TX status and counters for NO_ACK frames
Date: Thu, 26 Nov 2026 13:31:41 +0500	[thread overview]
Message-ID: <20261126083141.1470-3-owner@ph4ntom-rev.uz> (raw)
In-Reply-To: <20261126083141.1470-1-owner@ph4ntom-rev.uz>

In rtw89_pci_tx_status(), IEEE80211_TX_STAT_NOACK_TRANSMITTED is set
unconditionally whenever IEEE80211_TX_CTL_NO_ACK is present, even when
the frame was dropped (RTW89_TX_MACID_DROP or RTW89_TX_LIFE_TIME)
without being transmitted. In addition, when a NO_ACK frame completes
with RTW89_TX_DONE (broadcast, QoS No-Ack, or Wi-Fi 7 BE NO_ACK), the
subsequent RTW89_TX_DONE branch also sets IEEE80211_TX_STAT_ACK and
increments tx_ring->tx_acked, whereas unacknowledged Wi-Fi 6 AX unicast
NO_ACK frames (tx_cnt_lmt = 1) complete with RTW89_TX_RETRY_LIMIT and
fall into the failure path.

Clear stale TX status bits and set IEEE80211_TX_STAT_NOACK_TRANSMITTED
exclusively when a NO_ACK frame completes with RTW89_TX_DONE or
RTW89_TX_RETRY_LIMIT, reserving IEEE80211_TX_STAT_ACK and
tx_ring->tx_acked for non-NO_ACK completions while still accounting
RTW89_TX_LIFE_TIME and RTW89_TX_MACID_DROP as failures.

Fixes: e3ec7017f6a2 ("rtw89: add Realtek 802.11ax driver")
Cc: stable@vger.kernel.org
Signed-off-by: Enver Ikromov <owner@ph4ntom-rev.uz>
---
 drivers/net/wireless/realtek/rtw89/pci.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c
index 76523d057..2204ed8c5 100644
--- a/drivers/net/wireless/realtek/rtw89/pci.c
+++ b/drivers/net/wireless/realtek/rtw89/pci.c
@@ -470,9 +470,12 @@ static void rtw89_pci_tx_status(struct rtw89_dev *rtwdev,
 	info = IEEE80211_SKB_CB(skb);
 	ieee80211_tx_info_clear_status(info);
 
-	if (info->flags & IEEE80211_TX_CTL_NO_ACK)
+	info->flags &= ~(IEEE80211_TX_STAT_NOACK_TRANSMITTED |
+			 IEEE80211_TX_STAT_ACK);
+	if ((info->flags & IEEE80211_TX_CTL_NO_ACK) &&
+	    (tx_status == RTW89_TX_DONE || tx_status == RTW89_TX_RETRY_LIMIT)) {
 		info->flags |= IEEE80211_TX_STAT_NOACK_TRANSMITTED;
-	if (tx_status == RTW89_TX_DONE) {
+	} else if (tx_status == RTW89_TX_DONE) {
 		info->flags |= IEEE80211_TX_STAT_ACK;
 		tx_ring->tx_acked++;
 	} else {
-- 
2.53.0


      parent reply	other threads:[~2026-11-26  8:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  8:31 [PATCH rtw-next 0/2] wifi: rtw89: fix injected retry limit and NO_ACK TX status Enver Ikromov
2026-11-26  8:31 ` [PATCH rtw-next 1/2] wifi: rtw89: fix retry limit and NO_ACK status for injected frames Enver Ikromov
2026-11-26  8:31 ` Enver Ikromov [this message]

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=20261126083141.1470-3-owner@ph4ntom-rev.uz \
    --to=owner@ph4ntom-rev.uz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luka.gejak@linux.dev \
    --cc=niko3x@proton.me \
    --cc=pkshih@realtek.com \
    --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

all inboxes | Powered by JetHome®