Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Jun 2014 10:13:46 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r267211 - head/sys/dev/usb/controller
Message-ID:  <201406071013.s57ADkaD032874@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406071013.s57ADkaD032874>