Index: sys/dev/iwn/if_iwn.c =================================================================== --- sys/dev/iwn/if_iwn.c +++ sys/dev/iwn/if_iwn.c @@ -344,7 +344,6 @@ static void iwn_set_channel(struct ieee80211com *); static void iwn_scan_curchan(struct ieee80211_scan_state *, unsigned long); static void iwn_scan_mindwell(struct ieee80211_scan_state *); -static void iwn_hw_reset(void *, int); #ifdef IWN_DEBUG static char *iwn_get_csr_string(int); static void iwn_debug_register(struct iwn_softc *); @@ -677,7 +676,6 @@ callout_init_mtx(&sc->calib_to, &sc->sc_mtx, 0); callout_init_mtx(&sc->watchdog_to, &sc->sc_mtx, 0); - TASK_INIT(&sc->sc_reinit_task, 0, iwn_hw_reset, sc); TASK_INIT(&sc->sc_radioon_task, 0, iwn_radio_on, sc); TASK_INIT(&sc->sc_radiooff_task, 0, iwn_radio_off, sc); TASK_INIT(&sc->sc_panic_task, 0, iwn_panicked, sc); @@ -685,14 +683,6 @@ mbufq_init(&sc->sc_xmit_queue, 1024); - sc->sc_tq = taskqueue_create("iwn_taskq", M_WAITOK, - taskqueue_thread_enqueue, &sc->sc_tq); - error = taskqueue_start_threads(&sc->sc_tq, 1, 0, "iwn_taskq"); - if (error != 0) { - device_printf(dev, "can't start threads, error %d\n", error); - goto fail; - } - iwn_sysctlattach(sc); /* @@ -1390,27 +1380,27 @@ iwn_detach(device_t dev) { struct iwn_softc *sc = device_get_softc(dev); + struct ieee80211com *ic = &sc->sc_ic; int qid; DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); - if (sc->sc_ic.ic_softc != NULL) { + if (ic->ic_softc != NULL) { /* Free the mbuf queue and node references */ IWN_LOCK(sc); iwn_xmit_queue_drain(sc); IWN_UNLOCK(sc); - ieee80211_draintask(&sc->sc_ic, &sc->sc_reinit_task); - ieee80211_draintask(&sc->sc_ic, &sc->sc_radioon_task); - ieee80211_draintask(&sc->sc_ic, &sc->sc_radiooff_task); + ieee80211_draintask(ic, &sc->sc_radioon_task); + ieee80211_draintask(ic, &sc->sc_radiooff_task); + ieee80211_draintask(ic, &sc->sc_xmit_task); iwn_stop(sc); - taskqueue_drain_all(sc->sc_tq); - taskqueue_free(sc->sc_tq); + taskqueue_drain(taskqueue_thread, &sc->sc_panic_task); callout_drain(&sc->watchdog_to); callout_drain(&sc->calib_to); - ieee80211_ifdetach(&sc->sc_ic); + ieee80211_ifdetach(ic); } /* Uninstall interrupt handler. */ @@ -3149,7 +3139,7 @@ DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "%s: waking things up\n", __func__); /* queue taskqueue to transmit! */ - taskqueue_enqueue(sc->sc_tq, &sc->sc_xmit_task); + ieee80211_runtask(ic, &sc->sc_xmit_task); } } @@ -4153,7 +4143,7 @@ /* Dump firmware error log and stop. */ iwn_fatal_intr(sc); - taskqueue_enqueue(sc->sc_tq, &sc->sc_panic_task); + taskqueue_enqueue(taskqueue_thread, &sc->sc_panic_task); goto done; } if ((r1 & (IWN_INT_FH_RX | IWN_INT_SW_RX | IWN_INT_RX_PERIODIC)) || @@ -5001,7 +4991,7 @@ if (sc->sc_tx_timer > 0) { if (--sc->sc_tx_timer == 0) { ic_printf(ic, "device timeout\n"); - ieee80211_runtask(ic, &sc->sc_reinit_task); + ieee80211_restart_all(ic); return; } } @@ -8923,19 +8913,6 @@ { /* NB: don't try to abort scan; wait for firmware to finish */ } - -static void -iwn_hw_reset(void *arg0, int pending) -{ - struct iwn_softc *sc = arg0; - struct ieee80211com *ic = &sc->sc_ic; - - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); - - iwn_stop(sc); - iwn_init(sc); - ieee80211_notify_radio(ic, 1); -} #ifdef IWN_DEBUG #define IWN_DESC(x) case x: return #x Index: sys/dev/iwn/if_iwnvar.h =================================================================== --- sys/dev/iwn/if_iwnvar.h +++ sys/dev/iwn/if_iwnvar.h @@ -304,15 +304,11 @@ int sc_cap_off; /* PCIe Capabilities. */ /* Tasks used by the driver */ - struct task sc_reinit_task; struct task sc_radioon_task; struct task sc_radiooff_task; struct task sc_panic_task; struct task sc_xmit_task; - /* Taskqueue */ - struct taskqueue *sc_tq; - /* Calibration information */ struct callout calib_to; int calib_cnt;