aboutsummaryrefslogtreecommitdiffstats
path: root/executor
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2019-09-19 18:42:17 +0200
committerAndrey Konovalov <andreyknvl@gmail.com>2019-09-19 19:31:56 +0200
commit0c00210ff32f64808e2ab7a38feae960f3981ccf (patch)
tree4099d896bcb6757464a51763d394c2d8588f38dc /executor
parentb4680d8341733f48295ccf188f109cf69027a3f9 (diff)
executor: always provide DEVICE_QUALIFIER USB descriptor
Diffstat (limited to 'executor')
-rw-r--r--executor/common_usb.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/executor/common_usb.h b/executor/common_usb.h
index 6e181836e..c4b9e96ac 100644
--- a/executor/common_usb.h
+++ b/executor/common_usb.h
@@ -236,6 +236,22 @@ static bool lookup_connect_response(struct vusb_connect_descriptors* descs, stru
*response_length = descs->bos_len;
return true;
case USB_DT_DEVICE_QUALIFIER:
+ if (!descs->qual) {
+ // Fill in DEVICE_QUALIFIER based on DEVICE if not provided.
+ struct usb_qualifier_descriptor* qual =
+ (struct usb_qualifier_descriptor*)response_data;
+ qual->bLength = sizeof(*qual);
+ qual->bDescriptorType = USB_DT_DEVICE_QUALIFIER;
+ qual->bcdUSB = index->dev->bcdUSB;
+ qual->bDeviceClass = index->dev->bDeviceClass;
+ qual->bDeviceSubClass = index->dev->bDeviceSubClass;
+ qual->bDeviceProtocol = index->dev->bDeviceProtocol;
+ qual->bMaxPacketSize0 = index->dev->bMaxPacketSize0;
+ qual->bNumConfigurations = index->dev->bNumConfigurations;
+ qual->bRESERVED = 0;
+ *response_length = sizeof(*qual);
+ return true;
+ }
*response_data = descs->qual;
*response_length = descs->qual_len;
return true;