PERFORCE change 182110 for review
Hans Petter Selasky
hselasky at skunkworks.freebsd.org
Wed Aug 11 18:26:47 UTC 2010
http://p4web.freebsd.org/@@182110?ac=10
Change 182110 by hselasky at hselasky_laptop001 on 2010/08/08 22:06:26
USB core:
- correct calculations for Super Speed USB.
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#184 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#184 (text+ko) ====
@@ -322,6 +322,7 @@
usb_frcount_t x;
uint8_t type;
uint8_t zmps;
+ uint8_t mult;
/*
* Sanity check. The following parameters must be initialized before
@@ -358,12 +359,36 @@
xfer->max_packet_count = 3;
xfer->max_packet_size &= 0x7FF;
break;
+
case USB_SPEED_SUPER:
- if (xfer->endpoint->ecomp != NULL)
- xfer->max_packet_count += xfer->endpoint->ecomp->bMaxBurst;
+ xfer->max_packet_count += (xfer->max_packet_size >> 11) & 3;
+ mult = 1;
+
+ /* compute additional bMaxBurst */
+ if (xfer->endpoint->ecomp != NULL) {
+ xfer->max_packet_count +=
+ xfer->endpoint->ecomp->bMaxBurst;
+
+ if (type == UE_ISOCHRONOUS) {
+ mult +=
+ (xfer->endpoint->ecomp->bmAttributes & 3);
+ }
+ }
+
+ xfer->max_packet_count *= mult;
+
/* check for invalid max packet count */
- if (xfer->max_packet_count > 15)
- xfer->max_packet_count = 15;
+ if (type == UE_ISOCHRONOUS) {
+ if ((xfer->max_packet_count == 0) ||
+ (xfer->max_packet_count > (16 * 3)))
+ xfer->max_packet_count = (16 * 3);
+ } else {
+ if ((xfer->max_packet_count == 0) ||
+ (xfer->max_packet_count > (16 * 1)))
+ xfer->max_packet_count = (16 * 1);
+ }
+
+ xfer->max_packet_size &= 0x7FF;
break;
default:
break;
More information about the p4-projects
mailing list