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