From nobody Wed Jun 11 09:14:10 2025 X-Original-To: dev-commits-src-all@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 4bHKjJ6Wbqz5yytv; Wed, 11 Jun 2025 09:14:12 +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 4bHKjH32K0z3lFg; Wed, 11 Jun 2025 09:14:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749633251; 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=QyrmC+ODxAypTErx2pnq8eH/9EveJ/2vcI+V0GbJ/yo=; b=aokPJk299ebkd/A3Z2XVajyRxZPhasqb8x84o46AgfL0PV7wiV3qsXZqcQkqYlcR2CB+eI mIUskcSrENMfDRywI0YztThVgBkJHBobaHRHqJ4JLPV/K7rNyzfV7bJe1ql1jBg1iBxHLs mB+USpQ7pj6vEgH1FR2XOdjrOf8a4dn0U/bRjTxBw6qJ94iphPnx6Td5J6tE447ddgChpj SJrVrUaGP+5nBNBbi0QSKsL+z02TS1zsJIKKjZsiKky2ddwVfPfsPVlklVmQ7FNaruQdOb NemTP3navjZvUsFVpgV9RVSzRrbxMc1LViaqTU+gsqam8fdp4hcTpWB88z9Ung== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749633251; 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=QyrmC+ODxAypTErx2pnq8eH/9EveJ/2vcI+V0GbJ/yo=; b=R+4Ba0ZZqmioO8GwvBtSXnwFducqCOtRxC6vg35DYp0K4ivqR6Q3U4afdwZYAtGaJ0Kr2r 5h7xX554n4cN+yx06nzAEVLxLwdEzUZItyFJwPHePwegHVzyXFpjgVKMxs1H3gS8Oh8mvI I0YTN4I6WFXvd9SK9kF93B3vu5fDD9J8zQLGGQq6ZsWLDez7cEh0gEjU5boF1xB/I8j2mh 8e95LkLzj7GR0jgv+lzy8CHzyg95Noqqf7RpKlYA+tbTmPfqZDA9XcYGOTO/I6WB33Q3xm FgOja2DuAu7a8OE2Nwd6k4A/FGkB+ZtLZLyLn4euJnCEFoAYf1s/HdbbyrxXUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749633251; a=rsa-sha256; cv=none; b=okYkKaxN/FMOCuPYriCD5AacOOKtOhCIiRgD35yy8pbg9R4e1FJ5DOYKfkV4Q4NiK6IhAn 6dumZieAKEnRQisKZA6bIrXkpG7YtXByCN3P2O1F+HCqZ3MqatSzVTqDfu7nwbOZAS/8hG Y4V7c5HDfLOXJ5k2qD4f1fjFNwIus//TfZAsZhY5HEnPa87KlAczXyoiyH61v5UKuKP3q4 0j6FqZS1W/Qv+CDNSctd0OGNdZiEi4xPggz62kd4Z472eBggx0NLKNBOxjP3T0OWSJ0q/c Tx9Etm+FVRlNiLxF51gcO2iJE1H5uHyVSlZ5kWS31D8L0Zb0OlGlF3r9Oauf6Q== 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 4bHKjG3rYjz4lQ; Wed, 11 Jun 2025 09:14:10 +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 55B9EAo0061801; Wed, 11 Jun 2025 09:14:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55B9EACn061798; Wed, 11 Jun 2025 09:14:10 GMT (envelope-from git) Date: Wed, 11 Jun 2025 09:14:10 GMT Message-Id: <202506110914.55B9EACn061798@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 87cb97dcdef3 - stable/14 - LinuxKPI: 802.11: move rx_nss check to be at least 1 into sync function List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 87cb97dcdef3f2f271d5fcad6a1155408f0b4a97 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=87cb97dcdef3f2f271d5fcad6a1155408f0b4a97 commit 87cb97dcdef3f2f271d5fcad6a1155408f0b4a97 Author: Bjoern A. Zeeb AuthorDate: 2025-05-14 00:30:00 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-10 23:37:53 +0000 LinuxKPI: 802.11: move rx_nss check to be at least 1 into sync function We set rx_nss to at least 1 and the sync functions for HT and VHT are careful not to set it to 0. Rather than relying on that and any possible future call to lkpi_sta_sync_from_ni() migrate the MAX() call into the sync function after each standard level went through to make sure that at the end we at least have rx_nss set to 1. Sponsored by: The FreeBSD Foundation (cherry picked from commit 34c150cc5fdb3c599bb6ff14eb56afee00c45258) --- sys/compat/linuxkpi/common/src/linux_80211.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index e79ee01a6b32..ffa1c1f23339 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -619,6 +619,13 @@ lkpi_sta_sync_from_ni(struct ieee80211_hw *hw, struct ieee80211_vif *vif, #if defined(LKPI_80211_VHT) lkpi_sta_sync_vht_from_ni(vif, sta, ni); #endif + + /* + * Ensure rx_nss is at least 1 as otherwise drivers run into + * unexpected problems. + */ + sta->deflink.rx_nss = MAX(1, sta->deflink.rx_nss); + /* * We are also called from node allocation which net80211 * can do even on `ifconfig down`; in that case the chanctx @@ -2938,7 +2945,6 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int IMPROVE("net80211 does not consider node authorized"); } - sta->deflink.rx_nss = MAX(1, sta->deflink.rx_nss); IMPROVE("Is this the right spot, has net80211 done all updates already?"); lkpi_sta_sync_from_ni(hw, vif, sta, ni, true);