-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Set Class,Subclass,Protocol in USB Device Descriptor #957
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
Conversation
Also, strictly speaking, the first interface number should be 0, so |
Thanks, but I am reluctant to change things in the USB driver if there is not a specific bug to fix. I vaguely remember reading somewhere that you should use all 0's for these 3 values to improve compatibility across Linux/Mac/Windows. But, I may be remembering wrong :) Have you found a bug that this patch fixes? Have you tested the patch?
Actually, CDC_IFACE_NUM is the number of the first interface for the CDC, not the total number of interfaces. So these numbers are correct. |
No it's just that if there are numbers allocated for this specifically, I don't know maybe they should be used. And yes done some testing (on Linux/Windows could test more) no problems, I was just looking at the USB enumeration with USBlyzer on Windows, while trying some stuff, and it flagged some issues (let me send you a screen cap/report later or you could try it) this was one of them, the other one is that the first interface in a configuration descriptor should be 0.
That's not the point, it's the first interface in the config descriptor so its index should be 0, and then 1 (for the second CDC/data interface) and then MSC/HID should be 2. |
This is something I tried and found didn't work (on Window, Mac or Linux, I can't remember). I really does need to be the way it is currently to work (MSC second but with lower IFACE number). Maybe with your other patch, and also filling in some zeros in USBD_CDC_MSC_HID_DeviceQualifierDesc, it'll work with MSC described first... this needs a lot of testing. To test properly I need to have multiple OS in front of me with different versions of Windows and Mac and try them all. |
I got that working fine on Linux/Windows without any flags from USBLyzer, anyway, I have a Windows 7 VM around, and I'll probably apply those patches to my branch anyway, and do more testing, if this PR is still around I will send you more updates. |
Ok, thanks! I'll keep this open until I get a chance to test the changes properly. |
Apparently the order of interface numbers should be sequential and increasing in a config descriptor. So as to retain compatibility with Windows drivers for the CDC+MSC and CDC+HID modes, we move the CDC configs to the end of the descriptors, instead of changing the interface numbers. See PR #957 for background.
This is now implemented in 39ce2db. |
BTW I've tested those values on Arch, Ubuntu and Win7 32/64 looks good |
Great! I also adjusted the numbering of the interfaces, as you suggested. See 65af7eb. |
Composite Devices with IADs should use those values, see USB Interface Association Descriptor:
And