summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/usb/dump.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/hw/usb/dump.c b/hw/usb/dump.c
index 6d35d46963..b0209c1f02 100644
--- a/hw/usb/dump.c
+++ b/hw/usb/dump.c
@@ -157,11 +157,15 @@ static uint8_t get_ep_interval(USBEndpoint *ep)
assert(ep->ifnum < dev->ninterfaces);
const USBDescIface *iface = dev->ifaces[ep->ifnum];
- /* EP0 is defined as the Default control pipe */
- assert(ep->nr > 0);
- assert(ep->nr <= iface->bNumEndpoints);
- const USBDescEndpoint *uep = iface->eps + ep->nr - 1;
-
+ const USBDescEndpoint *uep = NULL;
+ int i;
+ for (i = 0; i < iface->bNumEndpoints; ++i) {
+ if ((iface->eps[i].bEndpointAddress & 15) == ep->nr) {
+ uep = &iface->eps[i];
+ break;
+ }
+ }
+ assert(uep != NULL);
return uep->bInterval;
}