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