From 5d4a7e01467ffe614556f7fd960d0f9c431b700a Mon Sep 17 00:00:00 2001 From: thompsa Date: Fri, 8 May 2009 13:44:33 +0000 Subject: [PATCH] Drain the tasks before the interface stop call in case a restart was queued. --- sys/dev/ipw/if_ipw.c | 2 +- sys/dev/iwi/if_iwi.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/ipw/if_ipw.c b/sys/dev/ipw/if_ipw.c index 9d67724f2c61..eac9091a748e 100644 --- a/sys/dev/ipw/if_ipw.c +++ b/sys/dev/ipw/if_ipw.c @@ -404,13 +404,13 @@ ipw_detach(device_t dev) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; + ieee80211_draintask(ic, &sc->sc_init_task); ipw_stop(sc); bpfdetach(ifp); ieee80211_ifdetach(ic); callout_drain(&sc->sc_wdtimer); - ieee80211_draintask(ic, &sc->sc_init_task); ipw_release(sc); diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c index 6957f9b9a87d..b04403b0a645 100644 --- a/sys/dev/iwi/if_iwi.c +++ b/sys/dev/iwi/if_iwi.c @@ -459,17 +459,17 @@ iwi_detach(device_t dev) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - iwi_stop(sc); - - bpfdetach(ifp); - ieee80211_ifdetach(ic); - /* NB: do early to drain any pending tasks */ ieee80211_draintask(ic, &sc->sc_radiontask); ieee80211_draintask(ic, &sc->sc_radiofftask); ieee80211_draintask(ic, &sc->sc_restarttask); ieee80211_draintask(ic, &sc->sc_disassoctask); + iwi_stop(sc); + + bpfdetach(ifp); + ieee80211_ifdetach(ic); + iwi_put_firmware(sc); iwi_release_fw_dma(sc);