]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/DriverHealth.h
Remove tabs in source code in MdePkg.
[mirror_edk2.git] / MdePkg / Include / Protocol / DriverHealth.h
CommitLineData
91750954 1/** @file\r
2 EFI Driver Health Protocol definitions.\r
3\r
4 When installed, the Driver Health Protocol produces a collection of services that allow\r
5 the health status for a controller to be retrieved. If a controller is not in a usable\r
6 state, status messages may be reported to the user, repair operations can be invoked,\r
7 and the user may be asked to make software and/or hardware configuration changes.\r
8 \r
9 The Driver Health Protocol is optionally produced by a driver that follows the \r
10 EFI Driver Model. If an EFI Driver needs to report health status to the platform, \r
11 provide warning or error messages to the user, perform length repair operations, \r
12 or request the user to make hardware or software configuration changes, then the \r
13 Driver Health Protocol must be produced.\r
14 \r
15 A controller that is managed by driver that follows the EFI Driver Model and \r
16 produces the Driver Health Protocol must report the current health of the \r
17 controllers that the driver is currently managing. The controller can initially \r
18 be healthy, failed, require repair, or require configuration. If a controller \r
19 requires configuration, and the user make configuration changes, the controller \r
20 may then need to be reconnected or the system may need to be rebooted for the \r
21 configuration changes to take affect. \r
22\r
23 Copyright (c) 2009, Intel Corporation \r
24 All rights reserved. This program and the accompanying materials \r
25 are licensed and made available under the terms and conditions of the BSD License \r
26 which accompanies this distribution. The full text of the license may be found at \r
27 http://opensource.org/licenses/bsd-license.php \r
28\r
29 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
30 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
31\r
32 @par Revision Reference:\r
33 This Protocol is defined in UEFI Specification 2.2 \r
34\r
35**/\r
36\r
37#ifndef __EFI_DRIVER_HEALTH_H__\r
38#define __EFI_DRIVER_HEALTH_H__\r
39\r
40#define EFI_DRIVER_HEALTH_PROTOCOL_GUID \\r
41 { \\r
42 0x2a534210, 0x9280, 0x41d8, { 0xae, 0x79, 0xca, 0xda, 0x1, 0xa2, 0xb1, 0x27 } \\r
43 }\r
44 \r
45typedef struct _EFI_DRIVER_HEALTH_PROTOCOL EFI_DRIVER_HEALTH_PROTOCOL;\r
46\r
47///\r
48/// EFI_DRIVER_HEALTH_HEALTH_STATUS\r
49///\r
50typedef enum {\r
51 EfiDriverHealthStatusHealthy,\r
52 EfiDriverHealthStatusRepairRequired,\r
53 EfiDriverHealthStatusConfigurationRequired,\r
54 EfiDriverHealthStatusFailed,\r
55 EfiDriverHealthStatusReconnectRequired,\r
56 EfiDriverHealthStatusRebootRequired\r
57} EFI_DRIVER_HEALTH_STATUS;\r
58\r
59///\r
60/// EFI_DRIVER_HEALTH_HII_MESSAGE\r
61///\r
62typedef struct {\r
63 EFI_HII_HANDLE HiiHandle;\r
64 EFI_STRING_ID StringId;\r
65 UINT64 Reserved;\r
66} EFI_DRIVER_HEALTH_HII_MESSAGE;\r
67\r
68/**\r
69 Reports the progress of a repair operation\r
70\r
71 @param Value A value between 0 and Limit that identifies the current \r
72 progress of the repair operation.\r
73 \r
74 @param Limit The maximum value of Value for the current repair operation.\r
75 For example, a driver that wants to specify progress in \r
76 percent would use a Limit value of 100.\r
77 \r
78 @retval EFI_SUCCESS An attempt to repair the controller specified by\r
79 ControllerHandle and ChildHandle was performed. The\r
80 result of the repair operation can bet determined by\r
81 calling GetHealthStatus().\r
82 @retval EFI_UNSUPPORTED The driver specified by This is not currently managing the\r
83 controller specified by ControllerHandle and\r
84 ChildHandle.\r
85 @retval EFI_OUT_OF_RESOURCES There are not enough resources to perform the repair operation.\r
86\r
87**/\r
88typedef\r
89EFI_STATUS\r
90(EFIAPI *EFI_DRIVER_HEALTH_REPAIR_PROGRESS_NOTIFY)(\r
91 IN UINTN Value,\r
92 IN UINTN Limit\r
93 );\r
94\r
95/**\r
96 Retrieves the health status of a controller in the platform. This function can also \r
97 optionally return warning messages, error messages, and a set of HII Forms that may \r
98 be repair a controller that is not proper configured. \r
99 \r
100 @param This A pointer to the EFI_DRIVER_HEALTH_PROTOCOL instance.\r
101\r
102 @param ControllerHandle The handle of the controller to retrieve the health status \r
103 on. This is an optional parameter that may be NULL. If \r
104 this parameter is NULL, then the value of ChildHandle is \r
105 ignored, and the combined health status of all the devices \r
106 that the driver is managing is returned.\r
107\r
108 @param ChildHandle The handle of the child controller to retrieve the health \r
109 status on. This is an optional parameter that may be NULL. \r
110 This parameter is ignored of ControllerHandle is NULL. It \r
111 will be NULL for device drivers. It will also be NULL for \r
112 bus drivers when an attempt is made to collect the health \r
113 status of the bus controller. If will not be NULL when an \r
114 attempt is made to collect the health status for a child \r
115 controller produced by the driver.\r
116\r
117 @param HealthStatus A pointer to the health status that is returned by this \r
118 function. This is an optional parameter that may be NULL. \r
119 This parameter is ignored of ControllerHandle is NULL. \r
120 The health status for the controller specified by \r
121 ControllerHandle and ChildHandle is returned. \r
122\r
123 @param MessageList A pointer to an array of warning or error messages associated \r
124 with the controller specified by ControllerHandle and \r
125 ChildHandle. This is an optional parameter that may be NULL. \r
126 MessageList is allocated by this function with the EFI Boot \r
127 Service AllocatePool(), and it is the caller's responsibility \r
128 to free MessageList with the EFI Boot Service FreePool(). \r
129 Each message is specified by tuple of an EFI_HII_HANDLE and \r
130 an EFI_STRING_ID. The array of messages is terminated by tuple \r
131 containing a EFI_HII_HANDLE with a value of NULL. The \r
132 EFI_HII_STRING_PROTOCOL.GetString() function can be used to \r
133 retrieve the warning or error message as a Null-terminated \r
134 Unicode string in a specific language. Messages may be \r
135 returned for any of the HealthStatus values except \r
136 EfiDriverHealthStatusReconnectRequired and \r
137 EfiDriverHealthStatusRebootRequired.\r
138\r
139 @param FormHiiHandle A pointer to the HII handle for an HII form associated with the \r
140 controller specified by ControllerHandle and ChildHandle. \r
141 This is an optional parameter that may be NULL. An HII form \r
142 is specified by a combination of an EFI_HII_HANDLE and an \r
143 EFI_GUID that identifies the Form Set GUID. The \r
144 EFI_FORM_BROWSER2_PROTOCOL.SendForm() function can be used \r
145 to display and allow the user to make configuration changes \r
146 to the HII Form. An HII form may only be returned with a \r
147 HealthStatus value of EfiDriverHealthStatusConfigurationRequired.\r
148\r
149 @retval EFI_SUCCESS ControllerHandle is NULL, and all the controllers \r
150 managed by this driver specified by This have a health \r
151 status of EfiDriverHealthStatusHealthy with no warning \r
152 messages to be returned. The ChildHandle, HealthStatus, \r
153 MessageList, and FormList parameters are ignored.\r
154\r
155 @retval EFI_DEVICE_ERROR ControllerHandle is NULL, and one or more of the \r
156 controllers managed by this driver specified by This \r
157 do not have a health status of EfiDriverHealthStatusHealthy. \r
158 The ChildHandle, HealthStatus, MessageList, and \r
159 FormList parameters are ignored.\r
160\r
161 @retval EFI_DEVICE_ERROR ControllerHandle is NULL, and one or more of the \r
162 controllers managed by this driver specified by This \r
163 have one or more warning and/or error messages. \r
164 The ChildHandle, HealthStatus, MessageList, and \r
165 FormList parameters are ignored.\r
166\r
167 @retval EFI_SUCCESS ControllerHandle is not NULL and the health status \r
168 of the controller specified by ControllerHandle and \r
169 ChildHandle was returned in HealthStatus. A list \r
170 of warning and error messages may be optionally \r
171 returned in MessageList, and a list of HII Forms \r
172 may be optionally returned in FormList.\r
173\r
174 @retval EFI_UNSUPPORTED ControllerHandle is not NULL, and the controller \r
175 specified by ControllerHandle and ChildHandle is not \r
176 currently being managed by the driver specified by This.\r
177\r
178 @retval EFI_INVALID_PARAMETER HealthStatus is NULL.\r
179\r
180 @retval EFI_OUT_OF_RESOURCES MessageList is not NULL, and there are not enough \r
181 resource available to allocate memory for MessageList.\r
182\r
183**/\r
184typedef\r
185EFI_STATUS\r
186(EFIAPI *EFI_DRIVER_HEALTH_GET_HEALTH_STATUS)(\r
187 IN EFI_DRIVER_HEALTH_PROTOCOL *This,\r
188 IN EFI_HANDLE ControllerHandle OPTIONAL,\r
189 IN EFI_HANDLE ChildHandle OPTIONAL,\r
190 OUT EFI_DRIVER_HEALTH_STATUS *HealthStatus,\r
191 OUT EFI_DRIVER_HEALTH_HII_MESSAGE **MessageList OPTIONAL,\r
192 OUT EFI_HII_HANDLE *FormHiiHandle OPTIONAL\r
193 );\r
194\r
195/**\r
196 Performs a repair operation on a controller in the platform. This function can \r
197 optionally report repair progress information back to the platform. \r
198 \r
199 @param This A pointer to the EFI_DRIVER_HEALTH_PROTOCOL instance.\r
200 @param ControllerHandle The handle of the controller to repair.\r
201 @param ChildHandle The handle of the child controller to repair. This is \r
202 an optional parameter that may be NULL. It will be NULL \r
203 for device drivers. It will also be NULL for bus \r
204 drivers when an attempt is made to repair a bus controller.\r
205 If will not be NULL when an attempt is made to repair a \r
206 child controller produced by the driver.\r
207 @param ProgressNotification A notification function that may be used by a driver to \r
208 report the progress of the repair operation. This is \r
209 an optional parameter that may be NULL. \r
210\r
211\r
212 @retval EFI_SUCCESS An attempt to repair the controller specified by \r
213 ControllerHandle and ChildHandle was performed. \r
214 The result of the repair operation can bet \r
215 determined by calling GetHealthStatus().\r
216 @retval EFI_UNSUPPORTED The driver specified by This is not currently \r
217 managing the controller specified by ControllerHandle \r
218 and ChildHandle.\r
219 @retval EFI_OUT_OF_RESOURCES There are not enough resources to perform the \r
220 repair operation.\r
221\r
222*/\r
223typedef\r
224EFI_STATUS\r
225(EFIAPI *EFI_DRIVER_HEALTH_REPAIR)(\r
226 IN EFI_DRIVER_HEALTH_PROTOCOL *This,\r
227 IN EFI_HANDLE ControllerHandle,\r
228 IN EFI_HANDLE ChildHandle OPTIONAL,\r
229 IN EFI_DRIVER_HEALTH_REPAIR_PROGRESS_NOTIFY ProgressNotification OPTIONAL\r
230 );\r
231\r
232///\r
233/// When installed, the Driver Health Protocol produces a collection of services\r
234/// that allow the health status for a controller to be retrieved. If a controller \r
235/// is not in a usable state, status messages may be reported to the user, repair \r
236/// operations can be invoked, and the user may be asked to make software and/or \r
237/// hardware configuration changes. \r
238///\r
239struct _EFI_DRIVER_HEALTH_PROTOCOL {\r
240 EFI_DRIVER_HEALTH_GET_HEALTH_STATUS GetHealthStatus;\r
241 EFI_DRIVER_HEALTH_REPAIR Repair;\r
242};\r
243\r
244extern EFI_GUID gEfiDriverHealthProtocolGuid;\r
245\r
246#endif\r
247\r
248\r
249\r
250\r