]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: rtw88: fix DTIM period handling when conf->dtim_period is zero
authorRoman Peshkichev <roman.peshkichev@gmail.com>
Tue, 25 Nov 2025 18:09:37 +0000 (23:09 +0500)
committerPing-Ke Shih <pkshih@realtek.com>
Tue, 23 Dec 2025 03:26:07 +0000 (11:26 +0800)
commit9f68fdcdc9dbf21be2a48feced90ff7f77d07443
tree94817af6a82790b9e50321d463e179ad036a9555
parent8f7aa3d3c7323f4ca2768a9e74ebbe359c4f8f88
wifi: rtw88: fix DTIM period handling when conf->dtim_period is zero

The function rtw_set_dtim_period() accepted an 'int' dtim_period parameter,
while mac80211 provides dtim_period as 'u8' in struct ieee80211_bss_conf.
In IBSS (ad-hoc) mode mac80211 may set dtim_period to 0.

The driver unconditionally wrote (dtim_period - 1) to
REG_DTIM_COUNTER_ROOT, which resulted in 0xFF when dtim_period was 0. This
caused delays in broadcast/multicast traffic processing and issues with
ad-hoc operation.

Convert the function parameter to u8 to match ieee80211_bss_conf and avoid
the underflow by writing 0 when dtim_period is 0.

Link: https://github.com/lwfinger/rtw88/issues/406
Signed-off-by: Roman Peshkichev <roman.peshkichev@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20251125180937.22977-1-roman.peshkichev@gmail.com
drivers/net/wireless/realtek/rtw88/main.c
drivers/net/wireless/realtek/rtw88/main.h