diff options
author | peter <peter@FreeBSD.org> | 1999-04-16 21:22:55 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-04-16 21:22:55 +0000 |
commit | 087d4857e56f150a8f549600150404f273efb895 (patch) | |
tree | cf4e27432c59d956f4e5784207180115ee8fef9d /sys/dev/usb/uhub.c | |
parent | c5fe612b8411a32a8e6e426fc1a70cba0cca3d31 (diff) | |
download | FreeBSD-src-087d4857e56f150a8f549600150404f273efb895.zip FreeBSD-src-087d4857e56f150a8f549600150404f273efb895.tar.gz |
Bring the 'new-bus' to the i386. This extensively changes the way the
i386 platform boots, it is no longer ISA-centric, and is fully dynamic.
Most old drivers compile and run without modification via 'compatability
shims' to enable a smoother transition. eisa, isapnp and pccard* are
not yet using the new resource manager. Once fully converted, all drivers
will be loadable, including PCI and ISA.
(Some other changes appear to have snuck in, including a port of Soren's
ATA driver to the Alpha. Soren, back this out if you need to.)
This is a checkpoint of work-in-progress, but is quite functional.
The bulk of the work was done over the last few years by Doug Rabson and
Garrett Wollman.
Approved by: core
Diffstat (limited to 'sys/dev/usb/uhub.c')
-rw-r--r-- | sys/dev/usb/uhub.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c index 2f4029c..bf53c01 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -81,10 +81,15 @@ usbd_status uhub_init_port __P((struct usbd_port *)); void uhub_disconnect_port __P((struct usbd_port *up)); usbd_status uhub_explore __P((usbd_device_handle hub)); void uhub_intr __P((usbd_request_handle, usbd_private_handle, usbd_status)); +#ifdef __FreeBSD__ +#include "usb_if.h" +static void uhub_disconnected __P((device_t)); +#endif /* void uhub_disco __P((void *)); */ -USB_DECLARE_DRIVER(uhub); +USB_DECLARE_DRIVER_INIT(uhub, + DEVMETHOD(usb_disconnected, uhub_disconnected)); #if defined(__FreeBSD__) devclass_t uhubroot_devclass; @@ -251,8 +256,8 @@ USB_ATTACH(uhub) } #if defined(__FreeBSD__) -static int -uhub_detach(device_t self) +static void +uhub_disconnected(device_t self) { struct uhub_softc *sc = device_get_softc(self); struct usbd_port *up; @@ -264,12 +269,20 @@ uhub_detach(device_t self) nports = dev->hub->hubdesc.bNbrPorts; for (p = 0; p < nports; p++) { up = &sc->sc_hub->hub->ports[p]; - if (up->device) + if (up->device) { uhub_disconnect_port(up); + } } - free(sc->sc_hub->hub, M_USB); + return; +} +static int +uhub_detach(device_t self) +{ + struct uhub_softc *sc = device_get_softc(self); + DPRINTF(("%s: disconnected\n", USBDEVNAME(self))); + free(sc->sc_hub->hub, M_USB); return 0; } #endif @@ -502,6 +515,7 @@ uhub_disconnect_port(up) } } #if defined(__FreeBSD__) + USB_DISCONNECTED(sc->sc_dev); device_delete_child(scp->sc_dev, sc->sc_dev); #endif |