Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Jan 2000 13:48:16 -0500 (EST)
From:      Louis Mamakos <louie@TransSys.COM>
To:        FreeBSD-gnats-submit@freebsd.org, n_hibma@webweaving.org
Subject:   kern/16315: ugen set configuration ioctl returns EIO on "normal" completeion
Message-ID:  <200001231848.NAA05102@whizzo.transsys.com>

next in thread | raw e-mail | index | archive | help

>Number:         16315
>Category:       kern
>Synopsis:       USB ugen set configuration ioctl() returns EIO rather than 0
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 23 10:50:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Louis Mamakos
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
>Environment:

Just out of the oven 4.0-current.

>Description:

The previous fix for the USB ugen device set configuration ioctl()
has a slight error, and returns EIO way too often.

>How-To-Repeat:

Try the ioctl() on a device that supports it.

>Fix:

Includes additional debugging message.

Index: /sys/dev/usb/ugen.c
===================================================================
RCS file: /usr/local/FreeBSD/cvs/src/sys/dev/usb/ugen.c,v
retrieving revision 1.35
diff -u -r1.35 ugen.c
--- /sys/dev/usb/ugen.c	2000/01/23 15:48:29	1.35
+++ /sys/dev/usb/ugen.c	2000/01/23 18:42:49
@@ -209,8 +209,12 @@
 	 * control endpoint is open or not. It is always present.
 	 */
 	for (endptno = 1; endptno < USB_MAX_ENDPOINTS; endptno++)
-		if (sc->sc_is_open[endptno])
+		if (sc->sc_is_open[endptno]) {
+			DPRINTFN(1,
+			     ("ugen_set_config: %s - endpoint %d is open\n",
+			      USBDEVNAME(sc->sc_dev), endptno));
 			return (USBD_IN_USE);
+		}
 
 	if (usbd_get_config_descriptor(dev)->bConfigurationValue != configno) {
 		/* Avoid setting the current value. */
@@ -957,10 +961,14 @@
 		if (!(flag & FWRITE))
 			return (EPERM);
 		err = ugen_set_config(sc, *(int *)addr);
-		if (err == USBD_IN_USE)
-			return(EBUSY);
-		else
+		switch (err) {
+		case USBD_NORMAL_COMPLETION:
+			break;
+		case USBD_IN_USE:
+			return (EBUSY);
+		default:
 			return (EIO);
+		}
 		break;
 	case USB_GET_ALTINTERFACE:
 		ai = (struct usb_alt_interface *)addr;


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200001231848.NAA05102>