Linux wireless drivers development
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: ph4ntom-rev <owner@ph4ntom-rev.uz>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: Kalle Valo <kvalo@kernel.org>
Subject: RE: [PATCH RFC net-next 0/2] wifi: rtw89: fix monitor mode RX filtering and enable raw packet injection
Date: Sun, 15 Nov 2026 02:57:21 +0000	[thread overview]
Message-ID: <20d94549347146e0b25926f7e91e1101@realtek.com> (raw)
In-Reply-To: <1a19f4ae04e.52fd7adc-309223923.5560034215405031423@zoho.com>

ph4ntom-rev <owner@ph4ntom-rev.uz> wrote:
> More specifically:
> 1. In R_AX_RX_FLTR_OPT (0xCE20), B_AX_A_CRC32_ERR must be unmasked whenever
>    mac80211 passes FIF_FCSFAIL, which is necessary to capture corrupted/aborted
>    ACKs and RTS/CTS frames in noisy air.

I thought the B_AX_SNIFFER_MODE set should be included CRC_ERR packets. I'll
check this internally.

> 2. If B_AX_SNIFFER_MODE is enabled on Band 0 without setting promiscuous matching
>    in the Address CAM, non-matching BSSID control frames are filtered at the MAC
>    CAM layer prior to reaching the R_AX_CTRL_FLTR routing logic.
> 
> For reference on our RTL8852AE test system (PCI ID [10ec:8852], HP subsystem
> [103c:88e1]), the default register values on channel 5 after monitor mode entry
> without our patch:
>   R_AX_RX_FLTR_OPT (0xCE20): 0x00020000  (B_AX_SNIFFER_MODE set, CRC32 error dropped)
>   R_AX_CTRL_FLTR   (0xCE24): 0x55555555
>   R_AX_MGNT_FLTR   (0xCE28): 0x55555555
>   R_AX_DATA_FLTR   (0xCE2C): 0x55555555

The 0xCE20 I can see is different from yours: (kernel 7.1.5 without any change)

1860ce20h : 03174438 55555555 55555555 55555555

If I use the latest driver, the bit B_AX_SNIFFER_MODE is enabled (after 7.2):

1860ce20h : 03174439 55555555 55555555 55555555

Can you try the latest kernel without any modification?

> > I did similar steps with program written in C, but no problem.
> > Could you share the simple Python raw socket script as attachment that you can
> > reproduce NULL vif pointer in your side? (I think radiotap_null_data_frame above
> > is a pseudo code).
> >
> > Does every injection cause NULL vif? Or some under certain conditions?
> > In my side, I have never seen that with raw_socket injection.
> 
> The difference comes down to how the monitor interface was instantiated:
> - If a monitor interface is created as a virtual sub-interface alongside an
>   existing station interface (e.g., `iw dev wlan0 interface add mon0 type monitor`),
>   mac80211 may retain an associated sdata/vif reference.
> - However, when the physical interface itself is switched directly into a pure,
>   standalone monitor mode:
>     # ip link set wlan0 down
>     # iw dev wlan0 set type monitor
>     # ip link set wlan0 up
>   In this mode, net/mac80211/tx.c (ieee80211_monitor_start_xmit()) is called
>   without an associated operational VIF. Consequently, mac80211 explicitly sets
>   info->control.vif = NULL.

My test results are the opposite of yours.

The standalone works well to me, no vif = NULL case. 

For concurrent wlan0 + mon0 case. I up two interfaces, and run your script on
each of them. 
If I did inject on wlan0, it obviously can't send out because vif type isn't
monitor. 
If I did inject on mon0, it crashes as what your first patch want to prevent.

But anyway, I have seen what you want to fix.


  reply	other threads:[~2026-11-15  2:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-01 11:20 [PATCH RFC net-next 0/2] wifi: rtw89: fix monitor mode RX filtering and enable raw packet injection ph4ntom-rev
2026-11-02  2:11 ` Ping-Ke Shih
2026-11-02  9:00 ` ph4ntom-rev
2026-11-03  0:54   ` Ping-Ke Shih
2026-11-03  2:44     ` ph4ntom-rev
2026-11-15  2:57       ` Ping-Ke Shih [this message]
2026-11-03 15:08   ` [PATCH v2 1/2] wifi: rtw89: fix RX filter configuration for monitor mode ph4ntom-rev
2026-11-03 15:08     ` [PATCH v2 2/2] wifi: rtw89: support raw frame injection on standalone monitor interface ph4ntom-rev

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=20d94549347146e0b25926f7e91e1101@realtek.com \
    --to=pkshih@realtek.com \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=owner@ph4ntom-rev.uz \
    /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