Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Sept/Oct 2019 Issue of The NT Insider available


Download PDF here: http://insider.osr.com/2019/ntinsider_2019_01.pdf

It’s a particularly BIG issue, too: 40 pages of technical goodness, ranging from WDF to Minifilters. Check it out.
Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

Enumerating USB device with invalid configuration descriptor

arseneyrarseneyr Member Posts: 2

Hello,

I'm trying to write a USB function driver for an old USB device that is non-compliant (it's a low-speed device with a bulk endpoint) while not having control of the firmware. I've discovered that on USB 2 ports, the bus driver will successfully enumerate a PDO with the correct VID and PIDs for the device. My function driver can then read the configuration descriptor, modify it to use an interrupt endpoint instead, and select the new configuration (which works just fine). On a USB 3 port however, the bus driver seemingly attempts to parse the configuration descriptor, fails, and creates a PDO with the device ID USB\CONFIGURATION_DESCRIPTOR_VALIDATION_FAILURE. This PDO fails device descriptor request URBs and calls to WdfUsbTargetDeviceCreateWithParameters with STATUS_NO_SUCH_DEVICE, so I suspect my function driver can't convince the bus to re-select a valid configuration descriptor.

Is there any way to get the USB 3 bus driver to not read the configuration descriptors, similarly to how the USB 2 bus driver does it? Or am I going to have to write a bus filter driver to fix up the configuration descriptor requests on the fly?

Thanks,
Arseney

Comments

  • Doron_HolanDoron_Holan Member - All Emails Posts: 10,441
    via Email
    I assume the usb2 version of the driver is not as strict as the usb3 version of the driver. Have you captured a usb etw log trace for the usb3 case and looked in the log to see what specifically failed?

    Bent from my phone

    ________________________________
    From: arseneyr
    Sent: Tuesday, October 9, 2018 6:42 PM
    To: Doron Holan
    Subject: [NTDEV] Enumerating USB device with invalid configuration descriptor

    OSR https://na01.safelinks.protection.outlook.com/?url=https://community.osr.com/&data=02|01|[email protected]|de6ce16625994ab0049e08d62e51a1c0|72f988bf86f141af91ab2d7cd011db47|1|0|636747325500792583&sdata=nFdaLJYzUQRx+FVWVA+EqBQZb6STdZNB5dMzwZCN3v8=&reserved=0
    arseneyr started a new discussion: Enumerating USB device with invalid configuration descriptor

    Hello,

    I'm trying to write a USB function driver for an old USB device that is non-compliant (it's a low-speed device with a bulk endpoint) while not having control of the firmware. I've discovered that on USB 2 ports, the bus driver will successfully enumerate a PDO with the correct VID and PIDs for the device. My function driver can then read the configuration descriptor, modify it to use an interrupt endpoint instead, and select the new configuration (which works just fine). On a USB 3 port however, the bus driver seemingly attempts to parse the configuration descriptor, fails, and creates a PDO with the device ID USB\CONFIGURATION_DESCRIPTOR_VALIDATION_FAILURE. This PDO fails device descriptor request URBs and calls to WdfUsbTargetDeviceCreateWithParameters with STATUS_NO_SUCH_DEVICE, so I suspect my function driver can't convince the bus to re-select a valid configuration descriptor.

    Is there any way to get the USB 3 bus driver to not read the configuration descriptors, similarly to how the USB 2 bus driver does it? Or am I going to have to write a bus filter driver to fix up the configuration descriptor requests on the fly?

    Thanks,

    Arseney
    d
  • arseneyrarseneyr Member Posts: 2

    The hub reports the start of device enumeration, three instances of "Validation Failure of Configuration Descriptor", followed by "Maximum Enumeration Retry Count Reached" and "Device reported problems causing enumeration failure". The last message has the device descriptor in the payload, but no indication of what failed to validate. However, I'm pretty sure it's because of the bulk endpoint in a low-speed device. The USB compliance tool flagged it and the USB 2 function driver only worked when I edited the configuration descriptor to remove the bulk endpoint. I was just wondering if there was any way of making the USB 3 stack more lenient in device validation so it can at least enumerate a PDO.

  • Petty_VendettaPetty_Vendetta Member Posts: 1

    Your Mixman DM2 driver works! Do the lights do anything once it's calibrated? We'd like them to receive MIDI...do they?
    Got a spec sheet on the thing? (didn't see it on GitHub)
    Thanks so much for resurrecting this cheap old piece of junk for us. We were about to scrap it.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
Writing WDF Drivers 21 Oct 2019 OSR Seminar Space & ONLINE
Internals & Software Drivers 18 Nov 2019 Dulles, VA
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 27 Apr 2020 OSR Seminar Space & ONLINE