Bug 285822 - rtwn filters BARs for the VAP when not in promiscuous mode
Summary: rtwn filters BARs for the VAP when not in promiscuous mode
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: wireless (show other bugs)
Version: 15.0-CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-wireless (Nobody)
URL:
Keywords:
Depends on:
Blocks: rtwn-tum-run-mtw
  Show dependency treegraph
 
Reported: 2025-03-31 21:36 UTC by Jessica Clarke
Modified: 2025-03-31 22:01 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jessica Clarke freebsd_committer freebsd_triage 2025-03-31 21:36:46 UTC
Without ifconfig wlan0 promisc, tracing sta_input and ieee80211_recv_bar, I do not see any BARs being reported.

Hardware is a T2U Nano (RTL8821AU).
Comment 1 Jessica Clarke freebsd_committer freebsd_triage 2025-03-31 22:01:46 UTC
The following seems to resolve this for me (I see a BAR come through for the VAP, and no others). Whether it's the right approach or not I leave up to people who actually know what they're doing.

diff --git a/sys/dev/rtwn/if_rtwn.c b/sys/dev/rtwn/if_rtwn.c
index 7df1b78db37b..7a547e13cafa 100644
--- a/sys/dev/rtwn/if_rtwn.c
+++ b/sys/dev/rtwn/if_rtwn.c
@@ -1203,6 +1203,9 @@ rtwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
 			/* Stop Rx of data frames. */
 			rtwn_write_2(sc, R92C_RXFLTMAP2, 0);
 
+			/* Stop Rx of control frames. */
+			rtwn_write_2(sc, R92C_RXFLTMAP1, 0);
+
 			/* Reset EDCA parameters. */
 			rtwn_write_4(sc, R92C_EDCA_VO_PARAM, 0x002f3217);
 			rtwn_write_4(sc, R92C_EDCA_VI_PARAM, 0x005e4317);
@@ -1374,6 +1377,11 @@ rtwn_run(struct rtwn_softc *sc, struct ieee80211vap *vap)
 	rtwn_write_2(sc, R92C_BCN_INTERVAL(uvp->id), ni->ni_intval);
 
 	if (sc->vaps_running == sc->monvaps_running) {
+		/* Enable Rx of BAR control frames. */
+		rtwn_write_2(sc, R92C_RXFLTMAP1,
+		    1 << (IEEE80211_FC0_SUBTYPE_BAR >>
+		    IEEE80211_FC0_SUBTYPE_SHIFT));
+
 		/* Enable Rx of data frames. */
 		rtwn_write_2(sc, R92C_RXFLTMAP2, 0xffff);