diff options
-rw-r--r-- | sys/dev/usb/controller/ehci.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/usb_device.c | 1 | ||||
-rw-r--r-- | sys/dev/usb/usb_device.h | 1 | ||||
-rw-r--r-- | sys/dev/usb/usb_hub.c | 4 |
4 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/usb/controller/ehci.c b/sys/dev/usb/controller/ehci.c index 8be6bec..e3f42d4 100644 --- a/sys/dev/usb/controller/ehci.c +++ b/sys/dev/usb/controller/ehci.c @@ -3651,8 +3651,8 @@ ehci_pipe_init(struct usb2_device *udev, struct usb2_endpoint_descriptor *edesc, if ((udev->speed != USB_SPEED_HIGH) && ((udev->hs_hub_addr == 0) || (udev->hs_port_no == 0) || - (udev->bus->devices[udev->hs_hub_addr] == NULL) || - (udev->bus->devices[udev->hs_hub_addr]->hub == NULL))) { + (udev->parent_hs_hub == NULL) || + (udev->parent_hs_hub->hub == NULL))) { /* We need a transaction translator */ goto done; } diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c index f50a29d..0217764 100644 --- a/sys/dev/usb/usb_device.c +++ b/sys/dev/usb/usb_device.c @@ -1490,6 +1490,7 @@ usb2_alloc_device(device_t parent_dev, struct usb2_bus *bus, while (hub) { if (hub->speed == USB_SPEED_HIGH) { udev->hs_hub_addr = hub->address; + udev->parent_hs_hub = hub; udev->hs_port_no = adev->port_no; break; } diff --git a/sys/dev/usb/usb_device.h b/sys/dev/usb/usb_device.h index 5ae9779..437bf8a 100644 --- a/sys/dev/usb/usb_device.h +++ b/sys/dev/usb/usb_device.h @@ -121,6 +121,7 @@ struct usb2_device { struct usb2_bus *bus; /* our USB BUS */ device_t parent_dev; /* parent device */ struct usb2_device *parent_hub; + struct usb2_device *parent_hs_hub; /* high-speed parent HUB */ struct usb2_config_descriptor *cdesc; /* full config descr */ struct usb2_hub *hub; /* only if this is a hub */ #if USB_HAVE_COMPAT_LINUX diff --git a/sys/dev/usb/usb_hub.c b/sys/dev/usb/usb_hub.c index 627d8a7..3c63f6c 100644 --- a/sys/dev/usb/usb_hub.c +++ b/sys/dev/usb/usb_hub.c @@ -1117,7 +1117,7 @@ usb2_intr_schedule_adjust(struct usb2_device *udev, int16_t len, uint8_t slot) * access. */ - hub = bus->devices[udev->hs_hub_addr]->hub; + hub = udev->parent_hs_hub->hub; if (slot >= USB_HS_MICRO_FRAMES_MAX) { slot = usb2_intr_find_best_slot(hub->uframe_usage, USB_FS_ISOC_UFRAME_MAX, 6); @@ -1232,7 +1232,7 @@ usb2_fs_isoc_schedule_isoc_time_expand(struct usb2_device *udev, isoc_time = usb2_isoc_time_expand(udev->bus, isoc_time); - hs_hub = udev->bus->devices[udev->hs_hub_addr]->hub; + hs_hub = udev->parent_hs_hub->hub; if (hs_hub != NULL) { |