summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/uhub.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2004-08-14 22:10:26 +0000
committerimp <imp@FreeBSD.org>2004-08-14 22:10:26 +0000
commitda6b7d8015bfe072fdecf22c4958f40e135d3c2b (patch)
tree9b99e9bea5a7c62b7a26bf54ee02ab0537c960ee /sys/dev/usb/uhub.c
parentbce29358a4ba1d2f5f059296d3e2d2d6ff05ce13 (diff)
downloadFreeBSD-src-da6b7d8015bfe072fdecf22c4958f40e135d3c2b.zip
FreeBSD-src-da6b7d8015bfe072fdecf22c4958f40e135d3c2b.tar.gz
Next step in making usb more newbus:
o reprobe children when a new driver is added to uhub o fix the usbd_probe_and_attach to set the ivars to a malloc'd area, as well as freeing the ivars on child destruction. o Don't delete children that don't attach. Evidentally, the need to do this is a common misconception. o minor formatting foo that may violate style(9) at the moment, but keeps the diffs against my p4 tree smaller. This does not solve the ugen gobbling things up problem, but the fixes I have for that expose bugs in other parts of the tree...
Diffstat (limited to 'sys/dev/usb/uhub.c')
-rw-r--r--sys/dev/usb/uhub.c40
1 files changed, 14 insertions, 26 deletions
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c
index d4f6833..2e99a1f 100644
--- a/sys/dev/usb/uhub.c
+++ b/sys/dev/usb/uhub.c
@@ -90,10 +90,9 @@ Static usbd_status uhub_explore(usbd_device_handle hub);
Static void uhub_intr(usbd_xfer_handle, usbd_private_handle,usbd_status);
#if defined(__FreeBSD__)
-Static bus_driver_added_t uhub_driver_added;
Static bus_child_detached_t uhub_child_detached;
-int uhub_child_location_str(device_t, device_t, char*, size_t);
-int uhub_child_pnpinfo_str(device_t, device_t, char*, size_t);
+Static bus_child_location_str_t uhub_child_location_str;
+Static bus_child_pnpinfo_str_t uhub_child_pnpinfo_str;
#endif
@@ -111,25 +110,26 @@ CFATTACH_DECL(uhub_uhub, sizeof(struct uhub_softc),
uhub_match, uhub_attach, uhub_detach, uhub_activate);
#elif defined(__FreeBSD__)
USB_DECLARE_DRIVER_INIT(uhub,
- DEVMETHOD(bus_driver_added, uhub_driver_added),
- DEVMETHOD(bus_child_detached, uhub_child_detached),
- DEVMETHOD(bus_child_pnpinfo_str, uhub_child_pnpinfo_str),
- DEVMETHOD(bus_child_location_str, uhub_child_location_str),
- DEVMETHOD(device_suspend, bus_generic_suspend),
- DEVMETHOD(device_resume, bus_generic_resume),
- DEVMETHOD(device_shutdown, bus_generic_shutdown)
- );
+ DEVMETHOD(bus_child_detached, uhub_child_detached),
+ DEVMETHOD(bus_child_pnpinfo_str, uhub_child_pnpinfo_str),
+ DEVMETHOD(bus_child_location_str, uhub_child_location_str),
+ DEVMETHOD(bus_driver_added, bus_generic_driver_added),
+ 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;
Static device_method_t uhubroot_methods[] = {
DEVMETHOD(bus_child_detached, uhub_child_detached),
- DEVMETHOD(device_probe, uhub_match),
- DEVMETHOD(device_attach, uhub_attach),
- DEVMETHOD(bus_child_pnpinfo_str, uhub_child_pnpinfo_str),
DEVMETHOD(bus_child_location_str, uhub_child_location_str),
+ DEVMETHOD(bus_child_pnpinfo_str, uhub_child_pnpinfo_str),
+ DEVMETHOD(bus_driver_added, bus_generic_driver_added),
+ DEVMETHOD(device_probe, uhub_match),
+ DEVMETHOD(device_attach, uhub_attach),
DEVMETHOD(device_detach, uhub_detach),
DEVMETHOD(device_suspend, bus_generic_suspend),
DEVMETHOD(device_resume, bus_generic_resume),
@@ -714,18 +714,6 @@ uhub_child_detached(device_t self, device_t child)
}
}
}
-
-Static void
-uhub_driver_added(device_t _dev, driver_t *_driver)
-{
- /*
- * Don't do anything, as reprobing does not work currently.
- * In the future we should properly allocate ivars so we can
- * leave the devices attached to the newbus tree. Once we do
- * that, then we can reprobe on driver loading with the
- * default driver added routines.
- */
-}
#endif
OpenPOWER on IntegriCloud