Date: Wed, 11 Jun 2025 09:14:10 GMT From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 87cb97dcdef3 - stable/14 - LinuxKPI: 802.11: move rx_nss check to be at least 1 into sync function Message-ID: <202506110914.55B9EACn061798@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=87cb97dcdef3f2f271d5fcad6a1155408f0b4a97 commit 87cb97dcdef3f2f271d5fcad6a1155408f0b4a97 Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2025-05-14 00:30:00 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202506110914.55B9EACn061798>