Windows: fix communication with hubs
authorPete Batard <pete@akeo.ie>
Mon, 19 Sep 2011 14:45:35 +0000 (15:45 +0100)
committerPeter Stuge <peter@stuge.se>
Mon, 17 Oct 2011 14:25:51 +0000 (16:25 +0200)
* issue reported by RenĂ© Haunstrup in http://marc.info/?m=130503019227814

libusb/os/windows_usb.c

index a96c8c4..bf1b9c6 100644 (file)
@@ -1446,6 +1446,7 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered
                                priv->depth = UINT8_MAX;        // Overflow to 0 for HCD Hubs
                                priv->path = dev_interface_path; dev_interface_path = NULL;
                                break;
+                       case HUB_PASS:
                        case DEV_PASS:
                                // If the device has already been setup, don't do it again
                                if (priv->path != NULL)
@@ -1455,6 +1456,7 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered
                                priv->apib = &usb_api_backend[api];
                                switch(api) {
                                case USB_API_COMPOSITE:
+                               case USB_API_HUB:
                                        break;
                                default:
                                        // For other devices, the first interface is the same as the device
@@ -1470,10 +1472,6 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered
                                        break;
                                }
                                break;
-                       case HUB_PASS:
-                               priv->apib = &usb_api_backend[api];
-                               priv->path = dev_interface_path; dev_interface_path = NULL;
-                               break;
                        case GEN_PASS:
                                r = init_device(dev, parent_dev, (uint8_t)port_nr, dev_id_path, dev_info_data.DevInst);
                                if (r == LIBUSB_SUCCESS) {