Root Hub Emulation
According to the USB architecture, each Host Controller (HC) must implement a USB root hub. The root hub is a pseudo device that gets attached to the root of the USB device tree topology located at the rear of each HC.
The attachment of the root hub starts the device topology discovery process. Since the root hub is a pseudo hub device, the driver for the HC cannot request it to assign a standard USB device address to the root hub. Instead, the root hub is marked as a special hub by setting the IS_ROOTHUB flag in the USB System Driver (USBD) internal root hub-related control and interrupt pipe data structures. During the process, the pipeConnect function Host controller driver uses this IS_ROOTHUB flag to set its root hub-related control and interrupt pipe data structures by using the emulated flag. Any operations on the root hub-related control and interrupt pipes are intercepted by the HC and are processed according to the information provided by the Host controller hardware registers.