Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Update for new speed handling.



details:   https://anonhg.NetBSD.org/src/rev/9853f6fd1512
branches:  trunk
changeset: 517855:9853f6fd1512
user:      augustss <augustss%NetBSD.org@localhost>
date:      Tue Nov 20 13:50:07 2001 +0000

description:
Update for new speed handling.

diffstat:

 sys/dev/usb/usb_subr.c |  25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)

diffs (78 lines):

diff -r a96af05232de -r 9853f6fd1512 sys/dev/usb/usb_subr.c
--- a/sys/dev/usb/usb_subr.c    Tue Nov 20 13:49:23 2001 +0000
+++ b/sys/dev/usb/usb_subr.c    Tue Nov 20 13:50:07 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_subr.c,v 1.93 2001/11/17 01:49:53 augustss Exp $   */
+/*     $NetBSD: usb_subr.c,v 1.94 2001/11/20 13:50:07 augustss Exp $   */
 /*     $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $   */
 
 /*
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.93 2001/11/17 01:49:53 augustss Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.94 2001/11/20 13:50:07 augustss Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -932,16 +932,17 @@
  */
 usbd_status
 usbd_new_device(device_ptr_t parent, usbd_bus_handle bus, int depth,
-               int lowspeed, int port, struct usbd_port *up)
+               int speed, int port, struct usbd_port *up)
 {
        usbd_device_handle dev;
+       struct usbd_device *hub;
        usb_device_descriptor_t *dd;
        usbd_status err;
        int addr;
        int i;
 
-       DPRINTF(("usbd_new_device bus=%p port=%d depth=%d lowspeed=%d\n",
-                bus, port, depth, lowspeed));
+       DPRINTF(("usbd_new_device bus=%p port=%d depth=%d speed=%d\n",
+                bus, port, depth, speed));
        addr = usbd_getnewaddr(bus);
        if (addr < 0) {
                printf("%s: No free USB addresses, new device ignored.\n", 
@@ -970,9 +971,15 @@
        dev->quirks = &usbd_no_quirk;
        dev->address = USB_START_ADDR;
        dev->ddesc.bMaxPacketSize = 0;
-       dev->lowspeed = lowspeed != 0;
        dev->depth = depth;
        dev->powersrc = up;
+       dev->myhub = up->parent;
+       for (hub = up->parent;
+            hub != NULL && hub->speed != USB_SPEED_HIGH;
+            hub = hub->myhub)
+               ;
+       dev->myhighhub = hub;
+       dev->speed = speed;
        dev->langid = USBD_NOLANG;
        dev->cookie.cookie = ++usb_cookie_no;
 
@@ -1002,10 +1009,10 @@
        }
 
        DPRINTF(("usbd_new_device: adding unit addr=%d, rev=%02x, class=%d, "
-                "subclass=%d, protocol=%d, maxpacket=%d, len=%d, ls=%d\n", 
+                "subclass=%d, protocol=%d, maxpacket=%d, len=%d, speed=%d\n", 
                 addr,UGETW(dd->bcdUSB), dd->bDeviceClass, dd->bDeviceSubClass,
                 dd->bDeviceProtocol, dd->bMaxPacketSize, dd->bLength, 
-                dev->lowspeed));
+                dev->speed));
 
        if (dd->bDescriptorType != UDESC_DEVICE) {
                /* Illegal device descriptor */
@@ -1208,7 +1215,7 @@
        di->protocol = dev->ddesc.bDeviceProtocol;
        di->config = dev->config;
        di->power = dev->self_powered ? 0 : dev->power;
-       di->speed = dev->lowspeed ? USB_SPEED_LOW : USB_SPEED_FULL;
+       di->speed = dev->speed;
 
        if (dev->subdevs != NULL) {
                for (i = 0; dev->subdevs[i] &&



Home | Main Index | Thread Index | Old Index