Re: Random Interface numbers
Alan Stern <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Message-ID | <[email protected]> |
On Thu, 13 Sep 2007, Greg KH wrote: > > What do you think about this: > > > > http://www.microsoft.com/whdc/system/bus/USB/USBFAQ_intermed.mspx > > > Does Windows have requirements or guidelines for assigning numbers to multiple interfaces on a composite device? > > > > > > A USB device with more than one interface on the first configuration is treated as a composite device. Windows XP (prior to Service Pack 2) mandates that interface numbers follow these rules: > > > ??? Interface numbers must be zero-based. > > > ??? Interface numbers must be consecutive and increasing. It's not clear what "increasing" is supposed to mean here. Perhaps this means that the interface descriptors must be sorted by increasing order of bInterfaceNumber. The USB spec doesn't contain such a requirement. > > > Windows XP Service Pack 2 (SP2) relaxed the requirement that interface numbers be consecutive by making changes to the driver Usbccgp.sys. Beginning with SP2, interface numbers need only be increasing. It's not clear what this means either. What about the requirement that interface numbers be zero-based? > > > For additional information about interface numbers, see Microsoft Knowledge Base article 814560. > > > > > > Windows has provided support for USB composite devices since Windows 98. The driver Usbhub.sys supports composite devices on the following operating systems: > > > ??? The default value for an interface is always alternate setting zero. > > > ??? Additional alternate setting numbers must be consecutive and increasing. > > > > > > For additional information on alternate settings, see Section 9.6.5 of the USB 2.0 specification, which is available from the USB Web site at http://www.usb.org/developers/docs . It wouldn't hurt to mention Section 9.2.3 also, which contains this sentence: Interfaces are numbered from zero to one less than the number of concurrent interfaces supported by the configuration. That's pretty darn specific. However Windows apparently is willing to tolerate violations of this requirement. > I think it looks like Microsoft has to work around stupid hardware > developers just like we do :) Yep. > I'm guessing that people forgot to put a test for this in the USB > validation test suite, so they have to handle it. Because of that, > there must be devices out there in the wild that do this, so we too, > need to also handle this kind of "broken" device. > > Anyone want to make up a patch? We do handle them. usbcore will accept such devices and work correctly, but it logs some warning messages about the illegal numbering. Do we really need to change this? Alan Stern ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel