diff options
Diffstat (limited to 'RedfishPkg')
19 files changed, 241 insertions, 32 deletions
diff --git a/RedfishPkg/Include/Library/RedfishCrtLib.h b/RedfishPkg/Include/Library/RedfishCrtLib.h index 0c51a03..f2aefbb 100644 --- a/RedfishPkg/Include/Library/RedfishCrtLib.h +++ b/RedfishPkg/Include/Library/RedfishCrtLib.h @@ -69,14 +69,17 @@ //
// Basic types mapping
//
-typedef UINTN size_t;
-typedef INTN ssize_t;
-typedef INT32 time_t;
-typedef INT32 int32_t;
-typedef UINT32 uint32_t;
-typedef UINT16 uint16_t;
-typedef UINT8 uint8_t;
-typedef BOOLEAN bool;
+typedef UINTN size_t;
+typedef INTN ssize_t;
+typedef INT32 time_t;
+typedef INT32 int32_t;
+typedef UINT32 uint32_t;
+typedef UINT16 uint16_t;
+typedef UINT8 uint8_t;
+// In C23, bool is a built-in type
+#if __STDC_VERSION__ < 202311L
+typedef BOOLEAN bool;
+#endif
#define true (1 == 1)
#define false (1 == 0)
diff --git a/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h b/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h index 22a8f92..4b13282 100644 --- a/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h +++ b/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h @@ -3,6 +3,7 @@ (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
+ Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -74,4 +75,17 @@ RedfishPlatformHostInterfaceNotification ( OUT EFI_GUID **InformationReadinessGuid
);
+/**
+ Get USB Serial Number.
+
+ @param[OUT] SerialNumber Pointer to retrieve complete serial number.
+
+ @retval EFI_SUCCESS Serial number is returned.
+ @retval Others Failed to get the serial number.
+**/
+EFI_STATUS
+RedfishPlatformHostInterfaceSerialNumber (
+ OUT CHAR8 **SerialNumber
+ );
+
#endif
diff --git a/RedfishPkg/Include/Library/RedfishPlatformWantedDeviceLib.h b/RedfishPkg/Include/Library/RedfishPlatformWantedDeviceLib.h new file mode 100644 index 0000000..31d4c93 --- /dev/null +++ b/RedfishPkg/Include/Library/RedfishPlatformWantedDeviceLib.h @@ -0,0 +1,37 @@ +/** @file
+ Definitions of RedfishPlatformWantedDeviceLib.
+
+ Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef REDFISH_PLATFORM_WANTED_DEVICE_LIB_H_
+#define REDFISH_PLATFORM_WANTED_DEVICE_LIB_H_
+
+#include <Uefi.h>
+
+/**
+ This is the function to decide if input controller is the device
+ that platform want to support. By returning EFI_UNSUPPORTED to
+ caller (normally Supported function), caller should ignore this device
+ and do not provide Redfish service on this controller.
+
+ @param[in] ControllerHandle The handle of the controller to test.
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path.
+ This is optional.
+
+ @retval EFI_SUCCESS This is the device supported by platform.
+ @retval EFI_UNSUPPORTED This device is not supported by platform.
+ @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
+
+**/
+EFI_STATUS
+EFIAPI
+IsPlatformWantedDevice (
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
+ );
+
+#endif
diff --git a/RedfishPkg/Library/JsonLib/JsonLib.inf b/RedfishPkg/Library/JsonLib/JsonLib.inf index b0d1bca..63997f8 100644 --- a/RedfishPkg/Library/JsonLib/JsonLib.inf +++ b/RedfishPkg/Library/JsonLib/JsonLib.inf @@ -84,5 +84,5 @@ #
MSFT:*_*_X64_CC_FLAGS = /wd4204 /wd4244 /wd4090 /wd4334 /wd4706 /DHAVE_CONFIG_H=1 /U_WIN32 /UWIN64 /U_MSC_VER
MSFT:*_*_IA32_CC_FLAGS = /wd4204 /wd4244 /wd4090 /wd4706 /DHAVE_CONFIG_H=1 /U_WIN32 /UWIN64 /U_MSC_VER
- GCC:*_*_*_CC_FLAGS = -Wno-unused-function -Wno-unused-but-set-variable
+ GCC:*_*_*_CC_FLAGS = -Wno-unused-function -Wno-unused-but-set-variable -DHAVE_CONFIG_H=1 -UWIN32 -U_WIN32 -UWIN64 -U_MSC_VER
diff --git a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c index 5c3f8f9..a6818c6 100644 --- a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c +++ b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c @@ -3,6 +3,7 @@ of USB NIC Device exposed by BMC.
Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+ Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -1366,3 +1367,20 @@ RedfishPlatformHostInterfaceNotification ( DEBUG ((DEBUG_ERROR, "%a: Something wrong when look for BMC USB NIC.\n", __func__));
return Status;
}
+
+/**
+ Get USB device serial number.
+
+ @param[out] SerialNumber Pointer to retrieve complete serial number.
+ It is the responsibility of the caller to free the allocated
+ memory for serial number.
+ @retval EFI_SUCCESS Serial number is returned.
+ @retval Others Failed to get the serial number
+**/
+EFI_STATUS
+RedfishPlatformHostInterfaceSerialNumber (
+ OUT CHAR8 **SerialNumber
+ )
+{
+ return EFI_UNSUPPORTED;
+}
diff --git a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c index 4064246..b9eca10 100644 --- a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c +++ b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c @@ -3,6 +3,7 @@ (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
+ Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -75,3 +76,20 @@ RedfishPlatformHostInterfaceNotification ( {
return EFI_UNSUPPORTED;
}
+
+/**
+ Get USB device serial number.
+
+ @param[out] SerialNumber Pointer to retrieve complete serial number.
+ It is the responsibility of the caller to free the allocated
+ memory for serial number.
+ @retval EFI_SUCCESS Serial number is returned.
+ @retval Others Failed to get the serial number
+**/
+EFI_STATUS
+RedfishPlatformHostInterfaceSerialNumber (
+ OUT CHAR8 **SerialNumber
+ )
+{
+ return EFI_UNSUPPORTED;
+}
diff --git a/RedfishPkg/Library/RedfishPlatformWantedDeviceLibNull/RedfishPlatformWantedDeviceLibNull.c b/RedfishPkg/Library/RedfishPlatformWantedDeviceLibNull/RedfishPlatformWantedDeviceLibNull.c new file mode 100644 index 0000000..11ae060 --- /dev/null +++ b/RedfishPkg/Library/RedfishPlatformWantedDeviceLibNull/RedfishPlatformWantedDeviceLibNull.c @@ -0,0 +1,41 @@ +/** @file
+ NULL instace of RedfishPlatformWantedDeviceLib
+
+ Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+#include <Library/RedfishPlatformWantedDeviceLib.h>
+
+/**
+ This is the function to decide if input controller is the device
+ that platform want to support. By returning EFI_UNSUPPORTED to
+ caller (normally Supported function), caller should ignore this device
+ and do not provide Redfish service on this controller.
+
+ @param[in] ControllerHandle The handle of the controller to test.
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path.
+ This is optional.
+
+ @retval EFI_SUCCESS This is the device supported by platform.
+ @retval EFI_UNSUPPORTED This device is not supported by platform.
+ @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
+
+**/
+EFI_STATUS
+EFIAPI
+IsPlatformWantedDevice (
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
+ )
+{
+ if (ControllerHandle == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ //
+ // Always support Redfish on ControllerHandle.
+ //
+ return EFI_SUCCESS;
+}
diff --git a/RedfishPkg/Library/RedfishPlatformWantedDeviceLibNull/RedfishPlatformWantedDeviceLibNull.inf b/RedfishPkg/Library/RedfishPlatformWantedDeviceLibNull/RedfishPlatformWantedDeviceLibNull.inf new file mode 100644 index 0000000..1cad295 --- /dev/null +++ b/RedfishPkg/Library/RedfishPlatformWantedDeviceLibNull/RedfishPlatformWantedDeviceLibNull.inf @@ -0,0 +1,28 @@ +## @file
+# NULL instance of RedfishPlatformWantedDeviceLib
+#
+# Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+ INF_VERSION = 0x0001000b
+ BASE_NAME = RedfishPlatformWantedDeviceLibNull
+ FILE_GUID = C5AEFFCA-3692-401E-8F82-9FFAA0622E45
+ MODULE_TYPE = DXE_DRIVER
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = RedfishPlatformWantedDeviceLib
+
+#
+# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 RISCV64
+#
+
+[Sources]
+ RedfishPlatformWantedDeviceLibNull.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
+ RedfishPkg/RedfishPkg.dec
diff --git a/RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/src/payload.c b/RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/src/payload.c index 8fb24a5..bb287f2 100644 --- a/RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/src/payload.c +++ b/RedfishPkg/PrivateLibrary/RedfishLib/edk2libredfish/src/payload.c @@ -525,7 +525,7 @@ getOpResult ( }
stringProp = prop->json;
- jsonType = JsonGetType (prop->json);
+ jsonType = (json_type)JsonGetType (prop->json);
switch (jsonType) {
case JSON_OBJECT:
stringProp = json_object_get (prop->json, propName);
diff --git a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerCommon.c b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerCommon.c index bc1ba59..f6c8c3d 100644 --- a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerCommon.c +++ b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerCommon.c @@ -188,11 +188,12 @@ RedfishConfigCommonStop ( &NumberOfHandles,
&HandleBuffer
);
- if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
+ if (Status == EFI_NOT_FOUND) {
+ return EFI_SUCCESS;
+ } else if (EFI_ERROR (Status)) {
return Status;
}
- Status = EFI_SUCCESS;
for (Index = 0; Index < NumberOfHandles; Index++) {
Status = gBS->HandleProtocol (
HandleBuffer[Index],
@@ -208,6 +209,8 @@ RedfishConfigCommonStop ( }
}
+ gBS->FreePool (HandleBuffer);
+
return Status;
}
@@ -272,4 +275,6 @@ RedfishConfigHandlerInitialization ( );
ASSERT_EFI_ERROR (Status);
}
+
+ gBS->FreePool (HandleBuffer);
}
diff --git a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c index 02d5f14..cc929f2 100644 --- a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c +++ b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c @@ -7,12 +7,13 @@ Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
- Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ Copyright (c) 2023 - 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
+#include <Base.h>
#include <Uefi.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
@@ -54,8 +55,12 @@ RedfishCreateSmbiosTable42 ( EFI_SMBIOS_PROTOCOL *Smbios;
EFI_SMBIOS_HANDLE MemArrayMappedAddrSmbiosHandle;
EFI_HANDLE Handle;
+ CHAR8 *SerialNumber;
+ UINTN SerialNumStrLen;
- Handle = NULL;
+ Handle = NULL;
+ SerialNumStrLen = 0;
+ SerialNumber = NULL;
//
// Get platform Redfish host interface device type descriptor data.
//
@@ -82,6 +87,16 @@ RedfishCreateSmbiosTable42 ( DeviceDataLength = DeviceDescriptor->DeviceDescriptor.PciPcieDeviceV2.Length;
} else {
DeviceDataLength = DeviceDescriptor->DeviceDescriptor.UsbDeviceV2.Length;
+ Status = RedfishPlatformHostInterfaceSerialNumber (&SerialNumber);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "%a: Fail to get redfish host interface serial number, %r.", __func__, Status));
+ DeviceDescriptor->DeviceDescriptor.UsbDeviceV2.SerialNumberStr = 0;
+ } else {
+ if (SerialNumber != NULL) {
+ SerialNumStrLen = (UINTN)AsciiStrLen (SerialNumber);
+ DeviceDescriptor->DeviceDescriptor.UsbDeviceV2.SerialNumberStr = 1;
+ }
+ }
}
//
@@ -167,6 +182,7 @@ RedfishCreateSmbiosTable42 ( + DeviceDataLength
+ 1 /// For Protocol Record Count
+ CurrentProtocolsDataLength
+ + SerialNumStrLen
+ 2 /// Double NULL terminator/
);
if (Type42Record == NULL) {
@@ -209,6 +225,13 @@ RedfishCreateSmbiosTable42 ( );
//
+ // Fill in Serial Number string at the end of SMBIOS table 42
+ //
+ if (SerialNumStrLen) {
+ CopyMem (Type42Record->InterfaceTypeSpecificData + DeviceDataLength + 1 + CurrentProtocolsDataLength, SerialNumber, SerialNumStrLen);
+ }
+
+ //
// 5. Add Redfish interface data record to SMBIOS table 42
//
Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID **)&Smbios);
@@ -259,6 +282,10 @@ ON_EXIT: FreePool (Type42Record);
}
+ if (SerialNumber != NULL) {
+ FreePool (SerialNumber);
+ }
+
return Status;
}
diff --git a/RedfishPkg/RedfishHttpDxe/RedfishHttpData.c b/RedfishPkg/RedfishHttpDxe/RedfishHttpData.c index d1d403c..fa8e37f 100644 --- a/RedfishPkg/RedfishHttpDxe/RedfishHttpData.c +++ b/RedfishPkg/RedfishHttpDxe/RedfishHttpData.c @@ -2,6 +2,7 @@ RedfishHttpData handles internal data to support Redfish HTTP protocol.
Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -84,7 +85,7 @@ ReleaseRedfishService ( }
/**
- This function creat new service. Host and HostName are copied to
+ This function create new service. Host and HostName are copied to
newly created service instance.
@param[in] Host Host string.
@@ -189,7 +190,7 @@ ReleaseRedfishPayload ( }
/**
- This function creat new payload. Server and JsonObj are
+ This function create new payload. Server and JsonObj are
copied to newly created payload.
@param[in] Service Pointer to Service instance.
diff --git a/RedfishPkg/RedfishHttpDxe/RedfishHttpData.h b/RedfishPkg/RedfishHttpDxe/RedfishHttpData.h index cb956a4..700c74c 100644 --- a/RedfishPkg/RedfishHttpDxe/RedfishHttpData.h +++ b/RedfishPkg/RedfishHttpDxe/RedfishHttpData.h @@ -2,6 +2,7 @@ Definitions of RedfishHttpData
Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -184,7 +185,7 @@ ReleaseRedfishPayload ( );
/**
- This function creat new payload. Server and JsonObj are
+ This function create new payload. Server and JsonObj are
copied to newly created payload.
@param[in] Service Pointer to Service instance.
@@ -215,7 +216,7 @@ ReleaseRedfishService ( );
/**
- This function creat new service. Host and HostName are copied to
+ This function create new service. Host and HostName are copied to
newly created service instance.
@param[in] Host Host string.
diff --git a/RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c b/RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c index 0a308a7..8ad0123 100644 --- a/RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c +++ b/RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c @@ -3,6 +3,7 @@ for EDK2 Redfish Feature driver to do HTTP operations.
Copyright (c) 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -399,7 +400,7 @@ RedfishCreateRedfishService ( Status = Base64Encode (
(CONST UINT8 *)BasicAuthString,
- BasicAuthStrSize,
+ AsciiStrLen (BasicAuthString),
EncodedAuthString,
&EncodedAuthStrSize
);
@@ -411,7 +412,7 @@ RedfishCreateRedfishService ( Status = Base64Encode (
(CONST UINT8 *)BasicAuthString,
- BasicAuthStrSize,
+ AsciiStrLen (BasicAuthString),
EncodedAuthString,
&EncodedAuthStrSize
);
diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec index f80c679..88f84ad 100644 --- a/RedfishPkg/RedfishPkg.dec +++ b/RedfishPkg/RedfishPkg.dec @@ -4,7 +4,7 @@ # Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
# Copyright (c) 2023, American Megatrends International LLC.
-# Copyright (c) 2023-2024, 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.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -75,6 +75,11 @@ #
RedfishHttpLib|Include/Library/RedfishHttpLib.h
+ ## @libraryclass Provides the library functions for platform to decide
+ # if this is the device platform supported.
+ #
+ RedfishPlatformWantedDeviceLib|Include/Library/RedfishPlatformWantedDeviceLib.h
+
[LibraryClasses.Common.Private]
## @libraryclass Provides the private C runtime library functions.
# CRT library is currently used by edk2 JsonLib (open source
diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc index 789f040..5412cc2 100644 --- a/RedfishPkg/RedfishPkg.dsc +++ b/RedfishPkg/RedfishPkg.dsc @@ -4,7 +4,7 @@ # Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2021 Hewlett-Packard Enterprise Development LP.
# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
-# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -47,6 +47,7 @@ RedfishContentCodingLib|RedfishPkg/Library/RedfishContentCodingLibNull/RedfishContentCodingLibNull.inf
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
+ RedfishPlatformWantedDeviceLib|RedfishPkg/Library/RedfishPlatformWantedDeviceLibNull/RedfishPlatformWantedDeviceLibNull.inf
# NULL instance of IPMI related library.
IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
@@ -67,5 +68,6 @@ RedfishPkg/Library/HiiUtilityLib/HiiUtilityLib.inf
RedfishPkg/Library/RedfishPlatformConfigLib/RedfishPlatformConfigLib.inf
RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
+ RedfishPkg/Library/RedfishPlatformWantedDeviceLibNull/RedfishPlatformWantedDeviceLibNull.inf
!include RedfishPkg/Redfish.dsc.inc
diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c index e601bb6..2626669 100644 --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c @@ -3,7 +3,7 @@ Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
- 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.<BR>
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 f0107a4..2f081cd 100644 --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h @@ -5,6 +5,7 @@ (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>
+ Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -23,6 +24,7 @@ #include <Library/HttpIoLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/NetLib.h>
+#include <Library/RedfishPlatformWantedDeviceLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiDriverEntryPoint.h>
diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf b/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf index 6da416d..f951b41 100644 --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf @@ -4,7 +4,7 @@ # Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
# 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.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -47,6 +47,7 @@ MemoryAllocationLib
NetLib
RedfishDebugLib
+ RedfishPlatformWantedDeviceLib
UefiLib
UefiBootServicesTableLib
UefiDriverEntryPoint
|