-
Notifications
You must be signed in to change notification settings - Fork 7.6k
drivers: uhc: uhc_mcux_common: add direction handling for non-setup packet #91924
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
base: main
Are you sure you want to change the base?
Conversation
…ackets added logic to determine the direction of USB transfers for non-setup packets using the endpoint direction. This ensures proper handling of USB_IN and USB_OUT directions. Signed-off-by: Richard Yim <[email protected]>
|
@yimjiajun , were you seeing any failures? |
yes, when sending to an endpoint other than 0 and not using standard request packet, the first byte is no longer bmRequestType. Therefore, the direction bit is not predictable in the same way. For example, in bulk transfers, an OUT token is might always used, even if the endpoint is configured with an IN direction. |
That must be some rather strange HAL design decision, it is definitely not how USB works. OUT token is only used for bulk OUT endpoints. |
The OUT token can be used for interrupt or bulk either control transfers. it’s not limited to bulk transfers. In USB, bit 7 of the endpoint address (bEndpointAddress) indicates the direction of the endpoint: |
to ensure proper processing by the SDK, logic has been enhanced to correctly determine the direction of non-setup USB transfers using the endpoint direction. This guarantees that USB_IN and USB_OUT directions are handled accurately, especially for bulk and other non-setup request packets.