diff options
author | joe <joe@FreeBSD.org> | 2002-02-19 02:00:27 +0000 |
---|---|---|
committer | joe <joe@FreeBSD.org> | 2002-02-19 02:00:27 +0000 |
commit | 2b020857cc6c386b678a9996f75d676a51122bd1 (patch) | |
tree | 16efc78dcb8196b634b8def785509c3fa3d75ff1 | |
parent | ff615f0a6d9f676ab9da10823de5be56dc753bea (diff) | |
download | FreeBSD-src-2b020857cc6c386b678a9996f75d676a51122bd1.zip FreeBSD-src-2b020857cc6c386b678a9996f75d676a51122bd1.tar.gz |
Merge from NetBSD:
* rev 1.47: Update a URL
* rev 1.56: Keep track of device speed for USB 2.0.
-rw-r--r-- | sys/dev/usb/uhub.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c index 05a1972..36c700f 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -1,4 +1,4 @@ -/* $NetBSD: uhub.c,v 1.47 2000/09/24 02:08:38 augustss Exp $ */ +/* $NetBSD: uhub.c,v 1.48 2000/12/29 01:24:56 augustss Exp $ */ /* $FreeBSD$ */ /* @@ -39,7 +39,7 @@ */ /* - * USB spec: http://www.usb.org/developers/docs.htm + * USB spec: http://www.usb.org/developers/data/usbspec.zip */ #include <sys/param.h> @@ -338,6 +338,7 @@ uhub_explore(usbd_device_handle dev) struct uhub_softc *sc = dev->hub->hubsoftc; struct usbd_port *up; usbd_status err; + int speed; int port; int change, status; @@ -437,10 +438,18 @@ uhub_explore(usbd_device_handle dev) continue; } + /* Figure out device speed */ + if (status & UPS_HIGH_SPEED) + speed = USB_SPEED_HIGH; + else if (status & UPS_LOW_SPEED) + speed = USB_SPEED_LOW; + else + speed = USB_SPEED_FULL; + /* Get device info and set its address. */ err = usbd_new_device(USBDEV(sc->sc_dev), dev->bus, - dev->depth + 1, status & UPS_LOW_SPEED, - port, up); + dev->depth + 1, speed, port, up); + /* XXX retry a few times? */ if (err) { DPRINTFN(-1,("uhub_explore: usb_new_device failed, " |