3 usb bus driver, 1 usb bus driver entry point, 2 driver binding protocol for usb bus drivers – Intel Extensible Firmware Interface User Manual

Page 575

Advertising
background image

Protocols

— USB Support

Version 1.10

12/01/02

14-35

In the USB Bus Driver Design, the USB Bus Controller is managed by two drivers. One is USB
Host Controller Driver, which consumes its parent bus

EFI_XYZ_IO_PROTOCOL

, and produces

EFI_USB_HC_PROTOCOL

and attaches it to the Bus Controller Handle. The other one is USB

Bus Driver, which consumes

EFI_USB_HC_PROTOCOL

, and performs bus enumeration.

Figure 14-2 shows protocols that are attached to the USB Bus Controller Handle. Detailed
descriptions are presented in the following sections.

14.2.3 USB Bus Driver

USB Bus Driver performs periodic Enumeration on the USB Bus. In USB bus enumeration, when
a new USB controller is found, the bus driver does some standard configuration for that new
controller, and creates a device handle for it. The

EFI_USB_IO_PROTOCOL

and the

EFI_DEVICE_PATH

are attached to the device handle so that the USB controller can be accessed.

The USB Bus Driver is also responsible for connecting USB device drivers to USB controllers.
When a USB device is detached from a USB bus, the USB bus driver will stop that USB controller,
and uninstall the

EFI_USB_IO_PROTOCOL

and the

EFI_DEVICE_PATH

from that handle. A

detailed description is given in Section 14.2.3.3.

14.2.3.1 USB Bus Driver Entry Point

Like all other device drivers, the entry point for a USB Bus Driver attaches the

EFI_DRIVER_BINDING_PROTOCOL

to image handle of the USB Bus Driver.

14.2.3.2 Driver Binding Protocol for USB Bus Drivers

The Driver Binding Protocol contains three services. These are

Supported()

,

Start()

, and

Stop()

.

Supported()

tests to see if the USB Bus Driver can manage a device handle. A USB

Bus Driver can only manage a device handle that contains

EFI_USB_HC_PROTOCOL

.

The general idea is that the USB Bus Driver is a generic driver. Since there are several types of
USB Host Controllers, an

EFI_USB_HC_PROTOCOL

is used to abstract the host controller

interface. Actually, a USB Bus Driver only requires an

EFI_USB_HC_PROTOCOL

.

The

Start()

function tells the USB Bus Driver to start managing the USB Bus. In this function,

the USB Bus Driver creates a device handle for the root hub, and creates a timer to monitor root
hub connection changes.

The

Stop()

function tells the USB Bus Driver to stop managing a USB Host Bus Controller. The

Stop()

function simply deconfigures the devices attached to the root hub. The deconfiguration is

a recursive process. If the device to be deconfigured is a USB hub, then all USB devices attached
to its downstream ports will be deconfigured first, then itself. If all of the child devices handles
have been destroyed then the

EFI_USB_HC_PROTOCOL

is closed. Finally, the

Stop()

unction

will then place the USB Host Bus Controller in a quiescent state.

Advertising