]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/DriverBinding.h
Remove the package header files PiDxe.h/PiPei.h/Uefi.h included by Protocol/Ppi/Guid...
[mirror_edk2.git] / MdePkg / Include / Protocol / DriverBinding.h
1 /** @file
2 UEFI DriverBinding Protocol is defined in UEFI specification.
3
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.
6
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
12
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.
15
16 **/
17
18 #ifndef __EFI_DRIVER_BINDING_H__
19 #define __EFI_DRIVER_BINDING_H__
20
21 #include <Protocol/DevicePath.h>
22 ///
23 /// Global ID for the ControllerHandle Driver Protocol
24 ///
25 #define EFI_DRIVER_BINDING_PROTOCOL_GUID \
26 { \
27 0x18a031ab, 0xb443, 0x4d1a, {0xa5, 0xc0, 0xc, 0x9, 0x26, 0x1e, 0x9f, 0x71 } \
28 }
29
30 typedef struct _EFI_DRIVER_BINDING_PROTOCOL EFI_DRIVER_BINDING_PROTOCOL;
31
32 /**
33 Test to see if this driver supports ControllerHandle.
34
35 @param This Protocol instance pointer.
36 @param ControllerHandle Handle of device to test
37 @param RemainingDevicePath Optional parameter use to pick a specific child
38 device to start.
39
40 @retval EFI_SUCCESS This driver supports this device
41 @retval EFI_ALREADY_STARTED This driver is already running on this device
42 @retval other This driver does not support this device
43
44 **/
45 typedef
46 EFI_STATUS
47 (EFIAPI *EFI_DRIVER_BINDING_SUPPORTED)(
48 IN EFI_DRIVER_BINDING_PROTOCOL *This,
49 IN EFI_HANDLE ControllerHandle,
50 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
51 );
52
53 /**
54 Start this driver on ControllerHandle.
55
56 @param This Protocol instance pointer.
57 @param ControllerHandle Handle of device to bind driver to
58 @param RemainingDevicePath Optional parameter use to pick a specific child
59 device to start.
60
61 @retval EFI_SUCCESS This driver is added to ControllerHandle
62 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
63 @retval other This driver does not support this device
64
65 **/
66 typedef
67 EFI_STATUS
68 (EFIAPI *EFI_DRIVER_BINDING_START)(
69 IN EFI_DRIVER_BINDING_PROTOCOL *This,
70 IN EFI_HANDLE ControllerHandle,
71 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
72 );
73
74 /**
75 Stop this driver on ControllerHandle.
76
77 @param This Protocol instance pointer.
78 @param ControllerHandle Handle of device to stop driver on
79 @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
80 children is zero stop the entire bus driver.
81 @param ChildHandleBuffer List of Child Handles to Stop.
82
83 @retval EFI_SUCCESS This driver is removed ControllerHandle
84 @retval other This driver was not removed from this device
85
86 **/
87 typedef
88 EFI_STATUS
89 (EFIAPI *EFI_DRIVER_BINDING_STOP)(
90 IN EFI_DRIVER_BINDING_PROTOCOL *This,
91 IN EFI_HANDLE ControllerHandle,
92 IN UINTN NumberOfChildren,
93 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
94 );
95
96 //
97 // Interface structure for the ControllerHandle Driver Protocol
98 //
99 /**
100 @par Protocol Description:
101 This protocol provides the services required to determine if a driver supports a given controller.
102 If a controller is supported, then it also provides routines to start and stop the controller.
103
104 @param Supported
105 Tests to see if this driver supports a given controller. This service
106 is called by the EFI boot service ConnectController(). In
107 order to make drivers as small as possible, there are a few calling
108 restrictions for this service. ConnectController() must
109 follow these calling restrictions. If any other agent wishes to call
110 Supported() it must also follow these calling restrictions.
111
112
113 @param Start
114 Starts a controller using this driver. This service is called by the
115 EFI boot service ConnectController(). In order to make
116 drivers as small as possible, there are a few calling restrictions for
117 this service. ConnectController() must follow these
118 calling restrictions. If any other agent wishes to call Start() it
119 must also follow these calling restrictions.
120
121 @param Stop
122 Stops a controller using this driver. This service is called by the
123 EFI boot service DisconnectController(). In order to
124 make drivers as small as possible, there are a few calling
125 restrictions for this service. DisconnectController()
126 must follow these calling restrictions. If any other agent wishes
127 to call Stop() it must also follow these calling restrictions.
128
129 @param Version
130 The version number of the UEFI driver that produced the
131 EFI_DRIVER_BINDING_PROTOCOL. This field is used by
132 the EFI boot service ConnectController() to determine
133 the order that driver's Supported() service will be used when
134 a controller needs to be started. EFI Driver Binding Protocol
135 instances with higher Version values will be used before ones
136 with lower Version values. The Version values of 0x0-
137 0x0f and 0xfffffff0-0xffffffff are reserved for
138 platform/OEM specific drivers. The Version values of 0x10-
139 0xffffffef are reserved for IHV-developed drivers.
140
141 @param ImageHandle
142 The image handle of the UEFI driver that produced this instance
143 of the EFI_DRIVER_BINDING_PROTOCOL.
144
145 @param DriverBindingHandle
146 The handle on which this instance of the
147 EFI_DRIVER_BINDING_PROTOCOL is installed. In most
148 cases, this is the same handle as ImageHandle. However, for
149 UEFI drivers that produce more than one instance of the
150 EFI_DRIVER_BINDING_PROTOCOL, this value may not be
151 the same as ImageHandle.
152
153 **/
154 struct _EFI_DRIVER_BINDING_PROTOCOL {
155 EFI_DRIVER_BINDING_SUPPORTED Supported;
156 EFI_DRIVER_BINDING_START Start;
157 EFI_DRIVER_BINDING_STOP Stop;
158 UINT32 Version;
159 EFI_HANDLE ImageHandle;
160 EFI_HANDLE DriverBindingHandle;
161 };
162
163 extern EFI_GUID gEfiDriverBindingProtocolGuid;
164
165 #endif