Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results
The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
This really is a Windows question, but I need to give you some background.
I have a device that enumerates on a non-x86 Linux systems. I suspect the DesignWare USB3 IP core, more common on non-x86 systems, is better supported on Linux by way of finding itself in Android devices and having code contributors with access to NDA gated documents. On the AMD64 Linux systems I have the device does not enumerate via USB3 but can enumerate via USB2. I was hoping to get some information from an AMD64 Windows system I have, but all USBView can report is a malformed configuration descriptor.
Can anyone clarify if that actually is the issue, and if it is not, what steps I might take to diagnose further? It feels likely I am encountering bugs in both operating systems or in hardware.
Endpoints as seen by ARM64 Linux, though keep in mind most enumerations fail:
$ lsusb -t /: Bus 06.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M |__ Port 1: Dev 36, If 0, Class=Communications, Driver=cdc_ncm, 5000M |__ Port 1: Dev 36, If 1, Class=CDC Data, Driver=cdc_ncm, 5000M |__ Port 1: Dev 36, If 2, Class=Vendor Specific Class, Driver=, 5000M |__ Port 1: Dev 36, If 3, Class=Vendor Specific Class, Driver=, 5000M
$ sudo lsusb -vv -d 1d6b:0104 Bus 006 Device 036: ID 1d6b:0104 Linux Foundation Multifunction Composite Gadget Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 3.20 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 9 idVendor 0x1d6b Linux Foundation idProduct 0x0104 Multifunction Composite Gadget bcdDevice 0.01 iManufacturer 1 Firstname Lastname iProduct 2 Gadget iSerial 3 0000000000 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x00be bNumInterfaces 4 bConfigurationValue 1 iConfiguration 4 Default Configuration bmAttributes 0x80 (Bus Powered) MaxPower 0mA Interface Association: bLength 8 bDescriptorType 11 bFirstInterface 0 bInterfaceCount 2 bFunctionClass 2 Communications bFunctionSubClass 13 bFunctionProtocol 0 iFunction 8 CDC NCM Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 2 Communications bInterfaceSubClass 13 bInterfaceProtocol 0 iInterface 5 CDC Network Control Model (NCM) CDC Header: bcdCDC 1.10 CDC Union: bMasterInterface 0 bSlaveInterface 1 CDC Ethernet: iMacAddress 6 aaea38b1911d bmEthernetStatistics 0x00000000 wMaxSegmentSize 1514 wNumberMCFilters 0x0000 bNumberPowerFilters 0 CDC NCM: bcdNcmVersion 1.00 bmNetworkCapabilities 0x11 crc mode packet filter Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0010 1x 16 bytes bInterval 9 bMaxBurst 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 10 CDC Data bInterfaceSubClass 0 bInterfaceProtocol 1 iInterface 7 CDC Network Data Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 1 bNumEndpoints 2 bInterfaceClass 10 CDC Data bInterfaceSubClass 0 bInterfaceProtocol 1 iInterface 7 CDC Network Data Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0400 1x 1024 bytes bInterval 0 bMaxBurst 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0400 1x 1024 bytes bInterval 0 bMaxBurst 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 10 Source/Sink Endpoint Descriptor: bLength 9 bDescriptorType 5 bEndpointAddress 0x83 EP 3 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0400 1x 1024 bytes bInterval 0 bRefresh 0 bSynchAddress 0 bMaxBurst 0 Endpoint Descriptor: bLength 9 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0400 1x 1024 bytes bInterval 1 bRefresh 0 bSynchAddress 0 bMaxBurst 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 3 bAlternateSetting 1 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 11 Isoc Source/Sink Endpoint Descriptor: bLength 9 bDescriptorType 5 bEndpointAddress 0x84 EP 4 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0400 1x 1024 bytes bInterval 0 bRefresh 0 bSynchAddress 0 bMaxBurst 0 Endpoint Descriptor: bLength 9 bDescriptorType 5 bEndpointAddress 0x03 EP 3 OUT bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0400 1x 1024 bytes bInterval 0 bRefresh 0 bSynchAddress 0 bMaxBurst 0 Binary Object Store Descriptor: bLength 5 bDescriptorType 15 wTotalLength 0x0016 bNumDeviceCaps 2 USB 2.0 Extension Device Capability: bLength 7 bDescriptorType 16 bDevCapabilityType 2 bmAttributes 0x00000006 BESL Link Power Management (LPM) Supported SuperSpeed USB Device Capability: bLength 10 bDescriptorType 16 bDevCapabilityType 3 bmAttributes 0x00 wSpeedsSupported 0x000f Device can operate at Low Speed (1Mbps) Device can operate at Full Speed (12Mbps) Device can operate at High Speed (480Mbps) Device can operate at SuperSpeed (5Gbps) bFunctionalitySupport 1 Lowest fully-functional device speed is Full Speed (12Mbps) bU1DevExitLat 10 micro seconds bU2DevExitLat 511 micro seconds can't get debug descriptor: Resource temporarily unavailable Device Status: 0x0001 Self Powered
Upcoming OSR Seminars | ||
---|---|---|
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead! | ||
Writing WDF Drivers | 7 Dec 2020 | LIVE ONLINE |
Internals & Software Drivers | 25 Jan 2021 | LIVE ONLINE |
Developing Minifilters | 8 March 2021 | LIVE ONLINE |
Comments
Clarification: On non-x86 Linux I can get the device to enumerate in many different configurations without fail, and can get those configurations to enumerate on Windows as well at USB2 speeds. But it fails when attempting to enumerate at USB3 speeds (device is 3.2 capable).
Interface 3 does not have an alternate setting 0. That's not valid, although I'd be surprised if that prevented enumeration.
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.
Added altsetting 0, worked. Pack it up boys! Shortest thread on OSR.
The different functions show up separately but I assume I can claim them in a driver to prevent that.
Do you mean you want interfaces 2 and 3 to be assigned to the same driver as a unit? If so, you can add another IAD (Interface Association Descriptor), just like the one you have combining the two CDC interfaces.
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.
Thanks for the recommendation. I've got a working association descriptor now and properly see fewer devices in device manager. However the names for the interfaces are not the right ones, and I realized before adding the association descriptor I was not able to change them likely because they are cached. From Linux I can see that the descriptors reported by the device have in fact changed.
I'm aware similar things have come up before on the list, but I think it was just driver to VID/PID association -- how do I clear USB string descriptor caching, etc?
Where are you seeing the interface names? The derivation of names for USB devices has varied wildly over the years. Sometimes the name comes from the string descriptor. Sometimes the name comes from the INF file.
Have you done a complete uninstall the device? You can try deleting the CurrentControlSet/Enum and CurrentControlSet/Control entries for your device, but that's hard to do.
In general, once your development system is polluted, it's hard to change these things without a fresh install. If it works properly on a second system, then I wouldn't worry about it.
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.
I was seeing them in device manager. Selecting the uninstall option from there and unplugging and then plugging the device back in was enough to get the names to change. At least in this location I can confirm the GUI is displaying the interface string descriptors on Win10.
Your suggestion seems appropriate, in "Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB" I can find my device's name as VID_xxxx&PID_xxxx&MI_xx filled in with vid, pid, and interface. At this point I'm not going to try to mimic the uninstall option from device manager, but this location is likely involved.
Oddly the first string descriptor is shown as the name for the combined device while the descriptor for the following interface is still recorded. I suppose this may be left over. As you suggested, I'll not worry about it for now. I have some autoinstall images set up. But eventually I'd like to ensure I can fully clean out my device.