summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2002-04-07 11:19:05 +0000
committerjoe <joe@FreeBSD.org>2002-04-07 11:19:05 +0000
commitca6fcfb6a4cb74d1d6b9ad773fd2f0af9a955eb7 (patch)
treefd11c7dbe4a850f6f5257ae9c428133c6c566e62 /sys
parenteee9c9d74ae2a64928350b17c67dae5749a632fa (diff)
downloadFreeBSD-src-ca6fcfb6a4cb74d1d6b9ad773fd2f0af9a955eb7.zip
FreeBSD-src-ca6fcfb6a4cb74d1d6b9ad773fd2f0af9a955eb7.tar.gz
MFNetBSD: ohci.c (1.109), uhci.c (1.144), uhub.c (1.56), usb.c (1.57),
usbdi.c (1.86), usbdivar.h (1.66) [Some partial, because most of this was merged in a while ago] date: 2001/11/20 13:48:03; author: augustss; Keep track of device speed for USB 2.0.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/ohci.c4
-rw-r--r--sys/dev/usb/uhci.c2
-rw-r--r--sys/dev/usb/uhub.c2
-rw-r--r--sys/dev/usb/usb.c17
-rw-r--r--sys/dev/usb/usbdi.c5
-rw-r--r--sys/dev/usb/usbdivar.h6
6 files changed, 25 insertions, 11 deletions
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
index 2268480..d8b772d 100644
--- a/sys/dev/usb/ohci.c
+++ b/sys/dev/usb/ohci.c
@@ -2156,7 +2156,7 @@ Static usb_device_descriptor_t ohci_devd = {
{0x00, 0x01}, /* USB version */
UDCLASS_HUB, /* class */
UDSUBCLASS_HUB, /* subclass */
- 0, /* protocol */
+ UDPROTO_FSHUB, /* protocol */
64, /* max packet */
{0},{0},{0x00,0x01}, /* device id */
1,2,0, /* string indicies */
@@ -2184,7 +2184,7 @@ Static usb_interface_descriptor_t ohci_ifcd = {
1,
UICLASS_HUB,
UISUBCLASS_HUB,
- 0,
+ UIPROTO_FSHUB,
0
};
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index d65a2b8..2fc3595 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uhci.c,v 1.142 2001/10/25 02:08:13 augustss Exp $ */
+/* $NetBSD: uhci.c,v 1.144 2001/11/20 13:48:32 augustss Exp $ */
/* $FreeBSD$ */
/*
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c
index c82eb69..70d507c 100644
--- a/sys/dev/usb/uhub.c
+++ b/sys/dev/usb/uhub.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uhub.c,v 1.55 2001/11/16 02:21:54 augustss Exp $ */
+/* $NetBSD: uhub.c,v 1.56 2001/11/20 13:48:03 augustss Exp $ */
/* $FreeBSD$ */
/*
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c
index a2ced28..7e4e6ae 100644
--- a/sys/dev/usb/usb.c
+++ b/sys/dev/usb/usb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: usb.c,v 1.56 2001/11/13 07:55:30 augustss Exp $ */
+/* $NetBSD: usb.c,v 1.57 2001/11/20 13:48:04 augustss Exp $ */
/* $FreeBSD$ */
/*
@@ -203,6 +203,7 @@ USB_ATTACH(usb)
usbd_device_handle dev;
usbd_status err;
int usbrev;
+ int speed;
struct usb_event ue;
sc->sc_dev = self;
@@ -222,8 +223,17 @@ USB_ATTACH(usb)
#endif
usbrev = sc->sc_bus->usbrev;
printf(": USB revision %s", usbrev_str[usbrev]);
- if (usbrev != USBREV_1_0 && usbrev != USBREV_1_1) {
+ switch (usbrev) {
+ case USBREV_1_0:
+ case USBREV_1_1:
+ speed = USB_SPEED_FULL;
+ break;
+ case USBREV_2_0:
+ speed = USB_SPEED_HIGH;
+ break;
+ default:
printf(", not supported\n");
+ sc->sc_dying = 1;
USB_ATTACH_ERROR_RETURN;
}
printf("\n");
@@ -243,13 +253,14 @@ USB_ATTACH(usb)
if (sc->sc_bus->soft == NULL) {
printf("%s: can't register softintr\n", USBDEVNAME(sc->sc_dev));
sc->sc_dying = 1;
+ USB_ATTACH_ERROR_RETURN;
}
#else
callout_init(&sc->sc_bus->softi);
#endif
#endif
- err = usbd_new_device(USBDEV(sc->sc_dev), sc->sc_bus, 0, 0, 0,
+ err = usbd_new_device(USBDEV(sc->sc_dev), sc->sc_bus, 0, speed, 0,
&sc->sc_port);
if (!err) {
dev = sc->sc_port.device;
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c
index 374cbb4..966b8ce 100644
--- a/sys/dev/usb/usbdi.c
+++ b/sys/dev/usb/usbdi.c
@@ -126,8 +126,9 @@ usbd_dump_device(struct usbd_device *dev)
if (dev == NULL)
return;
printf(" bus=%p default_pipe=%p\n", dev->bus, dev->default_pipe);
- printf(" address=%d config=%d depth=%d lowspeed=%d self_powered=%d power=%d langid=%d\n",
- dev->address, dev->config, dev->depth, dev->lowspeed,
+ printf(" address=%d config=%d depth=%d speed=%d self_powered=%d "
+ "power=%d langid=%d\n",
+ dev->address, dev->config, dev->depth, dev->speed,
dev->self_powered, dev->power, dev->langid);
}
diff --git a/sys/dev/usb/usbdivar.h b/sys/dev/usb/usbdivar.h
index 7420532..26329dc 100644
--- a/sys/dev/usb/usbdivar.h
+++ b/sys/dev/usb/usbdivar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: usbdivar.h,v 1.64 2001/11/10 16:54:56 augustss Exp $ */
+/* $NetBSD: usbdivar.h,v 1.66 2001/11/20 13:48:04 augustss Exp $ */
/* $FreeBSD$ */
/*
@@ -78,7 +78,7 @@ struct usbd_port {
u_int8_t portno;
u_int8_t restartcnt;
#define USBD_RESTART_MAX 5
- struct usbd_device *device;
+ struct usbd_device *device; /* Connected device */
struct usbd_device *parent; /* The ports hub */
};
@@ -141,6 +141,8 @@ struct usbd_device {
#define USBD_NOLANG (-1)
usb_event_cookie_t cookie; /* unique connection id */
struct usbd_port *powersrc; /* upstream hub port, or 0 */
+ struct usbd_device *myhub; /* upstream hub */
+ struct usbd_device *myhighhub; /* closest high speed hub */
struct usbd_endpoint def_ep; /* for pipe 0 */
usb_endpoint_descriptor_t def_ep_desc; /* for pipe 0 */
struct usbd_interface *ifaces; /* array of all interfaces */
OpenPOWER on IntegriCloud