aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2007-06-29 20:34:42 +0000
committerWarner Losh <imp@FreeBSD.org>2007-06-29 20:34:42 +0000
commit57c02fd5486b6a77211d078630b81dd5ddfacf85 (patch)
treeaf8ad444e2a61f7c26e3cb7e8f9ccbfb7c38b41f /sys/dev/usb
parentf43bbab9a85156989ce3f8c63f54b88b80127b30 (diff)
downloadsrc-57c02fd5486b6a77211d078630b81dd5ddfacf85.tar.gz
src-57c02fd5486b6a77211d078630b81dd5ddfacf85.zip
Change uhub to dynamic status size for status change endpoint. From a
pr, the submitter says: 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. Submitted by: Lonnie Mendez PR: 94946 Approved by: re@ (blanket)
Notes
Notes: svn path=/head/; revision=171091
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/uhub.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c
index aac0bfe49031..26defca9e003 100644
--- a/sys/dev/usb/uhub.c
+++ b/sys/dev/usb/uhub.c
@@ -83,7 +83,7 @@ struct uhub_softc {
device_t 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 @@ uhub_attach(device_t self)
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) {
device_printf(sc->sc_dev, "cannot open interrupt pipe\n");
goto bad;