git: f943454bfbd9 - main - LinuxKPI: 802.11: rework MC/configure_filter

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Sun, 14 Dec 2025 20:13:24 UTC
The branch main has been updated by bz:

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

commit f943454bfbd98ce49516c6ede8626b5f2602edc1
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-12-14 20:07:13 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-12-14 20:12:56 +0000

    LinuxKPI: 802.11: rework MC/configure_filter
    
    (*prepare_multicast)(), for the drivers we support, is iwlwifi(4)-specific.
    If it is not available do not let us stop from calling (*configure_filter)()
    at least as well.
    In addition to the interface setting mc_all_multi, if we have no way to
    prepare the multicast filter list this way, set FIF_ALLMULTI for now.
    This seems to help some with rtw89 but does not help me with other drivers
    yet to get IPv6 link-local (e.g., ff02::1%wlan0) going.
    This should also help in case we are scanning and are setting
    FIF_BCN_PRBRESP_PROMISC .  We should go and review the full FIF_ list and
    start adding conditional support for the other options too.
    
    Sponsored by:   The FreeBSD Foundation
    PR:             281982
    MFC after:      3 days
---
 sys/compat/linuxkpi/common/src/linux_80211.c        | 10 ++--------
 sys/compat/linuxkpi/common/src/linux_80211_macops.c |  3 ---
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index 1d510577f00c..02724433d89d 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -1874,10 +1874,6 @@ lkpi_update_mcast_filter(struct ieee80211com *ic)
 
 	lhw = ic->ic_softc;
 
-	if (lhw->ops->prepare_multicast == NULL ||
-	    lhw->ops->configure_filter == NULL)
-		return;
-
 	LKPI_80211_LHW_SCAN_LOCK(lhw);
 	scanning = (lhw->scan_flags & LKPI_LHW_SCAN_RUNNING) != 0;
 	LKPI_80211_LHW_SCAN_UNLOCK(lhw);
@@ -1887,7 +1883,8 @@ lkpi_update_mcast_filter(struct ieee80211com *ic)
 	flags = 0;
 	if (scanning)
 		flags |= FIF_BCN_PRBRESP_PROMISC;
-	if (lhw->mc_all_multi)
+	/* The latter condition may not be as expected but seems wise. */
+	if (lhw->mc_all_multi || lhw->ops->prepare_multicast == NULL)
 		flags |= FIF_ALLMULTI;
 
 	hw = LHW_TO_HW(lhw);
@@ -4246,9 +4243,6 @@ lkpi_ic_update_mcast(struct ieee80211com *ic)
 	struct lkpi_hw *lhw;
 
 	lhw = ic->ic_softc;
-	if (lhw->ops->prepare_multicast == NULL ||
-	    lhw->ops->configure_filter == NULL)
-		return;
 
 	LKPI_80211_LHW_MC_LOCK(lhw);
 	/* Cleanup anything on the current list. */
diff --git a/sys/compat/linuxkpi/common/src/linux_80211_macops.c b/sys/compat/linuxkpi/common/src/linux_80211_macops.c
index d9e82a6d64ee..a85e6d0d0dd7 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211_macops.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211_macops.c
@@ -310,9 +310,6 @@ lkpi_80211_mo_configure_filter(struct ieee80211_hw *hw, unsigned int changed_fla
 	if (lhw->ops->configure_filter == NULL)
 		return;
 
-	if (mc_ptr == 0)
-		return;
-
 	LKPI_80211_TRACE_MO("hw %p changed_flags %#x total_flags %p mc_ptr %ju", hw, changed_flags, total_flags, (uintmax_t)mc_ptr);
 	lhw->ops->configure_filter(hw, changed_flags, total_flags, mc_ptr);
 }