Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Complete the interrupt output transfer support c...



details:   https://anonhg.NetBSD.org/src/rev/9daa0019c69b
branches:  trunk
changeset: 580572:9daa0019c69b
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Apr 29 19:15:13 2005 +0000

description:
Complete the interrupt output transfer support copy from FreeBSD, but
remove the incorrect access to the bulk part of the union.

Reviewed and OK'ed by Lennart.

diffstat:

 sys/dev/usb/uhci.c |  16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diffs (51 lines):

diff -r f0f584319223 -r 9daa0019c69b sys/dev/usb/uhci.c
--- a/sys/dev/usb/uhci.c        Fri Apr 29 17:52:46 2005 +0000
+++ b/sys/dev/usb/uhci.c        Fri Apr 29 19:15:13 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhci.c,v 1.186 2005/04/27 07:47:25 skrll Exp $ */
+/*     $NetBSD: uhci.c,v 1.187 2005/04/29 19:15:13 skrll Exp $ */
 /*     $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $       */
 
 /*
@@ -49,7 +49,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.186 2005/04/27 07:47:25 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.187 2005/04/29 19:15:13 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -145,6 +145,7 @@
                /* Interrupt pipe */
                struct {
                        int npoll;
+                       int isread;
                        uhci_soft_qh_t **qhs;
                } intr;
                /* Bulk pipe */
@@ -2071,6 +2072,7 @@
        uhci_soft_td_t *data, *dataend;
        uhci_soft_qh_t *sqh;
        usbd_status err;
+       int isread, endpt;
        int i, s;
 
        if (sc->sc_dying)
@@ -2084,8 +2086,14 @@
                panic("uhci_device_intr_transfer: a request");
 #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;
+
+       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);



Home | Main Index | Thread Index | Old Index