Extensible Firmware Interface Specification
14-36 12/01/02 Version 1.10
14.2.3.3 USB Hot-Plug Event
Hot-Plug is one of the most important features provided by USB. A USB bus driver implements
this feature through two methods. There are two types of hubs defined in the USB specification.
One is the USB root hub, which is implemented in the USB Host controller. A timer event
is created for the root hub. The other one is a USB Hub. An event is created for each hub that
is correctly configured. All these events are associated with the same trigger which is USB
bus numerator.
When USB bus enumeration is triggered, the USB Bus Driver checks the source of the event.
This is required because the root hub differs from standard USB hub in checking the hub status.
The status of a root hub is retrieved through the EFI_USB_HC_PROTOCOL
, and that status of
a standard USB hub is retrieved through a USB control transfer. A detailed description of the
enumeration process is presented in the next section.
14.2.3.4 USB Bus Enumeration
When the periodic timer or the hubs notify event is signaled, the USB Bus Driver will perform
bus numeration.
1. Determine if the event is from the root hub or a standard USB hub.
2. Determine the port on which the connection change event occurred.
3. Determine if it is a connection change or a disconnection change.
4. If a connect change is detected, then a new device has been attached. Perform the following:
a. Reset and enable that port.
b. Configure the new device.
c. Parse the device configuration descriptors; get all of its interface descriptors (i.e. all USB
controllers), and configure each interface.
d. Create a new handle for each interface (USB Controller) within the USB device. Attach
the EFI_DEVICE_PATH
, and the EFI_USB_IO_PROTOCOL to each handle.
e. Connect the USB Controller to a USB device driver with the Boot Service
ConnectController()
if applicable.
f. If the USB Controller is a USB hub, create a Hub notify event which is associated with the
USB Bus Enumerator, and submit an Asynchronous Interrupt Transfer Request (See
Section 14.2.5).
5. If a disconnect change, then a device has been detached from the USB Bus. Perform the
following:
a. If the device is not a USB Hub, then find and deconfigure the USB Controllers within the
device. Then, stop each USB controller with DisconnectController()
, and
uninstall the EFI_DEVICE_PATH and the EFI_USB_IO_PROTOCOL from the
controller’s handle.
b. If the USB controller is USB hub controller, first find and deconfigure all its downstream
USB devices (this is a recursive process, since there may be additional USB hub controllers
on the downstream ports), then deconfigure USB hub controller itself.