From nobody Tue Jan 07 14:29:30 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSD2f5Vhtz5kf0m; Tue, 07 Jan 2025 14:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSD2f4kJNz4HFy; Tue, 7 Jan 2025 14:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736260170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vYSf6nHiUegyr6VMxEf0ahAEP/pxv52uL8ZOXBCLKlw=; b=p6IjOUDKl6a5Syo7Hh0lt9vSF7BEzmzOoCR7JDCPdFhKdKdEMi6QrPXU4/efS6GaSxkeuJ FzrfqdeOTyGcy39xjHG9VAVeCAHJ2LChaOuQdyKgKX2PuU1Z93DUrxpUHCrWVGGuUr//KN ufJ0Qck5LrqjCTKrPDErSOiCzDRYvY0MwIH1pWxAZ7CpFehMBRx+em6v+W/lkQ3Ls7/PRP 0Qe3ii9VW5LcSPH7GVZXALtC9CS0gYaxSi/BGqqwWvU5YdqipSKsQIrFMV0NTnbGt7JqQ+ uC9OPxarUlO1FV04IqBUKzWjP0PN4B9MOuNTeD1SPB+9/cl9C/jjEidA4cGmCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736260170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vYSf6nHiUegyr6VMxEf0ahAEP/pxv52uL8ZOXBCLKlw=; b=oO/J6Ukdll8+BJE5dwcdAhYjF98yYZPq8z0bL8t1HeUSlirfryweHTEwFwGcs42DOsRZwh 06LwfqX/ezVc3YFIi2yHdewWShMuQqnS0S1grg+k9ENvDvtlLXXjwsbCby6kk34Ga39CMo 3Azg23911tE9EfXKsukNFc3qKmyYfZhAThVTISK4zF5XeS9OrGCnMw8BvM/0MvLu2Zq53Y 8W648LH7bVVH0Eira7k7UUcAo/oDgHwZ6ZwLvPj6Ndt1AFizwhnzZklHrM7nCIbiBv0/2F KJtFZUy2nUJJdc6jSxee/mwUHOVJZvP44thqtx3YWU/zP3Z+HSygo+1R/VQoZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736260170; a=rsa-sha256; cv=none; b=iAGEm8VsU2CgQ26CVmuEb/rwR5eKMgTQNv4MIMKSuuguo/Qxcq74v8YVZkUERBwyQztKag 14TClbWud6ZEeYwJ5KpCLOkRI18qaf/R6AVnux8oo2XEhvnZ64NA+GAHHvd46nMCSjwAYp jgNG7gyccmRAgRHDmDHVe+Xxp9vlfYitySNpTlRnt46ysKZAHfRgHSUC4rPoOSyg42apT8 hbjiTGwwpozAJysfQkPOm3rsF33WmqQW6eo4AJ6fyVUJx3Poc9H2umMXDpY5KJuPOGffSi /vJFcFdXW7zGgmzowaSF3kh/FbHdLQrp6NkcZEktIiS8b6IIjspDakvQHxXYrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YSD2f45xcz1Cgn; Tue, 07 Jan 2025 14:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507ETUtC098690; Tue, 7 Jan 2025 14:29:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507ETUVD098687; Tue, 7 Jan 2025 14:29:30 GMT (envelope-from git) Date: Tue, 7 Jan 2025 14:29:30 GMT Message-Id: <202501071429.507ETUVD098687@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 2372f8cc640c - main - LinuxKPI 802.11 / rtw88: make packets flow again List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2372f8cc640c2f4ab82831e6ac0e27ab6c18321a Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2372f8cc640c2f4ab82831e6ac0e27ab6c18321a commit 2372f8cc640c2f4ab82831e6ac0e27ab6c18321a Author: Bjoern A. Zeeb AuthorDate: 2024-12-20 14:23:50 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-01-07 14:26:17 +0000 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 --- sys/compat/linuxkpi/common/src/linux_80211.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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); /*