Advertise that we accept SET_LINE_CODING and ignore it on GDB interface.
This fixes SetCommState failure on Windows.
This commit is contained in:
parent
edaae3957a
commit
9663274572
|
@ -118,7 +118,7 @@ static const struct {
|
||||||
.bFunctionLength = sizeof(struct usb_cdc_acm_descriptor),
|
.bFunctionLength = sizeof(struct usb_cdc_acm_descriptor),
|
||||||
.bDescriptorType = CS_INTERFACE,
|
.bDescriptorType = CS_INTERFACE,
|
||||||
.bDescriptorSubtype = USB_CDC_TYPE_ACM,
|
.bDescriptorSubtype = USB_CDC_TYPE_ACM,
|
||||||
.bmCapabilities = 0,
|
.bmCapabilities = 2, /* SET_LINE_CODING supported */
|
||||||
},
|
},
|
||||||
.cdc_union = {
|
.cdc_union = {
|
||||||
.bFunctionLength = sizeof(struct usb_cdc_union_descriptor),
|
.bFunctionLength = sizeof(struct usb_cdc_union_descriptor),
|
||||||
|
@ -222,7 +222,7 @@ static const struct {
|
||||||
.bFunctionLength = sizeof(struct usb_cdc_acm_descriptor),
|
.bFunctionLength = sizeof(struct usb_cdc_acm_descriptor),
|
||||||
.bDescriptorType = CS_INTERFACE,
|
.bDescriptorType = CS_INTERFACE,
|
||||||
.bDescriptorSubtype = USB_CDC_TYPE_ACM,
|
.bDescriptorSubtype = USB_CDC_TYPE_ACM,
|
||||||
.bmCapabilities = 0,
|
.bmCapabilities = 2, /* SET_LINE_CODING supported*/
|
||||||
},
|
},
|
||||||
.cdc_union = {
|
.cdc_union = {
|
||||||
.bFunctionLength = sizeof(struct usb_cdc_union_descriptor),
|
.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))
|
if(*len < sizeof(struct usb_cdc_line_coding))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if(req->wIndex == 0)
|
||||||
|
return 1; /* Ignore on GDB Port */
|
||||||
|
|
||||||
if(req->wIndex != 2)
|
if(req->wIndex != 2)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue