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