VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Include/Protocol/DriverHealth.h

最後變更 在這個檔案是 105670,由 vboxsync 提交於 7 月 前

Devices/EFI/FirmwareNew: Merge edk2-stable-202405 and make it build on aarch64, bugref:4643

  • 屬性 svn:eol-style 設為 native
檔案大小: 11.0 KB
 
1/** @file
2 EFI Driver Health Protocol definitions.
3
4 When installed, the Driver Health Protocol produces a collection of services that allow
5 the health status for a controller to be retrieved. If a controller is not in a usable
6 state, status messages may be reported to the user, repair operations can be invoked,
7 and the user may be asked to make software and/or hardware configuration changes.
8
9 The Driver Health Protocol is optionally produced by a driver that follows the
10 EFI Driver Model. If an EFI Driver needs to report health status to the platform,
11 provide warning or error messages to the user, perform length repair operations,
12 or request the user to make hardware or software configuration changes, then the
13 Driver Health Protocol must be produced.
14
15 A controller that is managed by driver that follows the EFI Driver Model and
16 produces the Driver Health Protocol must report the current health of the
17 controllers that the driver is currently managing. The controller can initially
18 be healthy, failed, require repair, or require configuration. If a controller
19 requires configuration, and the user make configuration changes, the controller
20 may then need to be reconnected or the system may need to be rebooted for the
21 configuration changes to take affect.
22
23 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
24 Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
25 SPDX-License-Identifier: BSD-2-Clause-Patent
26
27 @par Revision Reference:
28 This Protocol is defined in UEFI Specification 2.3d
29
30**/
31
32#ifndef __EFI_DRIVER_HEALTH_H__
33#define __EFI_DRIVER_HEALTH_H__
34
35#define EFI_DRIVER_HEALTH_PROTOCOL_GUID \
36 { \
37 0x2a534210, 0x9280, 0x41d8, { 0xae, 0x79, 0xca, 0xda, 0x1, 0xa2, 0xb1, 0x27 } \
38 }
39
40typedef struct _EFI_DRIVER_HEALTH_PROTOCOL EFI_DRIVER_HEALTH_PROTOCOL;
41
42///
43/// EFI_DRIVER_HEALTH_HEALTH_STATUS
44///
45typedef enum {
46 EfiDriverHealthStatusHealthy,
47 EfiDriverHealthStatusRepairRequired,
48 EfiDriverHealthStatusConfigurationRequired,
49 EfiDriverHealthStatusFailed,
50 EfiDriverHealthStatusReconnectRequired,
51 EfiDriverHealthStatusRebootRequired
52} EFI_DRIVER_HEALTH_STATUS;
53
54///
55/// EFI_DRIVER_HEALTH_HII_MESSAGE
56///
57typedef struct {
58 EFI_HII_HANDLE HiiHandle;
59 EFI_STRING_ID StringId;
60
61 ///
62 /// 64-bit numeric value of the warning/error specified by this message.
63 /// A value of 0x0000000000000000 is used to indicate that MessageCode is not specified.
64 /// The values 0x0000000000000001 to 0x0fffffffffffffff are reserved for allocation by the UEFI Specification.
65 /// The values 0x1000000000000000 to 0x1fffffffffffffff are reserved for IHV-developed drivers.
66 /// The values 0x8000000000000000 to 0x8fffffffffffffff is reserved for platform/OEM drivers.
67 /// All other values are reserved and should not be used.
68 ///
69 UINT64 MessageCode;
70} EFI_DRIVER_HEALTH_HII_MESSAGE;
71
72/**
73 Reports the progress of a repair operation
74
75 @param[in] Value A value between 0 and Limit that identifies the current
76 progress of the repair operation.
77
78 @param[in] Limit The maximum value of Value for the current repair operation.
79 For example, a driver that wants to specify progress in
80 percent would use a Limit value of 100.
81**/
82typedef
83EFI_STATUS
84(EFIAPI *EFI_DRIVER_HEALTH_REPAIR_NOTIFY)(
85 IN UINTN Value,
86 IN UINTN Limit
87 );
88
89/**
90 Retrieves the health status of a controller in the platform. This function can also
91 optionally return warning messages, error messages, and a set of HII Forms that may
92 be repair a controller that is not proper configured.
93
94 @param[in] This A pointer to the EFI_DRIVER_HEALTH_PROTOCOL instance.
95
96 @param[in] ControllerHandle The handle of the controller to retrieve the health status
97 on. This is an optional parameter that may be NULL. If
98 this parameter is NULL, then the value of ChildHandle is
99 ignored, and the combined health status of all the devices
100 that the driver is managing is returned.
101
102 @param[in] ChildHandle The handle of the child controller to retrieve the health
103 status on. This is an optional parameter that may be NULL.
104 This parameter is ignored of ControllerHandle is NULL. It
105 will be NULL for device drivers. It will also be NULL for
106 bus drivers when an attempt is made to collect the health
107 status of the bus controller. If will not be NULL when an
108 attempt is made to collect the health status for a child
109 controller produced by the driver.
110
111 @param[out] HealthStatus A pointer to the health status that is returned by this
112 function. This is an optional parameter that may be NULL.
113 This parameter is ignored of ControllerHandle is NULL.
114 The health status for the controller specified by
115 ControllerHandle and ChildHandle is returned.
116
117 @param[out] MessageList A pointer to an array of warning or error messages associated
118 with the controller specified by ControllerHandle and
119 ChildHandle. This is an optional parameter that may be NULL.
120 MessageList is allocated by this function with the EFI Boot
121 Service AllocatePool(), and it is the caller's responsibility
122 to free MessageList with the EFI Boot Service FreePool().
123 Each message is specified by tuple of an EFI_HII_HANDLE and
124 an EFI_STRING_ID. The array of messages is terminated by tuple
125 containing a EFI_HII_HANDLE with a value of NULL. The
126 EFI_HII_STRING_PROTOCOL.GetString() function can be used to
127 retrieve the warning or error message as a Null-terminated
128 string in a specific language. Messages may be
129 returned for any of the HealthStatus values except
130 EfiDriverHealthStatusReconnectRequired and
131 EfiDriverHealthStatusRebootRequired.
132
133 @param[out] FormHiiHandle A pointer to the HII handle containing the HII form used when
134 configuration is required. The HII handle is associated with
135 the controller specified by ControllerHandle and ChildHandle.
136 If this is NULL, then no HII form is available. An HII handle
137 will only be returned with a HealthStatus value of
138 EfiDriverHealthStatusConfigurationRequired.
139
140 @retval EFI_SUCCESS The health status of the controller specified by
141 ControllerHandle and ChildHandle was returned in HealthStatus.
142 A list of warning and error messages may be optionally
143 returned in MessageList, and an HII Form may be optionally
144 specified by FormHiiHandle.
145
146 @retval EFI_UNSUPPORTED ControllerHandle is not NULL, and the controller
147 specified by ControllerHandle and ChildHandle is not
148 currently being managed by the driver specified by This.
149
150 @retval EFI_UNSUPPORTED ControllerHandle is NULL and there are no devices being
151 managed by the driver.
152
153 @retval EFI_INVALID_PARAMETER HealthStatus is NULL.
154
155 @retval EFI_OUT_OF_RESOURCES MessageList is not NULL, and there are not enough
156 resource available to allocate memory for MessageList.
157
158**/
159typedef
160EFI_STATUS
161(EFIAPI *EFI_DRIVER_HEALTH_GET_HEALTH_STATUS)(
162 IN EFI_DRIVER_HEALTH_PROTOCOL *This,
163 IN EFI_HANDLE ControllerHandle OPTIONAL,
164 IN EFI_HANDLE ChildHandle OPTIONAL,
165 OUT EFI_DRIVER_HEALTH_STATUS *HealthStatus,
166 OUT EFI_DRIVER_HEALTH_HII_MESSAGE **MessageList OPTIONAL,
167 OUT EFI_HII_HANDLE *FormHiiHandle OPTIONAL
168 );
169
170/**
171 Performs a repair operation on a controller in the platform. This function can
172 optionally report repair progress information back to the platform.
173
174 @param[in] This A pointer to the EFI_DRIVER_HEALTH_PROTOCOL instance.
175 @param[in] ControllerHandle The handle of the controller to repair.
176 @param[in] ChildHandle The handle of the child controller to repair. This is
177 an optional parameter that may be NULL. It will be NULL
178 for device drivers. It will also be NULL for bus
179 drivers when an attempt is made to repair a bus controller.
180 If will not be NULL when an attempt is made to repair a
181 child controller produced by the driver.
182 @param[in] RepairNotify A notification function that may be used by a driver to
183 report the progress of the repair operation. This is
184 an optional parameter that may be NULL.
185
186
187 @retval EFI_SUCCESS An attempt to repair the controller specified by
188 ControllerHandle and ChildHandle was performed.
189 The result of the repair operation can bet
190 determined by calling GetHealthStatus().
191 @retval EFI_UNSUPPORTED The driver specified by This is not currently
192 managing the controller specified by ControllerHandle
193 and ChildHandle.
194 @retval EFI_OUT_OF_RESOURCES There are not enough resources to perform the
195 repair operation.
196
197*/
198typedef
199EFI_STATUS
200(EFIAPI *EFI_DRIVER_HEALTH_REPAIR)(
201 IN EFI_DRIVER_HEALTH_PROTOCOL *This,
202 IN EFI_HANDLE ControllerHandle,
203 IN EFI_HANDLE ChildHandle OPTIONAL,
204 IN EFI_DRIVER_HEALTH_REPAIR_NOTIFY RepairNotify OPTIONAL
205 );
206
207///
208/// When installed, the Driver Health Protocol produces a collection of services
209/// that allow the health status for a controller to be retrieved. If a controller
210/// is not in a usable state, status messages may be reported to the user, repair
211/// operations can be invoked, and the user may be asked to make software and/or
212/// hardware configuration changes.
213///
214struct _EFI_DRIVER_HEALTH_PROTOCOL {
215 EFI_DRIVER_HEALTH_GET_HEALTH_STATUS GetHealthStatus;
216 EFI_DRIVER_HEALTH_REPAIR Repair;
217};
218
219extern EFI_GUID gEfiDriverHealthProtocolGuid;
220
221#endif
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette