Skip to content

Commit 4875aa3

Browse files
jfischer-nofabiobaltieri
authored andcommitted
usb: device_next: limit CDC ACM OUT transfer size to the current MPS
When the controller is connected to a full speed bus, regardless of whether the controller supports high speed or not, the transfer size for the bulk OUT endpoint should be equal to the MPS in the current configuration. Signed-off-by: Johann Fischer <[email protected]>
1 parent ece1f51 commit 4875aa3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

subsys/usb/device_next/class/usbd_cdc_acm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,9 @@ static void cdc_acm_rx_fifo_handler(struct k_work *work)
596596
return;
597597
}
598598

599+
/* Shrink the buffer size if operating on a full speed bus */
600+
buf->size = MIN(cdc_acm_get_bulk_mps(c_data), buf->size);
601+
599602
ret = usbd_ep_enqueue(c_data, buf);
600603
if (ret) {
601604
LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep);

0 commit comments

Comments
 (0)