Skip to content

Commit bdc35fe

Browse files
committed
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 <nicklew@nvidia.com>
1 parent 21ed84a commit bdc35fe

3 files changed

Lines changed: 18 additions & 10 deletions

File tree

RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
55
(C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
6-
Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
6+
Copyright (c) 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
77
Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>
88
99
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -375,14 +375,19 @@ RedfishRestExDriverBindingSupported (
375375
//
376376
// Test for the HttpServiceBinding Protocol.
377377
//
378-
return gBS->OpenProtocol (
379-
ControllerHandle,
380-
&gEfiHttpServiceBindingProtocolGuid,
381-
NULL,
382-
This->DriverBindingHandle,
383-
ControllerHandle,
384-
EFI_OPEN_PROTOCOL_TEST_PROTOCOL
385-
);
378+
Status = gBS->OpenProtocol (
379+
ControllerHandle,
380+
&gEfiHttpServiceBindingProtocolGuid,
381+
NULL,
382+
This->DriverBindingHandle,
383+
ControllerHandle,
384+
EFI_OPEN_PROTOCOL_TEST_PROTOCOL
385+
);
386+
if (EFI_ERROR (Status)) {
387+
return Status;
388+
}
389+
390+
return IsPlatformWantedDevice (ControllerHandle, RemainingDevicePath);
386391
}
387392

388393
/**

RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
(C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
66
Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
77
Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>
8+
Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
89
910
SPDX-License-Identifier: BSD-2-Clause-Patent
1011
@@ -23,6 +24,7 @@
2324
#include <Library/HttpIoLib.h>
2425
#include <Library/MemoryAllocationLib.h>
2526
#include <Library/NetLib.h>
27+
#include <Library/RedfishPlatformWantedDeviceLib.h>
2628
#include <Library/UefiLib.h>
2729
#include <Library/UefiBootServicesTableLib.h>
2830
#include <Library/UefiDriverEntryPoint.h>

RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
55
# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
66
# Copyright (c) 2023, American Megatrends International LLC.
7-
# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
7+
# Copyright (c) 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
88
# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>
99
#
1010
# SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -47,6 +47,7 @@
4747
MemoryAllocationLib
4848
NetLib
4949
RedfishDebugLib
50+
RedfishPlatformWantedDeviceLib
5051
UefiLib
5152
UefiBootServicesTableLib
5253
UefiDriverEntryPoint

0 commit comments

Comments
 (0)