diff options
author | Marcus Glocker <mglocker@cvs.openbsd.org> | 2008-11-29 08:52:04 +0000 |
---|---|---|
committer | Marcus Glocker <mglocker@cvs.openbsd.org> | 2008-11-29 08:52:04 +0000 |
commit | 5c026bc0affe11153031dcb8e8b35e2302cb1f3c (patch) | |
tree | 23ff09d89a1fb2d7bda49b321b9e166d140a4c4f /sys/dev | |
parent | d30259fbe88716023dc262dd9e19c097f42e4d06 (diff) |
Fix high-speed isoc USB transfers; 64bit capable USB host controllers
have a different transfer descriptor than non-64bit capable ones.
This fixes isoc transfer issues (resulting in broken image data) for
uvideo(4) devices attached to ehci(4) seen on USB Intel host controllers.
From Jeremy Morse via NetBSD.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/usb/ehci.c | 12 | ||||
-rw-r--r-- | sys/dev/usb/ehcireg.h | 7 |
2 files changed, 12 insertions, 7 deletions
diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c index 501250fcdb8..e44d123d8ab 100644 --- a/sys/dev/usb/ehci.c +++ b/sys/dev/usb/ehci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ehci.c,v 1.96 2008/11/21 17:08:42 deraadt Exp $ */ +/* $OpenBSD: ehci.c,v 1.97 2008/11/29 08:52:03 mglocker Exp $ */ /* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */ /* @@ -876,6 +876,9 @@ ehci_idone(struct ehci_xfer *ex) status = letoh32(itd->itd.itd_ctl[i]); len = EHCI_ITD_GET_LEN(status); + if (EHCI_ITD_GET_STATUS(status) != 0) + len = 0; /*No valid data on error*/ + xfer->frlengths[nframes++] = len; actlen += len; } @@ -3806,11 +3809,12 @@ ehci_device_isoc_start(usbd_xfer_handle xfer) if (page_offs >= dma_buf->block->size) break; - int page = DMAADDR(dma_buf, page_offs); + long long page = DMAADDR(dma_buf, page_offs); page = EHCI_PAGE(page); itd->itd.itd_bufr[j] = - htole32(EHCI_ITD_SET_BPTR(page) | - EHCI_LINK_ITD); + htole32(EHCI_ITD_SET_BPTR(page)); + itd->itd.itd_bufr_hi[j] = + htole32(page >> 32); } /* diff --git a/sys/dev/usb/ehcireg.h b/sys/dev/usb/ehcireg.h index b72b8bf8ec5..5bdc4a71869 100644 --- a/sys/dev/usb/ehcireg.h +++ b/sys/dev/usb/ehcireg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ehcireg.h,v 1.15 2008/08/09 22:59:20 mglocker Exp $ */ +/* $OpenBSD: ehcireg.h,v 1.16 2008/11/29 08:52:03 mglocker Exp $ */ /* $NetBSD: ehcireg.h,v 1.17 2004/06/23 06:45:56 mycroft Exp $ */ /* @@ -207,8 +207,8 @@ typedef struct { #define EHCI_ITD_IOC 0x8000 #define EHCI_ITD_GET_IOC(x) (((x) >> 15) & 1) #define EHCI_ITD_SET_IOC(x) (((x) << 15) & EHCI_ITD_IOC) -#define EHCI_ITD_GET_PG(x) (((x) >> 12) & 0xf) -#define EHCI_ITD_SET_PG(x) (((x) & 0xf) << 12) +#define EHCI_ITD_GET_PG(x) (((x) >> 12) & 0x7) +#define EHCI_ITD_SET_PG(x) (((x) & 0x7) << 12) #define EHCI_ITD_GET_OFFS(x) (((x) >> 0) & 0xfff) #define EHCI_ITD_SET_OFFS(x) (((x) & 0xfff) << 0) volatile ehci_isoc_bufr_ptr_t itd_bufr[7]; @@ -224,6 +224,7 @@ typedef struct { #define EHCI_ITD_SET_MAXPKT(x) ((x) & 0x7ff) #define EHCI_ITD_GET_MULTI(x) ((x) & 0x3) #define EHCI_ITD_SET_MULTI(x) ((x) & 0x3) + volatile ehci_isoc_bufr_ptr_t itd_bufr_hi[7]; } ehci_itd_t; #define EHCI_ITD_ALIGN 32 |