diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-01-15 11:10:41 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-01-15 11:10:41 +0000 |
commit | 93ea84e1025fc17c2d23de231e4f20c57e6778b9 (patch) | |
tree | 383c3d1962c1b710d8c18fabca6b5bf375a8d691 /sys/dev/usb/ehci.c | |
parent | 9b58b73a6625e88b68393365f4d13cbcf8f7a5ee (diff) |
Remove a hack to update the address and packet length for every device
request and instead re-open the default pipe with updated values when
attaching a new device, adapted from FreeBSD r162977.
This fixes a problem where the controller could have cached the previous
values and would fail to get the device descriptor, leaving the device
unrecognized with a message like: "device problem, disabling port n".
Diffstat (limited to 'sys/dev/usb/ehci.c')
-rw-r--r-- | sys/dev/usb/ehci.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c index 68809c35efb..ed6dcb24069 100644 --- a/sys/dev/usb/ehci.c +++ b/sys/dev/usb/ehci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ehci.c,v 1.139 2013/12/06 21:03:04 deraadt Exp $ */ +/* $OpenBSD: ehci.c,v 1.140 2014/01/15 11:10:40 mpi Exp $ */ /* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */ /* @@ -3052,7 +3052,6 @@ ehci_device_request(struct usbd_xfer *xfer) usb_device_request_t *req = &xfer->request; struct usbd_device *dev = epipe->pipe.device; struct ehci_softc *sc = (struct ehci_softc *)dev->bus; - int addr = dev->address; struct ehci_soft_qtd *setup, *stat, *next; struct ehci_soft_qh *sqh; int isread; @@ -3066,7 +3065,7 @@ ehci_device_request(struct usbd_xfer *xfer) DPRINTFN(3,("ehci_device_request: type=0x%02x, request=0x%02x, " "wValue=0x%04x, wIndex=0x%04x len=%u, addr=%d, endpt=%d\n", req->bmRequestType, req->bRequest, UGETW(req->wValue), - UGETW(req->wIndex), len, addr, + UGETW(req->wIndex), len, dev->address, epipe->pipe.endpoint->edesc->bEndpointAddress)); setup = ehci_alloc_sqtd(sc); @@ -3083,17 +3082,6 @@ ehci_device_request(struct usbd_xfer *xfer) sqh = epipe->sqh; epipe->u.ctl.length = len; - /* Update device address and length since they may have changed - during the setup of the control pipe in usbd_new_device(). */ - /* XXX This only needs to be done once, but it's too early in open. */ - /* XXXX Should not touch ED here! */ - sqh->qh.qh_endp = - (sqh->qh.qh_endp & htole32(~(EHCI_QH_ADDRMASK | EHCI_QH_MPLMASK))) | - htole32( - EHCI_QH_SET_ADDR(addr) | - EHCI_QH_SET_MPL(UGETW(epipe->pipe.endpoint->edesc->wMaxPacketSize)) - ); - /* Set up data transaction */ if (len != 0) { struct ehci_soft_qtd *end; |