Skip to content

Commit

Permalink
LinuxKPI 802.11 / rtw88: make packets flow again
Browse files Browse the repository at this point in the history
In 8866534 we added checks for packets to only go out if the
station is known to the firmware (amongst others) as there are
implications in drivers.
Unfortunately rtw88 does not support the mac80211 (*sta_state)() KPI
but only the fallback (*sta_add/remove)() in which case the station is
only added to firmware when going from AUTH to ASSOC.  That means we
had no chance to get authenticated anymore.

The problem has existed since June in main and stable/14 but only now
was noticed in December with 14.2-R which makes me wonder.

I am still not entirely sure what implications the missing checks have
on all the other drivers using (*sta_state)() (or if they were really
needed in first place beyond txq_ready) but I have run a few days of
iwlwifi with this without extra trouble but I was not always able to
reproduce problems in the past.  Also people are occasionally still
reporting the original "Invalid TXQ" error which indicates there is
another lingering case somewhere.

For the moment make rtw88 work again and expose the change to a wider
audience.

PR:	283142, 274382
Fixes:	8866534 (make sure we can send DISASSOC or DEAUTH frames)
Tested by:	imb protected-networks.net, oleg.nauman gmail.com
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48161
  • Loading branch information
Bjoern A. Zeeb authored and Bjoern A. Zeeb committed Jan 7, 2025
1 parent 749b3b2 commit 2372f8c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions sys/compat/linuxkpi/common/src/linux_80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -3704,7 +3704,16 @@ lkpi_ic_raw_xmit(struct ieee80211_node *ni, struct mbuf *m,

lsta = ni->ni_drv_data;
LKPI_80211_LSTA_TXQ_LOCK(lsta);
#if 0
if (!lsta->added_to_drv || !lsta->txq_ready) {
#else
/*
* Backout this part of 886653492945f which breaks rtw88 or
* in general drivers without (*sta_state)() but only the
* legacy fallback to (*sta_add)().
*/
if (!lsta->txq_ready) {
#endif
LKPI_80211_LSTA_TXQ_UNLOCK(lsta);
/*
* Free the mbuf (do NOT release ni ref for the m_pkthdr.rcvif!
Expand Down Expand Up @@ -3952,7 +3961,16 @@ lkpi_80211_txq_task(void *ctx, int pending)
* We also use txq_ready as a semaphore and will drain the txq manually
* if needed on our way towards SCAN/INIT in the state machine.
*/
#if 0
shall_tx = lsta->added_to_drv && lsta->txq_ready;
#else
/*
* Backout this part of 886653492945f which breaks rtw88 or
* in general drivers without (*sta_state)() but only the
* legacy fallback to (*sta_add)().
*/
shall_tx = lsta->txq_ready;
#endif
if (__predict_true(shall_tx))
mbufq_concat(&mq, &lsta->txq);
/*
Expand Down

0 comments on commit 2372f8c

Please sign in to comment.