summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usbdi.c
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>1999-02-21 16:36:30 +0000
committern_hibma <n_hibma@FreeBSD.org>1999-02-21 16:36:30 +0000
commit97e0e8232bf6bb3338a482595365e442b0a56381 (patch)
tree3d6a1ad6d4e872f02857cf4e7c2cdf40cc0f6d15 /sys/dev/usb/usbdi.c
parentd95d4d33291bd884f40d02e2ad2c16bceb3d858d (diff)
downloadFreeBSD-src-97e0e8232bf6bb3338a482595365e442b0a56381.zip
FreeBSD-src-97e0e8232bf6bb3338a482595365e442b0a56381.tar.gz
Device unload code is broken, disabled. Requires a bit of redesign on the
part of the uhub driver to be able to fix it. Modules should not be unloaded as they unload partially. Not easy to fix either.
Diffstat (limited to 'sys/dev/usb/usbdi.c')
-rw-r--r--sys/dev/usb/usbdi.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c
index 4f69d1e..e051c8b 100644
--- a/sys/dev/usb/usbdi.c
+++ b/sys/dev/usb/usbdi.c
@@ -1224,18 +1224,26 @@ usbd_print_child(device_t parent, device_t child)
int
usbd_driver_load(module_t mod, int what, void *arg)
{
+#if 1
+ return 0;
+#else
devclass_t usb_devclass = devclass_find("usb");
devclass_t ugen_devclass = devclass_find("ugen");
device_t *devlist;
int devcount;
int error;
- switch (what) {
- case MOD_LOAD:
- case MOD_UNLOAD:
+ if ( what == MOD_LOAD || what == MOD_UNLOAD ) {
if (!usb_devclass)
return 0; /* just ignore call */
+ /* Detach all the generic devices and do a reconfigure
+ * of the bus. This should attach the new driver to anything
+ * that is already connected and it can handle.
+ * XXX For the moment disabled. The detach does not remove
+ * the device from the list of devices attached to the hub.
+ * Legacy of converting from NetBSD to FreeBSD.
+ */
if (ugen_devclass) {
/* detach devices from generic driver if possible */
error = devclass_get_devices(ugen_devclass, &devlist,
@@ -1243,8 +1251,11 @@ usbd_driver_load(module_t mod, int what, void *arg)
if (!error)
for (devcount--; devcount >= 0; devcount--)
(void)DEVICE_DETACH(devlist[devcount]);
+ free(devlist, M_TEMP);
}
+ /* Reconfigure the busses, possibly attaching something to the
+ * new driver */
error = devclass_get_devices(usb_devclass, &devlist, &devcount);
if (error)
return 0; /* XXX maybe transient, or error? */
@@ -1253,10 +1264,10 @@ usbd_driver_load(module_t mod, int what, void *arg)
USB_RECONFIGURE(devlist[devcount]);
free(devlist, M_TEMP);
- return 0;
}
- return 0; /* nothing to do by us */
+ return 0; /* nothing to do */
+#endif
}
/* Set the description of the device including a malloc and copy. */
OpenPOWER on IntegriCloud