Skip to content

Conversation

iabdalkader
Copy link
Contributor

Composite Devices with IADs should use those values, see USB Interface Association Descriptor:

The USB-IF core team has devised a special class and protocol code set that notifies the operating system that one or more IADs are present in device firmware. A device's device descriptor must have the values that appear in the following table or else the operating system will not detect the device's IADs or group the device's interfaces properly.

And

These code values also alert versions of Windows that do not support IADs to install a special-purpose bus driver that correctly enumerates the device. Without these codes in the device descriptor, the system might fail to enumerate the device, or the device might not work properly

@iabdalkader
Copy link
Contributor Author

Also, strictly speaking, the first interface number should be 0, so CDC_IFACE_NUM=0 and MSC_IFACE_NUM=2 (CDC has 2 interfaces)

@dpgeorge
Copy link
Member

dpgeorge commented Nov 5, 2014

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?

Also, strictly speaking, the first interface number should be 0, so CDC_IFACE_NUM=0 and MSC_IFACE_NUM=2 (CDC has 2 interfaces)

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.

@iabdalkader
Copy link
Contributor Author

Have you found a bug that this patch fixes? Have you tested the patch?

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.

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.

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.

@dpgeorge
Copy link
Member

dpgeorge commented Nov 5, 2014

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.

@iabdalkader
Copy link
Contributor Author

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.

@dpgeorge
Copy link
Member

dpgeorge commented Nov 5, 2014

... 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.

@dpgeorge dpgeorge mentioned this pull request Jan 12, 2015
9 tasks
dpgeorge added a commit that referenced this pull request Feb 13, 2015
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.
@dpgeorge
Copy link
Member

This is now implemented in 39ce2db.

@dpgeorge dpgeorge closed this Feb 13, 2015
@iabdalkader
Copy link
Contributor Author

BTW I've tested those values on Arch, Ubuntu and Win7 32/64 looks good

@dpgeorge
Copy link
Member

Great! I also adjusted the numbering of the interfaces, as you suggested. See 65af7eb.

@iabdalkader iabdalkader deleted the usb_dev_desc branch July 19, 2015 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants