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

cdcacm: Add the interface assoc descriptor to the length #12535

Merged
merged 1 commit into from
Oct 22, 2019

Conversation

bergzand
Copy link
Member

Contribution description

The interface association descriptor length must be included in the descriptor length claimed by the descriptor generator, otherwise the USB stack will report an incorrect total descriptor length.

Testing procedure

Before this PR tests/usbus_cdc_acm_stdio should be either broken or the Linux kernel should report something along the lines of:

[415964.073466] usb 1-9.2.2: new full-speed USB device number 113 using xhci_hcd
[415964.151103] usb 1-9.2.2: config 1 has an invalid descriptor of length 7, skipping remainder of the config
[415964.151111] usb 1-9.2.2: config 1 interface 1 altsetting 0 has 0 endpoint descriptors, different from the interface descriptor's value: 2
[415964.151779] usb 1-9.2.2: New USB device found, idVendor=1209, idProduct=0001, bcdDevice= 0.00
[415964.151784] usb 1-9.2.2: New USB device strings: Mfr=3, Product=2, SerialNumber=0
[415964.151787] usb 1-9.2.2: Product: USB device
[415964.151790] usb 1-9.2.2: Manufacturer: RIOT-os.org
[415964.156518] cdc_acm: probe of 1-9.2.2:1.0 failed with error -22

This PR fixes that.

Issues/PRs references

Broken by #12430

@bergzand bergzand added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: USB Area: Universal Serial Bus labels Oct 21, 2019
@bergzand bergzand requested review from benpicco and dylad October 21, 2019 18:32
Copy link
Member

@chrysn chrysn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirming that the misbehavior was recently introduced in master, and is fixed by this patch. History confirmed on a custom board branch with the saul example (CDC-ACM only), tested also in combination with CDC-ECM in the gcoap example.

Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proxy-ACK. You know better than I what you are doing ;-)

@miri64 miri64 merged commit 789cbb9 into RIOT-OS:master Oct 22, 2019
@dylad dylad added this to the Release 2020.01 milestone Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: USB Area: Universal Serial Bus CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants