]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/DriverBinding.h
Reviewed the description in the FatBinPkg .dec file.
[mirror_edk2.git] / MdePkg / Include / Protocol / DriverBinding.h
CommitLineData
d1f95000 1/** @file\r
4ca9b6c4
LG
2 UEFI DriverBinding Protocol is defined in UEFI specification.\r
3 \r
4 This protocol is produced by every driver that follows the UEFI Driver Model, \r
5 and it is the central component that allows drivers and controllers to be managed.\r
d1f95000 6\r
c8c44377 7 Copyright (c) 2006 - 2009, Intel Corporation \r
d1f95000 8 All rights reserved. This program and the accompanying materials \r
9 are licensed and made available under the terms and conditions of the BSD License \r
10 which accompanies this distribution. The full text of the license may be found at \r
11 http://opensource.org/licenses/bsd-license.php \r
12\r
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
15\r
d1f95000 16**/\r
17\r
18#ifndef __EFI_DRIVER_BINDING_H__\r
19#define __EFI_DRIVER_BINDING_H__\r
20\r
99e8ed21 21///\r
22/// Global ID for the ControllerHandle Driver Protocol\r
23///\r
d1f95000 24#define EFI_DRIVER_BINDING_PROTOCOL_GUID \\r
25 { \\r
26 0x18a031ab, 0xb443, 0x4d1a, {0xa5, 0xc0, 0xc, 0x9, 0x26, 0x1e, 0x9f, 0x71 } \\r
27 }\r
28\r
29typedef struct _EFI_DRIVER_BINDING_PROTOCOL EFI_DRIVER_BINDING_PROTOCOL;\r
30\r
31/**\r
74fec708
LG
32 Tests to see if this driver supports a given controller. If a child device is provided, \r
33 it further tests to see if this driver supports creating a handle for the specified child device.\r
34\r
6b005af9 35 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
36 @param[in] ControllerHandle The handle of the controller to test. This handle \r
37 must support a protocol interface that supplies \r
38 an I/O abstraction to the driver.\r
39 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. \r
40 This parameter is ignored by device drivers, and is optional for bus drivers.\r
41\r
42\r
43 @retval EFI_SUCCESS The device specified by ControllerHandle and\r
44 RemainingDevicePath is supported by the driver specified by This.\r
45 @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and\r
46 RemainingDevicePath is already being managed by the driver\r
47 specified by This.\r
48 @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and\r
49 RemainingDevicePath is already being managed by a different\r
50 driver or an application that requires exclusive acces.\r
51 Currently not implemented.\r
52 @retval EFI_UNSUPPORTED The device specified by ControllerHandle and\r
53 RemainingDevicePath is not supported by the driver specified by This.\r
d1f95000 54**/\r
55typedef\r
56EFI_STATUS\r
8b13229b 57(EFIAPI *EFI_DRIVER_BINDING_SUPPORTED)(\r
d1f95000 58 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
59 IN EFI_HANDLE ControllerHandle,\r
60 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
ed66e1bc 61 );\r
d1f95000 62\r
63/**\r
74fec708
LG
64 Start this driver on ControllerHandle. The Start() function is designed to be \r
65 invoked from the EFI boot service ConnectController(). As a result, much of \r
66 the error checking on the parameters to Start() has been moved into this \r
67 common boot service. It is legal to call Start() from other locations, \r
68 but the following calling restrictions must be followed or the system behavior will not be deterministic.\r
69 1. ControllerHandle must be a valid EFI_HANDLE.\r
70 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned\r
71 EFI_DEVICE_PATH_PROTOCOL.\r
72 3. Prior to calling Start(), the Supported() function for the driver specified by This must\r
73 have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS. \r
74\r
6b005af9 75 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
76 @param[in] ControllerHandle The handle of the controller to start. This handle \r
77 must support a protocol interface that supplies \r
78 an I/O abstraction to the driver.\r
79 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. \r
80 This parameter is ignored by device drivers, and is optional for bus drivers.\r
81\r
82 @retval EFI_SUCCESS The device was started.\r
83 @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.\r
84 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
85 @retval Others The driver failded to start the device.\r
d1f95000 86**/\r
87typedef\r
88EFI_STATUS\r
8b13229b 89(EFIAPI *EFI_DRIVER_BINDING_START)(\r
d1f95000 90 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
91 IN EFI_HANDLE ControllerHandle,\r
92 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
ed66e1bc 93 );\r
d1f95000 94\r
95/**\r
74fec708 96 Stop this driver on ControllerHandle. \r
6b005af9 97 \r
98 Release the control of this controller and remove the IScsi functions. The Stop()\r
99 function is designed to be invoked from the EFI boot service DisconnectController(). \r
74fec708
LG
100 As a result, much of the error checking on the parameters to Stop() has been moved \r
101 into this common boot service. It is legal to call Stop() from other locations, \r
102 but the following calling restrictions must be followed or the system behavior will not be deterministic.\r
103 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r
104 same driver's Start() function.\r
105 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid\r
ff7630cc 106 EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r
74fec708
LG
107 Start() function, and the Start() function must have called OpenProtocol() on\r
108 ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
3354353d 109 \r
6b005af9 110 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
111 @param[in] ControllerHandle A handle to the device being stopped. The handle must \r
112 support a bus specific I/O protocol for the driver \r
113 to use to stop the device.\r
114 @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.Not used.\r
115 @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL \r
c8c44377 116 if NumberOfChildren is 0.\r
6b005af9 117\r
118 @retval EFI_SUCCESS The device was stopped.\r
119 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.\r
d1f95000 120**/\r
121typedef\r
122EFI_STATUS\r
8b13229b 123(EFIAPI *EFI_DRIVER_BINDING_STOP)(\r
d1f95000 124 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
125 IN EFI_HANDLE ControllerHandle,\r
126 IN UINTN NumberOfChildren,\r
127 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL\r
ed66e1bc 128 );\r
d1f95000 129\r
44717a39 130///\r
131/// This protocol provides the services required to determine if a driver supports a given controller. \r
132/// If a controller is supported, then it also provides routines to start and stop the controller.\r
133///\r
d1f95000 134struct _EFI_DRIVER_BINDING_PROTOCOL {\r
135 EFI_DRIVER_BINDING_SUPPORTED Supported;\r
136 EFI_DRIVER_BINDING_START Start;\r
137 EFI_DRIVER_BINDING_STOP Stop;\r
3354353d 138 \r
139 ///\r
140 /// The version number of the UEFI driver that produced the\r
141 /// EFI_DRIVER_BINDING_PROTOCOL. This field is used by\r
142 /// the EFI boot service ConnectController() to determine\r
143 /// the order that driver's Supported() service will be used when\r
144 /// a controller needs to be started. EFI Driver Binding Protocol\r
145 /// instances with higher Version values will be used before ones\r
146 /// with lower Version values. The Version values of 0x0-\r
147 /// 0x0f and 0xfffffff0-0xffffffff are reserved for\r
148 /// platform/OEM specific drivers. The Version values of 0x10-\r
149 /// 0xffffffef are reserved for IHV-developed drivers.\r
150 ///\r
d1f95000 151 UINT32 Version;\r
3354353d 152 \r
153 ///\r
154 /// The image handle of the UEFI driver that produced this instance\r
155 /// of the EFI_DRIVER_BINDING_PROTOCOL.\r
156 ///\r
d1f95000 157 EFI_HANDLE ImageHandle;\r
3354353d 158 \r
159 ///\r
160 /// The handle on which this instance of the\r
161 /// EFI_DRIVER_BINDING_PROTOCOL is installed. In most\r
162 /// cases, this is the same handle as ImageHandle. However, for\r
163 /// UEFI drivers that produce more than one instance of the\r
164 /// EFI_DRIVER_BINDING_PROTOCOL, this value may not be\r
165 /// the same as ImageHandle. \r
166 ///\r
d1f95000 167 EFI_HANDLE DriverBindingHandle;\r
168};\r
169\r
170extern EFI_GUID gEfiDriverBindingProtocolGuid;\r
171\r
172#endif\r