summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorjakllsch <jakllsch@NetBSD.org>2011-05-27 20:37:13 +0000
committerjakllsch <jakllsch@NetBSD.org>2011-05-27 20:37:13 +0000
commit0bb0355c844b7510c0ffaa00284fa831825f816f (patch)
treea34a705a48d337a1c38e90403f67d85a5f3f8b45 /sys/dev
parentf894bf6317b9aef3e465c44b4d0ad40792d40fcc (diff)
Data toggle accounting for endpoints on OHCI.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/ohci.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
index 71518776ecc..fdf12808c99 100644
--- a/sys/dev/usb/ohci.c
+++ b/sys/dev/usb/ohci.c
@@ -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 @@ ohci_open(usbd_pipe_handle pipe)
(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_close_pipe(usbd_pipe_handle pipe, ohci_soft_ed_t *head)
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);
}