summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann2021-01-21 16:08:32 +0100
committerGerd Hoffmann2021-01-22 14:51:35 +0100
commit2980a316734c420e7398aec026909dcfc8614c1d (patch)
tree5f1c30bca7461c74fdb80ae941adae550aea8d1b
parentusb: add pcap support. (diff)
downloadqemu-2980a316734c420e7398aec026909dcfc8614c1d.tar.gz
qemu-2980a316734c420e7398aec026909dcfc8614c1d.tar.xz
qemu-2980a316734c420e7398aec026909dcfc8614c1d.zip
usb-host: map LIBUSB_SPEED_SUPER_PLUS to USB_SPEED_SUPER
Handle host superspeedplus (usb 3.1+) devices like superspeed (usb 3.0) devices. That is enough to get them handled properly by xhci. They show up as superspeed devices inside the guest, but should be able to actually run at higher speeds. Reported-by: Angel Pagan <Angel.Pagan@stratus.com> Tested-by: Angel Pagan <Angel.Pagan@stratus.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-Id: <20210121150832.3564097-1-kraxel@redhat.com>
-rw-r--r--hw/usb/host-libusb.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index 295d20227a..7dde3d1206 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -179,6 +179,9 @@ static void usb_host_attach_kernel(USBHostDevice *s);
#if LIBUSB_API_VERSION >= 0x01000103
# define HAVE_STREAMS 1
#endif
+#if LIBUSB_API_VERSION >= 0x01000106
+# define HAVE_SUPER_PLUS 1
+#endif
static const char *speed_name[] = {
[LIBUSB_SPEED_UNKNOWN] = "?",
@@ -186,6 +189,9 @@ static const char *speed_name[] = {
[LIBUSB_SPEED_FULL] = "12",
[LIBUSB_SPEED_HIGH] = "480",
[LIBUSB_SPEED_SUPER] = "5000",
+#ifdef HAVE_SUPER_PLUS
+ [LIBUSB_SPEED_SUPER_PLUS] = "5000+",
+#endif
};
static const unsigned int speed_map[] = {
@@ -193,6 +199,9 @@ static const unsigned int speed_map[] = {
[LIBUSB_SPEED_FULL] = USB_SPEED_FULL,
[LIBUSB_SPEED_HIGH] = USB_SPEED_HIGH,
[LIBUSB_SPEED_SUPER] = USB_SPEED_SUPER,
+#ifdef HAVE_SUPER_PLUS
+ [LIBUSB_SPEED_SUPER_PLUS] = USB_SPEED_SUPER,
+#endif
};
static const unsigned int status_map[] = {
@@ -964,8 +973,14 @@ static int usb_host_open(USBHostDevice *s, libusb_device *dev, int hostfd)
libusb_speed = LIBUSB_SPEED_HIGH;
break;
case 5: /* super */
+ libusb_speed = LIBUSB_SPEED_SUPER;
+ break;
case 6: /* super plus */
+#ifdef HAVE_SUPER_PLUS
+ libusb_speed = LIBUSB_SPEED_SUPER_PLUS;
+#else
libusb_speed = LIBUSB_SPEED_SUPER;
+#endif
break;
}
}