]>
Commit | Line | Data |
---|---|---|
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 |
a65c44c9 | 8 | Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r |
9df063a0 | 9 | This program and the accompanying materials \r |
d1f95000 | 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 | |
26 | typedef 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 | |
a65c44c9 RN |
47 | call to Query. The UEFI driver must continuously call Query and\r |
48 | Response until EFI_NOT_FOUND is returned by Query.\r | |
49 | If the UEFI driver does not recognize the ParameterTypeGuid, it\r | |
50 | calls Response with a ConfigurationAction of\r | |
51 | EfiPlatformConfigurationActionUnsupportedGuid. The UEFI driver\r | |
52 | must then continue calling Query and Response until EFI_NOT_FOUND\r | |
53 | is returned by Query. This gives the platform an opportunity to\r | |
54 | pass additional configuration settings using a different\r | |
55 | ParameterTypeGuid that may be supported by the driver.\r | |
764f4d53 | 56 | An Instance value of zero means return the first ParameterBlock\r |
57 | in the set of unprocessed parameter blocks. The driver should\r | |
58 | increment the Instance value by one for each successive call to Query.\r | |
d1f95000 | 59 | \r |
4ca9b6c4 | 60 | @param This A pointer to the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL instance.\r |
d1f95000 | 61 | \r |
4ca9b6c4 LG |
62 | @param ControllerHandle The handle the platform will return\r |
63 | configuration information about.\r | |
d1f95000 | 64 | \r |
4ca9b6c4 LG |
65 | @param ChildHandle The handle of the child controller to\r |
66 | return information on. This is an optional\r | |
67 | parameter that may be NULL. It will be\r | |
630b4187 | 68 | NULL for device drivers and for bus\r |
4ca9b6c4 LG |
69 | drivers that attempt to get options for\r |
70 | the bus controller. It will not be NULL\r | |
71 | for a bus driver that attempts to get\r | |
72 | options for one of its child controllers.\r | |
d1f95000 | 73 | \r |
74 | \r | |
764f4d53 | 75 | @param Instance Pointer to the Instance value. Zero means\r |
76 | return the first query data. The caller should\r | |
77 | increment this value by one each time to retrieve\r | |
78 | successive data.\r | |
79 | \r | |
80 | @param ParameterTypeGuid An EFI_GUID that defines the contents\r | |
81 | of ParameterBlock. UEFI drivers must\r | |
82 | use the ParameterTypeGuid to determine\r | |
83 | how to parse the ParameterBlock. The caller\r | |
84 | should not attempt to free ParameterTypeGuid.\r | |
4ca9b6c4 LG |
85 | \r |
86 | @param ParameterBlock The platform returns a pointer to the\r | |
f754f721 | 87 | ParameterBlock structure which\r |
4ca9b6c4 LG |
88 | contains details about the\r |
89 | configuration parameters specific to\r | |
90 | the ParameterTypeGuid. This structure\r | |
91 | is defined based on the protocol and\r | |
92 | may be different for different\r | |
93 | protocols. UEFI driver decodes this\r | |
94 | structure and its contents based on\r | |
bbeea0de | 95 | ParameterTypeGuid. ParameterBlock is\r |
f754f721 | 96 | allocated by the platform and the\r |
4ca9b6c4 LG |
97 | platform is responsible for freeing\r |
98 | the ParameterBlock after Result is\r | |
99 | called.\r | |
d1f95000 | 100 | \r |
101 | @param ParameterBlockSize The platform returns the size of\r | |
102 | the ParameterBlock in bytes.\r | |
103 | \r | |
104 | \r | |
4ca9b6c4 LG |
105 | @retval EFI_SUCCESS The platform return parameter\r |
106 | information for ControllerHandle.\r | |
d1f95000 | 107 | \r |
4ca9b6c4 | 108 | @retval EFI_NOT_FOUND No more unread Instance exists.\r |
d1f95000 | 109 | \r |
18bd7e85 | 110 | @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r |
d1f95000 | 111 | \r |
112 | @retval EFI_INVALID_PARAMETER Instance is NULL.\r | |
113 | \r | |
4ca9b6c4 LG |
114 | @retval EFI_DEVICE_ERROR A device error occurred while\r |
115 | attempting to return parameter block\r | |
116 | information for the controller\r | |
117 | specified by ControllerHandle and\r | |
118 | ChildHandle.\r | |
d1f95000 | 119 | \r |
4ca9b6c4 LG |
120 | @retval EFI_OUT_RESOURCES There are not enough resources\r |
121 | available to set the configuration\r | |
122 | options for the controller specified\r | |
123 | by ControllerHandle and ChildHandle.\r | |
d1f95000 | 124 | \r |
125 | \r | |
126 | **/\r | |
127 | typedef\r | |
128 | EFI_STATUS\r | |
8b13229b | 129 | (EFIAPI *EFI_PLATFORM_TO_DRIVER_CONFIGURATION_QUERY)(\r |
d1f95000 | 130 | IN CONST EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL *This,\r |
131 | IN CONST EFI_HANDLE ControllerHandle,\r | |
132 | IN CONST EFI_HANDLE ChildHandle OPTIONAL,\r | |
764f4d53 | 133 | IN CONST UINTN *Instance,\r |
134 | OUT EFI_GUID **ParameterTypeGuid,\r | |
135 | OUT VOID **ParameterBlock,\r | |
136 | OUT UINTN *ParameterBlockSize\r | |
d1f95000 | 137 | );\r |
138 | \r | |
d1f95000 | 139 | typedef enum {\r |
cce6f7aa | 140 | ///\r |
141 | /// The controller specified by ControllerHandle is still\r | |
630b4187 | 142 | /// in a usable state, and its configuration has been updated\r |
cce6f7aa | 143 | /// via parsing the ParameterBlock. If required by the\r |
630b4187 | 144 | /// parameter block, and the module supports an NVRAM store,\r |
cce6f7aa | 145 | /// the configuration information from PB was successfully\r |
146 | /// saved to the NVRAM. No actions are required before\r | |
147 | /// this controller can be used again with the updated\r | |
148 | /// configuration settings.\r | |
149 | ///\r | |
d1f95000 | 150 | EfiPlatformConfigurationActionNone = 0,\r |
cce6f7aa | 151 | \r |
152 | ///\r | |
153 | /// The driver has detected that the controller specified\r | |
630b4187 | 154 | /// by ControllerHandle is not in a usable state and \r |
cce6f7aa | 155 | /// needs to be stopped. The calling agent can use the\r |
156 | /// DisconnectControservice to perform this operation, and\r | |
157 | /// it should be performed as soon as possible. \r | |
158 | ///\r | |
d1f95000 | 159 | EfiPlatformConfigurationActionStopController = 1,\r |
cce6f7aa | 160 | \r |
161 | ///\r | |
162 | /// This controller specified by ControllerHandle needs to\r | |
163 | /// be stopped and restarted before it can be used again.\r | |
164 | /// The calling agent can use the DisconnectController()\r | |
165 | /// and ConnectController() services to perform this\r | |
630b4187 | 166 | /// operation. The restart operation can be delayed until\r |
167 | /// all of the configuration options have been set. \r | |
cce6f7aa | 168 | ///\r |
d1f95000 | 169 | EfiPlatformConfigurationActionRestartController = 2,\r |
cce6f7aa | 170 | \r |
171 | ///\r | |
172 | /// A configuration change has been made that requires the\r | |
173 | /// platform to be restarted before the controller\r | |
174 | /// specified by ControllerHandle can be used again. The\r | |
175 | /// calling agent can use the ResetSystem() services to\r | |
176 | /// perform this operation. The restart operation can be\r | |
177 | /// delayed until all of the configuration options have\r | |
178 | /// been set. \r | |
179 | ///\r | |
d1f95000 | 180 | EfiPlatformConfigurationActionRestartPlatform = 3,\r |
cce6f7aa | 181 | \r |
182 | ///\r | |
183 | /// The controller specified by ControllerHandle is still\r | |
184 | /// in a usable state; its configuration has been updated\r | |
185 | /// via parsing the ParameterBlock. The driver tried to\r | |
186 | /// update the driver's private NVRAM store with\r | |
187 | /// information from ParameterBlock and failed. No actions\r | |
188 | /// are required before this controller can be used again\r | |
189 | /// with the updated configuration settings, but these\r | |
190 | /// configuration settings are not guaranteed to persist\r | |
191 | /// after ControllerHandle is stopped. \r | |
192 | /// \r | |
d1f95000 | 193 | EfiPlatformConfigurationActionNvramFailed = 4,\r |
a65c44c9 RN |
194 | \r |
195 | ///\r | |
196 | /// The controller specified by ControllerHandle is still\r | |
197 | /// in a usable state; its configuration has not been updated\r | |
198 | /// via parsing the ParameterBlock. The driver did not support\r | |
199 | /// the ParameterBlock format identified by ParameterTypeGuid.\r | |
200 | /// No actions are required before this controller can be used\r | |
201 | /// again. On additional Query calls from this ControllerHandle,\r | |
202 | /// the platform should stop returning a ParameterBlock\r | |
203 | /// qualified by this same ParameterTypeGuid. If no other\r | |
204 | /// ParameterTypeGuid is supported by the platform, Query\r | |
205 | /// should return EFI_NOT_FOUND.\r | |
206 | ///\r | |
207 | EfiPlatformConfigurationActionUnsupportedGuid = 5,\r | |
d1f95000 | 208 | EfiPlatformConfigurationActionMaximum\r |
209 | } EFI_PLATFORM_CONFIGURATION_ACTION;\r | |
210 | \r | |
211 | \r | |
212 | /**\r | |
213 | The UEFI driver repeatedly calls Query, processes the\r | |
214 | information returned by the platform, and calls Response passing\r | |
215 | in the arguments returned from Query. The UEFI driver must\r | |
216 | continuously call Query until EFI_NOT_FOUND is returned. For\r | |
217 | every call to Query that returns EFI_SUCCESS a corrisponding\r | |
218 | call to Response is required passing in the same\r | |
219 | ContollerHandle, ChildHandle, Instance, ParameterTypeGuid,\r | |
220 | ParameterBlock, and ParameterBlockSize. The UEFI driver may\r | |
221 | update values in ParameterBlock based on rules defined by\r | |
222 | ParameterTypeGuid. The platform is responsible for freeing\r | |
630b4187 | 223 | ParameterBlock and the UEFI driver must not try to free it.\r |
d1f95000 | 224 | \r |
f754f721 | 225 | @param This A pointer to the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL instance.\r |
d1f95000 | 226 | \r |
f754f721 | 227 | @param ControllerHandle The handle the driver is returning\r |
228 | configuration information about.\r | |
d1f95000 | 229 | \r |
f754f721 | 230 | @param ChildHandle The handle of the child controller to\r |
231 | return information on. This is an optional\r | |
232 | parameter that may be NULL. It will be\r | |
233 | NULL for device drivers, and for bus\r | |
234 | drivers that attempt to get options for\r | |
235 | the bus controller. It will not be NULL\r | |
236 | for a bus driver that attempts to get\r | |
237 | options for one of its child controllers.\r | |
238 | Instance Instance data returned from\r | |
239 | Query().\r | |
d1f95000 | 240 | \r |
f754f721 | 241 | @param Instance Instance data passed to Query().\r |
764f4d53 | 242 | \r |
f754f721 | 243 | @param ParameterTypeGuid ParameterTypeGuid returned from Query.\r |
d1f95000 | 244 | \r |
f754f721 | 245 | @param ParameterBlock ParameterBlock returned from Query.\r |
d1f95000 | 246 | \r |
f754f721 | 247 | @param ParameterBlockSize The ParameterBlock size returned from Query.\r |
d1f95000 | 248 | \r |
f754f721 | 249 | @param ConfigurationAction The driver tells the platform what\r |
250 | action is required for ParameterBlock to\r | |
251 | take effect.\r | |
d1f95000 | 252 | \r |
d1f95000 | 253 | \r |
4ca9b6c4 LG |
254 | @retval EFI_SUCCESS The platform return parameter information\r |
255 | for ControllerHandle.\r | |
d1f95000 | 256 | \r |
4ca9b6c4 | 257 | @retval EFI_NOT_FOUND Instance was not found.\r |
d1f95000 | 258 | \r |
18bd7e85 | 259 | @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r |
4ca9b6c4 | 260 | \r |
d1f95000 | 261 | @retval EFI_INVALID_PARAMETER Instance is zero.\r |
262 | \r | |
263 | **/\r | |
264 | typedef\r | |
265 | EFI_STATUS\r | |
8b13229b | 266 | (EFIAPI *EFI_PLATFORM_TO_DRIVER_CONFIGURATION_RESPONSE)(\r |
d1f95000 | 267 | IN CONST EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL *This,\r |
268 | IN CONST EFI_HANDLE ControllerHandle,\r | |
269 | IN CONST EFI_HANDLE ChildHandle OPTIONAL,\r | |
270 | IN CONST UINTN *Instance,\r | |
271 | IN CONST EFI_GUID *ParameterTypeGuid,\r | |
272 | IN CONST VOID *ParameterBlock,\r | |
273 | IN CONST UINTN ParameterBlockSize ,\r | |
274 | IN CONST EFI_PLATFORM_CONFIGURATION_ACTION ConfigurationAction\r | |
275 | );\r | |
276 | \r | |
277 | \r | |
44717a39 | 278 | ///\r |
279 | /// The EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL is used by the\r | |
280 | /// UEFI driver to query the platform for configuration information.\r | |
281 | /// The UEFI driver calls Query() multiple times to get\r | |
282 | /// configuration information from the platform. For every call to\r | |
283 | /// Query() there must be a matching call to Response() so the\r | |
284 | /// UEFI driver can inform the platform how it used the\r | |
285 | /// information passed in from Query(). It's legal for a UEFI\r | |
286 | /// driver to use Response() to inform the platform it does not\r | |
287 | /// understand the data returned via Query() and thus no action was\r | |
288 | /// taken.\r | |
289 | ///\r | |
d1f95000 | 290 | struct _EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL {\r |
291 | EFI_PLATFORM_TO_DRIVER_CONFIGURATION_QUERY Query;\r | |
292 | EFI_PLATFORM_TO_DRIVER_CONFIGURATION_RESPONSE Response;\r | |
293 | };\r | |
294 | \r | |
295 | \r | |
296 | \r | |
297 | #define EFI_PLATFORM_TO_DRIVER_CONFIGURATION_CLP_GUID \\r | |
298 | {0x345ecc0e, 0xcb6, 0x4b75, { 0xbb, 0x57, 0x1b, 0x12, 0x9c, 0x47, 0x33,0x3e } }\r | |
299 | \r | |
300 | /**\r | |
301 | \r | |
302 | ParameterTypeGuid provides the support for parameters\r | |
303 | communicated through the DMTF SM CLP Specification 1.0 Final\r | |
304 | Standard to be used to configure the UEFI driver. In this\r | |
305 | section the producer of the\r | |
306 | EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL is platform\r | |
307 | firmware and the consumer is the UEFI driver. Note: if future\r | |
308 | versions of the DMTF SM CLP Specification require changes to the\r | |
630b4187 | 309 | parameter block definition, a newer ParameterTypeGuid will be\r |
d1f95000 | 310 | used.\r |
d1f95000 | 311 | **/\r |
312 | typedef struct {\r | |
9095e76b LG |
313 | CHAR8 *CLPCommand; ///< A pointer to the null-terminated UTF-8 string that specifies the DMTF SM CLP command\r |
314 | ///< line that the driver is required to parse and process when this function is called. \r | |
11f2f87e | 315 | ///< See the DMTF SM CLP Specification 1.0 Final Standard for details on the \r |
316 | ///< format and syntax of the CLP command line string. CLPCommand buffer\r | |
317 | ///< is allocated by the producer of the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOOL.\r | |
318 | UINT32 CLPCommandLength; ///< The length of the CLP Command in bytes.\r | |
9095e76b LG |
319 | CHAR8 *CLPReturnString; ///< A pointer to the null-terminated UTF-8 string that indicates the CLP return status\r |
320 | ///< that the driver is required to provide to the calling agent.\r | |
321 | ///< The calling agent may parse and/ or pass\r | |
11f2f87e | 322 | ///< this for processing and user feedback. The SM CLP Command Response string\r |
323 | ///< buffer is filled in by the UEFI driver in the "keyword=value" format\r | |
324 | ///< described in the SM CLP Specification, unless otherwise requested via the SM\r | |
325 | ///< CLP Coutput option in the Command Line string buffer. UEFI driver's support\r | |
326 | ///< for this default "keyword=value" output format is required if the UEFI\r | |
327 | ///< driver supports this protocol, while support for other SM CLP output\r | |
328 | ///< formats is optional (the UEFI Driver should return an EFI_UNSUPPORTED if\r | |
329 | ///< the SM CLP Coutput option requested by the caller is not supported by the\r | |
330 | ///< UEFI Driver). CLPReturnString buffer is allocated by the consumer of the\r | |
331 | ///< EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOC OL and undefined prior to the call to\r | |
332 | ///< Response(). \r | |
333 | UINT32 CLPReturnStringLength; ///< The length of the CLP return status string in bytes.\r | |
334 | UINT8 CLPCmdStatus; ///< SM CLP Command Status (see DMTF SM CLP Specification 1.0 Final Standard -\r | |
335 | ///< Table 4) CLPErrorValue SM CLP Processing Error Value (see DMTF SM\r | |
336 | ///< CLP Specification 1.0 Final Standard - Table 6). This field is filled in by\r | |
337 | ///< the consumer of the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOC \r | |
338 | ///< OL and undefined prior to the call to Response(). \r | |
339 | UINT8 CLPErrorValue; ///< SM CLP Processing Error Value (see DMTF SM CLP Specification 1.0 Final Standard - Table 6).\r | |
340 | ///< 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 | |
341 | UINT16 CLPMsgCode; ///< Bit 15: OEM Message Code Flag 0 = Message Code is an SM CLP Probable\r | |
342 | ///< Cause Value. (see SM CLP Specification Table 11) 1 = Message Code is OEM\r | |
343 | ///< Specific Bits 14-0: Message Code This field is filled in by the consumer of\r | |
344 | ///< the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOC OL and undefined prior to the call to\r | |
345 | ///< Response(). \r | |
346 | \r | |
d1f95000 | 347 | } EFI_CONFIGURE_CLP_PARAMETER_BLK;\r |
348 | \r | |
349 | \r | |
350 | \r | |
351 | extern EFI_GUID gEfiPlatformToDriverConfigurationClpGuid;\r | |
352 | \r | |
353 | extern EFI_GUID gEfiPlatformToDriverConfigurationProtocolGuid;\r | |
354 | \r | |
355 | #endif\r |