From nobody Tue Jun 3 18:37:43 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 4bBfbD5Xv5z5y0qg; Tue, 03 Jun 2025 18:37:44 +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 4bBfbD03phz3bZQ; Tue, 03 Jun 2025 18:37:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975864; 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=41SdlEIKzSLrfJLguaPtzHYRuZvC8ujNu/u8rz096FU=; b=f9AVzjzHSkr92e2P8dFpU5kgWZRpHAmdnwcWAUIUqZCfJpE3w0EuSrMRtv7QFS3ZIoi4fm 8nEw6ybyEbkQVgC7Vi76E2YUuE5v8lGn2wEe4rHe7d2hWz3aPOIGKvnNim9+j5s/lE1KGR 5ODb/8oGQ4vIQb+eTWyqYGlNnBsNOmDiahE8lnd7I7xdFwRcoRXHJFmneXAgd2D/bYd6dp yMz3ETyLsBfba8dgRvaW0RZtx7fPmnck0YaQLXmubfR8qRpAvCGJPjt3A1yQIDILGeBeHj PXOFWFoR4pCvcr3pVapB590JVen7ySu93DYarhV9cbil8Isf7IieKyPZjRhRjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975864; 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=41SdlEIKzSLrfJLguaPtzHYRuZvC8ujNu/u8rz096FU=; b=PN2p3msy3YAEmXbYaDEh5nUKrHXpPIa9FwI2CAgItz72ewBr2wwBrKi97fAjQFIscLgshr Mqg+NBTgyIAxLnToyC9D4cbz1ur5Lh0gIFWYezjo1/dNPe6KzclUaqaumWBGBlADimS6qb 1E2WQEGE6nRVRLLm2czh9ig2MJS/ZzWpPQrOIKunf4q7hRDuQs5v3u8uJYYER8o+X9Q5ZB 3Gq7TgjeMvd3SdqeZ6nDxRiTy6emUcKlNOlKcpXqNYOvxmBFJJmasGPOeU8RU8vcqkPMM/ B+JuSRaxK+VtFLtZ5nkzL7lSo6U8oAv7Eyk/X9dboZJ99NDIxaLqdR8DuMYMAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748975864; a=rsa-sha256; cv=none; b=AInDwR7EWGm8xs21FZaHZknHfY+PfFJ3kFon60l4HNHwx2ymx5hwHDM+67JG29XPcH+3Ak xnUAPyb52yJZBEufJqVQghb5uBFNK9v3HPT08SGAGz3M2H4rH0EzqRsGZqV+jlnoa9F+gc eQNr9oldRbGr3pm/14WMNz/q5BPUFzKsrsmMlyHz99PPeBi7rK9qwj4swADPcPizNwTPmj Op92XiJH92QutnMD1CayI14tYbROiRQ6Uo3N01eIrntGr2ACi2h0wEnNsvDF+g/yAsH7MD bVslvJNC0DXSu8JzcsapVSpwn4pHvjn3WufvaQg5akWNWzXJFwX2vJ8FLGoPfw== 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 4bBfbC6d21zqZC; Tue, 03 Jun 2025 18:37:43 +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 553IbhGF000568; Tue, 3 Jun 2025 18:37:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553IbhLv000565; Tue, 3 Jun 2025 18:37:43 GMT (envelope-from git) Date: Tue, 3 Jun 2025 18:37:43 GMT Message-Id: <202506031837.553IbhLv000565@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: 34c150cc5fdb - main - LinuxKPI: 802.11: move rx_nss check to be at least 1 into sync function 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: 34c150cc5fdb3c599bb6ff14eb56afee00c45258 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=34c150cc5fdb3c599bb6ff14eb56afee00c45258 commit 34c150cc5fdb3c599bb6ff14eb56afee00c45258 Author: Bjoern A. Zeeb AuthorDate: 2025-05-14 00:30:00 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-03 18:35:10 +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 MFC after: 3 days --- 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 e92656ed41c5..d424bb6c8d44 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);