Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usbus/cdc_acm: Return stall on line coding not supported #17085

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions sys/usb/usbus/cdc/acm/cdc_acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ static int _control_handler(usbus_t *usbus, usbus_handler_t *handler,
usbus_cdcacm_device_t *cdcacm = (usbus_cdcacm_device_t*)handler;
switch(setup->request) {
case USB_CDC_MGNT_REQUEST_SET_LINE_CODING:
if (!(cdcacm->coding_cb)) {
/* Line coding not supported, return STALL */
DEBUG("CDCACM: line coding not supported\n");
return -1;
}
if ((state == USBUS_CONTROL_REQUEST_STATE_OUTDATA) &&
(setup->length == sizeof(usb_req_cdcacm_coding_t))) {
size_t len = 0;
Expand Down