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