aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2024-12-20 14:23:50 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2025-01-07 14:26:17 +0000
commit2372f8cc640c2f4ab82831e6ac0e27ab6c18321a (patch)
treefeba73b14ad5a22d4783684bb17468d68172d6a1
parent749b3b2c0629f44f6b0044992dfb2ce5ac7e562b (diff)
LinuxKPI 802.11 / rtw88: make packets flow again
In 886653492945f 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: 886653492945f (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
-rw-r--r--sys/compat/linuxkpi/common/src/linux_80211.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index edc3131286f5..d66bc40f40f6 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -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!
@@ -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);
/*