PORTS Forum

Ports and Interfaces => USB => Topic started by: erdmann on July 01, 2021, 10:54:45 am

Title: USB 3 / USB 2 combined ports: how to get device speed from "Get Port Status" ?
Post by: erdmann on July 01, 2021, 10:54:45 am
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 ?



Title: Re: USB 3 / USB 2 combined ports: how to get device speed from "Get Port Status" ?
Post by: Jan Axelson on July 01, 2021, 08:58:08 pm
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.
Title: Re: USB 3 / USB 2 combined ports: how to get device speed from "Get Port Status" ?
Post by: erdmann on July 02, 2021, 07:36:53 am
So that means that Windows would show 2 root hubs for a single XHCI controller: a USB3 and a USB2 (EHCI) root hub ?
Title: Re: USB 3 / USB 2 combined ports: how to get device speed from "Get Port Status" ?
Post by: Renate on July 02, 2021, 02:13:06 pm
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;

Title: Re: USB 3 / USB 2 combined ports: how to get device speed from "Get Port Status" ?
Post by: Jan Axelson on July 05, 2021, 11:16:43 am
Windows device manager shows all hubs.

https://support.microsoft.com/en-us/windows/open-device-manager-a7f2db46-faaf-24f0-8b7b-9e4a6032fc8c