From 7262ab7364d4c326d10848e17ed0621d1a6e27a8 Mon Sep 17 00:00:00 2001 From: ZYH Date: Fri, 16 Mar 2018 18:40:07 +0800 Subject: [PATCH] =?UTF-8?q?[Components][USB=20Device]=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=A4=8D=E5=90=88=E8=AE=BE=E5=A4=87=E5=AF=B9HS=E7=9A=84?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/drivers/usb/usbdevice/core/usbdevice.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/components/drivers/usb/usbdevice/core/usbdevice.c b/components/drivers/usb/usbdevice/core/usbdevice.c index 10ffac8ad0..453084990b 100644 --- a/components/drivers/usb/usbdevice/core/usbdevice.c +++ b/components/drivers/usb/usbdevice/core/usbdevice.c @@ -59,6 +59,20 @@ static struct udevice_descriptor compsit_desc = USB_STRING_SERIAL_INDEX, //iSerialNumber; USB_DYNAMIC, //bNumConfigurations; }; + +//FS and HS needed +static struct usb_qualifier_descriptor dev_qualifier = +{ + sizeof(dev_qualifier), //bLength + USB_DESC_TYPE_DEVICEQUALIFIER, //bDescriptorType + 0x0200, //bcdUSB + USB_CLASS_MISC, //bDeviceClass + 0x02, //bDeviceSubClass + 0x01, //bDeviceProtocol + 64, //bMaxPacketSize0 + 0x01, //bNumConfigurations + 0, +}; #endif struct usb_os_comp_id_descriptor usb_comp_id_desc = @@ -169,6 +183,7 @@ rt_err_t rt_usb_device_init(void) #ifdef RT_USB_DEVICE_COMPOSITE rt_usbd_device_set_descriptor(udevice, &compsit_desc); rt_usbd_device_set_string(udevice, ustring); + rt_usbd_device_set_qualifier(device, &dev_qualifier); #else rt_usbd_device_set_descriptor(udevice, func->dev_desc); #endif