]> git.proxmox.com Git - mirror_edk2.git/blob - FmpDevicePkg/Include/Library/FmpDeviceLib.h
a14406abe8b5cee134f8260b7dc222c6b2500950
[mirror_edk2.git] / FmpDevicePkg / Include / Library / FmpDeviceLib.h
1 /** @file
2 Provides firmware device specific services to support updates of a firmware
3 image stored in a firmware device.
4
5 Copyright (c) Microsoft Corporation.<BR>
6 Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.<BR>
7
8 SPDX-License-Identifier: BSD-2-Clause-Patent
9
10 **/
11
12 #ifndef __FMP_DEVICE_LIB__
13 #define __FMP_DEVICE_LIB__
14
15 #include <Protocol/FirmwareManagement.h>
16
17 /**
18 Callback function that installs a Firmware Management Protocol instance onto
19 a handle.
20
21 @param[in] Handle The device handle to install a Firmware Management
22 Protocol instance.
23
24 @retval EFI_SUCCESS A Firmware Management Protocol instance was
25 installed onto Handle.
26 @retval EFI_INVALID_PARAMETER Handle is invalid
27 @retval other A Firmware Management Protocol instance could
28 not be installed onto Handle.
29
30 **/
31 typedef
32 EFI_STATUS
33 (EFIAPI *FMP_DEVICE_LIB_REGISTER_FMP_INSTALLER)(
34 IN EFI_HANDLE Handle
35 );
36
37 /**
38 Callback function that uninstalls a Firmware Management Protocol instance from
39 a handle.
40
41 @param[in] Handle The device handle to uninstall a Firmware Management
42 Protocol instance.
43
44 @retval EFI_SUCCESS A Firmware Management Protocol instance was
45 uninstalled from Handle.
46 @retval EFI_INVALID_PARAMETER Handle is invalid
47 @retval other A Firmware Management Protocol instance could
48 not be uninstalled from Handle.
49
50 **/
51 typedef
52 EFI_STATUS
53 (EFIAPI *FMP_DEVICE_LIB_REGISTER_FMP_UNINSTALLER)(
54 IN EFI_HANDLE Handle
55 );
56
57 /**
58 Provide a function to install the Firmware Management Protocol instance onto a
59 device handle when the device is managed by a driver that follows the UEFI
60 Driver Model. If the device is not managed by a driver that follows the UEFI
61 Driver Model, then EFI_UNSUPPORTED is returned.
62
63 @param[in] FmpInstaller Function that installs the Firmware Management
64 Protocol.
65
66 @retval EFI_SUCCESS The device is managed by a driver that follows the
67 UEFI Driver Model. FmpInstaller must be called on
68 each Driver Binding Start().
69 @retval EFI_UNSUPPORTED The device is not managed by a driver that follows
70 the UEFI Driver Model.
71 @retval other The Firmware Management Protocol for this firmware
72 device is not installed. The firmware device is
73 still locked using FmpDeviceLock().
74
75 **/
76 EFI_STATUS
77 EFIAPI
78 RegisterFmpInstaller (
79 IN FMP_DEVICE_LIB_REGISTER_FMP_INSTALLER FmpInstaller
80 );
81
82 /**
83 Provide a function to uninstall the Firmware Management Protocol instance from a
84 device handle when the device is managed by a driver that follows the UEFI
85 Driver Model. If the device is not managed by a driver that follows the UEFI
86 Driver Model, then EFI_UNSUPPORTED is returned.
87
88 @param[in] FmpUninstaller Function that installs the Firmware Management
89 Protocol.
90
91 @retval EFI_SUCCESS The device is managed by a driver that follows the
92 UEFI Driver Model. FmpUninstaller must be called on
93 each Driver Binding Stop().
94 @retval EFI_UNSUPPORTED The device is not managed by a driver that follows
95 the UEFI Driver Model.
96 @retval other The Firmware Management Protocol for this firmware
97 device is not installed. The firmware device is
98 still locked using FmpDeviceLock().
99
100 **/
101 EFI_STATUS
102 EFIAPI
103 RegisterFmpUninstaller (
104 IN FMP_DEVICE_LIB_REGISTER_FMP_UNINSTALLER FmpUninstaller
105 );
106
107 /**
108 Set the device context for the FmpDeviceLib services when the device is
109 managed by a driver that follows the UEFI Driver Model. If the device is not
110 managed by a driver that follows the UEFI Driver Model, then EFI_UNSUPPORTED
111 is returned. Once a device context is set, the FmpDeviceLib services
112 operate on the currently set device context.
113
114 @param[in] Handle Device handle for the FmpDeviceLib services.
115 If Handle is NULL, then Context is freed.
116 @param[in, out] Context Device context for the FmpDeviceLib services.
117 If Context is NULL, then a new context is allocated
118 for Handle and the current device context is set and
119 returned in Context. If Context is not NULL, then
120 the current device context is set.
121
122 @retval EFI_SUCCESS The device is managed by a driver that follows the
123 UEFI Driver Model.
124 @retval EFI_UNSUPPORTED The device is not managed by a driver that follows
125 the UEFI Driver Model.
126 @retval other The Firmware Management Protocol for this firmware
127 device is not installed. The firmware device is
128 still locked using FmpDeviceLock().
129
130 **/
131 EFI_STATUS
132 EFIAPI
133 FmpDeviceSetContext (
134 IN EFI_HANDLE Handle,
135 IN OUT VOID **Context
136 );
137
138 /**
139 Returns the size, in bytes, of the firmware image currently stored in the
140 firmware device. This function is used to by the GetImage() and
141 GetImageInfo() services of the Firmware Management Protocol. If the image
142 size can not be determined from the firmware device, then 0 must be returned.
143
144 @param[out] Size Pointer to the size, in bytes, of the firmware image
145 currently stored in the firmware device.
146
147 @retval EFI_SUCCESS The size of the firmware image currently
148 stored in the firmware device was returned.
149 @retval EFI_INVALID_PARAMETER Size is NULL.
150 @retval EFI_UNSUPPORTED The firmware device does not support reporting
151 the size of the currently stored firmware image.
152 @retval EFI_DEVICE_ERROR An error occurred attempting to determine the
153 size of the firmware image currently stored in
154 in the firmware device.
155
156 **/
157 EFI_STATUS
158 EFIAPI
159 FmpDeviceGetSize (
160 OUT UINTN *Size
161 );
162
163 /**
164 Returns the GUID value used to fill in the ImageTypeId field of the
165 EFI_FIRMWARE_IMAGE_DESCRIPTOR structure that is returned by the GetImageInfo()
166 service of the Firmware Management Protocol. If EFI_UNSUPPORTED is returned,
167 then the ImageTypeId field is set to gEfiCallerIdGuid. If EFI_SUCCESS is
168 returned, then ImageTypeId is set to the Guid returned from this function.
169
170 @param[out] Guid Double pointer to a GUID value that is updated to point to
171 to a GUID value. The GUID value is not allocated and must
172 not be modified or freed by the caller.
173
174 @retval EFI_SUCCESS EFI_FIRMWARE_IMAGE_DESCRIPTOR ImageTypeId GUID is set
175 to the returned Guid value.
176 @retval EFI_UNSUPPORTED EFI_FIRMWARE_IMAGE_DESCRIPTOR ImageTypeId GUID is set
177 to gEfiCallerIdGuid.
178
179 **/
180 EFI_STATUS
181 EFIAPI
182 FmpDeviceGetImageTypeIdGuidPtr (
183 OUT EFI_GUID **Guid
184 );
185
186 /**
187 Returns values used to fill in the AttributesSupported and AttributesSettings
188 fields of the EFI_FIRMWARE_IMAGE_DESCRIPTOR structure that is returned by the
189 GetImageInfo() service of the Firmware Management Protocol. The following
190 bit values from the Firmware Management Protocol may be combined:
191 IMAGE_ATTRIBUTE_IMAGE_UPDATABLE
192 IMAGE_ATTRIBUTE_RESET_REQUIRED
193 IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED
194 IMAGE_ATTRIBUTE_IN_USE
195 IMAGE_ATTRIBUTE_UEFI_IMAGE
196
197 @param[out] Supported Attributes supported by this firmware device.
198 @param[out] Setting Attributes settings for this firmware device.
199
200 @retval EFI_SUCCESS The attributes supported by the firmware
201 device were returned.
202 @retval EFI_INVALID_PARAMETER Supported is NULL.
203 @retval EFI_INVALID_PARAMETER Setting is NULL.
204
205 **/
206 EFI_STATUS
207 EFIAPI
208 FmpDeviceGetAttributes (
209 OUT UINT64 *Supported,
210 OUT UINT64 *Setting
211 );
212
213 /**
214 Returns the value used to fill in the LowestSupportedVersion field of the
215 EFI_FIRMWARE_IMAGE_DESCRIPTOR structure that is returned by the GetImageInfo()
216 service of the Firmware Management Protocol. If EFI_SUCCESS is returned, then
217 the firmware device supports a method to report the LowestSupportedVersion
218 value from the currently stored firmware image. If the value can not be
219 reported for the firmware image currently stored in the firmware device, then
220 EFI_UNSUPPORTED must be returned. EFI_DEVICE_ERROR is returned if an error
221 occurs attempting to retrieve the LowestSupportedVersion value for the
222 currently stored firmware image.
223
224 @note It is recommended that all firmware devices support a method to report
225 the LowestSupportedVersion value from the currently stored firmware
226 image.
227
228 @param[out] LowestSupportedVersion LowestSupportedVersion value retrieved
229 from the currently stored firmware image.
230
231 @retval EFI_SUCCESS The lowest supported version of currently stored
232 firmware image was returned in LowestSupportedVersion.
233 @retval EFI_UNSUPPORTED The firmware device does not support a method to
234 report the lowest supported version of the currently
235 stored firmware image.
236 @retval EFI_DEVICE_ERROR An error occurred attempting to retrieve the lowest
237 supported version of the currently stored firmware
238 image.
239
240 **/
241 EFI_STATUS
242 EFIAPI
243 FmpDeviceGetLowestSupportedVersion (
244 OUT UINT32 *LowestSupportedVersion
245 );
246
247 /**
248 Returns the Null-terminated Unicode string that is used to fill in the
249 VersionName field of the EFI_FIRMWARE_IMAGE_DESCRIPTOR structure that is
250 returned by the GetImageInfo() service of the Firmware Management Protocol.
251 The returned string must be allocated using EFI_BOOT_SERVICES.AllocatePool().
252
253 @note It is recommended that all firmware devices support a method to report
254 the VersionName string from the currently stored firmware image.
255
256 @param[out] VersionString The version string retrieved from the currently
257 stored firmware image.
258
259 @retval EFI_SUCCESS The version string of currently stored
260 firmware image was returned in Version.
261 @retval EFI_INVALID_PARAMETER VersionString is NULL.
262 @retval EFI_UNSUPPORTED The firmware device does not support a method
263 to report the version string of the currently
264 stored firmware image.
265 @retval EFI_DEVICE_ERROR An error occurred attempting to retrieve the
266 version string of the currently stored
267 firmware image.
268 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate the
269 buffer for the version string of the currently
270 stored firmware image.
271
272 **/
273 EFI_STATUS
274 EFIAPI
275 FmpDeviceGetVersionString (
276 OUT CHAR16 **VersionString
277 );
278
279 /**
280 Returns the value used to fill in the Version field of the
281 EFI_FIRMWARE_IMAGE_DESCRIPTOR structure that is returned by the GetImageInfo()
282 service of the Firmware Management Protocol. If EFI_SUCCESS is returned, then
283 the firmware device supports a method to report the Version value from the
284 currently stored firmware image. If the value can not be reported for the
285 firmware image currently stored in the firmware device, then EFI_UNSUPPORTED
286 must be returned. EFI_DEVICE_ERROR is returned if an error occurs attempting
287 to retrieve the LowestSupportedVersion value for the currently stored firmware
288 image.
289
290 @note It is recommended that all firmware devices support a method to report
291 the Version value from the currently stored firmware image.
292
293 @param[out] Version The version value retrieved from the currently stored
294 firmware image.
295
296 @retval EFI_SUCCESS The version of currently stored firmware image was
297 returned in Version.
298 @retval EFI_UNSUPPORTED The firmware device does not support a method to
299 report the version of the currently stored firmware
300 image.
301 @retval EFI_DEVICE_ERROR An error occurred attempting to retrieve the version
302 of the currently stored firmware image.
303
304 **/
305 EFI_STATUS
306 EFIAPI
307 FmpDeviceGetVersion (
308 OUT UINT32 *Version
309 );
310
311 /**
312 Returns the value used to fill in the HardwareInstance field of the
313 EFI_FIRMWARE_IMAGE_DESCRIPTOR structure that is returned by the GetImageInfo()
314 service of the Firmware Management Protocol. If EFI_SUCCESS is returned, then
315 the firmware device supports a method to report the HardwareInstance value.
316 If the value can not be reported for the firmware device, then EFI_UNSUPPORTED
317 must be returned. EFI_DEVICE_ERROR is returned if an error occurs attempting
318 to retrieve the HardwareInstance value for the firmware device.
319
320 @param[out] HardwareInstance The hardware instance value for the firmware
321 device.
322
323 @retval EFI_SUCCESS The hardware instance for the current firmware
324 device is returned in HardwareInstance.
325 @retval EFI_UNSUPPORTED The firmware device does not support a method to
326 report the hardware instance value.
327 @retval EFI_DEVICE_ERROR An error occurred attempting to retrieve the hardware
328 instance value.
329
330 **/
331 EFI_STATUS
332 EFIAPI
333 FmpDeviceGetHardwareInstance (
334 OUT UINT64 *HardwareInstance
335 );
336
337 /**
338 Returns a copy of the firmware image currently stored in the firmware device.
339
340 @note It is recommended that all firmware devices support a method to retrieve
341 a copy currently stored firmware image. This can be used to support
342 features such as recovery and rollback.
343
344 @param[out] Image Pointer to a caller allocated buffer where the
345 currently stored firmware image is copied to.
346 @param[in, out] ImageSize Pointer the size, in bytes, of the Image buffer.
347 On return, points to the size, in bytes, of firmware
348 image currently stored in the firmware device.
349
350 @retval EFI_SUCCESS Image contains a copy of the firmware image
351 currently stored in the firmware device, and
352 ImageSize contains the size, in bytes, of the
353 firmware image currently stored in the
354 firmware device.
355 @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small
356 to hold the firmware image currently stored in
357 the firmware device. The buffer size required
358 is returned in ImageSize.
359 @retval EFI_INVALID_PARAMETER The Image is NULL.
360 @retval EFI_INVALID_PARAMETER The ImageSize is NULL.
361 @retval EFI_UNSUPPORTED The operation is not supported.
362 @retval EFI_DEVICE_ERROR An error occurred attempting to retrieve the
363 firmware image currently stored in the firmware
364 device.
365
366 **/
367 EFI_STATUS
368 EFIAPI
369 FmpDeviceGetImage (
370 OUT VOID *Image,
371 IN OUT UINTN *ImageSize
372 );
373
374 /**
375 Checks if a new firmware image is valid for the firmware device. This
376 function allows firmware update operation to validate the firmware image
377 before FmpDeviceSetImage() is called.
378
379 @param[in] Image Points to a new firmware image.
380 @param[in] ImageSize Size, in bytes, of a new firmware image.
381 @param[out] ImageUpdatable Indicates if a new firmware image is valid for
382 a firmware update to the firmware device. The
383 following values from the Firmware Management
384 Protocol are supported:
385 IMAGE_UPDATABLE_VALID
386 IMAGE_UPDATABLE_INVALID
387 IMAGE_UPDATABLE_INVALID_TYPE
388 IMAGE_UPDATABLE_INVALID_OLD
389 IMAGE_UPDATABLE_VALID_WITH_VENDOR_CODE
390
391 @retval EFI_SUCCESS The image was successfully checked. Additional
392 status information is returned in
393 ImageUpdatable.
394 @retval EFI_INVALID_PARAMETER Image is NULL.
395 @retval EFI_INVALID_PARAMETER ImageUpdatable is NULL.
396
397 **/
398 EFI_STATUS
399 EFIAPI
400 FmpDeviceCheckImage (
401 IN CONST VOID *Image,
402 IN UINTN ImageSize,
403 OUT UINT32 *ImageUpdatable
404 );
405
406 /**
407 Checks if a new firmware image is valid for the firmware device. This
408 function allows firmware update operation to validate the firmware image
409 before FmpDeviceSetImage() is called.
410
411 @param[in] Image Points to a new firmware image.
412 @param[in] ImageSize Size, in bytes, of a new firmware image.
413 @param[out] ImageUpdatable Indicates if a new firmware image is valid for
414 a firmware update to the firmware device. The
415 following values from the Firmware Management
416 Protocol are supported:
417 IMAGE_UPDATABLE_VALID
418 IMAGE_UPDATABLE_INVALID
419 IMAGE_UPDATABLE_INVALID_TYPE
420 IMAGE_UPDATABLE_INVALID_OLD
421 IMAGE_UPDATABLE_VALID_WITH_VENDOR_CODE
422 @param[out] LastAttemptStatus A pointer to a UINT32 that holds the last attempt
423 status to report back to the ESRT table in case
424 of error. This value will only be checked when this
425 function returns an error.
426
427 The return status code must fall in the range of
428 LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE to
429 LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MAX_ERROR_CODE_VALUE.
430
431 If the value falls outside this range, it will be converted
432 to LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL.
433
434 @retval EFI_SUCCESS The image was successfully checked. Additional
435 status information is returned in
436 ImageUpdatable.
437 @retval EFI_INVALID_PARAMETER Image is NULL.
438 @retval EFI_INVALID_PARAMETER ImageUpdatable is NULL.
439
440 **/
441 EFI_STATUS
442 EFIAPI
443 FmpDeviceCheckImageWithStatus (
444 IN CONST VOID *Image,
445 IN UINTN ImageSize,
446 OUT UINT32 *ImageUpdatable,
447 OUT UINT32 *LastAttemptStatus
448 );
449
450 /**
451 Updates a firmware device with a new firmware image. This function returns
452 EFI_UNSUPPORTED if the firmware image is not updatable. If the firmware image
453 is updatable, the function should perform the following minimal validations
454 before proceeding to do the firmware image update.
455 - Validate that the image is a supported image for this firmware device.
456 Return EFI_ABORTED if the image is not supported. Additional details
457 on why the image is not a supported image may be returned in AbortReason.
458 - Validate the data from VendorCode if is not NULL. Firmware image
459 validation must be performed before VendorCode data validation.
460 VendorCode data is ignored or considered invalid if image validation
461 fails. Return EFI_ABORTED if the VendorCode data is invalid.
462
463 VendorCode enables vendor to implement vendor-specific firmware image update
464 policy. Null if the caller did not specify the policy or use the default
465 policy. As an example, vendor can implement a policy to allow an option to
466 force a firmware image update when the abort reason is due to the new firmware
467 image version is older than the current firmware image version or bad image
468 checksum. Sensitive operations such as those wiping the entire firmware image
469 and render the device to be non-functional should be encoded in the image
470 itself rather than passed with the VendorCode. AbortReason enables vendor to
471 have the option to provide a more detailed description of the abort reason to
472 the caller.
473
474 @param[in] Image Points to the new firmware image.
475 @param[in] ImageSize Size, in bytes, of the new firmware image.
476 @param[in] VendorCode This enables vendor to implement vendor-specific
477 firmware image update policy. NULL indicates
478 the caller did not specify the policy or use the
479 default policy.
480 @param[in] Progress A function used to report the progress of
481 updating the firmware device with the new
482 firmware image.
483 @param[in] CapsuleFwVersion The version of the new firmware image from the
484 update capsule that provided the new firmware
485 image.
486 @param[out] AbortReason A pointer to a pointer to a Null-terminated
487 Unicode string providing more details on an
488 aborted operation. The buffer is allocated by
489 this function with
490 EFI_BOOT_SERVICES.AllocatePool(). It is the
491 caller's responsibility to free this buffer with
492 EFI_BOOT_SERVICES.FreePool().
493
494 @retval EFI_SUCCESS The firmware device was successfully updated
495 with the new firmware image.
496 @retval EFI_ABORTED The operation is aborted. Additional details
497 are provided in AbortReason.
498 @retval EFI_INVALID_PARAMETER The Image was NULL.
499 @retval EFI_UNSUPPORTED The operation is not supported.
500
501 **/
502 EFI_STATUS
503 EFIAPI
504 FmpDeviceSetImage (
505 IN CONST VOID *Image,
506 IN UINTN ImageSize,
507 IN CONST VOID *VendorCode OPTIONAL,
508 IN EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS Progress OPTIONAL,
509 IN UINT32 CapsuleFwVersion,
510 OUT CHAR16 **AbortReason
511 );
512
513 /**
514 Updates a firmware device with a new firmware image. This function returns
515 EFI_UNSUPPORTED if the firmware image is not updatable. If the firmware image
516 is updatable, the function should perform the following minimal validations
517 before proceeding to do the firmware image update.
518 - Validate that the image is a supported image for this firmware device.
519 Return EFI_ABORTED if the image is not supported. Additional details
520 on why the image is not a supported image may be returned in AbortReason.
521 - Validate the data from VendorCode if is not NULL. Firmware image
522 validation must be performed before VendorCode data validation.
523 VendorCode data is ignored or considered invalid if image validation
524 fails. Return EFI_ABORTED if the VendorCode data is invalid.
525
526 VendorCode enables vendor to implement vendor-specific firmware image update
527 policy. Null if the caller did not specify the policy or use the default
528 policy. As an example, vendor can implement a policy to allow an option to
529 force a firmware image update when the abort reason is due to the new firmware
530 image version is older than the current firmware image version or bad image
531 checksum. Sensitive operations such as those wiping the entire firmware image
532 and render the device to be non-functional should be encoded in the image
533 itself rather than passed with the VendorCode. AbortReason enables vendor to
534 have the option to provide a more detailed description of the abort reason to
535 the caller.
536
537 @param[in] Image Points to the new firmware image.
538 @param[in] ImageSize Size, in bytes, of the new firmware image.
539 @param[in] VendorCode This enables vendor to implement vendor-specific
540 firmware image update policy. NULL indicates
541 the caller did not specify the policy or use the
542 default policy.
543 @param[in] Progress A function used to report the progress of
544 updating the firmware device with the new
545 firmware image.
546 @param[in] CapsuleFwVersion The version of the new firmware image from the
547 update capsule that provided the new firmware
548 image.
549 @param[out] AbortReason A pointer to a pointer to a Null-terminated
550 Unicode string providing more details on an
551 aborted operation. The buffer is allocated by
552 this function with
553 EFI_BOOT_SERVICES.AllocatePool(). It is the
554 caller's responsibility to free this buffer with
555 EFI_BOOT_SERVICES.FreePool().
556 @param[out] LastAttemptStatus A pointer to a UINT32 that holds the last attempt
557 status to report back to the ESRT table in case
558 of error. This value will only be checked when this
559 function returns an error.
560
561 The return status code must fall in the range of
562 LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE to
563 LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MAX_ERROR_CODE_VALUE.
564
565 If the value falls outside this range, it will be converted
566 to LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL.
567
568 @retval EFI_SUCCESS The firmware device was successfully updated
569 with the new firmware image.
570 @retval EFI_ABORTED The operation is aborted. Additional details
571 are provided in AbortReason.
572 @retval EFI_INVALID_PARAMETER The Image was NULL.
573 @retval EFI_UNSUPPORTED The operation is not supported.
574
575 **/
576 EFI_STATUS
577 EFIAPI
578 FmpDeviceSetImageWithStatus (
579 IN CONST VOID *Image,
580 IN UINTN ImageSize,
581 IN CONST VOID *VendorCode OPTIONAL,
582 IN EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS Progress OPTIONAL,
583 IN UINT32 CapsuleFwVersion,
584 OUT CHAR16 **AbortReason,
585 OUT UINT32 *LastAttemptStatus
586 );
587
588 /**
589 Lock the firmware device that contains a firmware image. Once a firmware
590 device is locked, any attempts to modify the firmware image contents in the
591 firmware device must fail.
592
593 @note It is recommended that all firmware devices support a lock method to
594 prevent modifications to a stored firmware image.
595
596 @note A firmware device lock mechanism is typically only cleared by a full
597 system reset (not just sleep state/low power mode).
598
599 @retval EFI_SUCCESS The firmware device was locked.
600 @retval EFI_UNSUPPORTED The firmware device does not support locking
601
602 **/
603 EFI_STATUS
604 EFIAPI
605 FmpDeviceLock (
606 VOID
607 );
608
609 #endif