diff options
Diffstat (limited to 'sys/dev/usb/if_run.c')
-rw-r--r-- | sys/dev/usb/if_run.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/sys/dev/usb/if_run.c b/sys/dev/usb/if_run.c index 5d4fe93a1c0..9622756109a 100644 --- a/sys/dev/usb/if_run.c +++ b/sys/dev/usb/if_run.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_run.c,v 1.85 2011/01/30 17:31:08 tedu Exp $ */ +/* $OpenBSD: if_run.c,v 1.86 2011/02/05 18:10:44 jakemsr Exp $ */ /*- * Copyright (c) 2008-2010 Damien Bergamini <damien.bergamini@free.fr> @@ -600,22 +600,8 @@ run_detach(struct device *self, int flags) timeout_del(&sc->calib_to); /* wait for all queued asynchronous commands to complete */ -#if 0 - while (sc->cmdq.queued > 0) - tsleep(&sc->cmdq, 0, "cmdq", 0); -#endif - /* the async commands are run in a task */ usb_rem_wait_task(sc->sc_udev, &sc->sc_task); - /* but the task might not have run if it did not start before - * usbd_deactivate() was called, so wakeup now. we're - * detaching, no need to try to run more commands. - */ - if (sc->cmdq.queued > 0) { - sc->cmdq.queued = 0; - wakeup(&sc->cmdq); - } - usbd_ref_wait(sc->sc_udev); if (ifp->if_softc != NULL) { @@ -1485,7 +1471,6 @@ run_task(void *arg) ring->queued--; ring->next = (ring->next + 1) % RUN_HOST_CMD_RING_COUNT; } - wakeup(ring); splx(s); } @@ -3534,8 +3519,7 @@ run_stop(struct ifnet *ifp, int disable) s = splusb(); ieee80211_new_state(ic, IEEE80211_S_INIT, -1); /* wait for all queued asynchronous commands to complete */ - while (sc->cmdq.queued > 0) - tsleep(&sc->cmdq, 0, "cmdq", 0); + usb_wait_task(sc->sc_udev, &sc->sc_task); splx(s); /* disable Tx/Rx */ |