USB speed detection

hi, all,

we have a Super Speed device, which use the winusb.
And want to detect the current link speed.

I check the winusb api, found only one API: IsDeviceHighSpeed

My question is:

  1. can this API check it is SS or HS?
  2. We have a user mode dll, which is layer above winusb.sys.
    How to use the API to detect the usb link speed?

workingmailing@163.com wrote:

we have a Super Speed device, which use the winusb.
And want to detect the current link speed.

For some reason, Microsoft has made it very difficult to acquire this
information, even in kernel mode.

Probably, the easiest way it to check the device descriptor. A USB 3
device operating in super speed should report bcdUSB=0x0300 and
bMaxPacketSize0=9. A USB 3 device operating in high speed should report
bcdUSB=0x0210 and bMaxPacketSize0=64.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thank you Tim.

So the when IsDeviceHighSpeed return TRUE, it includes both the SS and HS case?
And false for FS and LS case?

On Apr 7, 2015, at 7:23 PM, workingmailing@163.com wrote:

So the when IsDeviceHighSpeed return TRUE, it includes both the SS and HS case?
And false for FS and LS case?

Well, before you go to far, IsDeviceHighSpeed is NOT a WinUSB API. In fact, it’s not a user-mode API at all. It’s part of the USB_BUS_INTERFACE_USBDI_V1 device interface that is available to kernel drivers. You would call WinUsb_QueryDeviceInformation with DEVICE_SPEED, and that returns 1 for low-speed or full-speed, and 3 for high-speed or above.

Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

*USBD_QueryUsbCapability* or *WdfUsbTargetDeviceQueryUsbCapability.*
On Tue, Apr 7, 2015 at 10:23 PM, wrote:

> IsDeviceHighSpeed

Mark Roddy