summaryrefslogtreecommitdiff
path: root/sys/dev/usb/if_rsu.c
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2010-12-27 03:03:51 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2010-12-27 03:03:51 +0000
commitc04c7cf53825541b504fd4aa09a41a3465477bb8 (patch)
tree6807114556443e722197b1eaca8fb2cd40719fac /sys/dev/usb/if_rsu.c
parent9f879832bd1526394a19bd87abe3ae4a52683f1c (diff)
* add cfattach activate functions and call usbd_deactivate() in the
DVACT_DEACTIVATE case for drivers that don't have activate finctions * fill out cfattach activate functions and call usbd_deactivate() in the DVACT_DEACTIVATE case for drivers that don't have a dying flag "ok with the intent" miod@
Diffstat (limited to 'sys/dev/usb/if_rsu.c')
-rw-r--r--sys/dev/usb/if_rsu.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/sys/dev/usb/if_rsu.c b/sys/dev/usb/if_rsu.c
index 6eb68ba2842..f7d4ac0bacc 100644
--- a/sys/dev/usb/if_rsu.c
+++ b/sys/dev/usb/if_rsu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rsu.c,v 1.7 2010/12/18 22:55:18 jakemsr Exp $ */
+/* $OpenBSD: if_rsu.c,v 1.8 2010/12/27 03:03:50 jakemsr Exp $ */
/*-
* Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -130,6 +130,7 @@ static const struct usb_devno rsu_devs_noht[] = {
int rsu_match(struct device *, void *, void *);
void rsu_attach(struct device *, struct device *, void *);
int rsu_detach(struct device *, int);
+int rsu_activate(struct device *, int);
int rsu_open_pipes(struct rsu_softc *);
void rsu_close_pipes(struct rsu_softc *);
int rsu_alloc_rx_list(struct rsu_softc *);
@@ -200,7 +201,8 @@ const struct cfattach rsu_ca = {
sizeof(struct rsu_softc),
rsu_match,
rsu_attach,
- rsu_detach
+ rsu_detach,
+ rsu_activate
};
int
@@ -365,6 +367,23 @@ rsu_detach(struct device *self, int flags)
}
int
+rsu_activate(struct device *self, int act)
+{
+ struct rsu_softc *sc = (struct rsu_softc *)self;
+
+ switch (act) {
+ case DVACT_ACTIVATE:
+ break;
+
+ case DVACT_DEACTIVATE:
+ usbd_deactivate(sc->sc_udev);
+ break;
+ }
+
+ return 0;
+}
+
+int
rsu_open_pipes(struct rsu_softc *sc)
{
usb_interface_descriptor_t *id;