From f444c4bea5125ebc2b8b92ec03ab8d11c5c183bf Mon Sep 17 00:00:00 2001 From: Igor Kulchytskyy Date: Tue, 14 Nov 2023 21:52:51 -0500 Subject: RedfishPkg: RedfishDiscoverDxe: Fix issue if IPv4 installed after RestEx BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4602 Supported function of the driver changed to wait for all network interface to be installed. Reviewed-by: Abner Chang Reviewed-by: Nickle Wang Acked-by Mike Maslenkin Signed-off-by: Igor Kulchytskyy Acked-by: Leif Lindholm --- RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c | 31 +++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'RedfishPkg') diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c index 23da3b968f..0f622e05a9 100644 --- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c @@ -1547,25 +1547,26 @@ TestForRequiredProtocols ( ControllerHandle, EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); + if (EFI_ERROR (Status)) { + return EFI_UNSUPPORTED; + } + + Status = gBS->OpenProtocol ( + ControllerHandle, + gRequiredProtocol[Index].DiscoveredProtocolGuid, + (VOID **)&Id, + This->DriverBindingHandle, + ControllerHandle, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); if (!EFI_ERROR (Status)) { - Status = gBS->OpenProtocol ( - ControllerHandle, - gRequiredProtocol[Index].DiscoveredProtocolGuid, - (VOID **)&Id, - This->DriverBindingHandle, - ControllerHandle, - EFI_OPEN_PROTOCOL_GET_PROTOCOL - ); - if (EFI_ERROR (Status)) { - if (Index == ListCount - 1) { - DEBUG ((DEBUG_INFO, "%a: all required protocols are found on this controller handle: %p.\n", __func__, ControllerHandle)); - return EFI_SUCCESS; - } - } + // Already installed + return EFI_UNSUPPORTED; } } - return EFI_UNSUPPORTED; + DEBUG ((DEBUG_MANAGEABILITY, "%a: all required protocols are found on this controller handle: %p.\n", __func__, ControllerHandle)); + return EFI_SUCCESS; } /** -- cgit v1.2.3