From 99bbfb77e3c395805fe0a7f19006c5c29136f9fc Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Fri, 17 Apr 2026 02:40:03 +0000 Subject: [PATCH] rtw89: add a warn about beacon_int or dtim_period being 0 While after the changes to LinuxKPI 802.11 we should never be assoc and not have dtim_period set, we have seen before that this could happen. Add a WARN as that will help debugging the following DIV 0. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/contrib/dev/rtw89/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/contrib/dev/rtw89/core.c b/sys/contrib/dev/rtw89/core.c index aeaf1c8f80c..1dee73a62f9 100644 --- a/sys/contrib/dev/rtw89/core.c +++ b/sys/contrib/dev/rtw89/core.c @@ -2838,6 +2838,10 @@ static void rtw89_core_bcn_track_assoc(struct rtw89_dev *rtwdev, dtim = bss_conf->dtim_period; rcu_read_unlock(); +#if defined(__FreeBSD__) + WARN(beacon_int == 0 || dtim == 0, "period %u / beacon_int %u / dtim %u\n", + period, beacon_int, dtim); +#endif beacons_in_period = period / beacon_int / dtim; bcn_intvl_us = ieee80211_tu_to_usec(beacon_int);