beautypg.com

Intel Extensible Firmware Interface User Manual

Page 250

background image

Extensible Firmware Interface Specification

9-8

12/01/02

Version 1.10

Bus Driver that creates all of its child handles on the first call to Start():

1. Check the contents of the first Device Path Node of

RemainingDevicePath

to make sure

it is a legal Device Path Node for this bus driver’s children. If it is not, then return

EFI_UNSUPPORTED

.

2. Open all required protocols with

OpenProtocol()

. A standard driver should use an

Attribute

of

EFI_OPEN_PROTOCOL_BY_DRIVER

. If this driver needs exclusive access

to a protocol interface, and it requires any drivers that may be using the protocol interface to
disconnect, then the driver should use an

Attribute

of

EFI_OPEN_PROTOCOL_BY_DRIVER | EFI_OPEN_PROTOCOL_EXCLUSIVE

.

3. If any of the calls to

OpenProtocol()

in (2) returned an error, then close all of the protocols

opened in (2) with

CloseProtocol()

, and return the status code from the call to

OpenProtocol()

that returned an error.

4. Use the protocol instances opened in (2) to test to see if this driver supports the controller.

Sometimes, just the presence of the protocols is enough of a test. Other times, the services of
the protocols opened in (2) are used to further check the identity of the controller. If any of
these tests fails, then close all the protocols opened in (2) with

CloseProtocol()

and

return

EFI_UNSUPPORTED

.

5. Close all protocols opened in (2) with

CloseProtocol()

.

6. Return

EFI_SUCCESS

.

Bus Driver that is able to create all or one of its child handles on each call to Start():

1. Check the contents of the first Device Path Node of

RemainingDevicePath

to make sure

it is a legal Device Path Node for this bus driver’s children. If it is not, then return

EFI_UNSUPPORTED

.

2. Open all required protocols with

OpenProtocol()

. A standard driver should use an

Attribute

of

EFI_OPEN_PROTOCOL_BY_DRIVER

. If this driver needs exclusive access

to a protocol interface, and it requires any drivers that may be using the protocol interface to
disconnect, then the driver should use an

Attribute

of

EFI_OPEN_PROTOCOL_BY_DRIVER | EFI_OPEN_PROTOCOL_EXCLUSIVE

.

3. If any of the calls to

OpenProtocol()

in (2) failed with an error other than

EFI_ALREADY_STARTED

, then close all of the protocols opened in (2) that did not return

EFI_ALREADY_STARTED

with

CloseProtocol()

, and return the status code from the

OpenProtocol()

call that returned an error.

4. Use the protocol instances opened in (2) to test to see if this driver supports the controller.

Sometimes, just the presence of the protocols is enough of a test. Other times, the services of
the protocols opened in (2) are used to further check the identity of the controller. If any of
these tests fails, then close all the protocols opened in (2) that did not return

EFI_ALREADY_STARTED

with

CloseProtocol()

and return

EFI_UNSUPPORTED

.

5. Close all protocols opened in (2) that did not return

EFI_ALREADY_STARTED

with

CloseProtocol()

.

6. Return

EFI_SUCCESS

.