summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2004-10-31 09:16:23 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2004-10-31 09:16:23 +0000
commitf306f413b45c2e4457f8b5400f4ee12eb51cf714 (patch)
treec33f60eb92673919e440a3a3a5a38525497ab935
parent4b446e9b3634a718b75a54eb5da9630cc2b297a7 (diff)
from netbsd: ehci.c revisions 1.185 and 1.187:
Follow the spec more closely when updating the overlay qTD in the QH. Preserve some bits in the overlay qTD.
-rw-r--r--sys/dev/usb/ehci.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c
index 6d879eb24c9..e0a4e36470f 100644
--- a/sys/dev/usb/ehci.c
+++ b/sys/dev/usb/ehci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ehci.c,v 1.27 2004/10/31 08:29:53 dlg Exp $ */
+/* $OpenBSD: ehci.c,v 1.28 2004/10/31 09:16:22 dlg Exp $ */
/* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */
/*
@@ -1453,13 +1453,24 @@ ehci_rem_qh(ehci_softc_t *sc, ehci_soft_qh_t *sqh, ehci_soft_qh_t *head)
void
ehci_set_qh_qtd(ehci_soft_qh_t *sqh, ehci_soft_qtd_t *sqtd)
{
- /* Halt while we are messing. */
- sqh->qh.qh_qtd.qtd_status |= htole32(EHCI_QTD_HALTED);
+ int i;
+ u_int32_t status;
+
+ /* Save toggle bit and ping status. */
+ status = sqh->qh.qh_qtd.qtd_status &
+ htole32(EHCI_QTD_TOGGLE_MASK |
+ EHCI_QTD_SET_STATUS(EHCI_QTD_PINGSTATE));
+ /* Set HALTED to make gw leave it alone */
+ sqh->qh.qh_qtd.qtd_status =
+ htole32(EHCI_QTD_SET_STATUS(EHCI_QTD_HALTED));
sqh->qh.qh_curqtd = 0;
sqh->qh.qh_qtd.qtd_next = htole32(sqtd->physaddr);
+ sqh->qh.qh_qtd.qtd_altnext = 0;
+ for (i = 0; i < EHCI_QTD_NBUFFERS; i++ )
+ sqh->qh.qh_qtd.qtd_buffer[i] = 0;
sqh->sqtd = sqtd;
- /* Clear halt */
- sqh->qh.qh_qtd.qtd_status &= htole32(~EHCI_QTD_HALTED);
+ /* Set !HALTED && !ACTIVE to start execution, preserve some fields */
+ sqh->qh.qh_qtd.qtd_status = status;
}
/*