Advertise that we accept SET_LINE_CODING and ignore it on GDB interface.

This fixes SetCommState failure on Windows.
This commit is contained in:
Gareth McMullin 2012-01-07 18:46:17 +13:00
parent edaae3957a
commit 9663274572
1 changed files with 5 additions and 2 deletions

View File

@ -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;