37 if (EFI_ERROR (Status) && (Status != EFI_UNSUPPORTED)) {
38 DEBUG ((DEBUG_ERROR,
"Redfish credential protocol failed to stop service on EndOfDxe: %r", Status));
44 gBS->CloseEvent (gEndOfDxeEvent);
45 gEndOfDxeEvent =
NULL;
65 if (EFI_ERROR (Status) && (Status != EFI_UNSUPPORTED)) {
66 DEBUG ((DEBUG_ERROR,
"Redfish credential protocol failed to stop service on ExitBootService: %r", Status));
83 if (gEndOfDxeEvent !=
NULL) {
84 gBS->CloseEvent (gEndOfDxeEvent);
85 gEndOfDxeEvent =
NULL;
88 if (gExitBootServiceEvent !=
NULL) {
89 gBS->CloseEvent (gExitBootServiceEvent);
90 gExitBootServiceEvent =
NULL;
94 gBS->CloseEvent (gRedfishConfigData.
Event);
123 Status =
gBS->LocateProtocol (&gEdkIIRedfishCredentialProtocolGuid,
NULL, (VOID **)&gCredential);
124 if (EFI_ERROR (Status)) {
125 DEBUG ((DEBUG_ERROR,
"%a: No Redfish Credential Protocol is installed on system.", __func__));
132 Status =
gBS->CreateEventEx (
137 &gEfiEndOfDxeEventGroupGuid,
140 if (EFI_ERROR (Status)) {
141 DEBUG ((DEBUG_ERROR,
"%a: Fail to register End Of DXE event.", __func__));
148 Status =
gBS->CreateEventEx (
153 &gEfiEventExitBootServicesGuid,
154 &gExitBootServiceEvent
156 if (EFI_ERROR (Status)) {
157 gBS->CloseEvent (gEndOfDxeEvent);
158 gEndOfDxeEvent =
NULL;
159 DEBUG ((DEBUG_ERROR,
"%a: Fail to register Exit Boot Service event.", __func__));
180 UINTN NumberOfHandles;
184 Status =
gBS->LocateHandleBuffer (
186 &gEdkIIRedfishConfigHandlerProtocolGuid,
191 if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
196 for (Index = 0; Index < NumberOfHandles; Index++) {
197 Status =
gBS->HandleProtocol (
199 &gEdkIIRedfishConfigHandlerProtocolGuid,
200 (VOID **)&ConfigHandler
204 Status = ConfigHandler->Stop (ConfigHandler);
205 if (EFI_ERROR (Status) && (Status != EFI_UNSUPPORTED)) {
206 DEBUG ((DEBUG_ERROR,
"ERROR: Failed to stop Redfish config handler %p.\n", ConfigHandler));
226 UINTN NumberOfHandles;
231 Status =
gBS->LocateHandleBuffer (
233 &gEdkIIRedfishConfigHandlerProtocolGuid,
238 if (EFI_ERROR (Status)) {
242 for (Index = 0; Index < NumberOfHandles; Index++) {
243 Status =
gBS->HandleProtocol (
248 if (!EFI_ERROR (Status)) {
252 Status =
gBS->HandleProtocol (
254 &gEdkIIRedfishConfigHandlerProtocolGuid,
255 (VOID **)&ConfigHandler
258 Status = ConfigHandler->Init (ConfigHandler, &gRedfishConfigData.RedfishServiceInfo);
259 if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) {
260 DEBUG ((DEBUG_ERROR,
"ERROR: Failed to init Redfish config handler %p.\n", ConfigHandler));
267 Status =
gBS->InstallProtocolInterface (
268 &HandleBuffer[Index],
271 (VOID *)&gRedfishConfigData.
CallerId
@ ServiceStopTypeSecureBootDisabled
@ ServiceStopTypeExitBootService
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
VOID RedfishConfigHandlerInitialization(VOID)
EFI_STATUS RedfishConfigDriverCommonUnload(IN EFI_HANDLE ImageHandle)
VOID EFIAPI RedfishConfigOnExitBootService(IN EFI_EVENT Event, OUT VOID *Context)
VOID EFIAPI RedfishConfigOnEndOfDxe(IN EFI_EVENT Event, OUT VOID *Context)
EFI_STATUS RedfishConfigCommonInit(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS RedfishConfigCommonStop(VOID)
EFI_EVENT Event
Event for the notification of EFI_REDFISH_CONFIG_HANDLER_PROTOCOL.