From nobody Tue Sep 2 11:06:58 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 4cGNH71Rg2z66WFY; Tue, 02 Sep 2025 11:06:59 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cGNH701BJz3L70; Tue, 02 Sep 2025 11:06:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1756811219; 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=ajVMeI8UrYEHCgtZjzfD5Q8DizQt6U4hPPiBshB6lE8=; b=Ahjz4muwt9oumySEsd6mQ+FxTyM4z1Bk85d6qfATuTwPmT9xiu9km5LZKgT2OdhhsCitJL 8lyEPm9qi0b6BvjSZ5KvTZmCNHBflmNGigkfY1f3WdIjtS2YMx8k1i2rLixtb9Sr1E1fEQ Yn1fJk8kfCt+390NXyljQ7AK4hhbK/Djj8AqORZRTYG50GMBrcFd6bvRm57EOPFrlI3X1Z lkDUJzj+MUj8VOmAPCAIqLAjZsWSzaXXcB/biw3rEnl93xKMkSyN9MRLobe0QEHGACbwTC TX0sIavAWj5cQFnR22eKV0cjgedoT+A/sSGiB9pYot+R2oQ2R4rSCeZWuaZalA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1756811219; 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=ajVMeI8UrYEHCgtZjzfD5Q8DizQt6U4hPPiBshB6lE8=; b=apjmnYJ6ggHFF/msSzHVkk8Rzc+laCpWWqiYqynJSjo0fRZBrGNEL7a47N6MXfFYaFlu6L mE+blcFxp21RFRhgkYFzdu5vSS2LaSyzLbhx4tuyHCunr7MeZgQNJzS+0efqv57vlEh58Z xYs65vdldIpwT/HXOFyLjhK4qKyZp0d2qHeFH8ChjO1eMwq82jFYWIOAN1XZu7hx0eaivz +cyhzXnT8dSqlIzXKSHPiVBxl9YhK73VQ8mmMCHfOcxig6ax6T1ndDZ5bJaopkeKP6lgZy pUrHd/SHGN3jImzjPgDqqDMHE3jrSVI/dodoEPE8MWCAeOuAX60qr8deyy6YhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1756811219; a=rsa-sha256; cv=none; b=U7/OryzwAKPaG4RNu5fhGAzGrn6tlOgiVjNzDaKg3IDHB5AIV7aJp7efR9IX/nXBRPyw/J SWt4By/JAdOf1cD0nw3a1cGr+dj3i+ycuXJsJpwqz1HPBQPphemsPfLED54F7PuZBxPrpX mjggdP3WilqRfMw7ZRs0ojdMXQb9L/bqilpvQ4cHRJzmxRf4QWO1/+oceb12hs0NBDp+rM 4aCnMkm++Tq8ioW0kiKb52rqhuZpb6xoZ9HoErjlstEwFE8tfaqEHzGpy4KQZtaslEROo2 RZpsH3iFXDxjmaDZGNzOr4twP+0rIKxyamfPG0Ge9gvK4OsLKVmkgcPo+ANLSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cGNH66k5vzkpK; Tue, 02 Sep 2025 11:06:58 +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 582B6wSr085694; Tue, 2 Sep 2025 11:06:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 582B6wxr085691; Tue, 2 Sep 2025 11:06:58 GMT (envelope-from git) Date: Tue, 2 Sep 2025 11:06:58 GMT Message-Id: <202509021106.582B6wxr085691@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: 8b86235ddd42 - main - LinuxKPI: 802.11: only change dtim_period once assoc 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: 8b86235ddd42645b385458b7af6f42de683b6316 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8b86235ddd42645b385458b7af6f42de683b6316 commit 8b86235ddd42645b385458b7af6f42de683b6316 Author: Bjoern A. Zeeb AuthorDate: 2025-09-02 07:11:08 +0000 Commit: Bjoern A. Zeeb 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;