From nobody Wed Feb 26 23:46:16 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 4Z3B205trdz5pBqc; Wed, 26 Feb 2025 23:46:16 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3B2045nCz3pSR; Wed, 26 Feb 2025 23:46:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740613576; 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=PbhWmySCt2SlHn4mBXsM1tvQtILURnFo2v8BoUwmsQg=; b=nn4cnnDxohKrKbGm5+V/6Vx45WiXLncIXfuNzCFWyEjyYjYD/iiG4By28RpBhNH50YiCN5 nd1EFi0Rn17SY3zZeMDD7lLSFJdWKLG1XBE/WF4P6BSH+wYRxIk5oO0StucDdwE4Sj5XrO SFPkPp46dQbZlfc+y9YZexciLMaGl/LX6WdvWJhPvssfMFWjNu6Eq8+BMC97RR96D5maPD rZnIT5jN0BMm8BT1qsgLy/9HxvKGAofOIc0CIphMJQEBjUflKyCzTIxXrH9Ej/OnpgOk8Y RPySWGamlCRRUPZiu5DVPrsSYmEd6hlLKwAUyQ1NWR2xDHQ5yhwtef8PvFlutQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740613576; a=rsa-sha256; cv=none; b=eNvr6E0Kf1tJFa/A5WmHOJ6QIFqjTjmqa4nngqM8YEVx7xkWn9mgIm5txaMulNIEYJZSFj m+A++LWxAb0/h03u9oo1IDjMi5L1lVVMnG5S9L1UCnVH9bocHGhZoM3k9e3Y2ig7pgc24m xxC1QzHWAIoEkL2S9iBKSoalpbjW7Tc7oKR7JGZu5CW0GRnmjL5rQZZHxt+vaFYtIlgvid bG3pexLWF41zOkzdjIjvdEAMTRR6gxbGgBslox5SbMo7ZBNBmwEDcX/71I10ukWnX7Rxet joKF7uaMpVo5OKdoB2NLt67TQbd6wGLArELlnAtzC+ZA1MPruNMTI0gIEAizuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740613576; 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=PbhWmySCt2SlHn4mBXsM1tvQtILURnFo2v8BoUwmsQg=; b=eYUHo6BG0AY9hDHJa4zFZubNYFRpR6dVY0HR+n4sfA+p3KdgQ9YrbH63E8kIYs6j/sh+U/ HCGaKHxd9xcOUIewUqjuoUa6YA8Ch2W4ywHolOu3VtPH+93Fh2CXEhfD578UAlExr8W7NR AhunJbfYCPD0u7Je5h+9luVd/7kzwuRjP/OiVF/xs5HqEI5roHvXy+cmHjIq6OzvuKAE3c 6xIf5A/+bmmAU6RoqGhj1zP2xISAa4TI2Uo91DMH8pp+P/+yQgD+wGY49uagFVIGhoaMTL XG+vTPEKyJvIhgllGg5AQeaewpOpI6867/YedGKDxKR9vsBoOew/8/Vogt7ZaQ== 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 4Z3B203PfJz2lb; Wed, 26 Feb 2025 23:46:16 +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 51QNkGi9086628; Wed, 26 Feb 2025 23:46:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QNkGb7086625; Wed, 26 Feb 2025 23:46:16 GMT (envelope-from git) Date: Wed, 26 Feb 2025 23:46:16 GMT Message-Id: <202502262346.51QNkGb7086625@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: 7117d83bae36 - stable/14 - LinuxKPI: 802.11: factor out dynamic_rx_chains computation 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: 7117d83bae368d9240b2596d9db26423877ff4f0 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=7117d83bae368d9240b2596d9db26423877ff4f0 commit 7117d83bae368d9240b2596d9db26423877ff4f0 Author: Bjoern A. Zeeb AuthorDate: 2025-02-24 02:43:27 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 23:45:57 +0000 LinuxKPI: 802.11: factor out dynamic_rx_chains computation For the moment we set dynamic_rx_chains to the rx_nss value which should be correct given we count from 1 there too and we call lkpi_get_max_rx_chains() after we synced ht/vht initially already. Long-term some of these counting bits should be further factored out into their own functions and used both here and for the sync code. This will likely want to change as well once more dyamic synncronization takes place. Sponsored by: The FreeBSD Foundation (cherry picked from commit 389265e3ca827ad88b3b8ad787251471161d6634) --- sys/compat/linuxkpi/common/src/linux_80211.c | 30 +++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 4504a8f4f513..b7d3d7a298fc 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -509,6 +509,33 @@ lkpi_sta_sync_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) #endif } +static uint8_t +lkpi_get_max_rx_chains(struct ieee80211_node *ni) +{ + uint8_t chains; +#if defined(LKPI_80211_HT) || defined(LKPI_80211_VHT) + struct lkpi_sta *lsta; + struct ieee80211_sta *sta; + + lsta = ni->ni_drv_data; + sta = LSTA_TO_STA(lsta); +#endif + + chains = 1; +#if defined(LKPI_80211_HT) + IMPROVE("We should factor counting MCS/NSS out for sync and here"); + if (sta->deflink.ht_cap.ht_supported) + chains = MAX(chains, sta->deflink.rx_nss); +#endif + +#if defined(LKPI_80211_VHT) + if (sta->deflink.vht_cap.vht_supported) + chains = MAX(chains, sta->deflink.rx_nss); +#endif + + return (chains); +} + static void lkpi_lsta_dump(struct lkpi_sta *lsta, struct ieee80211_node *ni, const char *_f, int _l) @@ -1726,8 +1753,8 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int chanctx_conf = &lchanctx->chanctx_conf; } - chanctx_conf->rx_chains_dynamic = 1; chanctx_conf->rx_chains_static = 1; + chanctx_conf->rx_chains_dynamic = 1; chanctx_conf->radar_enabled = (chan->flags & IEEE80211_CHAN_RADAR) ? true : false; chanctx_conf->def.chan = chan; @@ -1758,6 +1785,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int chanctx_conf->def.width = NL80211_CHAN_WIDTH_80; } #endif + chanctx_conf->rx_chains_dynamic = lkpi_get_max_rx_chains(ni); /* Responder ... */ #if 0 chanctx_conf->min_def.chan = chanctx_conf->def.chan;