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

usbhost: recognize sim usb cdcacm composite device #206

Merged
merged 1 commit into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
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
11 changes: 9 additions & 2 deletions drivers/usbhost/usbhost_cdcacm.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ static bool usbhost_txempty(FAR struct uart_dev_s *uartdev);
* device.
*/

static const struct usbhost_id_s g_id[4] =
static const struct usbhost_id_s g_id[5] =
{
{
USB_CLASS_CDC, /* base */
Expand All @@ -385,6 +385,13 @@ static const struct usbhost_id_s g_id[4] =
0, /* vid */
0 /* pid */
},
{
USB_CLASS_CDC, /* base */
CDC_SUBCLASS_ACM, /* subclass */
CDC_PROTO_NONE, /* proto */
0, /* vid */
0 /* pid */
},
{
USB_CLASS_CDC, /* base */
CDC_SUBCLASS_ACM, /* subclass */
Expand Down Expand Up @@ -414,7 +421,7 @@ static struct usbhost_registry_s g_cdcacm =
{
NULL, /* flink */
usbhost_create, /* create */
4, /* nids */
5, /* nids */
&g_id[0] /* id[] */
};

Expand Down
8 changes: 5 additions & 3 deletions drivers/usbhost/usbhost_composite.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,15 +590,17 @@ int usbhost_composite(FAR struct usbhost_hubport_s *hport,

if (desc->type == USB_DESC_TYPE_INTERFACE)
{
#ifdef CONFIG_DEBUG_ASSERTIONS
FAR struct usb_ifdesc_s *ifdesc =
(FAR struct usb_ifdesc_s *)desc;

DEBUGASSERT(ifdesc->ifno < 32);
#endif

/* Increment the count of interfaces */

nintfs++;
if (ifdesc->alt == 0)
{
nintfs++;
}
}

/* Check for IAD descriptors that will be used when it is
Expand Down
Loading