summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/uhci.c
diff options
context:
space:
mode:
authorjhay <jhay@FreeBSD.org>2003-02-28 19:28:29 +0000
committerjhay <jhay@FreeBSD.org>2003-02-28 19:28:29 +0000
commit9cfb22c2099b864d1c2dc45a37f750df81d5d0cd (patch)
tree56b7bb65e35cb711738a66b2bf64158dd7874a4c /sys/dev/usb/uhci.c
parentf7135842db85e9aa10d78271936053555f274767 (diff)
downloadFreeBSD-src-9cfb22c2099b864d1c2dc45a37f750df81d5d0cd.zip
FreeBSD-src-9cfb22c2099b864d1c2dc45a37f750df81d5d0cd.tar.gz
Implement outgoing interrupt pipes. It is part of the USB 1.1 spec.
The Lego Infrared Tower use it.
Diffstat (limited to 'sys/dev/usb/uhci.c')
-rw-r--r--sys/dev/usb/uhci.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index 68a8070..4bb24a1 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -149,6 +149,7 @@ struct uhci_pipe {
/* Interrupt pipe */
struct {
int npoll;
+ int isread;
uhci_soft_qh_t **qhs;
} intr;
/* Bulk pipe */
@@ -2032,6 +2033,7 @@ uhci_device_intr_start(usbd_xfer_handle xfer)
uhci_soft_td_t *data, *dataend;
uhci_soft_qh_t *sqh;
usbd_status err;
+ int isread, endpt;
int i, s;
if (sc->sc_dying)
@@ -2045,8 +2047,15 @@ uhci_device_intr_start(usbd_xfer_handle xfer)
panic("uhci_device_intr_transfer: a request\n");
#endif
- err = uhci_alloc_std_chain(upipe, sc, xfer->length, 1, xfer->flags,
- &xfer->dmabuf, &data, &dataend);
+ endpt = upipe->pipe.endpoint->edesc->bEndpointAddress;
+ isread = UE_GET_DIR(endpt) == UE_DIR_IN;
+ sqh = upipe->u.bulk.sqh;
+
+ upipe->u.intr.isread = isread;
+
+ err = uhci_alloc_std_chain(upipe, sc, xfer->length, isread,
+ xfer->flags, &xfer->dmabuf, &data,
+ &dataend);
if (err)
return (err);
dataend->td.td_status |= htole32(UHCI_TD_IOC);
@@ -2637,7 +2646,8 @@ uhci_device_intr_done(usbd_xfer_handle xfer)
DPRINTFN(5,("uhci_device_intr_done: requeing\n"));
/* This alloc cannot fail since we freed the chain above. */
- uhci_alloc_std_chain(upipe, sc, xfer->length, 1, xfer->flags,
+ uhci_alloc_std_chain(upipe, sc, xfer->length,
+ upipe->u.intr.isread, xfer->flags,
&xfer->dmabuf, &data, &dataend);
dataend->td.td_status |= htole32(UHCI_TD_IOC);
OpenPOWER on IntegriCloud