summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2019-09-02 12:50:13 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2019-09-02 12:50:13 +0000
commitfbe59ca116c64eb924e71fe936b301dabd78c0a9 (patch)
tree70b076b68d21b0ca608fb9393bf8f50d3fc21f95 /sys/dev/pci
parent90ef47811b34d92acdd2081164c0a3717090c055 (diff)
Reset the current wireless PHY mode to 'auto' when a scan begins if we
are in media autoselect mode. The interface might have been switched to a fixed PHY mode during association and keeping it fixed will mislead AP selection after roaming failure. Problem found and diagnosed at CCC camp 2019 Tested by myself, fkr@, chris@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/if_iwm.c9
-rw-r--r--sys/dev/pci/if_iwn.c9
2 files changed, 16 insertions, 2 deletions
diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c
index 42cb00c62cc..d0dba0daa30 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.247 2019/08/29 07:49:15 stsp Exp $ */
+/* $OpenBSD: if_iwm.c,v 1.248 2019/09/02 12:50:12 stsp Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -5693,6 +5693,13 @@ iwm_scan(struct iwm_softc *sc)
return err;
}
+ /*
+ * 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)
+ ieee80211_setmode(ic, IEEE80211_MODE_AUTO);
+
sc->sc_flags |= IWM_FLAG_SCANNING;
if (ifp->if_flags & IFF_DEBUG)
printf("%s: %s -> %s\n", ifp->if_xname,
diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c
index 273d0f0b9e6..6be794c2cd4 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.213 2019/08/27 14:57:48 stsp Exp $ */
+/* $OpenBSD: if_iwn.c,v 1.214 2019/09/02 12:50:12 stsp Exp $ */
/*-
* Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -5199,6 +5199,13 @@ iwn_scan(struct iwn_softc *sc, uint16_t flags, int bgscan)
DPRINTF(("sending scan command nchan=%d\n", hdr->nchan));
error = iwn_cmd(sc, IWN_CMD_SCAN, buf, buflen, 1);
if (error == 0) {
+ /*
+ * 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)
+ ieee80211_setmode(ic, IEEE80211_MODE_AUTO);
+
sc->sc_flags |= IWN_FLAG_SCANNING;
if (bgscan)
sc->sc_flags |= IWN_FLAG_BGSCAN;