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

[rtl872x] usb: force SDK to pass recipient=interface requests by faking type=class #2638

Merged
merged 1 commit into from
Mar 28, 2023

Conversation

avtolstoy
Copy link
Member

Problem

After #2625 it seems that the Realtek SDK has new behavior again and doesn't pass even more interface requests to setup request callback.

Solution

Fake/force it to pass those requests by patching in wrapper __wrap_usb_hal_read_packet with bmRequestTypeType = SetupRequest::TYPE_CLASS. This for some reasons makes the SDK deliver these requests to our setup request callback.

Steps to Test

Build bootloader, go into DFU, test that dfu-util -d 2b04:d020 -a 1 -s 3106:192 -U p2.der works fine (involves SET_INTERFACE request).

Example App

N/A

References


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@avtolstoy avtolstoy added the bug label Mar 28, 2023
@avtolstoy avtolstoy added this to the 5.3.1 milestone Mar 28, 2023
@YutingYou
Copy link
Contributor

Below test cases passed, approved this PR to unblock release first.

  • private key dump
  • firmware update
  • open USB comm port on WIndows

I'll ask Realtek FAE why they changed the behavior and wether there is a dedicated callback.

@avtolstoy avtolstoy merged commit 9dd5fef into develop Mar 28, 2023
@avtolstoy avtolstoy deleted the fix/rtl872x-usb-pass-interface-request branch March 28, 2023 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants