usb: device: gs_usb: convert dummy endpoint to fully functional OUT ep #61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Convert the dummy endpoint to a fully functional bulk OUT endpoint in order to be compatible with gs_usb drivers selecting the first available IN/OUT endpoints for use, and introduce a Kconfig option for turning off gs_usb driver compatibility mode.
The Linux kernel gs_usb driver prior to kernel v6.12.5 uses hardcoded USB endpoint addresses 0x81 (bulk IN) and 0x02 (bulk OUT). The same assumption on USB endpoint addresses may be present in other drivers as well (e.g. python-can).
Depending on the capabilities of the USB device controller, the requested USB endpoint addresses may be rewritten by the Zephyr USB device stack at runtime. Enabling compatibility mode will include a second bulk OUT endpoint to ensure correct operation with gs_usb drivers using the hardcoded USB endpoint addresses described above.
It is safe to enable compatibility mode regardless of the driver being used, but the resulting firmware will require slightly more RAM and flash resources.