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

drivers/usbdev: minor update for cdcacm #13481

Merged
merged 3 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
cdcacm: Add cdcacm bulkout request buffer config
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
  • Loading branch information
Donny9 committed Sep 15, 2024
commit fdf90327bb113ffd24fb207a23bd7d205f994a40
8 changes: 8 additions & 0 deletions drivers/usbdev/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,14 @@ config CDCACM_NWRREQS
---help---
The number of write/read requests that can be in flight

config CDCACM_BULKOUT_REQLEN
int "Size of one read request buffer"
default 512 if USBDEV_DUALSPEED
default 256 if !USBDEV_DUALSPEED
---help---
Read buffer size maybe larger than the maxpacket size. Increasing
the buffer size can effectively improve the transmission speed.

config CDCACM_BULKIN_REQLEN
int "Size of one write request buffer"
default 768 if USBDEV_DUALSPEED
Expand Down
7 changes: 6 additions & 1 deletion drivers/usbdev/cdcacm.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ static int cdcacm_requeue_rdrequest(FAR struct cdcacm_dev_s *priv,
/* Requeue the read request */

ep = priv->epbulkout;
req->len = ep->maxpacket;
req->len = MAX(CONFIG_CDCACM_BULKOUT_REQLEN, ep->maxpacket);
ret = EP_SUBMIT(ep, req);
if (ret != OK)
{
Expand Down Expand Up @@ -1334,6 +1334,11 @@ static int cdcacm_bind(FAR struct usbdevclass_driver_s *driver,
reqlen = CONFIG_CDCACM_EPBULKOUT_FSSIZE;
}

if (CONFIG_CDCACM_BULKOUT_REQLEN > reqlen)
{
reqlen = CONFIG_CDCACM_BULKOUT_REQLEN;
}

for (i = 0; i < CONFIG_CDCACM_NRDREQS; i++)
{
rdcontainer = &priv->rdreqs[i];
Expand Down