1 | /** @file
|
---|
2 | Null Dxe Capsule Library instance does nothing and returns unsupport status.
|
---|
3 |
|
---|
4 | Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
|
---|
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
6 |
|
---|
7 | **/
|
---|
8 | #include <Uefi.h>
|
---|
9 | #include <Library/CapsuleLib.h>
|
---|
10 |
|
---|
11 | /**
|
---|
12 | The firmware checks whether the capsule image is supported
|
---|
13 | by the CapsuleGuid in CapsuleHeader or other specific information in capsule image.
|
---|
14 |
|
---|
15 | Caution: This function may receive untrusted input.
|
---|
16 |
|
---|
17 | @param CapsuleHeader Point to the UEFI capsule image to be checked.
|
---|
18 |
|
---|
19 | @retval EFI_UNSUPPORTED Input capsule is not supported by the firmware.
|
---|
20 | **/
|
---|
21 | EFI_STATUS
|
---|
22 | EFIAPI
|
---|
23 | SupportCapsuleImage (
|
---|
24 | IN EFI_CAPSULE_HEADER *CapsuleHeader
|
---|
25 | )
|
---|
26 | {
|
---|
27 | return EFI_UNSUPPORTED;
|
---|
28 | }
|
---|
29 |
|
---|
30 | /**
|
---|
31 | The firmware specific implementation processes the capsule image
|
---|
32 | if it recognized the format of this capsule image.
|
---|
33 |
|
---|
34 | Caution: This function may receive untrusted input.
|
---|
35 |
|
---|
36 | @param CapsuleHeader Point to the UEFI capsule image to be processed.
|
---|
37 |
|
---|
38 | @retval EFI_UNSUPPORTED Capsule image is not supported by the firmware.
|
---|
39 | **/
|
---|
40 | EFI_STATUS
|
---|
41 | EFIAPI
|
---|
42 | ProcessCapsuleImage (
|
---|
43 | IN EFI_CAPSULE_HEADER *CapsuleHeader
|
---|
44 | )
|
---|
45 | {
|
---|
46 | return EFI_UNSUPPORTED;
|
---|
47 | }
|
---|
48 |
|
---|
49 | /**
|
---|
50 |
|
---|
51 | This routine is called to process capsules.
|
---|
52 |
|
---|
53 | Caution: This function may receive untrusted input.
|
---|
54 |
|
---|
55 | The capsules reported in EFI_HOB_UEFI_CAPSULE are processed.
|
---|
56 | If there is no EFI_HOB_UEFI_CAPSULE, this routine does nothing.
|
---|
57 |
|
---|
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.
|
---|
66 |
|
---|
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.
|
---|
74 |
|
---|
75 | @retval EFI_SUCCESS There is no error when processing capsules.
|
---|
76 | @retval EFI_OUT_OF_RESOURCES No enough resource to process capsules.
|
---|
77 |
|
---|
78 | **/
|
---|
79 | EFI_STATUS
|
---|
80 | EFIAPI
|
---|
81 | ProcessCapsules (
|
---|
82 | VOID
|
---|
83 | )
|
---|
84 | {
|
---|
85 | return EFI_UNSUPPORTED;
|
---|
86 | }
|
---|
87 |
|
---|
88 |
|
---|
89 | /**
|
---|
90 | This routine is called to check if CapsuleOnDisk flag in OsIndications Variable
|
---|
91 | is enabled.
|
---|
92 |
|
---|
93 | @retval TRUE Flag is enabled
|
---|
94 | @retval FALSE Flag is not enabled
|
---|
95 |
|
---|
96 | **/
|
---|
97 | BOOLEAN
|
---|
98 | EFIAPI
|
---|
99 | CoDCheckCapsuleOnDiskFlag(
|
---|
100 | VOID
|
---|
101 | )
|
---|
102 | {
|
---|
103 | return FALSE;
|
---|
104 | }
|
---|
105 |
|
---|
106 | /**
|
---|
107 | This routine is called to clear CapsuleOnDisk flags including OsIndications and BootNext variable.
|
---|
108 |
|
---|
109 | @retval EFI_SUCCESS All Capsule On Disk flags are cleared
|
---|
110 |
|
---|
111 | **/
|
---|
112 | EFI_STATUS
|
---|
113 | EFIAPI
|
---|
114 | CoDClearCapsuleOnDiskFlag(
|
---|
115 | VOID
|
---|
116 | )
|
---|
117 | {
|
---|
118 | return EFI_UNSUPPORTED;
|
---|
119 | }
|
---|
120 |
|
---|
121 | /**
|
---|
122 | Relocate Capsule on Disk from EFI system partition.
|
---|
123 |
|
---|
124 | Two solution to deliver Capsule On Disk:
|
---|
125 | Solution A: If PcdCapsuleInRamSupport is enabled, relocate Capsule On Disk to memory and call UpdateCapsule().
|
---|
126 | Solution B: If PcdCapsuleInRamSupport is disabled, relocate Capsule On Disk to a platform-specific NV storage
|
---|
127 | device with BlockIo protocol.
|
---|
128 |
|
---|
129 | Device enumeration like USB costs time, user can input MaxRetry to tell function to retry.
|
---|
130 | Function will stall 100ms between each retry.
|
---|
131 |
|
---|
132 | Side Effects:
|
---|
133 | Capsule Delivery Supported Flag in OsIndication variable and BootNext variable will be cleared.
|
---|
134 | Solution B: Content corruption. Block IO write directly touches low level write. Orignal partitions, file
|
---|
135 | systems of the relocation device will be corrupted.
|
---|
136 |
|
---|
137 | @param[in] MaxRetry Max Connection Retry. Stall 100ms between each connection try to ensure
|
---|
138 | devices like USB can get enumerated. Input 0 means no retry.
|
---|
139 |
|
---|
140 | @retval EFI_SUCCESS Capsule on Disk images are successfully relocated.
|
---|
141 |
|
---|
142 | **/
|
---|
143 | EFI_STATUS
|
---|
144 | EFIAPI
|
---|
145 | CoDRelocateCapsule(
|
---|
146 | UINTN MaxRetry
|
---|
147 | )
|
---|
148 | {
|
---|
149 | return EFI_UNSUPPORTED;
|
---|
150 | }
|
---|
151 |
|
---|
152 | /**
|
---|
153 | Remove the temp file from the root of EFI System Partition.
|
---|
154 | Device enumeration like USB costs time, user can input MaxRetry to tell function to retry.
|
---|
155 | Function will stall 100ms between each retry.
|
---|
156 |
|
---|
157 | @param[in] MaxRetry Max Connection Retry. Stall 100ms between each connection try to ensure
|
---|
158 | devices like USB can get enumerated. Input 0 means no retry.
|
---|
159 |
|
---|
160 | @retval EFI_SUCCESS Remove the temp file successfully.
|
---|
161 |
|
---|
162 | **/
|
---|
163 | EFI_STATUS
|
---|
164 | EFIAPI
|
---|
165 | CoDRemoveTempFile (
|
---|
166 | UINTN MaxRetry
|
---|
167 | )
|
---|
168 | {
|
---|
169 | return EFI_UNSUPPORTED;
|
---|
170 | }
|
---|