From 9663274572ee5e2742c3de5df56ec8d8741a9978 Mon Sep 17 00:00:00 2001 From: Gareth McMullin Date: Sat, 7 Jan 2012 18:46:17 +1300 Subject: Advertise that we accept SET_LINE_CODING and ignore it on GDB interface. This fixes SetCommState failure on Windows. --- src/stm32/cdcacm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/stm32') diff --git a/src/stm32/cdcacm.c b/src/stm32/cdcacm.c index 0be7cbf..5c61eb7 100644 --- a/src/stm32/cdcacm.c +++ b/src/stm32/cdcacm.c @@ -118,7 +118,7 @@ static const struct { .bFunctionLength = sizeof(struct usb_cdc_acm_descriptor), .bDescriptorType = CS_INTERFACE, .bDescriptorSubtype = USB_CDC_TYPE_ACM, - .bmCapabilities = 0, + .bmCapabilities = 2, /* SET_LINE_CODING supported */ }, .cdc_union = { .bFunctionLength = sizeof(struct usb_cdc_union_descriptor), @@ -222,7 +222,7 @@ static const struct { .bFunctionLength = sizeof(struct usb_cdc_acm_descriptor), .bDescriptorType = CS_INTERFACE, .bDescriptorSubtype = USB_CDC_TYPE_ACM, - .bmCapabilities = 0, + .bmCapabilities = 2, /* SET_LINE_CODING supported*/ }, .cdc_union = { .bFunctionLength = sizeof(struct usb_cdc_union_descriptor), @@ -399,6 +399,9 @@ static int cdcacm_control_request(struct usb_setup_data *req, uint8_t **buf, if(*len < sizeof(struct usb_cdc_line_coding)) return 0; + if(req->wIndex == 0) + return 1; /* Ignore on GDB Port */ + if(req->wIndex != 2) return 0; -- cgit v1.2.3