summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJolan Luff <jolan@cvs.openbsd.org>2006-05-04 14:21:31 +0000
committerJolan Luff <jolan@cvs.openbsd.org>2006-05-04 14:21:31 +0000
commit04ffe450ccdc05851f8a95806c9e4678e65266c5 (patch)
tree703486abc822ba131c4420641342c277f05af26c /sys/dev
parent5abff8aeca0989399894ec43e810980e98dccaad (diff)
fix interrupt out transfers
from netbsd, ok dlg
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/ohci.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
index f5720aadf12..9a98850b372 100644
--- a/sys/dev/usb/ohci.c
+++ b/sys/dev/usb/ohci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohci.c,v 1.65 2005/12/03 03:40:52 brad Exp $ */
+/* $OpenBSD: ohci.c,v 1.66 2006/05/04 14:21:30 jolan Exp $ */
/* $NetBSD: ohci.c,v 1.139 2003/02/22 05:24:16 tsutsui Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
@@ -3010,8 +3010,7 @@ ohci_device_intr_start(usbd_xfer_handle xfer)
ohci_softc_t *sc = (ohci_softc_t *)dev->bus;
ohci_soft_ed_t *sed = opipe->sed;
ohci_soft_td_t *data, *tail;
- int len;
- int s;
+ int s, len, isread, endpt;
if (sc->sc_dying)
return (USBD_IOERROR);
@@ -3026,6 +3025,8 @@ ohci_device_intr_start(usbd_xfer_handle xfer)
#endif
len = xfer->length;
+ endpt = xfer->pipe->endpoint->edesc->bEndpointAddress;
+ isread = UE_GET_DIR(endpt) == UE_DIR_IN;
data = opipe->tail.td;
tail = ohci_alloc_std(sc);
@@ -3034,7 +3035,8 @@ ohci_device_intr_start(usbd_xfer_handle xfer)
tail->xfer = NULL;
data->td.td_flags = htole32(
- OHCI_TD_IN | OHCI_TD_NOCC |
+ isread ? OHCI_TD_IN : OHCI_TD_OUT |
+ OHCI_TD_NOCC |
OHCI_TD_SET_DI(1) | OHCI_TD_TOGGLE_CARRY);
if (xfer->flags & USBD_SHORT_XFER_OK)
data->td.td_flags |= htole32(OHCI_TD_R);