From 844e213d50c754e415ff22924cb86e86d4d63002 Mon Sep 17 00:00:00 2001 From: stsp Date: Fri, 16 Feb 2024 11:44:52 +0000 Subject: [PATCH] Fix wrong ifmedia check in intel wifi drivers. IFM_AUTO is a media sub-type, not a media mode. Should fix issues where only a subset of channels were scanned. Tested: iwm 8260: millert@ iwm 8265: mglocker@ iwm 9560: gnezdo@ iwx ax200: jmc@ iwx ax210: spiros thanasoulas iwx ax211: kn@ --- sys/dev/pci/if_iwm.c | 4 ++-- sys/dev/pci/if_iwn.c | 4 ++-- sys/dev/pci/if_iwx.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c index f0977cd84e8..ce04cea5bb9 100644 --- a/sys/dev/pci/if_iwm.c +++ b/sys/dev/pci/if_iwm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwm.c,v 1.413 2023/12/20 07:32:05 stsp Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.414 2024/02/16 11:44:52 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh @@ -8534,7 +8534,7 @@ iwm_scan(struct iwm_softc *sc) * The current mode might have been fixed during association. * Ensure all channels get scanned. */ - if (IFM_MODE(ic->ic_media.ifm_cur->ifm_media) == IFM_AUTO) + if (IFM_SUBTYPE(ic->ic_media.ifm_cur->ifm_media) == IFM_AUTO) ieee80211_setmode(ic, IEEE80211_MODE_AUTO); sc->sc_flags |= IWM_FLAG_SCANNING; diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c index 69ecb242154..10813741fa9 100644 --- a/sys/dev/pci/if_iwn.c +++ b/sys/dev/pci/if_iwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwn.c,v 1.260 2022/06/19 18:27:06 stsp Exp $ */ +/* $OpenBSD: if_iwn.c,v 1.261 2024/02/16 11:44:52 stsp Exp $ */ /*- * Copyright (c) 2007-2010 Damien Bergamini @@ -5359,7 +5359,7 @@ iwn_scan(struct iwn_softc *sc, uint16_t flags, int bgscan) * The current mode might have been fixed during association. * Ensure all channels get scanned. */ - if (IFM_MODE(ic->ic_media.ifm_cur->ifm_media) == IFM_AUTO) + if (IFM_SUBTYPE(ic->ic_media.ifm_cur->ifm_media) == IFM_AUTO) ieee80211_setmode(ic, IEEE80211_MODE_AUTO); sc->sc_flags |= IWN_FLAG_SCANNING; diff --git a/sys/dev/pci/if_iwx.c b/sys/dev/pci/if_iwx.c index 4b945edf2c7..2166d47151a 100644 --- a/sys/dev/pci/if_iwx.c +++ b/sys/dev/pci/if_iwx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwx.c,v 1.180 2023/12/30 16:55:44 stsp Exp $ */ +/* $OpenBSD: if_iwx.c,v 1.181 2024/02/16 11:44:52 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh @@ -7529,7 +7529,7 @@ iwx_scan(struct iwx_softc *sc) * The current mode might have been fixed during association. * Ensure all channels get scanned. */ - if (IFM_MODE(ic->ic_media.ifm_cur->ifm_media) == IFM_AUTO) + if (IFM_SUBTYPE(ic->ic_media.ifm_cur->ifm_media) == IFM_AUTO) ieee80211_setmode(ic, IEEE80211_MODE_AUTO); sc->sc_flags |= IWX_FLAG_SCANNING; -- 2.20.1