Fixed high-speed isoc USB transfers, 64 bit capable host controllers have a different transfer descriptor to non-capable controllers.
Added dma-sync of data buffer before scheduling transfers
This commit is contained in:
parent
d235df969a
commit
3ce0341c47
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ehci.c,v 1.154 2008/10/14 18:32:53 jmcneill Exp $ */
|
||||
/* $NetBSD: ehci.c,v 1.155 2008/11/28 17:18:21 jmorse Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2004-2008 The NetBSD Foundation, Inc.
|
||||
@ -52,7 +52,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.154 2008/10/14 18:32:53 jmcneill Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.155 2008/11/28 17:18:21 jmorse Exp $");
|
||||
|
||||
#include "ohci.h"
|
||||
#include "uhci.h"
|
||||
@ -908,6 +908,9 @@ ehci_idone(struct ehci_xfer *ex)
|
||||
|
||||
status = le32toh(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;
|
||||
}
|
||||
@ -918,11 +921,6 @@ ehci_idone(struct ehci_xfer *ex)
|
||||
|
||||
xfer->actlen = actlen;
|
||||
xfer->status = USBD_NORMAL_COMPLETION;
|
||||
if (xfer->rqflags & URQ_DEV_DMABUF) {
|
||||
usb_syncmem(&xfer->dmabuf, 0, ex->isoc_len,
|
||||
BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
|
||||
}
|
||||
|
||||
goto end;
|
||||
}
|
||||
|
||||
@ -3953,11 +3951,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);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -3990,6 +3989,9 @@ ehci_device_isoc_start(usbd_xfer_handle xfer)
|
||||
stop->xfer_next = NULL;
|
||||
exfer->isoc_len = total_length;
|
||||
|
||||
usb_syncmem(&exfer->xfer.dmabuf, 0, total_length,
|
||||
BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
|
||||
|
||||
/*
|
||||
* Part 2: Transfer descriptors have now been set up, now they must
|
||||
* be scheduled into the period frame list. Erk. Not wanting to
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ehcireg.h,v 1.28 2008/08/02 22:23:18 jmcneill Exp $ */
|
||||
/* $NetBSD: ehcireg.h,v 1.29 2008/11/28 17:18:21 jmorse Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001, 2004 The NetBSD Foundation, Inc.
|
||||
@ -206,8 +206,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];
|
||||
@ -223,6 +223,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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user