Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb PR/49091: xhci: wrong wMaxPacketSize value



details:   https://anonhg.NetBSD.org/src/rev/89056ff12877
branches:  trunk
changeset: 331467:89056ff12877
user:      skrll <skrll%NetBSD.org@localhost>
date:      Mon Aug 11 10:37:59 2014 +0000

description:
PR/49091: xhci: wrong wMaxPacketSize value

While this is correct according to the specification only fixed sizes
are allowed, i.e. 512 for SS, etc. Maybe these should be used?

diffstat:

 sys/dev/usb/xhci.c |  15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r d63e909ef8bd -r 89056ff12877 sys/dev/usb/xhci.c
--- a/sys/dev/usb/xhci.c        Mon Aug 11 10:28:38 2014 +0000
+++ b/sys/dev/usb/xhci.c        Mon Aug 11 10:37:59 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xhci.c,v 1.23 2014/08/05 10:33:46 skrll Exp $  */
+/*     $NetBSD: xhci.c,v 1.24 2014/08/11 10:37:59 skrll Exp $  */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.23 2014/08/05 10:33:46 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.24 2014/08/11 10:37:59 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1524,10 +1524,17 @@
                err = usbd_get_initial_ddesc(dev, dd);
                if (err)
                        return err;
-               USETW(dev->def_ep_desc.wMaxPacketSize, dd->bMaxPacketSize);
+               /* 4.8.2.1 */
+               if (speed == USB_SPEED_SUPER)
+                       USETW(dev->def_ep_desc.wMaxPacketSize,
+                           (1 << dd->bMaxPacketSize));
+               else
+                       USETW(dev->def_ep_desc.wMaxPacketSize,
+                           dd->bMaxPacketSize);
                device_printf(sc->sc_dev, "%s bMaxPacketSize %u\n", __func__,
                    dd->bMaxPacketSize);
-               xhci_update_ep0_mps(sc, xs, dd->bMaxPacketSize);
+               xhci_update_ep0_mps(sc, xs,
+                   UGETW(dev->def_ep_desc.wMaxPacketSize));
                err = usbd_reload_device_desc(dev);
                if (err)
                        return err;



Home | Main Index | Thread Index | Old Index