Fix problems with ehci on controllers that support 64-bit addressing. From

Cliff Wright, PR 23128.  Thanks!
This commit is contained in:
mycroft 2003-10-12 18:04:28 +00:00
parent ac8278da8c
commit ba41e2e19b
1 changed files with 9 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ehci.c,v 1.47 2003/05/10 12:04:22 augustss Exp $ */ /* $NetBSD: ehci.c,v 1.48 2003/10/12 18:04:28 mycroft Exp $ */
/* /*
* TODO * TODO
@ -52,7 +52,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.47 2003/05/10 12:04:22 augustss Exp $"); __KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.48 2003/10/12 18:04:28 mycroft Exp $");
#include "ohci.h" #include "ohci.h"
#include "uhci.h" #include "uhci.h"
@ -719,6 +719,10 @@ ehci_idone(struct ehci_xfer *ex)
break; break;
status = nstatus; status = nstatus;
/* halt is ok if descriptor is last, and complete */
if(sqtd->qtd.qtd_next == EHCI_NULL
&& EHCI_QTD_GET_BYTES(status) == 0)
status &= ~EHCI_QTD_HALTED;
if (EHCI_QTD_GET_PID(status) != EHCI_QTD_PID_SETUP) if (EHCI_QTD_GET_PID(status) != EHCI_QTD_PID_SETUP)
actlen += sqtd->len - EHCI_QTD_GET_BYTES(status); actlen += sqtd->len - EHCI_QTD_GET_BYTES(status);
} }
@ -2156,6 +2160,7 @@ ehci_alloc_sqtd_chain(struct ehci_pipe *epipe, ehci_softc_t *sc,
if (i != 0) /* use offset only in first buffer */ if (i != 0) /* use offset only in first buffer */
a = EHCI_PAGE(a); a = EHCI_PAGE(a);
cur->qtd.qtd_buffer[i] = htole32(a); cur->qtd.qtd_buffer[i] = htole32(a);
cur->qtd.qtd_buffer_hi[i] = 0;
#ifdef DIAGNOSTIC #ifdef DIAGNOSTIC
if (i >= EHCI_QTD_NBUFFERS) { if (i >= EHCI_QTD_NBUFFERS) {
printf("ehci_alloc_sqtd_chain: i=%d\n", i); printf("ehci_alloc_sqtd_chain: i=%d\n", i);
@ -2536,6 +2541,7 @@ ehci_device_request(usbd_xfer_handle xfer)
EHCI_QTD_SET_BYTES(sizeof *req) EHCI_QTD_SET_BYTES(sizeof *req)
); );
setup->qtd.qtd_buffer[0] = htole32(DMAADDR(&epipe->u.ctl.reqdma, 0)); setup->qtd.qtd_buffer[0] = htole32(DMAADDR(&epipe->u.ctl.reqdma, 0));
setup->qtd.qtd_buffer_hi[0] = 0;
setup->nextqtd = next; setup->nextqtd = next;
setup->qtd.qtd_next = setup->qtd.qtd_altnext = htole32(next->physaddr); setup->qtd.qtd_next = setup->qtd.qtd_altnext = htole32(next->physaddr);
setup->xfer = xfer; setup->xfer = xfer;
@ -2548,6 +2554,7 @@ ehci_device_request(usbd_xfer_handle xfer)
EHCI_QTD_IOC EHCI_QTD_IOC
); );
stat->qtd.qtd_buffer[0] = 0; /* XXX not needed? */ stat->qtd.qtd_buffer[0] = 0; /* XXX not needed? */
stat->qtd.qtd_buffer_hi[0] = 0; /* XXX not needed? */
stat->nextqtd = NULL; stat->nextqtd = NULL;
stat->qtd.qtd_next = stat->qtd.qtd_altnext = EHCI_NULL; stat->qtd.qtd_next = stat->qtd.qtd_altnext = EHCI_NULL;
stat->xfer = xfer; stat->xfer = xfer;