Intel Extensible Firmware Interface User Manual
Page 160

Extensible Firmware Interface Specification
5-62
12/01/02
Version 1.10
Description
This function connects one or more drivers to the controller specified by
ControllerHandle
.
If
ControllerHandle
is not a valid
EFI_HANDLE
, then
EFI_INVALID_PARAMETER
is
returned. If there are no
EFI_DRIVER_BINDING_PROTOCOL
instances present in the system,
then return
EFI_NOT_FOUND
. If there are not enough resources available to complete this
function, then
EFI_OUT_OF_RESOURCES
is returned.
If
Recursive
is
FALSE
, then this function returns after all drivers have been connected to
ControllerHandle
. If
Recursive
is
TRUE
, then
ConnectController()
is called
recursively on all of the child controllers of
ControllerHandle
. The child controllers can be
identified by searching the handle database for all the controllers that have opened
ControllerHandle
with an attribute of
EFI_OPEN_PROTOCOL_BY_CHILD_
CONTROLLER
.
This functions uses four precedence rules when deciding the order that drivers are tested against
controllers. These four rules from highest precedence to lowest precedence are as follows:
1. Context Override :
DriverImageHandle
is an ordered list of image handles. The highest
priority image handle is the first element of the list, and the lowest priority image handle is the
last element of the list. The list is terminated with a
NULL
image handle.
2. Platform Driver Override :If an
EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL
instance is present in the system, then the
service of this protocol is used to
retrieve an ordered list of image handles for
ControllerHandle
. The first image handle
returned from
GetDriver()
has the highest precedence, and the last image handle returned
from
GetDriver()
has the lowest precedence. The ordered list is terminated when
GetDriver()
returns
EFI_NOT_FOUND
. It is legal for no image handles to be returned by
GetDriver()
. There can be at most a single instance in the system of the
EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL
. If there is more than one, then the
system behavior is not deterministic.
3. Bus Specific Driver Override :If there is an instance of the
EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL
attached to
ControllerHandle
, then the
GetDriver()
service of this protocol is used to retrieve an
ordered list of image handle for
ControllerHandle
. The first image handle returned from
GetDriver()
has the highest precedence, and the last image handle returned from
GetDriver()
has the lowest precedence. The ordered list is terminated when
GetDriver()
returns
EFI_NOT_FOUND
. It is legal for no image handles to be returned by
GetDriver()
.
4. Driver Binding Search :The list of available driver image handles can be found by using the
boot service
with a
SearchType
of
ByProtocol
for the GUID of the
EFI_DRIVER_BINDING_PROTOCOL
. From this list, the image handles found in rules (1),
(2), and (3) above are removed. The remaining image handles are sorted from highest to lowest
based on the
Version
field of the
EFI_DRIVER_BINDING_PROTOCOL
instance
associated with each image handle.