-/* $OpenBSD: if_iwx.c,v 1.60 2021/06/30 09:46:46 stsp Exp $ */
+/* $OpenBSD: if_iwx.c,v 1.61 2021/06/30 09:47:20 stsp Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
struct iwx_node *in = (void *)ic->ic_bss;
int err, s = splnet();
- if (sc->sc_flags & IWX_FLAG_SHUTDOWN) {
+ if ((sc->sc_flags & IWX_FLAG_SHUTDOWN) ||
+ ic->ic_state != IEEE80211_S_RUN) {
refcnt_rele_wake(&sc->task_refs);
splx(s);
return;
{
struct iwx_softc *sc = ic->ic_softc;
- if (ic->ic_state == IEEE80211_S_RUN)
+ if (ic->ic_state == IEEE80211_S_RUN &&
+ !task_pending(&sc->newstate_task))
iwx_add_task(sc, systq, &sc->mac_ctxt_task);
}
{
struct iwx_softc *sc = ic->ic_softc;
- if (ic->ic_state == IEEE80211_S_RUN)
+ if (ic->ic_state == IEEE80211_S_RUN &&
+ !task_pending(&sc->newstate_task))
iwx_add_task(sc, systq, &sc->mac_ctxt_task);
}
{
struct iwx_softc *sc = ic->ic_softc;
- if (ic->ic_state == IEEE80211_S_RUN)
+ if (ic->ic_state == IEEE80211_S_RUN &&
+ !task_pending(&sc->newstate_task))
iwx_add_task(sc, systq, &sc->mac_ctxt_task);
}