Module Name:    src
Committed By:   martin
Date:           Mon Jul 13 14:32:20 UTC 2020

Modified Files:
        src/sys/dev/usb [netbsd-9]: ualea.c

Log Message:
Pull up following revision(s) (requested by simonb in ticket #1003):

        sys/dev/usb/ualea.c: revision 1.12

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


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.10.1 src/sys/dev/usb/ualea.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/ualea.c
diff -u src/sys/dev/usb/ualea.c:1.9 src/sys/dev/usb/ualea.c:1.9.10.1
--- src/sys/dev/usb/ualea.c:1.9	Sun Jan 21 13:57:12 2018
+++ src/sys/dev/usb/ualea.c	Mon Jul 13 14:32:20 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ualea.c,v 1.9 2018/01/21 13:57:12 skrll Exp $	*/
+/*	$NetBSD: ualea.c,v 1.9.10.1 2020/07/13 14:32:20 martin Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ualea.c,v 1.9 2018/01/21 13:57:12 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ualea.c,v 1.9.10.1 2020/07/13 14:32:20 martin Exp $");
 
 #include <sys/types.h>
 #include <sys/atomic.h>
@@ -144,11 +144,6 @@ ualea_attach(device_t parent, device_t s
 		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.  */
 	mutex_enter(&sc->sc_lock);
 	sc->sc_attached = true;
@@ -197,6 +192,11 @@ ualea_xfer(struct ualea_softc *sc)
 	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.  */
 	/*
 	 * XXX Does USBD_NORMAL_COMPLETION (= 0) make sense here?  The

Reply via email to