Date: Sun, 26 Mar 2006 08:53:09 GMT From: Lonnie Mendez <lmendez19@austin.rr.com> To: freebsd-gnats-submit@FreeBSD.org Subject: usb/94946: [uhub][patch] code dynamic status size for status change endpoint Message-ID: <200603260853.k2Q8r9la000434@www.freebsd.org> Resent-Message-ID: <200603260900.k2Q90YaT055196@freefall.freebsd.org>
index | next in thread | raw e-mail
>Number: 94946
>Category: usb
>Synopsis: [uhub][patch] code dynamic status size for status change endpoint
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-usb
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Mar 26 09:00:34 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Lonnie Mendez
>Release: 6.1-BETA2
>Organization:
>Environment:
FreeBSD twind 6.1-BETA2 FreeBSD 6.1-BETA2 #4: Fri Mar 10 22:09:38 CST 2006 root@twind:/usr/src/sys/i386/compile/MYKERNEL i386
>Description:
Found this while running freebsd as guest in qemu with -usb parameter. The patch implements the missing dynamic size based on number of ports a hub has.
>How-To-Repeat:
>Fix:
Index: sys/dev/usb/uhub.c
@@ -84,7 +84,7 @@
USBBASEDEVICE sc_dev; /* base device */
usbd_device_handle sc_hub; /* USB device */
usbd_pipe_handle sc_ipipe; /* interrupt pipe */
- u_int8_t sc_status[1]; /* xxx more ports */
+ u_int8_t sc_status[32]; /* max 255 ports */
u_char sc_running;
};
#define UHUB_PROTO(sc) ((sc)->sc_hub->ddesc.bDeviceProtocol)
@@ -279,7 +279,7 @@
err = usbd_open_pipe_intr(iface, ed->bEndpointAddress,
USBD_SHORT_XFER_OK, &sc->sc_ipipe, sc, sc->sc_status,
- sizeof(sc->sc_status), uhub_intr, UHUB_INTR_INTERVAL);
+ (nports + 1 + 7) / 8, uhub_intr, UHUB_INTR_INTERVAL);
if (err) {
printf("%s: cannot open interrupt pipe\n",
USBDEVNAME(sc->sc_dev));
>Release-Note:
>Audit-Trail:
>Unformatted:
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603260853.k2Q8r9la000434>
