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