]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/PlatformToDriverConfiguration.h
Reviewed the code comments in the Include/Protocol directory for typos, grammar issue...
[mirror_edk2.git] / MdePkg / Include / Protocol / PlatformToDriverConfiguration.h
CommitLineData
d1f95000 1/** @file\r
ee6c452c 2 UEFI Platform to Driver Configuration Protocol is defined in UEFI specification.\r
3 \r
4 This is a protocol that is optionally produced by the platform and optionally consumed \r
5 by a UEFI Driver in its Start() function. This protocol allows the driver to receive \r
6 configuration information as part of being started.\r
d1f95000 7\r
4ca9b6c4 8 Copyright (c) 2006 - 2008, Intel Corporation \r
d1f95000 9 All rights reserved. This program and the accompanying materials \r
10 are licensed and made available under the terms and conditions of the BSD License \r
11 which accompanies this distribution. The full text of the license may be found at \r
12 http://opensource.org/licenses/bsd-license.php \r
13\r
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
16\r
d1f95000 17**/\r
18\r
19#ifndef __PLATFORM_TO_DRIVER_CONFIGUARTION_H__\r
20#define __PLATFORM_TO_DRIVER_CONFIGUARTION_H__\r
21\r
22#define EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL_GUID \\r
23 { 0x642cd590, 0x8059, 0x4c0a, { 0xa9, 0x58, 0xc5, 0xec, 0x7, 0xd2, 0x3c, 0x4b } }\r
24\r
25\r
26typedef struct _EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL;\r
27\r
28\r
29/**\r
30 The UEFI driver must call Query early in the Start() function\r
31 before any time consuming operations are performed. If\r
32 ChildHandle is NULL the driver is requesting information from\r
33 the platform about the ControllerHandle that is being started.\r
34 Information returned from Query may lead to the drivers Start()\r
764f4d53 35 function failing.\r
630b4187 36 If the UEFI driver is a bus driver and producing a ChildHandle,\r
764f4d53 37 the driver must call Query after the child handle has been created\r
38 and an EFI_DEVICE_PATH_PROTOCOL has been placed on that handle,\r
39 but before any time consuming operation is performed. If information\r
40 return by Query may lead the driver to decide to not create the\r
41 ChildHandle. The driver must then cleanup and remove the ChildHandle\r
42 from the system.\r
43 The UEFI driver repeatedly calls Query, processes the information\r
44 returned by the platform, and calls Response passing in the\r
45 arguments returned from Query. The Instance value passed into\r
46 Response must be the same value passed into the corresponding\r
47 call to Query.\r
48 An Instance value of zero means return the first ParameterBlock\r
49 in the set of unprocessed parameter blocks. The driver should\r
50 increment the Instance value by one for each successive call to Query.\r
d1f95000 51\r
4ca9b6c4 52 @param This A pointer to the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL instance.\r
d1f95000 53 \r
4ca9b6c4
LG
54 @param ControllerHandle The handle the platform will return\r
55 configuration information about.\r
d1f95000 56 \r
4ca9b6c4
LG
57 @param ChildHandle The handle of the child controller to\r
58 return information on. This is an optional\r
59 parameter that may be NULL. It will be\r
630b4187 60 NULL for device drivers and for bus\r
4ca9b6c4
LG
61 drivers that attempt to get options for\r
62 the bus controller. It will not be NULL\r
63 for a bus driver that attempts to get\r
64 options for one of its child controllers.\r
d1f95000 65 \r
66 \r
764f4d53 67 @param Instance Pointer to the Instance value. Zero means\r
68 return the first query data. The caller should\r
69 increment this value by one each time to retrieve\r
70 successive data.\r
71\r
72 @param ParameterTypeGuid An EFI_GUID that defines the contents\r
73 of ParameterBlock. UEFI drivers must\r
74 use the ParameterTypeGuid to determine\r
75 how to parse the ParameterBlock. The caller\r
76 should not attempt to free ParameterTypeGuid.\r
4ca9b6c4
LG
77\r
78 @param ParameterBlock The platform returns a pointer to the\r
630b4187 79 ParameterBlock structure, which\r
4ca9b6c4
LG
80 contains details about the\r
81 configuration parameters specific to\r
82 the ParameterTypeGuid. This structure\r
83 is defined based on the protocol and\r
84 may be different for different\r
85 protocols. UEFI driver decodes this\r
86 structure and its contents based on\r
87 ProtocolGuid. ParameterBlock is\r
630b4187 88 allocated by the platform. The\r
4ca9b6c4
LG
89 platform is responsible for freeing\r
90 the ParameterBlock after Result is\r
91 called.\r
d1f95000 92\r
93 @param ParameterBlockSize The platform returns the size of\r
94 the ParameterBlock in bytes.\r
95\r
96\r
4ca9b6c4
LG
97 @retval EFI_SUCCESS The platform return parameter\r
98 information for ControllerHandle.\r
d1f95000 99\r
4ca9b6c4 100 @retval EFI_NOT_FOUND No more unread Instance exists.\r
d1f95000 101\r
102 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid\r
103 EFI_HANDLE.\r
104\r
105 @retval EFI_INVALID_PARAMETER Instance is NULL.\r
106\r
4ca9b6c4
LG
107 @retval EFI_DEVICE_ERROR A device error occurred while\r
108 attempting to return parameter block\r
109 information for the controller\r
110 specified by ControllerHandle and\r
111 ChildHandle.\r
d1f95000 112\r
4ca9b6c4
LG
113 @retval EFI_OUT_RESOURCES There are not enough resources\r
114 available to set the configuration\r
115 options for the controller specified\r
116 by ControllerHandle and ChildHandle.\r
d1f95000 117\r
118\r
119**/\r
120typedef\r
121EFI_STATUS\r
8b13229b 122(EFIAPI *EFI_PLATFORM_TO_DRIVER_CONFIGURATION_QUERY)(\r
d1f95000 123 IN CONST EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL *This,\r
124 IN CONST EFI_HANDLE ControllerHandle,\r
125 IN CONST EFI_HANDLE ChildHandle OPTIONAL,\r
764f4d53 126 IN CONST UINTN *Instance,\r
127 OUT EFI_GUID **ParameterTypeGuid,\r
128 OUT VOID **ParameterBlock,\r
129 OUT UINTN *ParameterBlockSize\r
d1f95000 130);\r
131\r
d1f95000 132typedef enum {\r
cce6f7aa 133 ///\r
134 /// The controller specified by ControllerHandle is still\r
630b4187 135 /// in a usable state, and its configuration has been updated\r
cce6f7aa 136 /// via parsing the ParameterBlock. If required by the\r
630b4187 137 /// parameter block, and the module supports an NVRAM store,\r
cce6f7aa 138 /// the configuration information from PB was successfully\r
139 /// saved to the NVRAM. No actions are required before\r
140 /// this controller can be used again with the updated\r
141 /// configuration settings.\r
142 ///\r
d1f95000 143 EfiPlatformConfigurationActionNone = 0,\r
cce6f7aa 144 \r
145 ///\r
146 /// The driver has detected that the controller specified\r
630b4187 147 /// by ControllerHandle is not in a usable state and \r
cce6f7aa 148 /// needs to be stopped. The calling agent can use the\r
149 /// DisconnectControservice to perform this operation, and\r
150 /// it should be performed as soon as possible. \r
151 ///\r
d1f95000 152 EfiPlatformConfigurationActionStopController = 1,\r
cce6f7aa 153 \r
154 ///\r
155 /// This controller specified by ControllerHandle needs to\r
156 /// be stopped and restarted before it can be used again.\r
157 /// The calling agent can use the DisconnectController()\r
158 /// and ConnectController() services to perform this\r
630b4187 159 /// operation. The restart operation can be delayed until\r
160 /// all of the configuration options have been set. \r
cce6f7aa 161 ///\r
d1f95000 162 EfiPlatformConfigurationActionRestartController = 2,\r
cce6f7aa 163 \r
164 ///\r
165 /// A configuration change has been made that requires the\r
166 /// platform to be restarted before the controller\r
167 /// specified by ControllerHandle can be used again. The\r
168 /// calling agent can use the ResetSystem() services to\r
169 /// perform this operation. The restart operation can be\r
170 /// delayed until all of the configuration options have\r
171 /// been set. \r
172 ///\r
d1f95000 173 EfiPlatformConfigurationActionRestartPlatform = 3,\r
cce6f7aa 174\r
175 ///\r
176 /// The controller specified by ControllerHandle is still\r
177 /// in a usable state; its configuration has been updated\r
178 /// via parsing the ParameterBlock. The driver tried to\r
179 /// update the driver's private NVRAM store with\r
180 /// information from ParameterBlock and failed. No actions\r
181 /// are required before this controller can be used again\r
182 /// with the updated configuration settings, but these\r
183 /// configuration settings are not guaranteed to persist\r
184 /// after ControllerHandle is stopped. \r
185 /// \r
d1f95000 186 EfiPlatformConfigurationActionNvramFailed = 4,\r
187 EfiPlatformConfigurationActionMaximum\r
188} EFI_PLATFORM_CONFIGURATION_ACTION;\r
189\r
190\r
191/**\r
192 The UEFI driver repeatedly calls Query, processes the\r
193 information returned by the platform, and calls Response passing\r
194 in the arguments returned from Query. The UEFI driver must\r
195 continuously call Query until EFI_NOT_FOUND is returned. For\r
196 every call to Query that returns EFI_SUCCESS a corrisponding\r
197 call to Response is required passing in the same\r
198 ContollerHandle, ChildHandle, Instance, ParameterTypeGuid,\r
199 ParameterBlock, and ParameterBlockSize. The UEFI driver may\r
200 update values in ParameterBlock based on rules defined by\r
201 ParameterTypeGuid. The platform is responsible for freeing\r
630b4187 202 ParameterBlock and the UEFI driver must not try to free it.\r
d1f95000 203\r
4ca9b6c4 204 @param This A pointer to the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL instance.\r
d1f95000 205\r
4ca9b6c4
LG
206 @param ControllerHandle The handle the driver is returning\r
207 configuration information about.\r
d1f95000 208\r
4ca9b6c4
LG
209 @param ChildHandle The handle of the child controller to\r
210 return information on. This is an optional\r
211 parameter that may be NULL. It will be\r
212 NULL for device drivers, and for bus\r
213 drivers that attempt to get options for\r
214 the bus controller. It will not be NULL\r
215 for a bus driver that attempts to get\r
216 options for one of its child controllers.\r
217 Instance Instance data returned from\r
218 Query().\r
d1f95000 219\r
764f4d53 220 @param Instance Instance data passed to Query().\r
221\r
4ca9b6c4 222 @param ParameterTypeGuid ParameterTypeGuid returned from Query.\r
d1f95000 223\r
4ca9b6c4 224 @param ParameterBlock ParameterBlock returned from Query.\r
d1f95000 225\r
4ca9b6c4 226 @param ParameterBlockSize The ParameterBlock size returned from Query.\r
d1f95000 227\r
630b4187 228 @param ConfigurationAction The driver tells the platform what\r
4ca9b6c4
LG
229 action is required for ParameterBlock to\r
230 take effect.\r
d1f95000 231 \r
d1f95000 232 \r
4ca9b6c4
LG
233 @retval EFI_SUCCESS The platform return parameter information\r
234 for ControllerHandle.\r
d1f95000 235 \r
4ca9b6c4 236 @retval EFI_NOT_FOUND Instance was not found.\r
d1f95000 237 \r
4ca9b6c4
LG
238 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
239 \r
d1f95000 240 @retval EFI_INVALID_PARAMETER Instance is zero.\r
241 \r
242**/\r
243typedef\r
244EFI_STATUS\r
8b13229b 245(EFIAPI *EFI_PLATFORM_TO_DRIVER_CONFIGURATION_RESPONSE)(\r
d1f95000 246 IN CONST EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL *This,\r
247 IN CONST EFI_HANDLE ControllerHandle,\r
248 IN CONST EFI_HANDLE ChildHandle OPTIONAL,\r
249 IN CONST UINTN *Instance,\r
250 IN CONST EFI_GUID *ParameterTypeGuid,\r
251 IN CONST VOID *ParameterBlock,\r
252 IN CONST UINTN ParameterBlockSize ,\r
253 IN CONST EFI_PLATFORM_CONFIGURATION_ACTION ConfigurationAction\r
254);\r
255\r
256\r
44717a39 257///\r
258/// The EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL is used by the\r
259/// UEFI driver to query the platform for configuration information.\r
260/// The UEFI driver calls Query() multiple times to get\r
261/// configuration information from the platform. For every call to\r
262/// Query() there must be a matching call to Response() so the\r
263/// UEFI driver can inform the platform how it used the\r
264/// information passed in from Query(). It's legal for a UEFI\r
265/// driver to use Response() to inform the platform it does not\r
266/// understand the data returned via Query() and thus no action was\r
267/// taken.\r
268///\r
d1f95000 269struct _EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL {\r
270 EFI_PLATFORM_TO_DRIVER_CONFIGURATION_QUERY Query;\r
271 EFI_PLATFORM_TO_DRIVER_CONFIGURATION_RESPONSE Response;\r
272};\r
273\r
274\r
275\r
276#define EFI_PLATFORM_TO_DRIVER_CONFIGURATION_CLP_GUID \\r
277 {0x345ecc0e, 0xcb6, 0x4b75, { 0xbb, 0x57, 0x1b, 0x12, 0x9c, 0x47, 0x33,0x3e } }\r
278\r
279/**\r
280 \r
281 ParameterTypeGuid provides the support for parameters\r
282 communicated through the DMTF SM CLP Specification 1.0 Final\r
283 Standard to be used to configure the UEFI driver. In this\r
284 section the producer of the\r
285 EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL is platform\r
286 firmware and the consumer is the UEFI driver. Note: if future\r
287 versions of the DMTF SM CLP Specification require changes to the\r
630b4187 288 parameter block definition, a newer ParameterTypeGuid will be\r
d1f95000 289 used.\r
d1f95000 290**/\r
291typedef struct {\r
11f2f87e 292 CHAR8 *CLPCommand; ///< A pointer to the DMTF SM CLP command line null-terminated string that the \r
630b4187 293 ///< driver is required to parse and process. EFI_SUCCESS The platform \r
11f2f87e 294 ///< return parameter information for ControllerHandle. EFI_NOT_FOUND Instance \r
295 ///< was not found. EFI_INVALID_PARAMETER ControllerHandle is not a valid \r
630b4187 296 ///< EFI_HANDLE. EFI_INVALID_PARAMETER Instance is zero. Function is called. \r
11f2f87e 297 ///< See the DMTF SM CLP Specification 1.0 Final Standard for details on the \r
298 ///< format and syntax of the CLP command line string. CLPCommand buffer\r
299 ///< is allocated by the producer of the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOOL.\r
300 UINT32 CLPCommandLength; ///< The length of the CLP Command in bytes.\r
301 CHAR8 *CLPReturnString; ///< A pointer to the CLP return status string that the driver is required to\r
302 ///< provide to the calling agent. The calling agent may parse and/ or pass\r
303 ///< this for processing and user feedback. The SM CLP Command Response string\r
304 ///< buffer is filled in by the UEFI driver in the "keyword=value" format\r
305 ///< described in the SM CLP Specification, unless otherwise requested via the SM\r
306 ///< CLP Coutput option in the Command Line string buffer. UEFI driver's support\r
307 ///< for this default "keyword=value" output format is required if the UEFI\r
308 ///< driver supports this protocol, while support for other SM CLP output\r
309 ///< formats is optional (the UEFI Driver should return an EFI_UNSUPPORTED if\r
310 ///< the SM CLP Coutput option requested by the caller is not supported by the\r
311 ///< UEFI Driver). CLPReturnString buffer is allocated by the consumer of the\r
312 ///< EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOC OL and undefined prior to the call to\r
313 ///< Response(). \r
314 UINT32 CLPReturnStringLength; ///< The length of the CLP return status string in bytes.\r
315 UINT8 CLPCmdStatus; ///< SM CLP Command Status (see DMTF SM CLP Specification 1.0 Final Standard -\r
316 ///< Table 4) CLPErrorValue SM CLP Processing Error Value (see DMTF SM\r
317 ///< CLP Specification 1.0 Final Standard - Table 6). This field is filled in by\r
318 ///< the consumer of the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOC \r
319 ///< OL and undefined prior to the call to Response(). \r
320 UINT8 CLPErrorValue; ///< SM CLP Processing Error Value (see DMTF SM CLP Specification 1.0 Final Standard - Table 6).\r
321 ///< This field is filled in by the consumer of the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL and undefined prior to the call to Response(). \r
322 UINT16 CLPMsgCode; ///< Bit 15: OEM Message Code Flag 0 = Message Code is an SM CLP Probable\r
323 ///< Cause Value. (see SM CLP Specification Table 11) 1 = Message Code is OEM\r
324 ///< Specific Bits 14-0: Message Code This field is filled in by the consumer of\r
325 ///< the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOC OL and undefined prior to the call to\r
326 ///< Response(). \r
327\r
d1f95000 328} EFI_CONFIGURE_CLP_PARAMETER_BLK;\r
329\r
330\r
331\r
332extern EFI_GUID gEfiPlatformToDriverConfigurationClpGuid;\r
333\r
334extern EFI_GUID gEfiPlatformToDriverConfigurationProtocolGuid;\r
335\r
336#endif\r