2 UEFI DriverBinding Protocol is defined in UEFI specification.
4 This protocol is produced by every driver that follows the UEFI Driver Model,
5 and it is the central component that allows drivers and controllers to be managed.
7 Copyright (c) 2006 - 2008, Intel Corporation
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #ifndef __EFI_DRIVER_BINDING_H__
19 #define __EFI_DRIVER_BINDING_H__
21 #include <Protocol/DevicePath.h>
23 /// Global ID for the ControllerHandle Driver Protocol
25 #define EFI_DRIVER_BINDING_PROTOCOL_GUID \
27 0x18a031ab, 0xb443, 0x4d1a, {0xa5, 0xc0, 0xc, 0x9, 0x26, 0x1e, 0x9f, 0x71 } \
30 typedef struct _EFI_DRIVER_BINDING_PROTOCOL EFI_DRIVER_BINDING_PROTOCOL
;
33 Test to see if this driver supports ControllerHandle. This service
34 is called by the EFI boot service ConnectController(). In
35 order to make drivers as small as possible, there are a few calling
36 restrictions for this service. ConnectController() must
37 follow these calling restrictions. If any other agent wishes to call
38 Supported() it must also follow these calling restrictions.
40 @param This Protocol instance pointer.
41 @param ControllerHandle Handle of device to test
42 @param RemainingDevicePath Optional parameter use to pick a specific child
45 @retval EFI_SUCCESS This driver supports this device
46 @retval EFI_ALREADY_STARTED This driver is already running on this device
47 @retval other This driver does not support this device
52 (EFIAPI
*EFI_DRIVER_BINDING_SUPPORTED
)(
53 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
54 IN EFI_HANDLE ControllerHandle
,
55 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
59 Start this driver on ControllerHandle. This service is called by the
60 EFI boot service ConnectController(). In order to make
61 drivers as small as possible, there are a few calling restrictions for
62 this service. ConnectController() must follow these
63 calling restrictions. If any other agent wishes to call Start() it
64 must also follow these calling restrictions.
66 @param This Protocol instance pointer.
67 @param ControllerHandle Handle of device to bind driver to
68 @param RemainingDevicePath Optional parameter use to pick a specific child
71 @retval EFI_SUCCESS This driver is added to ControllerHandle
72 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
73 @retval other This driver does not support this device
78 (EFIAPI
*EFI_DRIVER_BINDING_START
)(
79 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
80 IN EFI_HANDLE ControllerHandle
,
81 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
85 Stop this driver on ControllerHandle. This service is called by the
86 EFI boot service DisconnectController(). In order to
87 make drivers as small as possible, there are a few calling
88 restrictions for this service. DisconnectController()
89 must follow these calling restrictions. If any other agent wishes
90 to call Stop() it must also follow these calling restrictions.
92 @param This Protocol instance pointer.
93 @param ControllerHandle Handle of device to stop driver on
94 @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
95 children is zero stop the entire bus driver.
96 @param ChildHandleBuffer List of Child Handles to Stop.
98 @retval EFI_SUCCESS This driver is removed ControllerHandle
99 @retval other This driver was not removed from this device
104 (EFIAPI
*EFI_DRIVER_BINDING_STOP
)(
105 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
106 IN EFI_HANDLE ControllerHandle
,
107 IN UINTN NumberOfChildren
,
108 IN EFI_HANDLE
*ChildHandleBuffer OPTIONAL
112 // Interface structure for the ControllerHandle Driver Protocol
115 @par Protocol Description:
116 This protocol provides the services required to determine if a driver supports a given controller.
117 If a controller is supported, then it also provides routines to start and stop the controller.
119 struct _EFI_DRIVER_BINDING_PROTOCOL
{
120 EFI_DRIVER_BINDING_SUPPORTED Supported
;
121 EFI_DRIVER_BINDING_START Start
;
122 EFI_DRIVER_BINDING_STOP Stop
;
125 /// The version number of the UEFI driver that produced the
126 /// EFI_DRIVER_BINDING_PROTOCOL. This field is used by
127 /// the EFI boot service ConnectController() to determine
128 /// the order that driver's Supported() service will be used when
129 /// a controller needs to be started. EFI Driver Binding Protocol
130 /// instances with higher Version values will be used before ones
131 /// with lower Version values. The Version values of 0x0-
132 /// 0x0f and 0xfffffff0-0xffffffff are reserved for
133 /// platform/OEM specific drivers. The Version values of 0x10-
134 /// 0xffffffef are reserved for IHV-developed drivers.
139 /// The image handle of the UEFI driver that produced this instance
140 /// of the EFI_DRIVER_BINDING_PROTOCOL.
142 EFI_HANDLE ImageHandle
;
145 /// The handle on which this instance of the
146 /// EFI_DRIVER_BINDING_PROTOCOL is installed. In most
147 /// cases, this is the same handle as ImageHandle. However, for
148 /// UEFI drivers that produce more than one instance of the
149 /// EFI_DRIVER_BINDING_PROTOCOL, this value may not be
150 /// the same as ImageHandle.
152 EFI_HANDLE DriverBindingHandle
;
155 extern EFI_GUID gEfiDriverBindingProtocolGuid
;