svn commit: r267211 - head/sys/dev/usb/controller
Hans Petter Selasky
hselasky at FreeBSD.org
Sat Jun 7 10:13:46 UTC 2014
Author: hselasky
Date: Sat Jun 7 10:13:45 2014
New Revision: 267211
URL: http://svnweb.freebsd.org/changeset/base/267211
Log:
Fix for USB specification compliance. We need to accept both DATA0 and
DATA1 for INTERRUPT endpoints.
MFC after: 3 days
Modified:
head/sys/dev/usb/controller/dwc_otg.c
Modified: head/sys/dev/usb/controller/dwc_otg.c
==============================================================================
--- head/sys/dev/usb/controller/dwc_otg.c Sat Jun 7 07:23:17 2014 (r267210)
+++ head/sys/dev/usb/controller/dwc_otg.c Sat Jun 7 10:13:45 2014 (r267211)
@@ -1263,6 +1263,22 @@ dwc_otg_host_data_rx(struct dwc_otg_soft
case DWC_CHAN_ST_WAIT_ANE:
if (hcint & (HCINT_RETRY | HCINT_ERRORS)) {
+ if (td->ep_type == UE_INTERRUPT) {
+ /*
+ * The USB specification does not
+ * mandate a particular data toggle
+ * value for USB INTERRUPT
+ * transfers. Switch the data toggle
+ * value to receive the packet
+ * correctly:
+ */
+ if (hcint & HCINT_DATATGLERR) {
+ DPRINTF("Retrying packet due to "
+ "data toggle error\n");
+ td->toggle ^= 1;
+ goto receive_pkt;
+ }
+ }
td->did_nak++;
td->tt_scheduled = 0;
if (td->hcsplt != 0)
More information about the svn-src-all
mailing list