2
\$\begingroup\$

From the oracle wiki (usb controller):

The USB host controller has an embedded hub called the root hub. The ports that are visible at the system's back panel are the ports of the root hub.

What I understand from this is that the root hub merely is a point where all usb hubs come toghether.

-Is the root hub a piece of hardware, or is it a term used to denote the point where all data from usb devices come toghether?

-There are different types of interfaces between the root hub and the controller (UHCI,OHCI,EHCI), is it then correct to think of the controller as a "middleman" between the root hub and the actual computer?

\$\endgroup\$

3 Answers 3

2
\$\begingroup\$

You can have more than one root hub, so no, it is not the point where all hubs come together. It might be more convenient to think of root hub as one of the several starting points for enumeration.

Root hub is a piece of hardware. More specifically, it is a part of host controller (which itself can be either separate chip or a part of chipset).

The interfaces that you mention are Host Controller Interfaces (HCI), i.e. interfaces of host controller, not root hub. Basically they are registers that software can access in order to communicate with host controller.

From the above I don't think term "middleman" is applicable as you pictured it.

UPDATE:

Here is a simple analogue to illustrate to relationships:

A vehicle is a controller. It has an interface (pedals) that software (driver) can use to operate the controller. It also has an engine (root hub) that performs essential part of the car functionality.

You can say that driver operates an engine using pedals, and that would be correct but not precise, because there are quite a few parts between the pedals and an engine. These parts correspond to internal logic circuitry of the controller.

So, more precise statement would be "driver controls the car using pedals, steering wheel and a stick, and since engine is part of the car it does its job share in the whole driving process". In a computer terms that would translate into "software controls the host controller using HCI, and since root hub is part of the host controller it does its job share in supporting USB communication".

\$\endgroup\$
2
  • \$\begingroup\$ So the Host Controller is a chip that communicates with software through host controller interface (HCI) and that chip is also connected to one or more root hubs so data can be passed between usb device and controller (and from controller to software)? \$\endgroup\$
    – Arthur VP
    Commented Jun 16, 2018 at 18:06
  • \$\begingroup\$ You almost got it right. Host controller is not "connected" to root hubs, the root hub is part of the controller. And since PCs usually have several controllers (built into chipset as well as separate chips on motherboard) nowadays you have several root hubs in your system. I'll update the answer with better explanation. \$\endgroup\$
    – Maple
    Commented Jun 16, 2018 at 18:31
3
\$\begingroup\$

A regular USB hub is a USB device that can split USB traffic from one (upstream) link to several downstream ports, and mux the upcoming traffic from many ports into one upstream. To do so, each hub has special control pipe that controls port functions such as connect/disconnect/suspend/resume/disable etc. These functions are controlled via USB-type control transactions, which are directed to each particular port, all using USB packet-token protocol. This protocol works up to any valid level of hub stackup, and each port has well-defined status bits within USB responses.

A root hub performs similar function, except (a) the upstream is associated directly with host controller pipe/bus, and (b) various status bits of each ports are mapped directly into 32-bit registers in host PCI space. This is a piece of hardware.

However, to maintain bit-wise compatibility between ALL ports in USB tree and provide universal access to all ports, the host controller driver software usually has a special layer that converts the register-based port control statuses (PORTSC) into standard USB port status format. This is sort-of illustrated in the following Microsoft documentation.

enter image description here

where the circled layer, I believe, provides this port status translation. After that the system knows no difference between a root hub port and any regular hub port.

\$\endgroup\$
0
\$\begingroup\$

This is an implementation detail, for the most part.

USB hubs implement insertion/removal detection, port power control and the upstream side of the enumeration protocol that is used before the device is assigned a number.

The same functionality is required for each USB downstream port, whether it is directly attached to the controller or part of a separate device, and it would be silly to have two different specifications.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.