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

Gracefully handle SETUP packets whose wLength > 255. #1

Merged
merged 1 commit into from Jan 6, 2021

Conversation

cr1901
Copy link

@cr1901 cr1901 commented Jan 5, 2021

This isn't an exactly elegant solution, but since this device isn't responding to SETUP xfers with > 255 bytes anyway, I think saturating wLength to 255 is a reasonable solution.

The old behavior was to send back wLength % 256 bytes. At least for this device, Windows will deliberately send a SETUP packet w/ length > 255- 265 in my case. The device responds with 9 bytes only, which is 265 % 256. This is legal per USB, but the Windows driver interprets this as a malfunctioning device.

By forcing wLength to 255, we still don't send 255 bytes back, but we at least send all the data back we mean to send.

@enjoy-digital enjoy-digital merged commit 912d8e6 into litex-hub:hw_cdc_eptri Jan 6, 2021
@enjoy-digital
Copy link
Member

Thanks @cr1901 for reporting and investigating on this, this is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants