Skip to content

Commit

Permalink
RedfishClientPkg/RedfishTaskLib: add library to update Redfish task s…
Browse files Browse the repository at this point in the history
…tate

Introduce new library of updating Redfish task state to BMC. The interface
between host and BMC for updating Redfish task state is not defined in
industrial specification. Since this depends on platform BMC
implementation, this library is created for platform owner to handle this
part.

Signed-off-by: Nickle Wang <[email protected]>
  • Loading branch information
nicklela committed Oct 24, 2024
1 parent 8c9e4df commit 8c468ea
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 0 deletions.
40 changes: 40 additions & 0 deletions RedfishClientPkg/Include/Library/RedfishTaskLib.h
Original file line number Diff line number Diff line change
@@ -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 <Uefi.h>
#include <RedfishServiceData.h>
#include <Protocol/EdkIIRedfishTaskProtocol.h>

/**
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
38 changes: 38 additions & 0 deletions RedfishClientPkg/Library/RedfishTaskLibNull/RedfishTaskLibNull.c
Original file line number Diff line number Diff line change
@@ -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 <Library/RedfishTaskLib.h>
#include <Library/DebugLib.h>

/**
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;
}
34 changes: 34 additions & 0 deletions RedfishClientPkg/Library/RedfishTaskLibNull/RedfishTaskLibNull.inf
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions RedfishClientPkg/RedfishClientPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8c468ea

Please sign in to comment.