Browse Source

usb: accept usb3 control requests

Windows 10 reportedly sends these, so accept them in case
the device in question is a superspeed (usb3) device.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 1485870727-21956-2-git-send-email-kraxel@redhat.com
Gerd Hoffmann 8 năm trước cách đây
mục cha
commit
811ad5d8f1
2 tập tin đã thay đổi với 9 bổ sung0 xóa
  1. 7 0
      hw/usb/desc.c
  2. 2 0
      include/hw/usb.h

+ 7 - 0
hw/usb/desc.c

@@ -774,6 +774,13 @@ int usb_desc_handle_control(USBDevice *dev, USBPacket *p,
         trace_usb_set_device_feature(dev->addr, value, ret);
         trace_usb_set_device_feature(dev->addr, value, ret);
         break;
         break;
 
 
+    case DeviceOutRequest | USB_REQ_SET_SEL:
+    case DeviceOutRequest | USB_REQ_SET_ISOCH_DELAY:
+        if (dev->speed == USB_SPEED_SUPER) {
+            ret = 0;
+        }
+        break;
+
     case InterfaceRequest | USB_REQ_GET_INTERFACE:
     case InterfaceRequest | USB_REQ_GET_INTERFACE:
         if (index < 0 || index >= dev->ninterfaces) {
         if (index < 0 || index >= dev->ninterfaces) {
             break;
             break;

+ 2 - 0
include/hw/usb.h

@@ -135,6 +135,8 @@
 #define USB_REQ_GET_INTERFACE		0x0A
 #define USB_REQ_GET_INTERFACE		0x0A
 #define USB_REQ_SET_INTERFACE		0x0B
 #define USB_REQ_SET_INTERFACE		0x0B
 #define USB_REQ_SYNCH_FRAME		0x0C
 #define USB_REQ_SYNCH_FRAME		0x0C
+#define USB_REQ_SET_SEL                 0x30
+#define USB_REQ_SET_ISOCH_DELAY         0x31
 
 
 #define USB_DEVICE_SELF_POWERED		0
 #define USB_DEVICE_SELF_POWERED		0
 #define USB_DEVICE_REMOTE_WAKEUP	1
 #define USB_DEVICE_REMOTE_WAKEUP	1