From c8c92323ed8af3cedd9039558aad8e3aec6814ae Mon Sep 17 00:00:00 2001 From: Stefan Sperling Date: Fri, 19 Nov 2021 13:05:20 +0000 Subject: Fix monitor mode on iwm(4) and iwx(4). Set sc->ns_nstate when bypassing the driver's newstate handler while bringing the interface down. Otherwise, if the interface was already running, the INIT->RUN transition which kicks off monitor mode will appear as a RUN->RUN transition to the driver's newstate handler, and the handler will do nothing. Monitor mode did not work as a result. --- sys/dev/pci/if_iwm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/dev/pci/if_iwm.c') diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c index 6ecf1dd8915..32d831f78f3 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.379 2021/11/17 15:15:32 stsp Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.380 2021/11/19 13:05:19 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh @@ -10075,6 +10075,7 @@ iwm_stop(struct ifnet *ifp) sc->ba_tx.stop_tidmask = 0; sc->sc_newstate(ic, IEEE80211_S_INIT, -1); + sc->ns_nstate = IEEE80211_S_INIT; timeout_del(&sc->sc_calib_to); /* XXX refcount? */ for (i = 0; i < nitems(sc->sc_rxba_data); i++) { -- cgit v1.2.3