Skip to content

Conversation

@santhosh-c-c
Copy link

WIP : Add support for the USB CDC ECM (Ethernet Control Model) class to the USB host subsystem. This implementation enables virtual Ethernet functionality for USB host devices.

This is draft PR, few changes to be made.

Signed-off-by: Santhosh Charles [email protected]

Josuah Demangeon and others added 8 commits November 7, 2025 20:48
Add a "struct usbh_status" that contains a bitmask of flags to keep
track of the global state of the host context, like done for the
device_next implementation.

Signed-off-by: Josuah Demangeon <[email protected]>
Add a "struct usbh_class_api" for the host implementation, and move all
the function poitners to it. Add more fields to "struct usbh_class_data".

Signed-off-by: Josuah Demangeon <[email protected]>
Add API wrappers around the function pointers in struct usbh_class_api,
while also documenting the USB host class internal API.

Signed-off-by: Josuah Demangeon <[email protected]>
Add functions to probe/remove all classes as part of a new usbh_class.c
and a matching usbh_class.h. These functions are called from the function
usbh_init_device_intl() in usbh_core.c to initialize every class upon
connection of a device. Every class driver provide filters to match the
interfaces of the device.

Co-authored-by: Aiden Hu <[email protected]>
Signed-off-by: Josuah Demangeon <[email protected]>
Allocate extra room at the end of the USB descriptor buffer to ensure
that the device ends with `desc->bLength == 0`. For now, validating
`desc->bLength` from the device to ensure no access past the buffer
is still not done.

Signed-off-by: Josuah Demangeon <[email protected]>
Introduce subsys/usb/common as a new directory intended to hold
sources and configuration that are shared between USB host and device
implementations. Integrate the new common directory into the build
system.

Signed-off-by: Santhosh Charles <[email protected]>
Signed-off-by: Josuah Demangeon <[email protected]>
Add devicetree binding file describing the USB Host CDC Ethernet
Control Model (ECM) implementation for Zephyr.

Signed-off-by: Santhosh Charles <[email protected]>
Add support for the USB CDC ECM (Ethernet Control Model) class to the
USB host subsystem. This implementation enables virtual Ethernet
functionality for USB host devices.

Signed-off-by: Santhosh Charles <[email protected]>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 7, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant