Linux wireless drivers development
 help / color / mirror / Atom feed
* wifi: rtw88: usb: no TX on 5 GHz after setting up a monitor interface again on the same frequency
@ 2026-12-01 19:50 martin
  2026-12-01 19:56 ` martin
  0 siblings, 1 reply; 5+ messages in thread
From: martin @ 2026-12-01 19:50 UTC (permalink / raw)
  To: pkshih
  Cc: linux-wireless, "Bitterblue Smith rtl8821cerfe2",
	"Luka Gejak luka.gejak"


Hi,

On rtw88 USB adapters, a monitor interface that is set up a second
time on the same 5 GHz frequency, without reloading the driver, stops
transmitting. On the RTL8814AU it also stops receiving.

Setup: Ubuntu 7.0.0-43-generic with its stock rtw88 modules,
RTL8814AU (firmware 33.6.0) and RTL8812AU (firmware 52.14.0) on USB 3,
an MT7921AU as receiver. Injected unicast data frames, 50 per run.

Steps:

   ip link set wlan0 down
   iw dev wlan0 set type monitor
   ip link set wlan0 up
   iw dev wlan0 set freq 5180 80 5210
   # inject: arrives (49 tries per frame at 6 Mbit/s)

   ip link set wlan0 down
   iw dev wlan0 set type monitor
   ip link set wlan0 up
   iw dev wlan0 set freq 5180 80 5210
   # inject: nothing arrives

What I see:
- After the second setup no injected frame reaches the receiver, on
   any 20 MHz channel of that block. The RTL8814AU then also receives
   no beacons; the RTL8812AU keeps receiving.
- The same happens at 20 MHz (5180 set up twice).
- A second setup on a different frequency (5200/80/5210, or 2437)
   transmits normally.
- In the silent state, set freq to another channel and back does not
   bring transmission back. On the RTL8814AU, a detour over 5200
   brings reception back, but not transmission.
- With Ahmet's injection v3 patches the TX reports in the silent state
   look like those of frames that went out (status 0x40, the requested
   rate), so the driver does not notice.
- Restarting Kismet with an RTL8814AU on a fixed 5 GHz channel hits
   this: the first run receives, the second gets nothing until the
   driver is reloaded.

Register dumps of the RTL8814AU (debugfs mac_*/bb_*/rf_dump) after
the first setup, the second setup on the same frequency, and a setup
on 5200 differ in about 50 values that are only different in the
silent state. Among them (first and third setup / silent state):

   0x0cb0, 0x0eb0, 0x18b4  33173317 / 54775477  (RFE pinmux A/B/C)
   0x1ab4                  77177717 / 54775477  (RFE pinmux D)
   0x1abc                  73300000 / 77700000
   0x0454                  ...80 / ...05        (BIT_CHECK_CCK_EN gone)
   0x004c                  c0228282 / 04228282

33173317 is what rtw8814a_set_rfe_reg_5g() writes for rfe_option 1,
which this adapter has; 54775477 is the rfe_option 0 value. And the
band bit in REG_CCK_CHECK, which rtw8814a_set_channel() reads to
decide on switch_band(), says 2.4 GHz. So it looks as if the channel
and band setup is not redone after the power-on when the frequency
stays the same. I haven't traced that through mac80211, and the
RTL8812AU shows the same lack of TX with its own code.

Deleting and re-adding the monitor interface doesn't help; reloading
rtw88_8814au alone or a USB unbind/bind does, until the next setup on
the same frequency.

I haven't tried 2.4 GHz twice on the same channel, nor the RTL8822BU
or RTL8821CU. The full register diffs are available, and I can test
patches on both adapters.

Martin


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: wifi: rtw88: usb: no TX on 5 GHz after setting up a monitor interface again on the same frequency
  2026-12-01 19:50 wifi: rtw88: usb: no TX on 5 GHz after setting up a monitor interface again on the same frequency martin
@ 2026-12-01 19:56 ` martin
  2026-12-02 14:44   ` Luka Gejak
  0 siblings, 1 reply; 5+ messages in thread
From: martin @ 2026-12-01 19:56 UTC (permalink / raw)
  To: pkshih; +Cc: linux-wireless, luka.gejak, rtl8821cerfe2

Adding Bitterblue and Luka; their addresses got mangled in the Cc of
the original mail. The report is quoted below.

Martin

Quoting martin@rfdeck.de:

> Hi,
>
> On rtw88 USB adapters, a monitor interface that is set up a second
> time on the same 5 GHz frequency, without reloading the driver, stops
> transmitting. On the RTL8814AU it also stops receiving.
>
> Setup: Ubuntu 7.0.0-43-generic with its stock rtw88 modules,
> RTL8814AU (firmware 33.6.0) and RTL8812AU (firmware 52.14.0) on USB 3,
> an MT7921AU as receiver. Injected unicast data frames, 50 per run.
>
> Steps:
>
>   ip link set wlan0 down
>   iw dev wlan0 set type monitor
>   ip link set wlan0 up
>   iw dev wlan0 set freq 5180 80 5210
>   # inject: arrives (49 tries per frame at 6 Mbit/s)
>
>   ip link set wlan0 down
>   iw dev wlan0 set type monitor
>   ip link set wlan0 up
>   iw dev wlan0 set freq 5180 80 5210
>   # inject: nothing arrives
>
> What I see:
> - After the second setup no injected frame reaches the receiver, on
>   any 20 MHz channel of that block. The RTL8814AU then also receives
>   no beacons; the RTL8812AU keeps receiving.
> - The same happens at 20 MHz (5180 set up twice).
> - A second setup on a different frequency (5200/80/5210, or 2437)
>   transmits normally.
> - In the silent state, set freq to another channel and back does not
>   bring transmission back. On the RTL8814AU, a detour over 5200
>   brings reception back, but not transmission.
> - With Ahmet's injection v3 patches the TX reports in the silent state
>   look like those of frames that went out (status 0x40, the requested
>   rate), so the driver does not notice.
> - Restarting Kismet with an RTL8814AU on a fixed 5 GHz channel hits
>   this: the first run receives, the second gets nothing until the
>   driver is reloaded.
>
> Register dumps of the RTL8814AU (debugfs mac_*/bb_*/rf_dump) after
> the first setup, the second setup on the same frequency, and a setup
> on 5200 differ in about 50 values that are only different in the
> silent state. Among them (first and third setup / silent state):
>
>   0x0cb0, 0x0eb0, 0x18b4  33173317 / 54775477  (RFE pinmux A/B/C)
>   0x1ab4                  77177717 / 54775477  (RFE pinmux D)
>   0x1abc                  73300000 / 77700000
>   0x0454                  ...80 / ...05        (BIT_CHECK_CCK_EN gone)
>   0x004c                  c0228282 / 04228282
>
> 33173317 is what rtw8814a_set_rfe_reg_5g() writes for rfe_option 1,
> which this adapter has; 54775477 is the rfe_option 0 value. And the
> band bit in REG_CCK_CHECK, which rtw8814a_set_channel() reads to
> decide on switch_band(), says 2.4 GHz. So it looks as if the channel
> and band setup is not redone after the power-on when the frequency
> stays the same. I haven't traced that through mac80211, and the
> RTL8812AU shows the same lack of TX with its own code.
>
> Deleting and re-adding the monitor interface doesn't help; reloading
> rtw88_8814au alone or a USB unbind/bind does, until the next setup on
> the same frequency.
>
> I haven't tried 2.4 GHz twice on the same channel, nor the RTL8822BU
> or RTL8821CU. The full register diffs are available, and I can test
> patches on both adapters.
>
> Martin




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: wifi: rtw88: usb: no TX on 5 GHz after setting up a monitor interface again on the same frequency
  2026-12-01 19:56 ` martin
@ 2026-12-02 14:44   ` Luka Gejak
  2026-12-03  7:18     ` martin
  0 siblings, 1 reply; 5+ messages in thread
From: Luka Gejak @ 2026-12-02 14:44 UTC (permalink / raw)
  To: martin; +Cc: pkshih, rtl8821cerfe2, linux-wireless

Hi Martin,

Thanks for the register dumps. I have one change to try.

On December 1, 2026 8:56:13 PM GMT+01:00, Martin <martin@rfdeck.de> wrote:

[ ... ]
>   0x0cb0, 0x0eb0, 0x18b4  33173317 / 54775477  (RFE pinmux A/B/C)
>   0x1ab4                  77177717 / 54775477  (RFE pinmux D)
[ ... ]

The silent pinmux values match the RTL8814A baseband init table. When
rtw88 powers back up, mac80211 still has the old channel definition.
Reopening on the same channel leaves IEEE80211_CONF_CHANGE_CHANNEL
clear, so rtw88 skips rtw_set_channel().

Could you try adding this at the end of the local->emulate_chanctx block
in ieee80211_hw_conf_init()?

	changed |= IEEE80211_CONF_CHANGE_CHANNEL;

This restored the channel update in mac80211_hwsim. With stock rtw88,
could you check TX on both adapters and beacon RX on the RTL8814AU
after the second setup at 5180 MHz and 80 MHz width, before retuning?
If either still fails, could you include the 5200 MHz detour in the
trace?

Best regards,
Luka Gejak

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: wifi: rtw88: usb: no TX on 5 GHz after setting up a monitor interface again on the same frequency
  2026-12-02 14:44   ` Luka Gejak
@ 2026-12-03  7:18     ` martin
  2026-12-03  9:31       ` Luka Gejak
  0 siblings, 1 reply; 5+ messages in thread
From: martin @ 2026-12-03  7:18 UTC (permalink / raw)
  To: Luka Gejak; +Cc: pkshih, rtl8821cerfe2, linux-wireless

Luka Gejak <luka.gejak@linux.dev> wrote:
> Could you try adding this at the end of the local->emulate_chanctx block
> in ieee80211_hw_conf_init()?
>
> 	changed |= IEEE80211_CONF_CHANGE_CHANNEL;
>
> This restored the channel update in mac80211_hwsim. With stock rtw88,
> could you check TX on both adapters and beacon RX on the RTL8814AU
> after the second setup at 5180 MHz and 80 MHz width, before retuning?

Hi Luka,

That works. With your change in mac80211 and stock rtw88 (Ubuntu
7.0.0-43), the first drv_config after the second drv_start now has a
mask of 0xffffffdd instead of 0xffffff9d, so CHANNEL is set. After the
second setup on 5180 MHz at 80 MHz width, before any retuning:
- The RTL8814AU receives 1113 beacons in 30 s (1157 on the first
   setup, 0 without the change).
- The RTL8814AU and the RTL8812AU both inject 50 of 50 frames.
- The RTL8814AU register values match the first setup.

A second setup on 5200 MHz behaves the same. No new messages in dmesg,
and the other wireless drivers on the box (mt7921u, iwlwifi, ath9k_htc
and the other rtw88 chips) work normally with the modified mac80211.

Ping-Ke pointed to the rtw89 fix for non-chanctx devices
(e07c9af7bbc8). The same check in rtw_ops_config() also fixes it with
stock mac80211; details are in the v3 thread. So the fix can go into
either rtw88 or mac80211. I leave it to you and Ping-Ke which one you
prefer.

Martin


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: wifi: rtw88: usb: no TX on 5 GHz after setting up a monitor interface again on the same frequency
  2026-12-03  7:18     ` martin
@ 2026-12-03  9:31       ` Luka Gejak
  0 siblings, 0 replies; 5+ messages in thread
From: Luka Gejak @ 2026-12-03  9:31 UTC (permalink / raw)
  To: martin; +Cc: pkshih, rtl8821cerfe2, linux-wireless

On December 3, 2026 8:18:31 AM GMT+01:00, martin@rfdeck.de wrote:
>Luka Gejak <luka.gejak@linux.dev> wrote:
>> Could you try adding this at the end of the local->emulate_chanctx block
>> in ieee80211_hw_conf_init()?
>> 
>> 	changed |= IEEE80211_CONF_CHANGE_CHANNEL;
>> 
>> This restored the channel update in mac80211_hwsim. With stock rtw88,
>> could you check TX on both adapters and beacon RX on the RTL8814AU
>> after the second setup at 5180 MHz and 80 MHz width, before retuning?
>
>Hi Luka,
>
>That works. With your change in mac80211 and stock rtw88 (Ubuntu
>7.0.0-43), the first drv_config after the second drv_start now has a
>mask of 0xffffffdd instead of 0xffffff9d, so CHANNEL is set. After the
>second setup on 5180 MHz at 80 MHz width, before any retuning:
>- The RTL8814AU receives 1113 beacons in 30 s (1157 on the first
>  setup, 0 without the change).
>- The RTL8814AU and the RTL8812AU both inject 50 of 50 frames.
>- The RTL8814AU register values match the first setup.
>
>A second setup on 5200 MHz behaves the same. No new messages in dmesg,
>and the other wireless drivers on the box (mt7921u, iwlwifi, ath9k_htc
>and the other rtw88 chips) work normally with the modified mac80211.
>
>Ping-Ke pointed to the rtw89 fix for non-chanctx devices
>(e07c9af7bbc8). The same check in rtw_ops_config() also fixes it with
>stock mac80211; details are in the v3 thread. So the fix can go into
>either rtw88 or mac80211. I leave it to you and Ping-Ke which one you
>prefer.
>

Ping-Ke said he prefers the change to be in rtw88, so just let me know
whether you prefer for you or me to send it. I'm ok with either.

Best regards,
Luka Gejak

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-12-03  9:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 19:50 wifi: rtw88: usb: no TX on 5 GHz after setting up a monitor interface again on the same frequency martin
2026-12-01 19:56 ` martin
2026-12-02 14:44   ` Luka Gejak
2026-12-03  7:18     ` martin
2026-12-03  9:31       ` Luka Gejak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox