Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Sep 2025 11:06:58 GMT
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 8b86235ddd42 - main - LinuxKPI: 802.11: only change dtim_period once assoc
Message-ID:  <202509021106.582B6wxr085691@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=8b86235ddd42645b385458b7af6f42de683b6316

commit 8b86235ddd42645b385458b7af6f42de683b6316
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-09-02 07:11:08 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-09-02 11:04:29 +0000

    LinuxKPI: 802.11: only change dtim_period once assoc
    
    At least iwlwifi(4) seems to expect us to be assoc when seeing
    BSS_CHANGED_BEACON_INFO as it will stop session protection and
    update the beacon filter amongst other things.  Check for the vif
    to be assoc before applying any dtim_period updates.  See comment
    for more details on the entire flow.
    
    MFC after:      3 days
---
 sys/compat/linuxkpi/common/src/linux_80211.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index 4cf9053f053b..6c838df28ff6 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -1890,7 +1890,25 @@ lkpi_update_dtim_tsf(struct ieee80211_vif *vif, struct ieee80211_node *ni,
 			vif->bss_conf.beacon_int = 16;
 		bss_changed |= BSS_CHANGED_BEACON_INT;
 	}
-	if (vif->bss_conf.dtim_period != ni->ni_dtim_period &&
+
+	/*
+	 * lkpi_iv_sta_recv_mgmt() will directly call into this function.
+	 * iwlwifi(4) in iwl_mvm_bss_info_changed_station_common() will
+	 * stop seesion protection the moment it sees
+	 * BSS_CHANGED_BEACON_INFO (with the expectations that it was
+	 * "a beacon from the associated AP"). It will also update
+	 * the beacon filter in that case.  This is the only place
+	 * we set the BSS_CHANGED_BEACON_INFO on the non-teardown
+	 * path so make sure we only do run this check once we are
+	 * assoc. (*iv_recv_mgmt)() will be called before we enter
+	 * here so the ni will be updates with information from the
+	 * beacon via net80211::sta_recv_mgmt().  We also need to
+	 * make sure we do not do it on every beacon we still may
+	 * get so only do if something changed.  vif->bss_conf.dtim_period
+	 * should be 0 as we start up (we also reset it on teardown).
+	 */
+	if (vif->cfg.assoc &&
+	    vif->bss_conf.dtim_period != ni->ni_dtim_period &&
 	    ni->ni_dtim_period > 0) {
 		vif->bss_conf.dtim_period = ni->ni_dtim_period;
 		bss_changed |= BSS_CHANGED_BEACON_INFO;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202509021106.582B6wxr085691>