Module Name:    src
Committed By:   jakllsch
Date:           Fri May 27 20:37:13 UTC 2011

Modified Files:
        src/sys/dev/usb: ohci.c

Log Message:
Data toggle accounting for endpoints on OHCI.


To generate a diff of this commit:
cvs rdiff -u -r1.213 -r1.214 src/sys/dev/usb/ohci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.213 src/sys/dev/usb/ohci.c:1.214
--- src/sys/dev/usb/ohci.c:1.213	Fri May 27 19:04:24 2011
+++ src/sys/dev/usb/ohci.c	Fri May 27 20:37:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.213 2011/05/27 19:04:24 tsutsui Exp $	*/
+/*	$NetBSD: ohci.c,v 1.214 2011/05/27 20:37:13 jakllsch Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $	*/
 
 /*
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.213 2011/05/27 19:04:24 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.214 2011/05/27 20:37:13 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2122,7 +2122,9 @@
 			(dev->speed == USB_SPEED_LOW ? OHCI_ED_SPEED : 0) |
 			fmt |
 			OHCI_ED_SET_MAXP(UGETW(ed->wMaxPacketSize)));
-		sed->ed.ed_headp = sed->ed.ed_tailp = HTOO32(tdphys);
+		sed->ed.ed_headp = HTOO32(tdphys |
+		    (pipe->endpoint->datatoggle ? OHCI_TOGGLECARRY : 0));
+		sed->ed.ed_tailp = HTOO32(tdphys);
 		usb_syncmem(&sed->dma, sed->offs, sizeof(sed->ed),
 		    BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
 
@@ -2209,6 +2211,8 @@
 	ohci_rem_ed(sed, head);
 	/* Make sure the host controller is not touching this ED */
 	usb_delay_ms(&sc->sc_bus, 1);
+	pipe->endpoint->datatoggle =
+	    (O32TOH(sed->ed.ed_headp) & OHCI_TOGGLECARRY) ? 1 : 0;
 	splx(s);
 	ohci_free_sed(sc, opipe->sed);
 }

Reply via email to