Do not update frame lengths to reflect what has really been transfered
authormpi <mpi@openbsd.org>
Mon, 22 Jun 2015 12:56:55 +0000 (12:56 +0000)
committermpi <mpi@openbsd.org>
Mon, 22 Jun 2015 12:56:55 +0000 (12:56 +0000)
when an isochronous transfer is done.

Frame lengths are just input values and no driver mess with them.

ok ratchov@, jmatthew@

sys/dev/usb/dwc2/dwc2.c
sys/dev/usb/ehci.c
sys/dev/usb/ohci.c
sys/dev/usb/uhci.c

index b90ff51..f6d5ecc 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dwc2.c,v 1.28 2015/06/08 08:47:38 jmatthew Exp $      */
+/*     $OpenBSD: dwc2.c,v 1.29 2015/06/22 12:56:55 mpi Exp $   */
 /*     $NetBSD: dwc2.c,v 1.32 2014/09/02 23:26:20 macallan Exp $       */
 
 /*-
@@ -1771,14 +1771,14 @@ void dwc2_host_complete(struct dwc2_hsotg *hsotg, struct dwc2_qtd *qtd,
        }
 
        if (xfertype == UE_ISOCHRONOUS) {
+               uint32_t len;
                int i;
 
                xfer->actlen = 0;
                for (i = 0; i < xfer->nframes; ++i) {
-                       xfer->frlengths[i] =
-                               dwc2_hcd_urb_get_iso_desc_actual_length(
-                                               qtd->urb, i);
-                       xfer->actlen += xfer->frlengths[i];
+                       len = dwc2_hcd_urb_get_iso_desc_actual_length(qtd->urb,
+                           i);
+                       xfer->actlen += len;
                }
        }
 
index b21bb20..0672d7b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ehci.c,v 1.185 2015/04/16 14:23:48 mpi Exp $ */
+/*     $OpenBSD: ehci.c,v 1.186 2015/06/22 12:56:55 mpi Exp $ */
 /*     $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $        */
 
 /*
@@ -825,7 +825,6 @@ ehci_isoc_idone(struct usbd_xfer *xfer)
                                if (EHCI_ITD_GET_STATUS(status) != 0)
                                        len = 0; /*No valid data on error*/
 
-                               xfer->frlengths[nframes++] = len;
                                actlen += len;
                        }
                }
@@ -843,7 +842,6 @@ ehci_isoc_idone(struct usbd_xfer *xfer)
                        else
                                len = 0;
 
-                       xfer->frlengths[nframes++] = len;
                        actlen += len;
                }
        }
index 40c4a4a..ababa51 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ohci.c,v 1.143 2015/03/14 03:38:49 jsg Exp $ */
+/*     $OpenBSD: ohci.c,v 1.144 2015/06/22 12:56:55 mpi 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 $       */
 
@@ -1218,7 +1218,7 @@ ohci_softintr(void *v)
        struct usbd_xfer *xfer;
        struct ohci_pipe *opipe;
        int len, cc, s;
-       int i, j, actlen, iframes, uedir;
+       int i, j, actlen, iframes;
 
        DPRINTFN(10,("ohci_softintr: enter\n"));
 
@@ -1351,8 +1351,6 @@ ohci_softintr(void *v)
 
                        opipe = (struct ohci_pipe *)xfer->pipe;
                        opipe->u.iso.inuse -= xfer->nframes;
-                       uedir = UE_GET_DIR(xfer->pipe->endpoint->edesc->
-                           bEndpointAddress);
                        xfer->status = USBD_NORMAL_COMPLETION;
                        actlen = 0;
                        for (i = 0, sitd = xfer->hcpriv; ;
@@ -1361,10 +1359,7 @@ ohci_softintr(void *v)
                                if (OHCI_ITD_GET_CC(letoh32(sitd->
                                    itd.itd_flags)) != OHCI_CC_NO_ERROR)
                                        xfer->status = USBD_IOERROR;
-                               /* For input, update frlengths with actual */
-                               /* XXX anything necessary for output? */
-                               if (uedir == UE_DIR_IN &&
-                                   xfer->status == USBD_NORMAL_COMPLETION) {
+                               if (xfer->status == USBD_NORMAL_COMPLETION) {
                                        iframes = OHCI_ITD_GET_FC(letoh32(
                                            sitd->itd.itd_flags));
                                        for (j = 0; j < iframes; i++, j++) {
@@ -1376,7 +1371,6 @@ ohci_softintr(void *v)
                                                        len = 0;
                                                else
                                                        len = OHCI_ITD_PSW_LENGTH(len);
-                                               xfer->frlengths[i] = len;
                                                actlen += len;
                                        }
                                }
@@ -1385,8 +1379,7 @@ ohci_softintr(void *v)
                                ohci_free_sitd(sc, sitd);
                        }
                        ohci_free_sitd(sc, sitd);
-                       if (uedir == UE_DIR_IN &&
-                           xfer->status == USBD_NORMAL_COMPLETION)
+                       if (xfer->status == USBD_NORMAL_COMPLETION)
                                xfer->actlen = actlen;
                        xfer->hcpriv = NULL;
 
index 5af934b..b18f959 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: uhci.c,v 1.136 2015/03/14 03:38:50 jsg Exp $  */
+/*     $OpenBSD: uhci.c,v 1.137 2015/06/22 12:56:55 mpi Exp $  */
 /*     $NetBSD: uhci.c,v 1.172 2003/02/23 04:19:26 simonb Exp $        */
 /*     $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $       */
 
@@ -1234,7 +1234,6 @@ uhci_idone(struct usbd_xfer *xfer)
                                n = 0;
                        status = letoh32(std->td.td_status);
                        len = UHCI_TD_GET_ACTLEN(status);
-                       xfer->frlengths[i] = len;
                        actlen += len;
                }
                upipe->u.iso.inuse -= nframes;