usb/94946: [uhub][patch] code dynamic status size for status change
endpoint
Lonnie Mendez
lmendez19 at austin.rr.com
Sun Mar 26 09:00:52 UTC 2006
>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 at 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:
More information about the freebsd-usb
mailing list