diff --git a/RedfishClientPkg/Include/Library/RedfishTaskLib.h b/RedfishClientPkg/Include/Library/RedfishTaskLib.h new file mode 100644 index 000000000..aad530d78 --- /dev/null +++ b/RedfishClientPkg/Include/Library/RedfishTaskLib.h @@ -0,0 +1,40 @@ +/** @file + This file defines the Redfish task library interface. + + Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef REDFISH_TASK_LIB_H_ +#define REDFISH_TASK_LIB_H_ + +#include +#include +#include + +/** + + This function update task result to BMC task service. There is + no standard way defined in Redfish specification that allows + BIOS to update task state and status. Platform implement + this function to update task result to BMC by following + BMC defined interface. + + @param[in] RedfishService Instance to Redfish service. + @param[in] TaskUri The URI of task to update result. + @param[in] TaskResult The task state and task status to update. + + @retval EFI_SUCCESS Task state and status is updated to BMC. + @retval Others Errors occur. + +**/ +EFI_STATUS +RedfishTaskUpdate ( + IN REDFISH_SERVICE RedfishService, + IN EFI_STRING TaskUri, + IN REDFISH_TASK_RESULT TaskResult + ); + +#endif diff --git a/RedfishClientPkg/Library/RedfishTaskLibNull/RedfishTaskLibNull.c b/RedfishClientPkg/Library/RedfishTaskLibNull/RedfishTaskLibNull.c new file mode 100644 index 000000000..03a2d3017 --- /dev/null +++ b/RedfishClientPkg/Library/RedfishTaskLibNull/RedfishTaskLibNull.c @@ -0,0 +1,38 @@ +/** @file + Redfish task library NULL implementation. + + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include + +/** + + This function update task result to BMC task service. There is + no standard way defined in Redfish specification that allows + BIOS to update task state and status. Platform implement + this function to update task result to BMC by following + BMC defined interface. + + @param[in] RedfishService Instance to Redfish service. + @param[in] TaskUri The URI of task to update result. + @param[in] TaskResult The task state and task status to update. + + @retval EFI_SUCCESS Task state and status is updated to BMC. + @retval Others Errors occur. + +**/ +EFI_STATUS +RedfishTaskUpdate ( + IN REDFISH_SERVICE RedfishService, + IN EFI_STRING TaskUri, + IN REDFISH_TASK_RESULT TaskResult + ) +{ + DEBUG ((DEBUG_WARN, "%a: update task state and status is unsupported\n", __func__)); + return EFI_UNSUPPORTED; +} diff --git a/RedfishClientPkg/Library/RedfishTaskLibNull/RedfishTaskLibNull.inf b/RedfishClientPkg/Library/RedfishTaskLibNull/RedfishTaskLibNull.inf new file mode 100644 index 000000000..124d88f71 --- /dev/null +++ b/RedfishClientPkg/Library/RedfishTaskLibNull/RedfishTaskLibNull.inf @@ -0,0 +1,34 @@ +## @file +# +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x00010006 + BASE_NAME = RedfishTaskLibNull + FILE_GUID = 7A78D9A3-B823-4423-9F02-8ECF42033F4D + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + LIBRARY_CLASS = RedfishTaskLib| DXE_DRIVER UEFI_DRIVER + +# +# VALID_ARCHITECTURES = IA32 X64 EBC +# + +[Sources] + RedfishTaskLibNull.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + RedfishPkg/RedfishPkg.dec + RedfishClientPkg/RedfishClientPkg.dec + +[LibraryClasses] + DebugLib + +[Depex] + TRUE diff --git a/RedfishClientPkg/RedfishClientPkg.dec b/RedfishClientPkg/RedfishClientPkg.dec index a75acb72d..9af798d8b 100644 --- a/RedfishClientPkg/RedfishClientPkg.dec +++ b/RedfishClientPkg/RedfishClientPkg.dec @@ -28,6 +28,7 @@ RedfishEventLib|Include/Library/RedfishEventLib.h RedfishVersionLib|Include/Library/RedfishVersionLib.h RedfishMessageLib|Include/Library/RedfishMessageLib.h + RedfishTaskLib|Include/Library/RedfishTaskLib.h [Protocols] ## Include/Protocol/EdkIIRedfishFeature.h