git: be1ae08d0a10 - main - LinuxKPI: 802.11: use ni_dtim_period instead of iv_dtim_period

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Fri, 29 Aug 2025 13:19:00 UTC
The branch main has been updated by bz:

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

commit be1ae08d0a10332893990f079d4bef1b64d5d4ff
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-08-25 19:17:01 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-08-29 13:18:42 +0000

    LinuxKPI: 802.11: use ni_dtim_period instead of iv_dtim_period
    
    Both iwm(4) and iwx(4) are using the iv_dtim_period from the vap.
    This likely stems from the fact that ieee80211_sta_join() while setting
    up the ni basics does set the dtim_period on the vap (we should revist
    this in net80211) from the scan results.
    
    The problem with that is that once we are associated and are receiving
    beacons, sta_recv_mgmt() will handle the TIM IE and and save the
    tim period and tim count in ni_dtim_period and ni_dtim_count on the node.
    
    Given we need to inform the driver/firmware (at least for iwlwifi)
    with values from beacons received after assoc, the ni is the better
    place the take the value from (though the beacons hopefully stay
    consistent).
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
---
 sys/compat/linuxkpi/common/src/linux_80211.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index 7f8182ef67b4..1f7a0fa9d9b0 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -1872,13 +1872,13 @@ 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 != vap->iv_dtim_period &&
-	    vap->iv_dtim_period > 0) {
-		vif->bss_conf.dtim_period = vap->iv_dtim_period;
+	if (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;
 	}
 
-	vif->bss_conf.sync_dtim_count = vap->iv_dtim_count;
+	vif->bss_conf.sync_dtim_count = ni->ni_dtim_count;
 	vif->bss_conf.sync_tsf = le64toh(ni->ni_tstamp.tsf);
 	/* vif->bss_conf.sync_device_ts = set in linuxkpi_ieee80211_rx. */