-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RedfishClientPkg/RedfishTaskLib: add library to update Redfish task s…
…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
Showing
4 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
38
RedfishClientPkg/Library/RedfishTaskLibNull/RedfishTaskLibNull.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
34
RedfishClientPkg/Library/RedfishTaskLibNull/RedfishTaskLibNull.inf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters