]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/FirmwareManagement.h
Rollback r17113.
[mirror_edk2.git] / MdePkg / Include / Protocol / FirmwareManagement.h
CommitLineData
252b9c7a 1/** @file\r
2 UEFI Firmware Management Protocol definition\r
71058578
HW
3 Firmware Management Protocol provides an abstraction for device to provide firmware \r
4 management support. The base requirements for managing device firmware images include \r
252b9c7a 5 identifying firmware image revision level and programming the image into the device.\r
6\r
71058578
HW
7 GetImageInfo() is the only required function. GetImage(), SetImage(), \r
8 CheckImage(), GetPackageInfo(), and SetPackageInfo() shall return \r
252b9c7a 9 EFI_UNSUPPORTED if not supported by the driver.\r
71058578
HW
10 \r
11 Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
12 Copyright (c) 2013 - 2014, Hewlett-Packard Development Company, L.P.<BR> \r
13 This program and the accompanying materials \r
14 are licensed and made available under the terms and conditions of the BSD License \r
15 which accompanies this distribution. The full text of the license may be found at \r
16 http://opensource.org/licenses/bsd-license.php \r
252b9c7a 17\r
71058578
HW
18 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
19 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
252b9c7a 20\r
71058578
HW
21 @par Revision Reference: \r
22 This Protocol is introduced in UEFI Specification 2.3 \r
252b9c7a 23\r
24**/\r
25\r
26#ifndef __EFI_FIRMWARE_MANAGEMENT_PROTOCOL_H__\r
27#define __EFI_FIRMWARE_MANAGEMENT_PROTOCOL_H__\r
28\r
29\r
30#define EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GUID \\r
31 { \\r
32 0x86c77a67, 0xb97, 0x4633, {0xa1, 0x87, 0x49, 0x10, 0x4d, 0x6, 0x85, 0xc7 } \\r
33 }\r
34\r
35typedef struct _EFI_FIRMWARE_MANAGEMENT_PROTOCOL EFI_FIRMWARE_MANAGEMENT_PROTOCOL;\r
36\r
37///\r
38/// EFI_FIRMWARE_IMAGE_DESCRIPTOR\r
39///\r
40typedef struct {\r
71058578
HW
41 /// \r
42 /// A unique number identifying the firmware image within the device. The number is \r
252b9c7a 43 /// between 1 and DescriptorCount.\r
71058578 44 /// \r
252b9c7a 45 UINT8 ImageIndex;\r
46 ///\r
71058578
HW
47 /// A unique number identifying the firmware image type. \r
48 /// \r
252b9c7a 49 EFI_GUID ImageTypeId;\r
71058578
HW
50 /// \r
51 /// A unique number identifying the firmware image. \r
52 /// \r
252b9c7a 53 UINT64 ImageId;\r
71058578
HW
54 /// \r
55 /// A pointer to a null-terminated string representing the firmware image name. \r
56 /// \r
252b9c7a 57 CHAR16 *ImageIdName;\r
71058578
HW
58 /// \r
59 /// Identifies the version of the device firmware. The format is vendor specific and new \r
252b9c7a 60 /// version must have a greater value than an old version.\r
71058578 61 /// \r
252b9c7a 62 UINT32 Version;\r
71058578 63 /// \r
4f077902 64 /// A pointer to a null-terminated string representing the firmware image version name.\r
71058578 65 /// \r
252b9c7a 66 CHAR16 *VersionName;\r
71058578
HW
67 /// \r
68 /// Size of the image in bytes. If size=0, then only ImageIndex and ImageTypeId are valid.\r
69 /// \r
252b9c7a 70 UINTN Size;\r
71058578
HW
71 /// \r
72 /// Image attributes that are supported by this device. See 'Image Attribute Definitions' \r
73 /// for possible returned values of this parameter. A value of 1 indicates the attribute is \r
74 /// supported and the current setting value is indicated in AttributesSetting. A \r
75 /// value of 0 indicates the attribute is not supported and the current setting value in \r
252b9c7a 76 /// AttributesSetting is meaningless.\r
71058578 77 /// \r
252b9c7a 78 UINT64 AttributesSupported;\r
71058578
HW
79 /// \r
80 /// Image attributes. See 'Image Attribute Definitions' for possible returned values of \r
252b9c7a 81 /// this parameter.\r
71058578 82 /// \r
252b9c7a 83 UINT64 AttributesSetting;\r
71058578
HW
84 /// \r
85 /// Image compatibilities. See 'Image Compatibility Definitions' for possible returned \r
252b9c7a 86 /// values of this parameter.\r
71058578 87 /// \r
252b9c7a 88 UINT64 Compatibilities;\r
7076ecdb
SQ
89 ///\r
90 /// Describes the lowest ImageDescriptor version that the device will accept. Only\r
91 /// present in version 2 or higher.\r
92 ///\r
93 UINT32 LowestSupportedImageVersion;\r
252b9c7a 94} EFI_FIRMWARE_IMAGE_DESCRIPTOR;\r
95\r
96\r
97//\r
98// Image Attribute Definitions\r
99//\r
100///\r
71058578 101/// The attribute IMAGE_ATTRIBUTE_IMAGE_UPDATABLE indicates this device supports firmware \r
252b9c7a 102/// image update.\r
103///\r
104#define IMAGE_ATTRIBUTE_IMAGE_UPDATABLE 0x0000000000000001\r
105///\r
71058578
HW
106/// The attribute IMAGE_ATTRIBUTE_RESET_REQUIRED indicates a reset of the device is required \r
107/// for the new firmware image to take effect after a firmware update. The device is the device hosting \r
252b9c7a 108/// the firmware image.\r
71058578 109/// \r
252b9c7a 110#define IMAGE_ATTRIBUTE_RESET_REQUIRED 0x0000000000000002\r
111///\r
71058578
HW
112/// The attribute IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED indicates authentication is \r
113/// required to perform the following image operations: GetImage(), SetImage(), and \r
252b9c7a 114/// CheckImage(). See 'Image Attribute - Authentication'.\r
71058578 115/// \r
252b9c7a 116#define IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED 0x0000000000000004\r
117///\r
71058578
HW
118/// The attribute IMAGE_ATTRIBUTE_IN_USE indicates the current state of the firmware image. \r
119/// This distinguishes firmware images in a device that supports redundant images. \r
120/// \r
252b9c7a 121#define IMAGE_ATTRIBUTE_IN_USE 0x0000000000000008\r
cb9ec399
SEHM
122///\r
123/// The attribute IMAGE_ATTRIBUTE_UEFI_IMAGE indicates that this image is an EFI compatible image.\r
124///\r
125#define IMAGE_ATTRIBUTE_UEFI_IMAGE 0x0000000000000010\r
252b9c7a 126\r
127\r
128//\r
129// Image Compatibility Definitions\r
130//\r
131/// Values from 0x0000000000000002 thru 0x000000000000FFFF are reserved for future assignments.\r
71058578 132/// Values from 0x0000000000010000 thru 0xFFFFFFFFFFFFFFFF are used by firmware vendor for \r
252b9c7a 133/// compatibility check.\r
134///\r
135#define IMAGE_COMPATIBILITY_CHECK_SUPPORTED 0x0000000000000001\r
136\r
137///\r
9938c13d 138/// Descriptor Version exposed by GetImageInfo() function\r
252b9c7a 139///\r
71058578 140#define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION 2\r
252b9c7a 141\r
142\r
143///\r
fa3e7746 144/// Image Attribute -Authentication Required\r
252b9c7a 145///\r
146typedef struct {\r
147 ///\r
71058578
HW
148 /// It is included in the signature of AuthInfo. It is used to ensure freshness/no replay. \r
149 /// It is incremented during each firmware image operation. \r
150 /// \r
252b9c7a 151 UINT64 MonotonicCount;\r
152 ///\r
71058578
HW
153 /// Provides the authorization for the firmware image operations. It is a signature across \r
154 /// the image data and the Monotonic Count value. Caller uses the private key that is \r
155 /// associated with a public key that has been provisioned via the key exchange. \r
9938c13d
LG
156 /// Because this is defined as a signature, WIN_CERTIFICATE_UEFI_GUID.CertType must\r
157 /// be EFI_CERT_TYPE_PKCS7_GUID.\r
252b9c7a 158 ///\r
159 WIN_CERTIFICATE_UEFI_GUID AuthInfo;\r
160} EFI_FIRMWARE_IMAGE_AUTHENTICATION;\r
161\r
162\r
163//\r
164// ImageUpdatable Definitions\r
165//\r
166///\r
71058578 167/// IMAGE_UPDATABLE_VALID indicates SetImage() will accept the new image and update the \r
252b9c7a 168/// device with the new image.\r
169///\r
170#define IMAGE_UPDATABLE_VALID 0x0000000000000001\r
171///\r
71058578 172/// IMAGE_UPDATABLE_INVALID indicates SetImage() will reject the new image. No additional \r
252b9c7a 173/// information is provided for the rejection.\r
174///\r
175#define IMAGE_UPDATABLE_INVALID 0x0000000000000002\r
176///\r
71058578 177/// IMAGE_UPDATABLE_INVALID_TYPE indicates SetImage() will reject the new image. The \r
252b9c7a 178/// rejection is due to the new image is not a firmware image recognized for this device.\r
179///\r
180#define IMAGE_UPDATABLE_INVALID_TYPE 0x0000000000000004\r
181///\r
71058578 182/// IMAGE_UPDATABLE_INVALID_OLD indicates SetImage() will reject the new image. The \r
252b9c7a 183/// rejection is due to the new image version is older than the current firmware image\r
71058578 184/// version in the device. The device firmware update policy does not support firmware \r
252b9c7a 185/// version downgrade.\r
186///\r
187#define IMAGE_UPDATABLE_INVALID_OLD 0x0000000000000008\r
188\r
189\r
190//\r
191// Package Attribute Definitions\r
192//\r
193///\r
71058578 194/// The attribute PACKAGE_ATTRIBUTE_VERSION_UPDATABLE indicates this device supports the \r
252b9c7a 195/// update of the firmware package version.\r
196///\r
197#define PACKAGE_ATTRIBUTE_VERSION_UPDATABLE 0x0000000000000001\r
198///\r
71058578 199/// The attribute PACKAGE_ATTRIBUTE_RESET_REQUIRED indicates a reset of the device is \r
252b9c7a 200/// required for the new package info to take effect after an update.\r
201///\r
202#define PACKAGE_ATTRIBUTE_RESET_REQUIRED 0x0000000000000002\r
203///\r
71058578 204/// The attribute PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED indicates authentication \r
252b9c7a 205/// is required to update the package info.\r
206///\r
207#define PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED 0x0000000000000004\r
208\r
71058578 209/** \r
252b9c7a 210 Callback funtion to report the process of the firmware updating.\r
211\r
212 @param[in] Completion A value between 1 and 100 indicating the current completion\r
71058578 213 progress of the firmware update. Completion progress is \r
252b9c7a 214 reported as from 1 to 100 percent. A value of 0 is used by\r
215 the driver to indicate that progress reporting is not supported.\r
216\r
217 @retval EFI_SUCCESS SetImage() continues to do the callback if supported.\r
218 @retval other SetImage() discontinues the callback and completes\r
219 the update and returns.\r
220\r
221**/\r
222typedef\r
223EFI_STATUS\r
224(EFIAPI *EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS)(\r
225 IN UINTN Completion\r
226 );\r
227\r
228/**\r
229 Returns information about the current firmware image(s) of the device.\r
230\r
231 This function allows a copy of the current firmware image to be created and saved.\r
232 The saved copy could later been used, for example, in firmware image recovery or rollback.\r
233\r
234 @param[in] This A pointer to the EFI_FIRMWARE_MANAGEMENT_PROTOCOL instance.\r
71058578 235 @param[in, out] ImageInfoSize A pointer to the size, in bytes, of the ImageInfo buffer. \r
252b9c7a 236 On input, this is the size of the buffer allocated by the caller.\r
71058578 237 On output, it is the size of the buffer returned by the firmware \r
252b9c7a 238 if the buffer was large enough, or the size of the buffer needed\r
239 to contain the image(s) information if the buffer was too small.\r
240 @param[in, out] ImageInfo A pointer to the buffer in which firmware places the current image(s)\r
241 information. The information is an array of EFI_FIRMWARE_IMAGE_DESCRIPTORs.\r
242 @param[out] DescriptorVersion A pointer to the location in which firmware returns the version number\r
71058578 243 associated with the EFI_FIRMWARE_IMAGE_DESCRIPTOR. \r
252b9c7a 244 @param[out] DescriptorCount A pointer to the location in which firmware returns the number of\r
245 descriptors or firmware images within this device.\r
246 @param[out] DescriptorSize A pointer to the location in which firmware returns the size, in bytes,\r
247 of an individual EFI_FIRMWARE_IMAGE_DESCRIPTOR.\r
248 @param[out] PackageVersion A version number that represents all the firmware images in the device.\r
249 The format is vendor specific and new version must have a greater value\r
250 than the old version. If PackageVersion is not supported, the value is\r
251 0xFFFFFFFF. A value of 0xFFFFFFFE indicates that package version comparison\r
252 is to be performed using PackageVersionName. A value of 0xFFFFFFFD indicates\r
253 that package version update is in progress.\r
4f077902 254 @param[out] PackageVersionName A pointer to a pointer to a null-terminated string representing the\r
71058578 255 package version name. The buffer is allocated by this function with \r
252b9c7a 256 AllocatePool(), and it is the caller's responsibility to free it with a call\r
257 to FreePool().\r
258\r
259 @retval EFI_SUCCESS The device was successfully updated with the new image.\r
71058578
HW
260 @retval EFI_BUFFER_TOO_SMALL The ImageInfo buffer was too small. The current buffer size \r
261 needed to hold the image(s) information is returned in ImageInfoSize. \r
252b9c7a 262 @retval EFI_INVALID_PARAMETER ImageInfoSize is NULL.\r
263 @retval EFI_DEVICE_ERROR Valid information could not be returned. Possible corrupted image.\r
264\r
71058578 265**/ \r
252b9c7a 266typedef\r
267EFI_STATUS\r
268(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE_INFO)(\r
269 IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,\r
270 IN OUT UINTN *ImageInfoSize,\r
271 IN OUT EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo,\r
272 OUT UINT32 *DescriptorVersion,\r
273 OUT UINT8 *DescriptorCount,\r
274 OUT UINTN *DescriptorSize,\r
275 OUT UINT32 *PackageVersion,\r
276 OUT CHAR16 **PackageVersionName\r
277 );\r
278\r
279/**\r
71058578 280 Retrieves a copy of the current firmware image of the device. \r
252b9c7a 281\r
282 This function allows a copy of the current firmware image to be created and saved.\r
283 The saved copy could later been used, for example, in firmware image recovery or rollback.\r
284\r
285 @param[in] This A pointer to the EFI_FIRMWARE_MANAGEMENT_PROTOCOL instance.\r
286 @param[in] ImageIndex A unique number identifying the firmware image(s) within the device.\r
287 The number is between 1 and DescriptorCount.\r
288 @param[out] Image Points to the buffer where the current image is copied to.\r
289 @param[out] ImageSize On entry, points to the size of the buffer pointed to by Image, in bytes.\r
290 On return, points to the length of the image, in bytes.\r
291\r
292 @retval EFI_SUCCESS The device was successfully updated with the new image.\r
71058578
HW
293 @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small to hold the \r
294 image. The current buffer size needed to hold the image is returned \r
252b9c7a 295 in ImageSize.\r
296 @retval EFI_INVALID_PARAMETER The Image was NULL.\r
297 @retval EFI_NOT_FOUND The current image is not copied to the buffer.\r
298 @retval EFI_UNSUPPORTED The operation is not supported.\r
299 @retval EFI_SECURITY_VIOLATIO The operation could not be performed due to an authentication failure.\r
300\r
71058578 301**/ \r
252b9c7a 302typedef\r
303EFI_STATUS\r
304(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE)(\r
305 IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,\r
306 IN UINT8 ImageIndex,\r
307 IN OUT VOID *Image,\r
308 IN OUT UINTN *ImageSize\r
309 );\r
310\r
311/**\r
312 Updates the firmware image of the device.\r
313\r
314 This function updates the hardware with the new firmware image.\r
315 This function returns EFI_UNSUPPORTED if the firmware image is not updatable.\r
316 If the firmware image is updatable, the function should perform the following minimal validations\r
317 before proceeding to do the firmware image update.\r
71058578
HW
318 - Validate the image authentication if image has attribute \r
319 IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED. The function returns \r
252b9c7a 320 EFI_SECURITY_VIOLATION if the validation fails.\r
71058578
HW
321 - Validate the image is a supported image for this device. The function returns EFI_ABORTED if \r
322 the image is unsupported. The function can optionally provide more detailed information on \r
252b9c7a 323 why the image is not a supported image.\r
71058578
HW
324 - Validate the data from VendorCode if not null. Image validation must be performed before \r
325 VendorCode data validation. VendorCode data is ignored or considered invalid if image \r
326 validation failed. The function returns EFI_ABORTED if the data is invalid.\r
327 \r
328 VendorCode enables vendor to implement vendor-specific firmware image update policy. Null if \r
329 the caller did not specify the policy or use the default policy. As an example, vendor can implement \r
330 a policy to allow an option to force a firmware image update when the abort reason is due to the new \r
331 firmware image version is older than the current firmware image version or bad image checksum. \r
252b9c7a 332 Sensitive operations such as those wiping the entire firmware image and render the device to be\r
333 non-functional should be encoded in the image itself rather than passed with the VendorCode.\r
334 AbortReason enables vendor to have the option to provide a more detailed description of the abort\r
335 reason to the caller.\r
336\r
337 @param[in] This A pointer to the EFI_FIRMWARE_MANAGEMENT_PROTOCOL instance.\r
338 @param[in] ImageIndex A unique number identifying the firmware image(s) within the device.\r
339 The number is between 1 and DescriptorCount.\r
340 @param[in] Image Points to the new image.\r
341 @param[in] ImageSize Size of the new image in bytes.\r
71058578 342 @param[in] VendorCode This enables vendor to implement vendor-specific firmware image update policy. \r
252b9c7a 343 Null indicates the caller did not specify the policy or use the default policy.\r
344 @param[in] Progress A function used by the driver to report the progress of the firmware update.\r
4f077902 345 @param[out] AbortReason A pointer to a pointer to a null-terminated string providing more\r
71058578 346 details for the aborted operation. The buffer is allocated by this function \r
252b9c7a 347 with AllocatePool(), and it is the caller's responsibility to free it with a\r
348 call to FreePool().\r
349\r
350 @retval EFI_SUCCESS The device was successfully updated with the new image.\r
351 @retval EFI_ABORTED The operation is aborted.\r
352 @retval EFI_INVALID_PARAMETER The Image was NULL.\r
353 @retval EFI_UNSUPPORTED The operation is not supported.\r
354 @retval EFI_SECURITY_VIOLATIO The operation could not be performed due to an authentication failure.\r
355\r
71058578 356**/ \r
252b9c7a 357typedef\r
358EFI_STATUS\r
359(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_SET_IMAGE)(\r
360 IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,\r
361 IN UINT8 ImageIndex,\r
362 IN CONST VOID *Image,\r
363 IN UINTN ImageSize,\r
364 IN CONST VOID *VendorCode,\r
365 IN EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS Progress,\r
366 OUT CHAR16 **AbortReason\r
367 );\r
368\r
369/**\r
370 Checks if the firmware image is valid for the device.\r
371\r
71058578 372 This function allows firmware update application to validate the firmware image without \r
252b9c7a 373 invoking the SetImage() first.\r
374\r
375 @param[in] This A pointer to the EFI_FIRMWARE_MANAGEMENT_PROTOCOL instance.\r
376 @param[in] ImageIndex A unique number identifying the firmware image(s) within the device.\r
377 The number is between 1 and DescriptorCount.\r
378 @param[in] Image Points to the new image.\r
379 @param[in] ImageSize Size of the new image in bytes.\r
380 @param[out] ImageUpdatable Indicates if the new image is valid for update. It also provides,\r
71058578 381 if available, additional information if the image is invalid. \r
252b9c7a 382\r
383 @retval EFI_SUCCESS The image was successfully checked.\r
384 @retval EFI_INVALID_PARAMETER The Image was NULL.\r
385 @retval EFI_UNSUPPORTED The operation is not supported.\r
386 @retval EFI_SECURITY_VIOLATIO The operation could not be performed due to an authentication failure.\r
387\r
71058578 388**/ \r
252b9c7a 389typedef\r
390EFI_STATUS\r
391(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_CHECK_IMAGE)(\r
392 IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,\r
393 IN UINT8 ImageIndex,\r
394 IN CONST VOID *Image,\r
395 IN UINTN ImageSize,\r
396 OUT UINT32 *ImageUpdatable\r
397 );\r
398\r
399/**\r
71058578 400 Returns information about the firmware package. \r
252b9c7a 401\r
402 This function returns package information.\r
403\r
404 @param[in] This A pointer to the EFI_FIRMWARE_MANAGEMENT_PROTOCOL instance.\r
405 @param[out] PackageVersion A version number that represents all the firmware images in the device.\r
406 The format is vendor specific and new version must have a greater value\r
407 than the old version. If PackageVersion is not supported, the value is\r
408 0xFFFFFFFF. A value of 0xFFFFFFFE indicates that package version\r
409 comparison is to be performed using PackageVersionName. A value of\r
410 0xFFFFFFFD indicates that package version update is in progress.\r
4f077902 411 @param[out] PackageVersionName A pointer to a pointer to a null-terminated string representing\r
252b9c7a 412 the package version name. The buffer is allocated by this function with\r
413 AllocatePool(), and it is the caller's responsibility to free it with a\r
414 call to FreePool().\r
415 @param[out] PackageVersionNameMaxLen The maximum length of package version name if device supports update of\r
416 package version name. A value of 0 indicates the device does not support\r
417 update of package version name. Length is the number of Unicode characters,\r
418 including the terminating null character.\r
71058578
HW
419 @param[out] AttributesSupported Package attributes that are supported by this device. See 'Package Attribute \r
420 Definitions' for possible returned values of this parameter. A value of 1 \r
252b9c7a 421 indicates the attribute is supported and the current setting value is\r
422 indicated in AttributesSetting. A value of 0 indicates the attribute is not\r
423 supported and the current setting value in AttributesSetting is meaningless.\r
424 @param[out] AttributesSetting Package attributes. See 'Package Attribute Definitions' for possible returned\r
425 values of this parameter\r
426\r
427 @retval EFI_SUCCESS The package information was successfully returned.\r
428 @retval EFI_UNSUPPORTED The operation is not supported.\r
429\r
430**/\r
431typedef\r
432EFI_STATUS\r
433(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_PACKAGE_INFO)(\r
434 IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,\r
435 OUT UINT32 *PackageVersion,\r
436 OUT CHAR16 **PackageVersionName,\r
437 OUT UINT32 *PackageVersionNameMaxLen,\r
438 OUT UINT64 *AttributesSupported,\r
439 OUT UINT64 *AttributesSetting\r
440 );\r
441\r
442/**\r
443 Updates information about the firmware package.\r
444\r
445 This function updates package information.\r
446 This function returns EFI_UNSUPPORTED if the package information is not updatable.\r
447 VendorCode enables vendor to implement vendor-specific package information update policy.\r
448 Null if the caller did not specify this policy or use the default policy.\r
449\r
450 @param[in] This A pointer to the EFI_FIRMWARE_MANAGEMENT_PROTOCOL instance.\r
451 @param[in] Image Points to the authentication image.\r
452 Null if authentication is not required.\r
453 @param[in] ImageSize Size of the authentication image in bytes.\r
454 0 if authentication is not required.\r
455 @param[in] VendorCode This enables vendor to implement vendor-specific firmware\r
71058578 456 image update policy. \r
252b9c7a 457 Null indicates the caller did not specify this policy or use\r
458 the default policy.\r
459 @param[in] PackageVersion The new package version.\r
460 @param[in] PackageVersionName A pointer to the new null-terminated Unicode string representing\r
71058578
HW
461 the package version name. \r
462 The string length is equal to or less than the value returned in \r
252b9c7a 463 PackageVersionNameMaxLen.\r
464\r
465 @retval EFI_SUCCESS The device was successfully updated with the new package\r
466 information.\r
71058578 467 @retval EFI_INVALID_PARAMETER The PackageVersionName length is longer than the value \r
252b9c7a 468 returned in PackageVersionNameMaxLen.\r
469 @retval EFI_UNSUPPORTED The operation is not supported.\r
470 @retval EFI_SECURITY_VIOLATIO The operation could not be performed due to an authentication failure.\r
471\r
472**/\r
473typedef\r
474EFI_STATUS\r
475(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_SET_PACKAGE_INFO)(\r
476 IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,\r
477 IN CONST VOID *Image,\r
478 IN UINTN ImageSize,\r
479 IN CONST VOID *VendorCode,\r
480 IN UINT32 PackageVersion,\r
481 IN CONST CHAR16 *PackageVersionName\r
482 );\r
483\r
484///\r
485/// EFI_FIRMWARE_MANAGEMENT_PROTOCOL\r
486/// The protocol for managing firmware provides the following services.\r
487/// - Get the attributes of the current firmware image. Attributes include revision level.\r
71058578 488/// - Get a copy of the current firmware image. As an example, this service could be used by a \r
252b9c7a 489/// management application to facilitate a firmware roll-back.\r
490/// - Program the device with a firmware image supplied by the user.\r
491/// - Label all the firmware images within a device with a single version.\r
492///\r
493struct _EFI_FIRMWARE_MANAGEMENT_PROTOCOL {\r
494 EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE_INFO GetImageInfo;\r
495 EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE GetImage;\r
496 EFI_FIRMWARE_MANAGEMENT_PROTOCOL_SET_IMAGE SetImage;\r
497 EFI_FIRMWARE_MANAGEMENT_PROTOCOL_CHECK_IMAGE CheckImage;\r
498 EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_PACKAGE_INFO GetPackageInfo;\r
499 EFI_FIRMWARE_MANAGEMENT_PROTOCOL_SET_PACKAGE_INFO SetPackageInfo;\r
500};\r
501\r
502extern EFI_GUID gEfiFirmwareManagementProtocolGuid;\r
503\r
504#endif\r