From 225bf1277cff3a262f08dd526db0a8fa71176390 Mon Sep 17 00:00:00 2001 From: Nickle Wang Date: Thu, 24 Apr 2025 10:43:18 +0800 Subject: [PATCH] RedfishPkg/RedfishExDxe: call platform device wanted lib In supported() function, add the call to platform device wanted lib to see if platform wants to support this device or not. If platform does not support this device, Redfish Ex protocol won't be available on this controller handle and the reset of Redfish service is not available either. Signed-off-by: Nickle Wang --- .../RedfishRestExDxe/RedfishRestExDriver.c | 23 +++++++++++-------- .../RedfishRestExDxe/RedfishRestExDriver.h | 2 ++ .../RedfishRestExDxe/RedfishRestExDxe.inf | 3 ++- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c index e601bb633d..26266691eb 100644 --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c @@ -3,7 +3,7 @@ Copyright (c) 2019, Intel Corporation. All rights reserved.
(C) Copyright 2020 Hewlett Packard Enterprise Development LP
- Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + Copyright (c) 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -375,14 +375,19 @@ RedfishRestExDriverBindingSupported ( // // Test for the HttpServiceBinding Protocol. // - return gBS->OpenProtocol ( - ControllerHandle, - &gEfiHttpServiceBindingProtocolGuid, - NULL, - This->DriverBindingHandle, - ControllerHandle, - EFI_OPEN_PROTOCOL_TEST_PROTOCOL - ); + Status = gBS->OpenProtocol ( + ControllerHandle, + &gEfiHttpServiceBindingProtocolGuid, + NULL, + This->DriverBindingHandle, + ControllerHandle, + EFI_OPEN_PROTOCOL_TEST_PROTOCOL + ); + if (EFI_ERROR (Status)) { + return Status; + } + + return IsPlatformWantedDevice (ControllerHandle, RemainingDevicePath); } /** diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h index f0107a453f..2f081cd912 100644 --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h @@ -5,6 +5,7 @@ (C) Copyright 2020 Hewlett Packard Enterprise Development LP
Copyright (c) 2023, Ampere Computing LLC. All rights reserved.
Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+ Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -23,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf b/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf index 6da416ddb9..f951b41d9b 100644 --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf @@ -4,7 +4,7 @@ # Copyright (c) 2019, Intel Corporation. All rights reserved.
# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
# Copyright (c) 2023, American Megatrends International LLC. -# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -47,6 +47,7 @@ MemoryAllocationLib NetLib RedfishDebugLib + RedfishPlatformWantedDeviceLib UefiLib UefiBootServicesTableLib UefiDriverEntryPoint