Status codes returned, Examples – Intel Extensible Firmware Interface User Manual
Page 253

Protocols
— EFI Driver Model
Version 1.10
12/01/02
9-11
If the driver specified by
This
is a bus driver, and
RemainingDevicePath
is
NULL
, then all
of the children of
Controller
are discovered and enumerated, and a device handle is created for
each child.
If the driver specified by
This
is a bus driver that is capable of creating one child handle at a time
and
RemainingDevicePath
is not
NULL
, then only the device handle for the child device
specified by
RemainingDevicePath
is created. Depending on the bus type, all of the child
devices may need to be discovered and enumerated, but only device handle for the one child
specified by
RemainingDevicePath
shall be created.
The
Start()
function is designed to be invoked from the EFI boot service
. As a result, much of the error checking on the parameters to
Start()
has been moved into this common boot service. It is legal to call
Start()
from other
locations, but the following calling restrictions must be followed or the system behavior will not be
deterministic.
1.
ControllerHandle
must be a valid
EFI_HANDLE
.
2. If
RemainingDevicePath
is not
NULL
, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH
that contains at least one device path node other than the end node.
3. Prior
to
calling
Start()
function for the driver specified by
This
must
have been called with the same calling parameters, and
Supported()
must have returned
EFI_SUCCESS
.
Status Codes Returned
EFI_SUCCESS
The device was started
.
EFI_DEVICE_ERROR
The device could not be started due to a device error.
EFI_OUT_OF_RESOURCES
The request could not be completed due to a lack of resources.
Examples
extern EFI_GUID gEfiDriverBindingProtocolGuid;
EFI_HANDLE DriverImageHandle;
EFI_HANDLE ControllerHandle;
EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath;
//
// Use the DriverImageHandle to get the Driver Binding Protocol instance
//
Status = gBS->OpenProtocol (
DriverImageHandle,
&gEfiDriverBindingProtocolGuid,
&DriverBinding,
DriverImageHandle,
NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL
);
if (EFI_ERROR (Status)) {
return Status;
}