diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c index 22684805a9ff..d8b772d12984 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 d65a2b842640..2fc35956e9db 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 c82eb6963602..70d507c90573 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 a2ced284f9bd..7e4e6aef83f0 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 374cbb4a0e99..966b8cec4b1c 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 742053252608..26329dc58d24 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 */