Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/dev/usb Pull up following revision(s) (requested by m...



details:   https://anonhg.NetBSD.org/src/rev/e14df25bf428
branches:  netbsd-8
changeset: 445778:e14df25bf428
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Nov 12 12:17:06 2018 +0000

description:
Pull up following revision(s) (requested by manu in ticket #1090):

        sys/dev/usb/ugen.c: revision 1.141

Enfore USB timeout on ugen(4) write operations

diffstat:

 sys/dev/usb/ugen.c |  20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diffs (48 lines):

diff -r a5b08b785844 -r e14df25bf428 sys/dev/usb/ugen.c
--- a/sys/dev/usb/ugen.c        Mon Nov 12 09:44:17 2018 +0000
+++ b/sys/dev/usb/ugen.c        Mon Nov 12 12:17:06 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ugen.c,v 1.134.10.1 2018/01/31 18:01:55 martin Exp $   */
+/*     $NetBSD: ugen.c,v 1.134.10.2 2018/11/12 12:17:06 martin Exp $   */
 
 /*
  * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.134.10.1 2018/01/31 18:01:55 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.134.10.2 2018/11/12 12:17:06 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1428,6 +1428,7 @@
        uint8_t conf, alt;
        int cdesclen;
        int error;
+       int dir;
 
        DPRINTFN(5, ("ugenioctl: cmd=%08lx\n", cmd));
        if (sc->sc_dying)
@@ -1450,14 +1451,13 @@
                        sce->state &= ~UGEN_SHORT_OK;
                return 0;
        case USB_SET_TIMEOUT:
-               sce = &sc->sc_endpoints[endpt][IN];
-               if (sce == NULL
-                   /* XXX this shouldn't happen, but the distinction between
-                      input and output pipes isn't clear enough.
-                      || sce->pipeh == NULL */
-                       )
-                       return EINVAL;
-               sce->timeout = *(int *)addr;
+               for (dir = OUT; dir <= IN; dir++) {
+                       sce = &sc->sc_endpoints[endpt][dir];
+                       if (sce == NULL)
+                               return EINVAL;
+
+                       sce->timeout = *(int *)addr;
+               }
                return 0;
        case USB_SET_BULK_RA:
                if (endpt == USB_CONTROL_ENDPOINT)



Home | Main Index | Thread Index | Old Index