]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
usb-host: fix streams detection in usb_host_speed_compat
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 9 Sep 2016 07:41:30 +0000 (09:41 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 13 Sep 2016 07:19:26 +0000 (09:19 +0200)
The companion descriptor is present on all usb3 devices, not only
those with streams support.  We need to check attributes to see
whenever the device uses streams or not.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 1473406890-30164-1-git-send-email-kraxel@redhat.com

hw/usb/host-libusb.c

index e94672c15563e77b9a5b1fb099ebd3692c3a2e4a..bd81d71a98f6843ae0cab6f50d6b5759821b0adb 100644 (file)
@@ -743,10 +743,13 @@ static void usb_host_speed_compat(USBHostDevice *s)
                         rc = libusb_get_ss_endpoint_companion_descriptor
                             (ctx, endp, &endp_ss_comp);
                         if (rc == LIBUSB_SUCCESS) {
+                            int streams = endp_ss_comp->bmAttributes & 0x1f;
+                            if (streams) {
+                                compat_full = false;
+                                compat_high = false;
+                            }
                             libusb_free_ss_endpoint_companion_descriptor
                                 (endp_ss_comp);
-                            compat_full = false;
-                            compat_high = false;
                         }
 #endif
                         break;