TianoCore EDK2 master
Loading...
Searching...
No Matches
RedfishPlatformConfigLib.c
Go to the documentation of this file.
1
12
13REDFISH_PLATFORM_CONFIG_LIB_PRIVATE mRedfishPlatformConfigLibPrivate;
14
30 IN CHAR8 *Schema,
31 IN CHAR8 *Version,
32 IN EFI_STRING ConfigureLang,
34 )
35{
36 if (mRedfishPlatformConfigLibPrivate.Protocol == NULL) {
37 return EFI_NOT_READY;
38 }
39
40 return mRedfishPlatformConfigLibPrivate.Protocol->GetValue (
41 mRedfishPlatformConfigLibPrivate.Protocol,
42 Schema,
43 Version,
44 ConfigureLang,
45 Value
46 );
47}
48
63 IN CHAR8 *Schema,
64 IN CHAR8 *Version,
65 IN EFI_STRING ConfigureLang,
66 OUT EDKII_REDFISH_ATTRIBUTE *AttributeValue
67 )
68{
69 if (mRedfishPlatformConfigLibPrivate.Protocol == NULL) {
70 return EFI_NOT_READY;
71 }
72
73 return mRedfishPlatformConfigLibPrivate.Protocol->GetAttribute (
74 mRedfishPlatformConfigLibPrivate.Protocol,
75 Schema,
76 Version,
77 ConfigureLang,
78 AttributeValue
79 );
80}
81
98 IN CHAR8 *Schema,
99 IN CHAR8 *Version,
100 IN EFI_STRING ConfigureLang,
101 IN UINT16 DefaultClass,
103 )
104{
105 if (mRedfishPlatformConfigLibPrivate.Protocol == NULL) {
106 return EFI_NOT_READY;
107 }
108
109 return mRedfishPlatformConfigLibPrivate.Protocol->GetDefaultValue (
110 mRedfishPlatformConfigLibPrivate.Protocol,
111 Schema,
112 Version,
113 ConfigureLang,
114 DefaultClass,
115 Value
116 );
117}
118
134 IN CHAR8 *Schema,
135 IN CHAR8 *Version,
136 IN EFI_STRING ConfigureLang,
138 )
139{
140 if (mRedfishPlatformConfigLibPrivate.Protocol == NULL) {
141 return EFI_NOT_READY;
142 }
143
144 return mRedfishPlatformConfigLibPrivate.Protocol->SetValue (
145 mRedfishPlatformConfigLibPrivate.Protocol,
146 Schema,
147 Version,
148 ConfigureLang,
149 Value
150 );
151}
152
169 IN CHAR8 *Schema,
170 IN CHAR8 *Version,
171 IN EFI_STRING Pattern,
172 OUT EFI_STRING **ConfigureLangList,
173 OUT UINTN *Count
174 )
175{
176 if (mRedfishPlatformConfigLibPrivate.Protocol == NULL) {
177 return EFI_NOT_READY;
178 }
179
180 return mRedfishPlatformConfigLibPrivate.Protocol->GetConfigureLang (
181 mRedfishPlatformConfigLibPrivate.Protocol,
182 Schema,
183 Version,
184 Pattern,
185 ConfigureLangList,
186 Count
187 );
188}
189
204EFIAPI
206 OUT CHAR8 **SupportedSchema
207 )
208{
209 if (mRedfishPlatformConfigLibPrivate.Protocol == NULL) {
210 return EFI_NOT_READY;
211 }
212
213 return mRedfishPlatformConfigLibPrivate.Protocol->GetSupportedSchema (
214 mRedfishPlatformConfigLibPrivate.Protocol,
215 SupportedSchema
216 );
217}
218
228VOID
229EFIAPI
231 IN EFI_EVENT Event,
232 IN VOID *Context
233 )
234{
235 EFI_STATUS Status;
236
237 //
238 // Locate EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL.
239 //
240 Status = gBS->LocateProtocol (
241 &gEdkIIRedfishPlatformConfigProtocolGuid,
242 NULL,
243 (VOID **)&mRedfishPlatformConfigLibPrivate.Protocol
244 );
245 if (EFI_ERROR (Status)) {
246 DEBUG ((DEBUG_ERROR, "%a: locate EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL failure: %r\n", __func__, Status));
247 return;
248 }
249
250 gBS->CloseEvent (Event);
251 mRedfishPlatformConfigLibPrivate.ProtocolEvent = NULL;
252}
253
265EFIAPI
267 IN EFI_HANDLE ImageHandle,
268 IN EFI_SYSTEM_TABLE *SystemTable
269 )
270{
271 ZeroMem (&mRedfishPlatformConfigLibPrivate, sizeof (REDFISH_PLATFORM_CONFIG_LIB_PRIVATE));
272 mRedfishPlatformConfigLibPrivate.ProtocolEvent = EfiCreateProtocolNotifyEvent (
273 &gEdkIIRedfishPlatformConfigProtocolGuid,
274 TPL_CALLBACK,
276 NULL,
277 &mRedfishPlatformConfigLibPrivate.Registration
278 );
279 if (mRedfishPlatformConfigLibPrivate.ProtocolEvent == NULL) {
280 DEBUG ((DEBUG_ERROR, "%a: failed to create protocol notify event\n", __func__));
281 }
282
283 return EFI_SUCCESS;
284}
285
296EFIAPI
298 IN EFI_HANDLE ImageHandle,
299 IN EFI_SYSTEM_TABLE *SystemTable
300 )
301{
302 if (mRedfishPlatformConfigLibPrivate.ProtocolEvent != NULL) {
303 gBS->CloseEvent (mRedfishPlatformConfigLibPrivate.ProtocolEvent);
304 mRedfishPlatformConfigLibPrivate.ProtocolEvent = NULL;
305 }
306
307 mRedfishPlatformConfigLibPrivate.Protocol = NULL;
308
309 return EFI_SUCCESS;
310}
UINT64 UINTN
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
#define NULL
Definition: Base.h:319
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define DEBUG(Expression)
Definition: DebugLib.h:434
EFI_STATUS EFIAPI RedfishPlatformConfigGetSupportedSchema(OUT CHAR8 **SupportedSchema)
EFI_STATUS EFIAPI RedfishPlatformConfigLibDestructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
VOID EFIAPI RedfishPlatformConfigProtocolInstalled(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS RedfishPlatformConfigGetValue(IN CHAR8 *Schema, IN CHAR8 *Version, IN EFI_STRING ConfigureLang, OUT EDKII_REDFISH_VALUE *Value)
EFI_STATUS RedfishPlatformConfigGetDefaultValue(IN CHAR8 *Schema, IN CHAR8 *Version, IN EFI_STRING ConfigureLang, IN UINT16 DefaultClass, OUT EDKII_REDFISH_VALUE *Value)
EFI_STATUS RedfishPlatformConfigSetValue(IN CHAR8 *Schema, IN CHAR8 *Version, IN EFI_STRING ConfigureLang, IN EDKII_REDFISH_VALUE Value)
EFI_STATUS EFIAPI RedfishPlatformConfigLibConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS RedfishPlatformConfigGetAttribute(IN CHAR8 *Schema, IN CHAR8 *Version, IN EFI_STRING ConfigureLang, OUT EDKII_REDFISH_ATTRIBUTE *AttributeValue)
EFI_STATUS RedfishPlatformConfigGetConfigureLang(IN CHAR8 *Schema, IN CHAR8 *Version, IN EFI_STRING Pattern, OUT EFI_STRING **ConfigureLangList, OUT UINTN *Count)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS
EFI_EVENT EFIAPI EfiCreateProtocolNotifyEvent(IN EFI_GUID *ProtocolGuid, IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *NotifyContext OPTIONAL, OUT VOID **Registration)
Definition: UefiLib.c:134
EFI_EVENT ProtocolEvent
Protocol notification event.
VOID * Registration
Protocol notification registration.