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

Error reporting of control read requests is not quite per spec #341

Open
xross opened this issue Mar 3, 2022 · 0 comments
Open

Error reporting of control read requests is not quite per spec #341

xross opened this issue Mar 3, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@xross
Copy link
Contributor

xross commented Mar 3, 2022

For a bad Control Write Request (say an unrecognised SetSampleFreq) where the expected transaction sequence from host is as follows:

SETUP
OUT (Data stage)
IN (Status stage)

we currently would mark the control EP as halted after the SETUP, therefore responding to the OUT will a STALL (i.e the data stage)

The spec essentially defines two errors:

  • Device cannot fulfil the request - STALL the Status stage
  • Too much data is sent of requested from the device - STALL the Data stage

The spec is a little ambiguous in that in table 8-7 it states the the STALL is sent in the data phase when the function has an error. This seems to contradict the text.

My interpretation of the text is that in this case the device should accept the data stage but STALL the status stage.

Note, if we wish to stall reliably on too much data sent/requested we will probably need need to encapsulate the GetSetupBuffer() function further - GetControlData() for example. This would perform the checking and stall as appropriate.

Note, table 8-7 for "Control Read transfers" also reads "sent during the handshake phase". I assume this should be "sent during the status phase"

Ultimately this issue is probably low impact, a STALL is still issued from the device, just possibly at the wrong time. The end result is likely the same, that is the host moves to the next control request.

@xross xross added the bug Something isn't working label Mar 3, 2022
@xross xross self-assigned this Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant