From 7a2cdd24f992cf84ef0ea06ffd8cd3e07274886c Mon Sep 17 00:00:00 2001 From: mycroft Date: Tue, 22 Jun 2004 08:55:25 +0000 Subject: Fix a stupid bug in ehci_check_intr() that caused use to try to complete a transaction that was still running. Now ehci can handle multiple devices being active at once. --- sys/dev/usb/ehci.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c index e0bf4559925..f0c46443c28 100644 --- a/sys/dev/usb/ehci.c +++ b/sys/dev/usb/ehci.c @@ -1,4 +1,4 @@ -/* $NetBSD: ehci.c,v 1.57 2004/06/22 07:40:19 mycroft Exp $ */ +/* $NetBSD: ehci.c,v 1.58 2004/06/22 08:55:25 mycroft Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -69,7 +69,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.57 2004/06/22 07:40:19 mycroft Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.58 2004/06/22 08:55:25 mycroft Exp $"); #include "ohci.h" #include "uhci.h" @@ -675,7 +675,7 @@ ehci_check_intr(ehci_softc_t *sc, struct ehci_xfer *ex) if (status & EHCI_QTD_HALTED) goto done; /* We want short packets, and it is short: it's done */ - if (EHCI_QTD_SET_BYTES(status) != 0) + if (EHCI_QTD_GET_BYTES(status) != 0) goto done; } DPRINTFN(12, ("ehci_check_intr: ex=%p std=%p still active\n", @@ -748,9 +748,12 @@ ehci_idone(struct ehci_xfer *ex) /* If there are left over TDs we need to update the toggle. */ if (sqtd != NULL) { - if (!(xfer->rqflags & URQ_REQUEST)) - printf("ehci_idone: need toggle update\n"); - epipe->nexttoggle = EHCI_QTD_GET_TOGGLE(status); + printf("ehci_idone: need toggle update status=%08x nstatus=%08x\n", status, nstatus); +#if 0 + ehci_dump_sqh(epipe->sqh); + ehci_dump_sqtds(ex->sqtdstart); +#endif + epipe->nexttoggle = EHCI_QTD_GET_TOGGLE(nstatus); } status &= EHCI_QTD_STATERRS; -- cgit