diff options
author | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2010-12-27 03:03:51 +0000 |
---|---|---|
committer | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2010-12-27 03:03:51 +0000 |
commit | c04c7cf53825541b504fd4aa09a41a3465477bb8 (patch) | |
tree | 6807114556443e722197b1eaca8fb2cd40719fac | |
parent | 9f879832bd1526394a19bd87abe3ae4a52683f1c (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@
-rw-r--r-- | sys/dev/usb/if_cdcef.c | 23 | ||||
-rw-r--r-- | sys/dev/usb/if_otus.c | 23 | ||||
-rw-r--r-- | sys/dev/usb/if_rsu.c | 23 | ||||
-rw-r--r-- | sys/dev/usb/if_urtwn.c | 23 | ||||
-rw-r--r-- | sys/dev/usb/uberry.c | 5 | ||||
-rw-r--r-- | sys/dev/usb/udfu.c | 23 | ||||
-rw-r--r-- | sys/dev/usb/udl.c | 6 | ||||
-rw-r--r-- | sys/dev/usb/uow.c | 3 | ||||
-rw-r--r-- | sys/dev/usb/uyap.c | 13 |
9 files changed, 127 insertions, 15 deletions
diff --git a/sys/dev/usb/if_cdcef.c b/sys/dev/usb/if_cdcef.c index 4784be63355..74f12ea27ec 100644 --- a/sys/dev/usb/if_cdcef.c +++ b/sys/dev/usb/if_cdcef.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cdcef.c,v 1.25 2010/06/29 07:12:31 matthew Exp $ */ +/* $OpenBSD: if_cdcef.c,v 1.26 2010/12/27 03:03:50 jakemsr Exp $ */ /* * Copyright (c) 2007 Dale Rahn <drahn@openbsd.org> @@ -87,6 +87,7 @@ struct cdcef_softc { int cdcef_match(struct device *, void *, void *); void cdcef_attach(struct device *, struct device *, void *); +int cdcef_activate(struct device *, int); usbf_status cdcef_do_request(usbf_function_handle, usb_device_request_t *, void **); @@ -106,7 +107,8 @@ struct mbuf * cdcef_newbuf(void); void cdcef_start_timeout (void *); struct cfattach cdcef_ca = { - sizeof(struct cdcef_softc), cdcef_match, cdcef_attach + sizeof(struct cdcef_softc), cdcef_match, cdcef_attach, NULL, + cdcef_activate }; struct cfdriver cdcef_cd = { @@ -266,6 +268,23 @@ cdcef_attach(struct device *parent, struct device *self, void *aux) splx(s); } +int +cdcef_activate(struct device *self, int act) +{ + struct cdcef_softc *sc = (struct cdcef_softc *)self; + + switch (act) { + case DVACT_ACTIVATE: + break; + + case DVACT_DEACTIVATE: + usbd_deactivate(sc->sc_udev); + break; + } + + return 0; +} + usbf_status cdcef_do_request(usbf_function_handle fun, usb_device_request_t *req, void **data) diff --git a/sys/dev/usb/if_otus.c b/sys/dev/usb/if_otus.c index 12bb568f0b7..a3817ce3c68 100644 --- a/sys/dev/usb/if_otus.c +++ b/sys/dev/usb/if_otus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_otus.c,v 1.24 2010/10/30 18:03:43 damien Exp $ */ +/* $OpenBSD: if_otus.c,v 1.25 2010/12/27 03:03:50 jakemsr Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr> @@ -105,6 +105,7 @@ static const struct usb_devno otus_devs[] = { int otus_match(struct device *, void *, void *); void otus_attach(struct device *, struct device *, void *); int otus_detach(struct device *, int); +int otus_activate(struct device *, int); void otus_attachhook(void *); void otus_get_chanlist(struct otus_softc *); int otus_load_firmware(struct otus_softc *, const char *, @@ -179,7 +180,8 @@ struct cfdriver otus_cd = { }; const struct cfattach otus_ca = { - sizeof (struct otus_softc), otus_match, otus_attach, otus_detach + sizeof (struct otus_softc), otus_match, otus_attach, otus_detach, + otus_activate }; int @@ -270,6 +272,23 @@ otus_detach(struct device *self, int flags) return 0; } +int +otus_activate(struct device *self, int act) +{ + struct otus_softc *sc = (struct otus_softc *)self; + + switch (act) { + case DVACT_ACTIVATE: + break; + + case DVACT_DEACTIVATE: + usbd_deactivate(sc->sc_udev); + break; + } + + return 0; +} + void otus_attachhook(void *xsc) { 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; diff --git a/sys/dev/usb/if_urtwn.c b/sys/dev/usb/if_urtwn.c index 68902fd7a33..8d0e1869fbe 100644 --- a/sys/dev/usb/if_urtwn.c +++ b/sys/dev/usb/if_urtwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_urtwn.c,v 1.10 2010/12/11 21:07:38 damien Exp $ */ +/* $OpenBSD: if_urtwn.c,v 1.11 2010/12/27 03:03:50 jakemsr Exp $ */ /*- * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> @@ -113,6 +113,7 @@ static const struct usb_devno urtwn_devs[] = { int urtwn_match(struct device *, void *, void *); void urtwn_attach(struct device *, struct device *, void *); int urtwn_detach(struct device *, int); +int urtwn_activate(struct device *, int); int urtwn_open_pipes(struct urtwn_softc *); void urtwn_close_pipes(struct urtwn_softc *); int urtwn_alloc_rx_list(struct urtwn_softc *); @@ -213,7 +214,8 @@ const struct cfattach urtwn_ca = { sizeof(struct urtwn_softc), urtwn_match, urtwn_attach, - urtwn_detach + urtwn_detach, + urtwn_activate }; int @@ -395,6 +397,23 @@ urtwn_detach(struct device *self, int flags) } int +urtwn_activate(struct device *self, int act) +{ + struct urtwn_softc *sc = (struct urtwn_softc *)self; + + switch (act) { + case DVACT_ACTIVATE: + break; + + case DVACT_DEACTIVATE: + usbd_deactivate(sc->sc_udev); + break; + } + + return 0; +} + +int urtwn_open_pipes(struct urtwn_softc *sc) { /* Bulk-out endpoints addresses (from highest to lowest prio). */ diff --git a/sys/dev/usb/uberry.c b/sys/dev/usb/uberry.c index e0b23a58a0b..d3da23d31e5 100644 --- a/sys/dev/usb/uberry.c +++ b/sys/dev/usb/uberry.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uberry.c,v 1.17 2010/04/20 22:05:43 tedu Exp $ */ +/* $OpenBSD: uberry.c,v 1.18 2010/12/27 03:03:50 jakemsr Exp $ */ /*- * Copyright (c) 2006 Theo de Raadt <deraadt@openbsd.org> @@ -158,11 +158,14 @@ uberry_detach(struct device *self, int flags) int uberry_activate(struct device *self, int act) { + struct uberry_softc *sc = (struct uberry_softc *)self; + switch (act) { case DVACT_ACTIVATE: break; case DVACT_DEACTIVATE: + usbd_deactivate(sc->sc_udev); break; } return 0; diff --git a/sys/dev/usb/udfu.c b/sys/dev/usb/udfu.c index 2fc8764a655..b64ae3a0e9d 100644 --- a/sys/dev/usb/udfu.c +++ b/sys/dev/usb/udfu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udfu.c,v 1.1 2009/01/25 02:00:25 fgsch Exp $ */ +/* $OpenBSD: udfu.c,v 1.2 2010/12/27 03:03:50 jakemsr Exp $ */ /* * Copyright (c) 2009 Federico G. Schwindt <fgsch@openbsd.org> @@ -72,6 +72,7 @@ struct udfu_softc { int udfu_match(struct device *, void *, void *); void udfu_attach(struct device *, struct device *, void *); int udfu_detach(struct device *, int); +int udfu_activate(struct device *, int); void udfu_parse_desc(struct udfu_softc *); int udfu_request(struct udfu_softc *, int, int, int, void *, size_t); @@ -84,7 +85,8 @@ const struct cfattach udfu_ca = { sizeof(struct udfu_softc), udfu_match, udfu_attach, - udfu_detach + udfu_detach, + udfu_activate }; int @@ -167,6 +169,23 @@ udfu_detach(struct device *self, int flags) return (0); } +int +udfu_activate(struct device *self, int act) +{ + struct udfu_softc *sc = (struct udfu_softc *)self; + + switch (act) { + case DVACT_ACTIVATE: + break; + + case DVACT_DEACTIVATE: + usbd_deactivate(sc->sc_udev); + break; + } + + return 0; +} + void udfu_parse_desc(struct udfu_softc *sc) { diff --git a/sys/dev/usb/udl.c b/sys/dev/usb/udl.c index 5995bfba6f3..ad853bd481b 100644 --- a/sys/dev/usb/udl.c +++ b/sys/dev/usb/udl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udl.c,v 1.65 2010/12/26 15:41:00 miod Exp $ */ +/* $OpenBSD: udl.c,v 1.66 2010/12/27 03:03:50 jakemsr Exp $ */ /* * Copyright (c) 2009 Marcus Glocker <mglocker@openbsd.org> @@ -487,11 +487,13 @@ udl_detach(struct device *self, int flags) int udl_activate(struct device *self, int act) { + struct udl_softc *sc = (struct udl_softc *)self; + switch (act) { case DVACT_ACTIVATE: break; case DVACT_DEACTIVATE: - /* XXX sc->sc_dying = 1; */ + usbd_deactivate(sc->sc_udev); break; } diff --git a/sys/dev/usb/uow.c b/sys/dev/usb/uow.c index ad215d29472..b6a6c602c9f 100644 --- a/sys/dev/usb/uow.c +++ b/sys/dev/usb/uow.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uow.c,v 1.27 2010/03/07 08:59:32 mk Exp $ */ +/* $OpenBSD: uow.c,v 1.28 2010/12/27 03:03:50 jakemsr Exp $ */ /* * Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org> @@ -278,6 +278,7 @@ uow_activate(struct device *self, int act) case DVACT_DEACTIVATE: if (sc->sc_ow_dev != NULL) rv = config_deactivate(sc->sc_ow_dev); + usbd_deactivate(sc->sc_udev); break; } diff --git a/sys/dev/usb/uyap.c b/sys/dev/usb/uyap.c index 93ae92516d7..e28918d158e 100644 --- a/sys/dev/usb/uyap.c +++ b/sys/dev/usb/uyap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uyap.c,v 1.17 2009/10/13 19:33:19 pirofti Exp $ */ +/* $OpenBSD: uyap.c,v 1.18 2010/12/27 03:03:50 jakemsr Exp $ */ /* $NetBSD: uyap.c,v 1.6 2002/07/11 21:14:37 augustss Exp $ */ /* @@ -125,5 +125,16 @@ uyap_detach(struct device *self, int flags) int uyap_activate(struct device *self, int act) { + struct uyap_softc *sc = (struct uyap_softc *)self; + + switch (act) { + case DVACT_ACTIVATE: + break; + + case DVACT_DEACTIVATE: + usbd_deactivate(sc->sc_udev); + break; + } + return 0; } |