From owner-freebsd-bugs Sun Jan 23 10:50: 5 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id B829A14D91 for ; Sun, 23 Jan 2000 10:50:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id KAA42494; Sun, 23 Jan 2000 10:50:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from whizzo.transsys.com (whizzo.TransSys.COM [144.202.42.10]) by hub.freebsd.org (Postfix) with ESMTP id 1062914C88 for ; Sun, 23 Jan 2000 10:48:20 -0800 (PST) (envelope-from louie@whizzo.transsys.com) Received: (from louie@localhost) by whizzo.transsys.com (8.9.3/8.9.1) id NAA05102; Sun, 23 Jan 2000 13:48:16 -0500 (EST) (envelope-from louie) Message-Id: <200001231848.NAA05102@whizzo.transsys.com> Date: Sun, 23 Jan 2000 13:48:16 -0500 (EST) From: Louis Mamakos Reply-To: louie@TransSys.COM To: FreeBSD-gnats-submit@freebsd.org, n_hibma@webweaving.org X-Send-Pr-Version: 3.2 Subject: kern/16315: ugen set configuration ioctl returns EIO on "normal" completeion Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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