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

Fix ZLP bug on CONTROL IN transfers #115

Merged

Conversation

antoinevg
Copy link
Member

@antoinevg antoinevg commented Aug 28, 2024

Cynthion requires the length field of any CONTROL IN transfer request in order to negotiate the transfer acknowledgement successfully.

This PR extends the Facedancer backend API as well as the core implementation to:

  • Provide a new USBDevice method: control_send(self, endpoint_number: int, in_request: USBControlRequest, data: bytes, *, blocking: bool = False)
  • Provide a new backend method: send_on_control_endpoint(self, endpoint_number: int, in_request: USBControlRequest, data: bytes, blocking: bool=True)
  • A backwards compatible default implementation for Facedancer boards that do not need this method which:
    • Will use the length field to truncate transfers to the requested length, fixing a long-standing bug.
    • Allows the USBControlRequest to be modified by filters in USB Proxy or custom control handlers in Facedancer devices.

Depends on: greatscottgadgets/cynthion#183


Closes #90

@mossmann mossmann self-requested a review September 5, 2024 14:51
@antoinevg antoinevg merged commit b4defce into greatscottgadgets:main Sep 16, 2024
1 check passed
@antoinevg antoinevg deleted the antoinevg/fix-facedancer-zlp-bug branch September 16, 2024 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant