Add two new iterfaces to Redfish Platform Config Library in order to support GetAttribute() and GetDefaultValue() interfaces.
Signed-off-by: Nickle Wang <nick...@nvidia.com> Cc: Abner Chang <abner.ch...@amd.com> Cc: Igor Kulchytskyy <ig...@ami.com> Cc: Nick Ramirez <nrami...@nvidia.com> --- .../Library/RedfishPlatformConfigLib.h | 44 ++++++++++++ .../RedfishPlatformConfigLib.c | 71 +++++++++++++++++++ 2 files changed, 115 insertions(+) diff --git a/RedfishPkg/Include/Library/RedfishPlatformConfigLib.h b/RedfishPkg/Include/Library/RedfishPlatformConfigLib.h index ebe2329fd9..8014799aea 100644 --- a/RedfishPkg/Include/Library/RedfishPlatformConfigLib.h +++ b/RedfishPkg/Include/Library/RedfishPlatformConfigLib.h @@ -2,6 +2,7 @@ Definitinos of RedfishPlatformConfigLib (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR> + Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -98,4 +99,47 @@ RedfishPlatformConfigGetSupportedSchema ( OUT CHAR8 **SupportedSchema ); +/** + Get Redfish attribute value with the given Schema and Configure Language. + + @param[in] Schema The Redfish schema to query. + @param[in] Version The Redfish version to query. + @param[in] ConfigureLang The target value which match this configure Language. + @param[out] AttributeValue The attribute value. + + @retval EFI_SUCCESS Value is returned successfully. + @retval Others Some error happened. + +**/ +EFI_STATUS +RedfishPlatformConfigGetAttribute ( + IN CHAR8 *Schema, + IN CHAR8 *Version, + IN EFI_STRING ConfigureLang, + OUT EDKII_REDFISH_ATTRIBUTE *AttributeValue + ); + +/** + Get Redfish default value with the given Schema and Configure Language. + + @param[in] Schema The Redfish schema to query. + @param[in] Version The Redfish version to query. + @param[in] ConfigureLang The target value which match this configure Language. + @param[in] DefaultClass The UEFI defined default class. + Please refer to UEFI spec. 33.2.5.8 "defaults" for details. + @param[out] Value The returned value. + + @retval EFI_SUCCESS Value is returned successfully. + @retval Others Some error happened. + +**/ +EFI_STATUS +RedfishPlatformConfigGetDefaultValue ( + IN CHAR8 *Schema, + IN CHAR8 *Version, + IN EFI_STRING ConfigureLang, + IN UINT16 DefaultClass, + OUT EDKII_REDFISH_VALUE *Value + ); + #endif diff --git a/RedfishPkg/Library/RedfishPlatformConfigLib/RedfishPlatformConfigLib.c b/RedfishPkg/Library/RedfishPlatformConfigLib/RedfishPlatformConfigLib.c index eb2c64b0e6..5cfc240766 100644 --- a/RedfishPkg/Library/RedfishPlatformConfigLib/RedfishPlatformConfigLib.c +++ b/RedfishPkg/Library/RedfishPlatformConfigLib/RedfishPlatformConfigLib.c @@ -2,6 +2,7 @@ Wrapper function to support Redfish Platform Config protocol. (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR> + Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -46,6 +47,76 @@ RedfishPlatformConfigGetValue ( ); } +/** + Get Redfish attribute value with the given Schema and Configure Language. + + @param[in] Schema The Redfish schema to query. + @param[in] Version The Redfish version to query. + @param[in] ConfigureLang The target value which match this configure Language. + @param[out] AttributeValue The attribute value. + + @retval EFI_SUCCESS Value is returned successfully. + @retval Others Some error happened. + +**/ +EFI_STATUS +RedfishPlatformConfigGetAttribute ( + IN CHAR8 *Schema, + IN CHAR8 *Version, + IN EFI_STRING ConfigureLang, + OUT EDKII_REDFISH_ATTRIBUTE *AttributeValue + ) +{ + if (mRedfishPlatformConfigLibPrivate.Protocol == NULL) { + return EFI_NOT_READY; + } + + return mRedfishPlatformConfigLibPrivate.Protocol->GetAttribute ( + mRedfishPlatformConfigLibPrivate.Protocol, + Schema, + Version, + ConfigureLang, + AttributeValue + ); +} + +/** + Get Redfish default value with the given Schema and Configure Language. + + @param[in] Schema The Redfish schema to query. + @param[in] Version The Redfish version to query. + @param[in] ConfigureLang The target value which match this configure Language. + @param[in] DefaultClass The UEFI defined default class. + Please refer to UEFI spec. 33.2.5.8 "defaults" for details. + @param[out] Value The returned value. + + @retval EFI_SUCCESS Value is returned successfully. + @retval Others Some error happened. + +**/ +EFI_STATUS +RedfishPlatformConfigGetDefaultValue ( + IN CHAR8 *Schema, + IN CHAR8 *Version, + IN EFI_STRING ConfigureLang, + IN UINT16 DefaultClass, + OUT EDKII_REDFISH_VALUE *Value + ) +{ + if (mRedfishPlatformConfigLibPrivate.Protocol == NULL) { + return EFI_NOT_READY; + } + + return mRedfishPlatformConfigLibPrivate.Protocol->GetDefaultValue ( + mRedfishPlatformConfigLibPrivate.Protocol, + Schema, + Version, + ConfigureLang, + DefaultClass, + Value + ); +} + /** Set Redfish value with the given Schema and Configure Language. -- 2.38.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#97081): https://edk2.groups.io/g/devel/message/97081 Mute This Topic: https://groups.io/mt/95515763/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-