Module Name: src
Committed By: martin
Date: Mon Nov 12 12:17:07 UTC 2018
Modified Files:
src/sys/dev/usb [netbsd-8]: ugen.c
Log Message:
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
To generate a diff of this commit:
cvs rdiff -u -r1.134.10.1 -r1.134.10.2 src/sys/dev/usb/ugen.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/ugen.c
diff -u src/sys/dev/usb/ugen.c:1.134.10.1 src/sys/dev/usb/ugen.c:1.134.10.2
--- src/sys/dev/usb/ugen.c:1.134.10.1 Wed Jan 31 18:01:55 2018
+++ src/sys/dev/usb/ugen.c Mon Nov 12 12:17:06 2018
@@ -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 @@ ugen_do_ioctl(struct ugen_softc *sc, int
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 @@ ugen_do_ioctl(struct ugen_softc *sc, int
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)