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