summaryrefslogtreecommitdiff
path: root/chip/stm32/usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/stm32/usb.c')
-rw-r--r--chip/stm32/usb.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/chip/stm32/usb.c b/chip/stm32/usb.c
index ea26eeb93d..1dfb24e0ff 100644
--- a/chip/stm32/usb.c
+++ b/chip/stm32/usb.c
@@ -19,12 +19,23 @@
/* Console output macro */
#define CPRINTF(format, args...) cprintf(CC_USB, format, ## args)
+#ifdef CONFIG_USB_BOS
+/* v2.01 (vs 2.00) BOS Descriptor provided */
+#define USB_DEV_BCDUSB 0x0201
+#else
+#define USB_DEV_BCDUSB 0x0200
+#endif
+
+#ifndef USB_DEV_CLASS
+#define USB_DEV_CLASS USB_CLASS_PER_INTERFACE
+#endif
+
/* USB Standard Device Descriptor */
static const struct usb_device_descriptor dev_desc = {
.bLength = USB_DT_DEVICE_SIZE,
.bDescriptorType = USB_DT_DEVICE,
- .bcdUSB = 0x0200, /* v2.00 */
- .bDeviceClass = USB_CLASS_PER_INTERFACE,
+ .bcdUSB = USB_DEV_BCDUSB,
+ .bDeviceClass = USB_DEV_CLASS,
.bDeviceSubClass = 0x00,
.bDeviceProtocol = 0x00,
.bMaxPacketSize0 = USB_MAX_PACKET_SIZE,
@@ -102,6 +113,12 @@ static void ep0_rx(void)
STM32_TOGGLE_EP(0, EP_TX_RX_MASK, EP_TX_RX_VALID,
EP_STATUS_OUT /*null OUT transaction */);
break;
+#ifdef CONFIG_USB_BOS
+ case USB_DT_BOS: /* Setup : Get BOS descriptor */
+ desc = bos_ctx.descp;
+ len = bos_ctx.size;
+ break;
+#endif
case USB_DT_STRING: /* Setup : Get string descriptor */
if (idx >= USB_STR_COUNT) {
/* The string does not exist : STALL */