diff options
author | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2010-12-06 04:41:41 +0000 |
---|---|---|
committer | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2010-12-06 04:41:41 +0000 |
commit | 586226f2be8916cb9799bd7c4c47749b6f386d52 (patch) | |
tree | 0345ca9864b3287f60b7d747fc92d9727488e4fb /sys/dev/usb/if_rum.c | |
parent | c771dfeb92ac7c03200839673dde83bd36b2ec0e (diff) |
* replace per-driver dying and/or other state variables with use of
usbd_deactivete() and usbd_is_dying()
* use usbd_deactivate() in activate()/DEACTIVATE
* convert a few more direct checks of the associated bus' dying flag
with usbd_is_dying()
Diffstat (limited to 'sys/dev/usb/if_rum.c')
-rw-r--r-- | sys/dev/usb/if_rum.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/dev/usb/if_rum.c b/sys/dev/usb/if_rum.c index 6de3f817736..6312915407e 100644 --- a/sys/dev/usb/if_rum.c +++ b/sys/dev/usb/if_rum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rum.c,v 1.93 2010/10/27 17:51:11 jakemsr Exp $ */ +/* $OpenBSD: if_rum.c,v 1.94 2010/12/06 04:41:39 jakemsr Exp $ */ /*- * Copyright (c) 2005-2007 Damien Bergamini <damien.bergamini@free.fr> @@ -644,6 +644,9 @@ rum_next_scan(void *arg) struct ieee80211com *ic = &sc->sc_ic; struct ifnet *ifp = &ic->ic_if; + if (usbd_is_dying(sc->sc_udev)) + return; + if (ic->ic_state == IEEE80211_S_SCAN) ieee80211_next_scan(ifp); } @@ -657,6 +660,9 @@ rum_task(void *arg) struct ieee80211_node *ni; uint32_t tmp; + if (usbd_is_dying(sc->sc_udev)) + return; + ostate = ic->ic_state; switch (sc->sc_state) { @@ -2239,6 +2245,9 @@ rum_amrr_timeout(void *arg) struct rum_softc *sc = arg; usb_device_request_t req; + if (usbd_is_dying(sc->sc_udev)) + return; + /* * Asynchronously read statistic registers (cleared by read). */ @@ -2287,11 +2296,14 @@ rum_amrr_update(usbd_xfer_handle xfer, usbd_private_handle priv, int rum_activate(struct device *self, int act) { + struct rum_softc *sc = (struct rum_softc *)self; + switch (act) { case DVACT_ACTIVATE: break; case DVACT_DEACTIVATE: + usbd_deactivate(sc->sc_udev); break; } |