Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Only set wMaxPacketSize to 64 for HS/FS and set ...
details: https://anonhg.NetBSD.org/src/rev/d2def51b5b31
branches: trunk
changeset: 785557:d2def51b5b31
user: skrll <skrll%NetBSD.org@localhost>
date: Wed Mar 20 11:14:51 2013 +0000
description:
Only set wMaxPacketSize to 64 for HS/FS and set to 8 for LS to be within
the USB spec.
Should help PR/46696.
Requesting 64 bytes via wLength is indeed common, but fallback to 8
would probably help.
diffstat:
sys/dev/usb/usb_subr.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diffs (31 lines):
diff -r d827012b959e -r d2def51b5b31 sys/dev/usb/usb_subr.c
--- a/sys/dev/usb/usb_subr.c Wed Mar 20 06:35:49 2013 +0000
+++ b/sys/dev/usb/usb_subr.c Wed Mar 20 11:14:51 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: usb_subr.c,v 1.189 2013/01/22 14:01:19 jmcneill Exp $ */
+/* $NetBSD: usb_subr.c,v 1.190 2013/03/20 11:14:51 skrll Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
/*
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.189 2013/01/22 14:01:19 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.190 2013/03/20 11:14:51 skrll Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -1133,7 +1133,11 @@
* (which uses 64 bytes so it shouldn't be less),
* highspeed devices must support 64 byte packets anyway
*/
- USETW(dev->def_ep_desc.wMaxPacketSize, 64);
+ if (speed == USB_SPEED_HIGH || speed == USB_SPEED_FULL)
+ USETW(dev->def_ep_desc.wMaxPacketSize, 64);
+ else
+ USETW(dev->def_ep_desc.wMaxPacketSize, USB_MAX_IPACKET);
+
dev->def_ep_desc.bInterval = 0;
/* doesn't matter, just don't let it uninitialized */
Home |
Main Index |
Thread Index |
Old Index