Hello all, I feel like I am totally missing something here so I apologize if this is a stupid question…
I maintain a KMDF USB 3.1 Gen2 device driver and I would like to detect the negotiated connection speed from within the device driver, i.e. if the device is running in SuperSpeed (5Gbps) or SuperSpeedPlus (10Gbps) mode.
I tried the obvious WdfUsbTargetDeviceQueryUsbCapability
, unfortunately there is no GUID for SuperSpeedPlus capability, only HighSpeed and SuperSpeed. I am using the latest WDK 10.0.18362.0 version. (Have MSFT guys simply forgot to add it or is it intentionally not supported anymore?)
So I took a look at the UsbView source code and they use the USB_NODE_CONNECTION_INFORMATION_EX_V2
structure which contains this information. However, for that I think I would need to know the USB hub handle my device is attached to so I can send it the IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX_V2
.
So this leads me to following questions:
- What’s the best way to detect SuperSpeedPlus connection speed from within a KMDF driver?
- How can I obtain handle to the USB hub object my device is attached to - so I can send it IOCTLs?
- Similarly, can I obtain handle to the USB controller the hub is attached to?
The last two would be really nice to have at least for debugging purposes as I could detect whether I am connected to an Intel or AsMedia controller or whether there are other devices attached in the same hub.
Thank you!
Lubo