summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>1999-01-14 01:28:15 +0000
committern_hibma <n_hibma@FreeBSD.org>1999-01-14 01:28:15 +0000
commit229f57eb8f306ebe3d4ad60839c54b642df32aa4 (patch)
treede317ce3b34a8a4f36c9ca5727d4488b93ea661c /sys
parentcd40f4d28ab93dee00e802d75b820a19cf4eacb1 (diff)
downloadFreeBSD-src-229f57eb8f306ebe3d4ad60839c54b642df32aa4.zip
FreeBSD-src-229f57eb8f306ebe3d4ad60839c54b642df32aa4.tar.gz
Corrected the latent fact that the uhub driver was providing a driver for
the usb device class instead of the uhub devclass. Only a problem with more than one USB host controller.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/ucom.c2
-rw-r--r--sys/dev/usb/ugen.c2
-rw-r--r--sys/dev/usb/uhid.c2
-rw-r--r--sys/dev/usb/uhub.c26
-rw-r--r--sys/dev/usb/ukbd.c6
-rw-r--r--sys/dev/usb/ulpt.c2
-rw-r--r--sys/dev/usb/umodem.c2
-rw-r--r--sys/dev/usb/ums.c2
8 files changed, 31 insertions, 13 deletions
diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c
index 6772854..749cad4 100644
--- a/sys/dev/usb/ucom.c
+++ b/sys/dev/usb/ucom.c
@@ -135,5 +135,5 @@ ucom_detach(device_t self)
#endif
#if defined(__FreeBSD__)
-DRIVER_MODULE(ucom, usb, ucom_driver, ucom_devclass, usbd_driver_load, 0);
+DRIVER_MODULE(ucom, uhub, ucom_driver, ucom_devclass, usbd_driver_load, 0);
#endif
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c
index 86162a3..f739b4b 100644
--- a/sys/dev/usb/ugen.c
+++ b/sys/dev/usb/ugen.c
@@ -981,5 +981,5 @@ ugen_detach(device_t self)
return 0;
}
-DRIVER_MODULE(ugen, usb, ugen_driver, ugen_devclass, usbd_driver_load, 0);
+DRIVER_MODULE(ugen, uhub, ugen_driver, ugen_devclass, usbd_driver_load, 0);
#endif
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c
index 0b07dce..26c0e5b 100644
--- a/sys/dev/usb/uhid.c
+++ b/sys/dev/usb/uhid.c
@@ -542,5 +542,5 @@ uhidpoll(dev, events, p)
}
#if defined(__FreeBSD__)
-DRIVER_MODULE(uhid, usb, uhid_driver, uhid_devclass, usbd_driver_load, 0);
+DRIVER_MODULE(uhid, uhub, uhid_driver, uhid_devclass, usbd_driver_load, 0);
#endif
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c
index 40b2a84..40ff363 100644
--- a/sys/dev/usb/uhub.c
+++ b/sys/dev/usb/uhub.c
@@ -1,5 +1,5 @@
/* $NetBSD: uhub.c,v 1.14 1999/01/08 11:58:25 augustss Exp $ */
-/* FreeBSD $Id: uhub.c,v 1.5 1999/01/07 23:31:34 n_hibma Exp $ */
+/* $FreeBSD$ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -81,9 +81,26 @@ void uhub_intr __P((usbd_request_handle, usbd_private_handle, usbd_status));
/*void uhub_disco __P((void *));*/
-USB_DECLARE_DRIVER_NAME(usb, uhub);
+USB_DECLARE_DRIVER(uhub);
+
+#if defined(__FreeBSD__)
+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 */
+ {0,0}
+};
+
+static driver_t uhubroot_driver = {
+ "uhub",
+ uhubroot_methods,
+ DRIVER_TYPE_MISC,
+ sizeof(struct uhub_softc)
+};
+#endif
-/* FIXME what does FreeBSD need? */
#if defined(__NetBSD__)
struct cfattach uhub_uhub_ca = {
sizeof(struct uhub_softc), uhub_match, uhub_attach
@@ -499,5 +516,6 @@ uhub_intr(reqh, addr, status)
}
#if defined(__FreeBSD__)
-DRIVER_MODULE(uhub, usb, uhub_driver, uhub_devclass, usbd_driver_load, 0);
+DRIVER_MODULE(uhub, usb, uhubroot_driver, uhubroot_devclass, 0, 0);
+DRIVER_MODULE(uhub, uhub, uhub_driver, uhub_devclass, usbd_driver_load, 0);
#endif
diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c
index c9b9a72..0d54e01 100644
--- a/sys/dev/usb/ukbd.c
+++ b/sys/dev/usb/ukbd.c
@@ -542,11 +542,11 @@ ukbd_intr(reqh, addr, status)
/* XXX shouldn't the keys be used? */
for (i = 0; i < nkeys; i++) {
c = ibuf[i];
- printf("%c (%d) %s\n",
+ printf("%c (%d) %s ",
((c&0xff) < 32 || (c&0xff) > 126? '.':(c&0xff)), c,
(c&RELEASE? "released":"pressed"));
if (ud->modifiers)
- printf("0x%04x\n", ud->modifiers);
+ printf("mod = 0x%04x ", ud->modifiers);
for (i = 0; i < NKEYCODE; i++)
if (ud->keycode[i])
printf("%d ", ud->keycode[i]);
@@ -676,5 +676,5 @@ ukbd_cnattach(v)
#endif /* NetBSD */
#if defined(__FreeBSD__)
-DRIVER_MODULE(ukbd, usb, ukbd_driver, ukbd_devclass, usbd_driver_load, 0);
+DRIVER_MODULE(ukbd, uhub, ukbd_driver, ukbd_devclass, usbd_driver_load, 0);
#endif
diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c
index e3f2657..074fe04 100644
--- a/sys/dev/usb/ulpt.c
+++ b/sys/dev/usb/ulpt.c
@@ -446,6 +446,6 @@ ulpt_detach(device_t self)
return 0;
}
-CDEV_DRIVER_MODULE(ulpt, usb, ulpt_driver, ulpt_devclass,
+CDEV_DRIVER_MODULE(ulpt, uhub, ulpt_driver, ulpt_devclass,
ULPT_CDEV_MAJOR, ulpt_cdevsw, usbd_driver_load, 0);
#endif
diff --git a/sys/dev/usb/umodem.c b/sys/dev/usb/umodem.c
index 23f3489..16bfae2 100644
--- a/sys/dev/usb/umodem.c
+++ b/sys/dev/usb/umodem.c
@@ -137,6 +137,6 @@ umodem_detach(device_t self)
#endif
#if defined(__FreeBSD__)
-DRIVER_MODULE(umodem, usb, umodem_driver, umodem_devclass, usbd_driver_load,0);
+DRIVER_MODULE(umodem, uhub, umodem_driver, umodem_devclass, usbd_driver_load,0);
#endif
diff --git a/sys/dev/usb/ums.c b/sys/dev/usb/ums.c
index 745e255..e92d027 100644
--- a/sys/dev/usb/ums.c
+++ b/sys/dev/usb/ums.c
@@ -715,6 +715,6 @@ ums_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
#endif
#if defined(__FreeBSD__)
-CDEV_DRIVER_MODULE(ums, usb, ums_driver, ums_devclass,
+CDEV_DRIVER_MODULE(ums, uhub, ums_driver, ums_devclass,
UMS_CDEV_MAJOR, ums_cdevsw, usbd_driver_load, 0);
#endif
OpenPOWER on IntegriCloud