summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2007-06-29 20:34:42 +0000
committerimp <imp@FreeBSD.org>2007-06-29 20:34:42 +0000
commit981a651b4c5509498b3baacbe4f3b72f56954ee7 (patch)
treeaf8ad444e2a61f7c26e3cb7e8f9ccbfb7c38b41f /sys
parent3bf4959688a82d8eb9b5c7caf17dbdd043102e3e (diff)
downloadFreeBSD-src-981a651b4c5509498b3baacbe4f3b72f56954ee7.zip
FreeBSD-src-981a651b4c5509498b3baacbe4f3b72f56954ee7.tar.gz
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)
Diffstat (limited to 'sys')
-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 aac0bfe..26defca 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;
OpenPOWER on IntegriCloud