Index: ehci.c =================================================================== RCS file: /dump/FreeBSD-CVS/src/sys/dev/usb/ehci.c,v retrieving revision 1.36.2.1 diff -u -r1.36.2.1 ehci.c --- ehci.c 26 Jan 2006 01:43:13 -0000 1.36.2.1 +++ ehci.c 28 Feb 2006 01:18:45 -0000 @@ -1390,7 +1390,7 @@ if (sc->sc_dying) return (USBD_IOERROR); - epipe->nexttoggle = 0; + epipe->nexttoggle = pipe->endpoint->savedtoggle; if (addr == sc->sc_addr) { switch (ed->bEndpointAddress) { @@ -2479,6 +2479,8 @@ ehci_rem_qh(sc, sqh, head); splx(s); ehci_free_sqh(sc, epipe->sqh); + + pipe->endpoint->savedtoggle = epipe->nexttoggle; } /* Index: ohci.c =================================================================== RCS file: /dump/FreeBSD-CVS/src/sys/dev/usb/ohci.c,v retrieving revision 1.154.2.2 diff -u -r1.154.2.2 ohci.c --- ohci.c 29 Jan 2006 01:26:46 -0000 1.154.2.2 +++ ohci.c 28 Feb 2006 01:18:55 -0000 @@ -2161,7 +2161,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 = htole32(tdphys); + sed->ed.ed_headp = htole32(tdphys | + (pipe->endpoint->savedtoggle ? OHCI_TOGGLECARRY : 0)); + sed->ed.ed_tailp = htole32(tdphys); switch (xfertype) { case UE_CONTROL: @@ -2247,6 +2249,8 @@ /* Make sure the host controller is not touching this ED */ usb_delay_ms(&sc->sc_bus, 1); splx(s); + pipe->endpoint->savedtoggle = + (le32toh(sed->ed.ed_headp) & OHCI_TOGGLECARRY) ? 1 : 0; ohci_free_sed(sc, opipe->sed); } Index: uhci.c =================================================================== RCS file: /dump/FreeBSD-CVS/src/sys/dev/usb/uhci.c,v retrieving revision 1.162 diff -u -r1.162 uhci.c --- uhci.c 29 May 2005 04:42:27 -0000 1.162 +++ uhci.c 28 Feb 2006 01:19:11 -0000 @@ -2031,6 +2031,7 @@ uhci_softc_t *sc = (uhci_softc_t *)dev->bus; uhci_free_sqh(sc, upipe->u.bulk.sqh); + pipe->endpoint->savedtoggle = upipe->nexttoggle; } usbd_status @@ -2915,7 +2916,7 @@ ed->bEndpointAddress, sc->sc_addr)); upipe->aborting = 0; - upipe->nexttoggle = 0; + upipe->nexttoggle = pipe->endpoint->savedtoggle; if (pipe->device->address == sc->sc_addr) { switch (ed->bEndpointAddress) { Index: usb_subr.c =================================================================== RCS file: /dump/FreeBSD-CVS/src/sys/dev/usb/usb_subr.c,v retrieving revision 1.76.2.2 diff -u -r1.76.2.2 usb_subr.c --- usb_subr.c 15 Feb 2006 22:51:08 -0000 1.76.2.2 +++ usb_subr.c 28 Feb 2006 01:19:26 -0000 @@ -514,6 +514,7 @@ } } ifc->endpoints[endpt].refcnt = 0; + ifc->endpoints[endpt].savedtoggle = 0; p += ed->bLength; } #undef ed Index: usbdivar.h =================================================================== RCS file: /dump/FreeBSD-CVS/src/sys/dev/usb/usbdivar.h,v retrieving revision 1.43 diff -u -r1.43 usbdivar.h --- usbdivar.h 6 Jan 2005 01:43:29 -0000 1.43 +++ usbdivar.h 28 Feb 2006 01:19:47 -0000 @@ -51,6 +51,7 @@ struct usbd_endpoint { usb_endpoint_descriptor_t *edesc; int refcnt; + int savedtoggle; }; struct usbd_bus_methods {