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, linux-kernel@vger.kernel.org,
	Enver Ikromov <owner@ph4ntom-rev.uz>
Subject: [PATCH rtw-next v5 08/10] wifi: rtw89: skip host-side TX hooks for injected frames
Date: Sat, 14 Nov 2026 04:52:09 +0500	[thread overview]
Message-ID: <20261113235211.1911-9-owner@ph4ntom-rev.uz> (raw)
In-Reply-To: <20261113235211.1911-1-owner@ph4ntom-rev.uz>

Several TX hooks assume frames that were built by the local network
stack for an associated link:

- rtw89_traffic_stats_accu() and rtw89_core_tx_btc_spec_pkt_notify()
  inspect ip_hdr()/udp_hdr(). For frames injected on a monitor
  interface the network header points into the 802.11 header, so
  traffic statistics and BT-coexistence notifications are derived
  from unrelated bytes.
- rtw89_wow_parse_akm() records the AKM from (Re)Association Request
  frames for WoWLAN, which an injected frame must not change.
- rtw89_core_tx_update_he_qos_htc(), rtw89_core_tx_update_ampdu_info(),
  and rtw89_core_txq_check_agg() mutate QoS/HTC headers, enable A-MPDU
  aggregation, or start/stop BA sessions based on link state, while
  injected frames are expected to be sent as supplied.

Skip these hooks when IEEE80211_TX_CTL_INJECTED is set.

Signed-off-by: Enver Ikromov <owner@ph4ntom-rev.uz>
---
 drivers/net/wireless/realtek/rtw89/core.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c
index 7003c24..84c12c6 100644
--- a/drivers/net/wireless/realtek/rtw89/core.c
+++ b/drivers/net/wireless/realtek/rtw89/core.c
@@ -1351,9 +1351,11 @@ rtw89_core_tx_update_desc_info(struct rtw89_dev *rtwdev,
 		break;
 	case RTW89_CORE_TX_TYPE_DATA:
 		rtw89_core_tx_update_data_info(rtwdev, tx_req);
-		pkt_type = rtw89_core_tx_btc_spec_pkt_notify(rtwdev, tx_req);
-		rtw89_core_tx_update_he_qos_htc(rtwdev, tx_req, pkt_type);
-		rtw89_core_tx_update_ampdu_info(rtwdev, tx_req, pkt_type);
+		if (likely(!(info->flags & IEEE80211_TX_CTL_INJECTED))) {
+			pkt_type = rtw89_core_tx_btc_spec_pkt_notify(rtwdev, tx_req);
+			rtw89_core_tx_update_he_qos_htc(rtwdev, tx_req, pkt_type);
+			rtw89_core_tx_update_ampdu_info(rtwdev, tx_req, pkt_type);
+		}
 		rtw89_core_tx_update_llc_hdr(rtwdev, desc_info, skb);
 		break;
 	default:
@@ -1477,8 +1479,10 @@ static int rtw89_core_tx_write_link(struct rtw89_dev *rtwdev,
 	tx_req.rtwsta_link = rtwsta_link;
 	tx_req.with_wait = !!wait;
 
-	rtw89_traffic_stats_accu(rtwdev, rtwvif, skb, true, true);
-	rtw89_wow_parse_akm(rtwdev, skb);
+	if (likely(!(IEEE80211_SKB_CB(skb)->flags & IEEE80211_TX_CTL_INJECTED))) {
+		rtw89_traffic_stats_accu(rtwdev, rtwvif, skb, true, true);
+		rtw89_wow_parse_akm(rtwdev, skb);
+	}
 	rtw89_core_tx_update_desc_info(rtwdev, &tx_req);
 	rtw89_core_tx_wake(rtwdev, &tx_req);
 
@@ -4740,6 +4744,9 @@ static void rtw89_core_txq_check_agg(struct rtw89_dev *rtwdev,
 	struct ieee80211_sta *sta = txq->sta;
 	struct rtw89_sta *rtwsta = sta_to_rtwsta_safe(sta);
 
+	if (unlikely(IEEE80211_SKB_CB(skb)->flags & IEEE80211_TX_CTL_INJECTED))
+		return;
+
 	if (test_bit(RTW89_TXQ_F_FORBID_BA, rtwtxq->flags))
 		return;
 
-- 
2.56.0.windows.4


  parent reply	other threads:[~2026-11-13 23:56 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 23:52 [PATCH rtw-next v5 00/10] wifi: rtw89: monitor mode RX filter and raw frame injection fixes Enver Ikromov
2026-11-13 23:52 ` [PATCH rtw-next v5 01/10] wifi: rtw89: avoid NULL vif dereference in rtw89_ops_tx() Enver Ikromov
2026-11-15  3:23   ` Ping-Ke Shih
2026-11-16 15:27     ` Enver Ikromov
2026-11-13 23:52 ` [PATCH rtw-next v5 02/10] wifi: rtw89: handle negative rate index for injected frames Enver Ikromov
2026-11-15  3:38   ` Ping-Ke Shih
2026-11-16 15:27     ` Enver Ikromov
2026-11-13 23:52 ` [PATCH rtw-next v5 03/10] wifi: rtw89: fix RX filter configuration for monitor mode Enver Ikromov
2026-11-15  3:48   ` Ping-Ke Shih
2026-11-16 15:27     ` Enver Ikromov
2026-11-17  7:17       ` Ping-Ke Shih
2026-11-17  9:40         ` Enver Ikromov
2026-11-13 23:52 ` [PATCH rtw-next v5 04/10] wifi: rtw89: protect pure_monitor_mode_vif with RCU Enver Ikromov
2026-11-15  4:00   ` Ping-Ke Shih
2026-11-16 15:27     ` Enver Ikromov
2026-11-13 23:52 ` [PATCH rtw-next v5 05/10] wifi: rtw89: use AP self role for monitor interfaces Enver Ikromov
2026-11-15  4:08   ` Ping-Ke Shih
2026-11-16 15:27     ` Enver Ikromov
2026-11-17  0:41       ` Ping-Ke Shih
2026-11-17  9:40         ` Enver Ikromov
2026-11-13 23:52 ` [PATCH rtw-next v5 06/10] wifi: rtw89: transmit frames from " Enver Ikromov
2026-11-16  1:35   ` Ping-Ke Shih
2026-11-16 15:27     ` Enver Ikromov
2026-11-13 23:52 ` [PATCH rtw-next v5 07/10] wifi: rtw89: send injected control frames through the management path Enver Ikromov
2026-11-16  2:14   ` Ping-Ke Shih
2026-11-16 15:27     ` Enver Ikromov
2026-11-13 23:52 ` Enver Ikromov [this message]
2026-11-16  2:20   ` [PATCH rtw-next v5 08/10] wifi: rtw89: skip host-side TX hooks for injected frames Ping-Ke Shih
2026-11-16 15:28     ` Enver Ikromov
2026-11-13 23:52 ` [PATCH rtw-next v5 09/10] wifi: rtw89: honor ASSIGN_SEQ, retries, and NO_ACK " Enver Ikromov
2026-11-16  3:00   ` Ping-Ke Shih
2026-11-16 15:28     ` Enver Ikromov
2026-11-13 23:52 ` [PATCH rtw-next v5 10/10] wifi: rtw89: restore channel when leaving idle on non-chanctx devices Enver Ikromov
2026-11-16  3:45   ` Ping-Ke Shih
2026-11-16 15:28     ` Enver Ikromov
2026-11-17  4:14       ` Zong-Zhe Yang
2026-11-17  9:40         ` Enver Ikromov
2026-11-16  7:56   ` Zong-Zhe Yang
2026-11-16 15:28     ` Enver Ikromov
2026-11-15  3:12 ` [PATCH rtw-next v5 00/10] wifi: rtw89: monitor mode RX filter and raw frame injection fixes Ping-Ke Shih
2026-11-16 15:27   ` Enver Ikromov

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=20261113235211.1911-9-owner@ph4ntom-rev.uz \
    --to=owner@ph4ntom-rev.uz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.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®