From 2f9b6e1f34d64141ad417b126cc200386a1b4fdf Mon Sep 17 00:00:00 2001 From: Ian Dowse Date: Tue, 8 Mar 2005 02:47:18 +0000 Subject: [PATCH] Fix the silly bug that prevented most EHCI interrupt transfers from ever working correctly: the code was linking the QHs together but then immediately overwriting the "next" pointers. Oops. Also initialise qh_endphub, since the EHCI spec says that we should always set the pipe multiplier field to something sensible. This appears to make basic split transactions work, so enable split transactions for control, bulk and interrupt pipes (split isochronous transfers are not yet implemented). It should now be possible to use USB1 devices even when they are connected through a USB2 hub. --- sys/dev/usb/ehci.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c index bdbd4eb4fb6..428edf2a52b 100644 --- a/sys/dev/usb/ehci.c +++ b/sys/dev/usb/ehci.c @@ -451,9 +451,8 @@ ehci_init(ehci_softc_t *sc) EHCI_LINK_QH); } sqh->qh.qh_endp = htole32(EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH)); - sqh->qh.qh_link = EHCI_NULL; + sqh->qh.qh_endphub = htole32(EHCI_QH_SET_MULT(1)); sqh->qh.qh_curqtd = EHCI_NULL; - sqh->next = NULL; sqh->qh.qh_qtd.qtd_next = EHCI_NULL; sqh->qh.qh_qtd.qtd_altnext = EHCI_NULL; sqh->qh.qh_qtd.qtd_status = htole32(EHCI_QTD_HALTED); @@ -1408,14 +1407,13 @@ ehci_open(usbd_pipe_handle pipe) case USB_SPEED_HIGH: speed = EHCI_QH_SPEED_HIGH; break; default: panic("ehci_open: bad device speed %d", dev->speed); } - if (speed != EHCI_QH_SPEED_HIGH) { + if (speed != EHCI_QH_SPEED_HIGH && xfertype == UE_ISOCHRONOUS) { printf("%s: *** WARNING: opening low/full speed device, this " "does not work yet.\n", USBDEVNAME(sc->sc_bus.bdev)); DPRINTFN(1,("ehci_open: hshubaddr=%d hshubport=%d\n", hshubaddr, hshubport)); - if (xfertype != UE_CONTROL) - return USBD_INVAL; + return USBD_INVAL; } naks = 8; /* XXX */