diff options
| author | Nick Hibma <n_hibma@FreeBSD.org> | 2000-01-20 22:24:35 +0000 |
|---|---|---|
| committer | Nick Hibma <n_hibma@FreeBSD.org> | 2000-01-20 22:24:35 +0000 |
| commit | 341777d00446177cb435e376626271e39e3590ab (patch) | |
| tree | 56105b2e921617b31c9f6ff6b90168c0769d655e | |
| parent | fc096eaad4d2e8b159b7247b4b11dca87549a6e5 (diff) | |
Notes
| -rw-r--r-- | sys/dev/usb/uhci.c | 6 | ||||
| -rw-r--r-- | sys/dev/usb/uhcivar.h | 3 | ||||
| -rw-r--r-- | sys/dev/usb/uhub.c | 10 | ||||
| -rw-r--r-- | sys/dev/usb/usb.c | 6 | ||||
| -rw-r--r-- | sys/dev/usb/usb_port.h | 2 |
5 files changed, 17 insertions, 10 deletions
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c index 3e907d8cd5ad..8d754b82835e 100644 --- a/sys/dev/usb/uhci.c +++ b/sys/dev/usb/uhci.c @@ -150,10 +150,6 @@ struct uhci_pipe { LIST_HEAD(, uhci_intr_info) uhci_ii_free; static void uhci_busreset __P((uhci_softc_t *)); -#if defined(__NetBSD__) || defined(__OpenBSD__) -static void uhci_shutdown __P((void *v)); -static void uhci_power __P((int, void *)); -#endif static usbd_status uhci_run __P((uhci_softc_t *, int run)); static uhci_soft_td_t *uhci_alloc_std __P((uhci_softc_t *)); static void uhci_free_std __P((uhci_softc_t *, uhci_soft_td_t *)); @@ -543,7 +539,6 @@ uhci_freex(bus, xfer) SIMPLEQ_INSERT_HEAD(&sc->sc_free_xfers, xfer, next); } -#if defined(__NetBSD__) || defined(__OpenBSD__) /* * Shut down the controller when the system is going down. */ @@ -626,7 +621,6 @@ uhci_power(why, v) } splx(s); } -#endif #ifdef UHCI_DEBUG static void diff --git a/sys/dev/usb/uhcivar.h b/sys/dev/usb/uhcivar.h index 82e4c1ea2346..381df9b39726 100644 --- a/sys/dev/usb/uhcivar.h +++ b/sys/dev/usb/uhcivar.h @@ -177,3 +177,6 @@ int uhci_detach __P((uhci_softc_t *, int)); int uhci_activate __P((device_ptr_t, enum devact)); #endif +void uhci_shutdown __P((void *v)); +void uhci_power __P((int state, void *priv)); + diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c index a0087de3daed..8b1edbb1ef7a 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -104,7 +104,11 @@ struct cfattach uhub_uhub_ca = { }; #elif defined(__FreeBSD__) USB_DECLARE_DRIVER_INIT(uhub, - DEVMETHOD(bus_child_detached, uhub_child_detached)); + DEVMETHOD(bus_child_detached, uhub_child_detached), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown) + ); /* Create the driver instance for the hub connected to usb case. */ devclass_t uhubroot_devclass; @@ -112,8 +116,10 @@ devclass_t uhubroot_devclass; static device_method_t uhubroot_methods[] = { DEVMETHOD(device_probe, uhub_match), DEVMETHOD(device_attach, uhub_attach), - /* detach is not allowed for a root hub */ + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_suspend), + DEVMETHOD(device_shutdown, bus_generic_shutdown), {0,0} }; diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c index 891aca757e66..4a166db0f418 100644 --- a/sys/dev/usb/usb.c +++ b/sys/dev/usb/usb.c @@ -174,7 +174,11 @@ extern int cold; static const char *usbrev_str[] = USBREV_STR; -USB_DECLARE_DRIVER(usb); +USB_DECLARE_DRIVER_INIT(usb, + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown) + ); USB_MATCH(usb) { diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h index 70b41c9b11e6..8ab7c31d3167 100644 --- a/sys/dev/usb/usb_port.h +++ b/sys/dev/usb/usb_port.h @@ -296,7 +296,7 @@ __CONCAT(dname,_detach)(self, flags) \ #define PWR_SUSPEND 1 #define PWR_RESUME 0 -#define USB_DECLARE_DRIVER_INIT(dname, init) \ +#define USB_DECLARE_DRIVER_INIT(dname, init...) \ static device_probe_t __CONCAT(dname,_match); \ static device_attach_t __CONCAT(dname,_attach); \ static device_detach_t __CONCAT(dname,_detach); \ |
