diff options
author | Stuart Henderson <sthen@cvs.openbsd.org> | 2013-05-04 21:55:57 +0000 |
---|---|---|
committer | Stuart Henderson <sthen@cvs.openbsd.org> | 2013-05-04 21:55:57 +0000 |
commit | 337ba3c03aa9666511753c5834a21460c2d5e589 (patch) | |
tree | 98feb7e7afa61712576a09da9132c3b917eddfe0 /sys/dev/usb | |
parent | 03b0f15850910c6ba2c6986d44c92d2464303a9c (diff) |
revert uthum_activate removal, it is needed in the detach path as found the
hard way by mglocker@
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/uthum.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/dev/usb/uthum.c b/sys/dev/usb/uthum.c index add7cfefcf2..66d0fc47eb8 100644 --- a/sys/dev/usb/uthum.c +++ b/sys/dev/usb/uthum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthum.c,v 1.20 2013/05/04 12:22:14 sthen Exp $ */ +/* $OpenBSD: uthum.c,v 1.21 2013/05/04 21:55:56 sthen Exp $ */ /* * Copyright (c) 2009, 2010 Yojiro UO <yuo@nui.org> @@ -113,6 +113,7 @@ struct uthum_sensor { struct uthum_softc { struct uhidev sc_hdev; struct usbd_device *sc_udev; + u_char sc_dying; int sc_device_type; int sc_num_sensors; @@ -136,6 +137,7 @@ const struct usb_devno uthum_devs[] = { int uthum_match(struct device *, void *, void *); void uthum_attach(struct device *, struct device *, void *); int uthum_detach(struct device *, int); +int uthum_activate(struct device *, int); int uthum_issue_cmd(struct uthum_softc *, uint8_t, int); int uthum_read_data(struct uthum_softc *, uint8_t, uint8_t *, size_t, int); @@ -164,7 +166,8 @@ const struct cfattach uthum_ca = { sizeof(struct uthum_softc), uthum_match, uthum_attach, - uthum_detach + uthum_detach, + uthum_activate }; int @@ -275,6 +278,19 @@ uthum_detach(struct device *self, int flags) return (rv); } +int +uthum_activate(struct device *self, int act) +{ + struct uthum_softc *sc = (struct uthum_softc *)self; + + switch (act) { + case DVACT_DEACTIVATE: + sc->sc_dying = 1; + break; + } + return (0); +} + void uthum_intr(struct uhidev *addr, void *ibuf, u_int len) { |