Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Set up the USB xfer for every transfer, not just...



details:   https://anonhg.NetBSD.org/src/rev/efc27b2c7ab5
branches:  trunk
changeset: 935925:efc27b2c7ab5
user:      simonb <simonb%NetBSD.org@localhost>
date:      Mon Jul 13 13:53:04 2020 +0000

description:
Set up the USB xfer for every transfer, not just once in the attach
function.  Caught by DIAGNOSTIC on a similar driver.  Thanks to phone@
for USB xfer clue and martin@ for testing.

diffstat:

 sys/dev/usb/ualea.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (42 lines):

diff -r b31790450697 -r efc27b2c7ab5 sys/dev/usb/ualea.c
--- a/sys/dev/usb/ualea.c       Mon Jul 13 13:42:51 2020 +0000
+++ b/sys/dev/usb/ualea.c       Mon Jul 13 13:53:04 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ualea.c,v 1.11 2020/04/30 03:40:53 riastradh Exp $     */
+/*     $NetBSD: ualea.c,v 1.12 2020/07/13 13:53:04 simonb Exp $        */
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ualea.c,v 1.11 2020/04/30 03:40:53 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ualea.c,v 1.12 2020/07/13 13:53:04 simonb Exp $");
 
 #include <sys/types.h>
 #include <sys/atomic.h>
@@ -139,11 +139,6 @@
                return;
        }
 
-       /* Setup the xfer to call ualea_xfer_done with sc.  */
-       usbd_setup_xfer(sc->sc_xfer, sc, usbd_get_buffer(sc->sc_xfer),
-           sc->sc_maxpktsize, USBD_SHORT_XFER_OK, USBD_NO_TIMEOUT,
-           ualea_xfer_done);
-
        /* Success!  We are ready to run.  */
        sc->sc_attached = true;
        rndsource_setcb(&sc->sc_rnd, ualea_get, sc);
@@ -188,6 +183,11 @@
        if (sc->sc_needed == 0)
                return;
 
+       /* Setup the xfer to call ualea_xfer_done with sc.  */
+       usbd_setup_xfer(sc->sc_xfer, sc, usbd_get_buffer(sc->sc_xfer),
+           sc->sc_maxpktsize, USBD_SHORT_XFER_OK, USBD_NO_TIMEOUT,
+           ualea_xfer_done);
+
        /* Issue xfer or complain if we can't.  */
        status = usbd_transfer(sc->sc_xfer);
        KASSERT(status != USBD_NORMAL_COMPLETION); /* asynchronous xfer */



Home | Main Index | Thread Index | Old Index