Author Topic: USB 3 / USB 2 combined ports: how to get device speed from "Get Port Status" ?  (Read 3927 times)

erdmann

  • Member
  • ***
  • Posts: 43
As I saw when comparing USB 2 and USB 3 spec is that bit meanings have changed for the "Get Port Status" message.
Under USB 2.0, the port status bits contained bits for "low speed" and "high speed" (and if neither was set, it was full speed).

For USB 3.x, the port status bits contain a different 3-bit field that is always to be 0.

If you now have a port that supports Superspeed as well as Low/Full/Highspeed devices, how do you know what "variant" of return from "Get Port Status" you will get ? Or does a XHCI controller actually always have 2 completely separate hubs, one for USB 3.0 and yet another one for USB 2.0 with  even separate hub/device addresses ?

If I wanted to write a XHCI HC driver, would that then mean that that driver would actually need to support both, XHCI and EHCI ?




Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
A USB 3.1 hub contains both a USB 2.0 hub that supports low, full, and high speeds and an Enhanced SuperSpeed hub that contains a SuperSpeed hub and a Super-SpeedPlus hub. The USB 2.0 and Enhanced SuperSpeed hubs operate independently except for sharing logic to control VBUS. The host enumerates a USB 3.1 hub as two hubs.

erdmann

  • Member
  • ***
  • Posts: 43
So that means that Windows would show 2 root hubs for a single XHCI controller: a USB3 and a USB2 (EHCI) root hub ?

Renate

  • Frequent Contributor
  • ****
  • Posts: 97
Very approximately...

Code: [Select]
   HANDLE hub;
   USB_NODE_CONNECTION_INFORMATION_EX info;

   for(i=1;;i++)
   {
      info.ConnectionIndex=i;
      flag=DeviceIoControl(hub, IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX, &info, sizeof(info), &info, sizeof(info), &n, NULL);
      speed=info.Speed;


Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research