]>
git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.c
aced356324e667aab711d1d1ae585f6116891131
2 Null Dxe Capsule Library instance does nothing and returns unsupport status.
4 Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #include <Library/CapsuleLib.h>
12 The firmware checks whether the capsule image is supported
13 by the CapsuleGuid in CapsuleHeader or other specific information in capsule image.
15 Caution: This function may receive untrusted input.
17 @param CapsuleHeader Point to the UEFI capsule image to be checked.
19 @retval EFI_UNSUPPORTED Input capsule is not supported by the firmware.
24 IN EFI_CAPSULE_HEADER
*CapsuleHeader
27 return EFI_UNSUPPORTED
;
31 The firmware specific implementation processes the capsule image
32 if it recognized the format of this capsule image.
34 Caution: This function may receive untrusted input.
36 @param CapsuleHeader Point to the UEFI capsule image to be processed.
38 @retval EFI_UNSUPPORTED Capsule image is not supported by the firmware.
43 IN EFI_CAPSULE_HEADER
*CapsuleHeader
46 return EFI_UNSUPPORTED
;
51 This routine is called to process capsules.
53 Caution: This function may receive untrusted input.
55 The capsules reported in EFI_HOB_UEFI_CAPSULE are processed.
56 If there is no EFI_HOB_UEFI_CAPSULE, this routine does nothing.
58 This routine should be called twice in BDS.
59 1) The first call must be before EndOfDxe. The system capsules is processed.
60 If device capsule FMP protocols are exposted at this time and device FMP
61 capsule has zero EmbeddedDriverCount, the device capsules are processed.
62 Each individual capsule result is recorded in capsule record variable.
63 System may reset in this function, if reset is required by capsule and
64 all capsules are processed.
65 If not all capsules are processed, reset will be defered to second call.
67 2) The second call must be after EndOfDxe and after ConnectAll, so that all
68 device capsule FMP protocols are exposed.
69 The system capsules are skipped. If the device capsules are NOT processed
70 in first call, they are processed here.
71 Each individual capsule result is recorded in capsule record variable.
72 System may reset in this function, if reset is required by capsule
73 processed in first call and second call.
75 @retval EFI_SUCCESS There is no error when processing capsules.
76 @retval EFI_OUT_OF_RESOURCES No enough resource to process capsules.
85 return EFI_UNSUPPORTED
;
89 This routine is called to check if CapsuleOnDisk flag in OsIndications Variable
92 @retval TRUE Flag is enabled
93 @retval FALSE Flag is not enabled
98 CoDCheckCapsuleOnDiskFlag (
106 This routine is called to clear CapsuleOnDisk flags including OsIndications and BootNext variable.
108 @retval EFI_SUCCESS All Capsule On Disk flags are cleared
113 CoDClearCapsuleOnDiskFlag (
117 return EFI_UNSUPPORTED
;
121 Relocate Capsule on Disk from EFI system partition.
123 Two solution to deliver Capsule On Disk:
124 Solution A: If PcdCapsuleInRamSupport is enabled, relocate Capsule On Disk to memory and call UpdateCapsule().
125 Solution B: If PcdCapsuleInRamSupport is disabled, relocate Capsule On Disk to a platform-specific NV storage
126 device with BlockIo protocol.
128 Device enumeration like USB costs time, user can input MaxRetry to tell function to retry.
129 Function will stall 100ms between each retry.
132 Capsule Delivery Supported Flag in OsIndication variable and BootNext variable will be cleared.
133 Solution B: Content corruption. Block IO write directly touches low level write. Orignal partitions, file
134 systems of the relocation device will be corrupted.
136 @param[in] MaxRetry Max Connection Retry. Stall 100ms between each connection try to ensure
137 devices like USB can get enumerated. Input 0 means no retry.
139 @retval EFI_SUCCESS Capsule on Disk images are successfully relocated.
148 return EFI_UNSUPPORTED
;
152 Remove the temp file from the root of EFI System Partition.
153 Device enumeration like USB costs time, user can input MaxRetry to tell function to retry.
154 Function will stall 100ms between each retry.
156 @param[in] MaxRetry Max Connection Retry. Stall 100ms between each connection try to ensure
157 devices like USB can get enumerated. Input 0 means no retry.
159 @retval EFI_SUCCESS Remove the temp file successfully.
168 return EFI_UNSUPPORTED
;