Re: [edk2-devel] [PATCH] MdePkg: Add PciVenNameLib to get vendor name.
The original intention is using the string data for firmware manufacturer of SMBIOS type 45 record which associated to PCI device. Moving to ShellPkg would limit the usage for other purpose. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116912): https://edk2.groups.io/g/devel/message/116912 Mute This Topic: https://groups.io/mt/104943937/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] MdePkg: Add PciVenNameLib to get vendor name.
-=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116786): https://edk2.groups.io/g/devel/message/116786 Mute This Topic: https://groups.io/mt/104943937/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support.
Zhichao, PR, ShellPkg/SmbiosView: type 45 and type 46 support. by wangsim · Pull Request #4482 · tianocore/edk2 (github.com) ( https://github.com/tianocore/edk2/pull/4482 ) Just finished CI/CD check. Thanks, Simon -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#105915): https://edk2.groups.io/g/devel/message/105915 Mute This Topic: https://groups.io/mt/99398301/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support.
Hi, May I know the plan of code merging? Thanks, Simon -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#105563): https://edk2.groups.io/g/devel/message/105563 Mute This Topic: https://groups.io/mt/98677252/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support.
Hi Ray, Zhichao Could you please help to review this change? Thanks, Simon Could you please help to review this change? Thanks, Simon -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#104818): https://edk2.groups.io/g/devel/message/104818 Mute This Topic: https://groups.io/mt/98677252/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support.
Hi @Ray Ni ( ray.ni@... ) , @Zhichao Gao ( zhichao.gao@... ) , Could you please help to review this change? Thanks, Simon -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#104313): https://edk2.groups.io/g/devel/message/104313 Mute This Topic: https://groups.io/mt/98677252/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support.
The initial version of Smbios Specification 3.6.0 type 45 and type 46 support. Signed-off-by: Simon Wang Cc: Ray Ni Cc: Zhichao Gao --- .../SmbiosView/PrintInfo.c| 111 +- .../SmbiosView/PrintInfo.h| 25 .../SmbiosView/QueryTable.c | 81 + .../SmbiosView/SmbiosViewStrings.uni | 9 +- 4 files changed, 222 insertions(+), 4 deletions(-) diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c index 1811cf0c44..e6a110beee 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c @@ -5,6 +5,7 @@ Copyright (c) 1985 - 2022, American Megatrends International LLC. (C) Copyright 2014 Hewlett-Packard Development Company, L.P. (C) Copyright 2015-2019 Hewlett Packard Enterprise Development LP + Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -305,9 +306,10 @@ SmbiosPrintStructure ( IN UINT8 Option ) { - UINT8 Index; - UINT8 Index2; - UINT8 *Buffer; + UINT8 Index; + UINT8 Index2; + UINT8 *Buffer; + EFI_STRING String; if (Struct == NULL) { return EFI_INVALID_PARAMETER; @@ -1302,6 +1304,109 @@ SmbiosPrintStructure ( break; // +// Firmware Inventory (Type 45) +// +case 45: + PRINT_PENDING_STRING (Struct, Type45, FirmwareComponentName); + PRINT_PENDING_STRING (Struct, Type45, FirmwareVersion); + if (Struct->Type45->FirmwareVersionFormat == VersionFormatTypeFreeForm) { +String = L"Free-form string"; + } else if (Struct->Type45->FirmwareVersionFormat == VersionFormatTypeMajorMinor) { +String = L"MAJOR.MINOR"; + } else if (Struct->Type45->FirmwareVersionFormat == VersionFormatType32BitHex) { +String = L"32-bit hexadecimal string"; + } else if (Struct->Type45->FirmwareVersionFormat == VersionFormatTypeMajorMinor) { +String = L"64-bit hexadecimal string"; + } else if (Struct->Type45->FirmwareVersionFormat >= 0x80) { +String = L"BIOS Vendor/OEM-specific"; + } else { +String = L"Reserved"; + } + + ShellPrintHiiEx ( +-1, +-1, +NULL, +STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FIRMWARE_VERSION_FORMAT), +gShellDebug1HiiHandle, +String +); + PRINT_PENDING_STRING (Struct, Type45, FirmwareId); + if (Struct->Type45->FirmwareIdFormat == FirmwareIdFormatTypeFreeForm) { +String = L"Free-form string"; + } else if (Struct->Type45->FirmwareIdFormat == FirmwareIdFormatTypeUuid) { +String = L"RFC4122 UUID string"; + } else if (Struct->Type45->FirmwareIdFormat >= 0x80) { +String = L"BIOS Vendor/OEM-specific"; + } else { +String = L"Reserved"; + } + + ShellPrintHiiEx ( +-1, +-1, +NULL, +STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FIRMWARE_ID_FORMAT), +gShellDebug1HiiHandle, +String +); + PRINT_PENDING_STRING (Struct, Type45, ReleaseDate); + PRINT_PENDING_STRING (Struct, Type45, Manufacturer); + PRINT_PENDING_STRING (Struct, Type45, LowestSupportedVersion); + if (Struct->Type45->ImageSize != MAX_UINT64) { +PRINT_STRUCT_VALUE_H (Struct, Type45, ImageSize); + } else { +ShellPrintHiiEx ( + -1, + -1, + NULL, + STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_IMAGE_SIZE_UNKNOWN), + gShellDebug1HiiHandle + ); + } + + DisplayFirmwareCharacteristics (ReadUnaligned16 ((UINT16 *)(UINTN)&(Struct->Type45->Characteristics)), Option); + DisplayFirmwareState (*(UINT8 *)(UINTN)&(Struct->Type45->State), Option); + + PRINT_STRUCT_VALUE_H (Struct, Type45, AssociatedComponentCount); + if (Struct->Hdr->Length > sizeof (*Struct->Type45)) { +for (Index = 0; Index < Struct->Type45->AssociatedComponentCount; Index++) { + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FIRMWARE_INVENTORY_ASSOCIATED), gShellDebug1HiiHandle); + Print (L"0x%04X ", Buffer[sizeof (*Struct->Type45) + (Index * sizeof (SMBIOS_HANDLE))]); + Print (L"\n"); +} + } + + break; + +// +// String Property (Type 46) +// +case 46: + if (Struct->Type46->StringPropertyId == StringPropertyIdDevicePath) { +String = L"UEFI device path"; + } else if ((Struct->Type46->StringPropertyId >= StringPropertyIdBiosVendor) && + (Struct->Type46->StringPropertyId < StringPropertyIdOem)) + { +String = L"BIOS vendor defined"; + } else if (Struct->Type46->StringPropertyId >= StringPropertyIdOem) { +String = L"OEM
[edk2-devel] [edk2-staging][PATCH] edk2-staging/RedfishClientPkg: Reduce the header file dependency.
Move REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG and REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST from RedfishFeatureUtilityLib.h to EdkIIRedfishInterchangeData.h. Also, remove unnecessary jansson.h in RedfishDataTypeDef.h. Signed-off-by: Simon Wang Cc: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Nick Ramirez --- .../ConverterLib/include/RedfishDataTypeDef.h | 40 +-- .../Library/RedfishFeatureUtilityLib.h| 17 +--- .../Protocol/EdkIIRedfishInterchangeData.h| 33 ++- 3 files changed, 45 insertions(+), 45 deletions(-) diff --git a/RedfishClientPkg/ConverterLib/include/RedfishDataTypeDef.h b/RedfishClientPkg/ConverterLib/include/RedfishDataTypeDef.h index 23d13a854c..c759428ab6 100644 --- a/RedfishClientPkg/ConverterLib/include/RedfishDataTypeDef.h +++ b/RedfishClientPkg/ConverterLib/include/RedfishDataTypeDef.h @@ -1,6 +1,7 @@ /** @file (C) Copyright 2018-2021 Hewlett Packard Enterprise Development LP + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -8,29 +9,28 @@ Copyright 2019-2021 Distributed Management Task Force, Inc. All rights reserved. License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/Redfish-JSON-C-Struct-Converter/blob/master/LICENSE.md **/ + #ifndef REDFISH_CS_DATA_TYPE_H_ #define REDFISH_CS_DATA_TYPE_H_ -#include - -typedef char RedfishCS_char; -typedef intRedfishCS_bool; -typedef signed charRedfishCS_int8; -typedef unsigned char RedfishCS_uint8; -typedef intRedfishCS_int16; -typedef intRedfishCS_int; -typedef unsigned int RedfishCS_uint16; -typedef long int RedfishCS_int32; -typedef unsigned long int RedfishCS_uint32; -typedef long long RedfishCS_int64; -typedef unsigned long long RedfishCS_uint64; -typedef void RedfishCS_void; - -#define RedfishCS_boolean_false 0 -#define RedfishCS_boolean_true 1 +typedef charRedfishCS_char; +typedef int RedfishCS_bool; +typedef signed char RedfishCS_int8; +typedef unsigned char RedfishCS_uint8; +typedef int RedfishCS_int16; +typedef int RedfishCS_int; +typedef unsigned intRedfishCS_uint16; +typedef long intRedfishCS_int32; +typedef unsigned long int RedfishCS_uint32; +typedef long long RedfishCS_int64; +typedef unsigned long long RedfishCS_uint64; +typedef voidRedfishCS_void; + +#define RedfishCS_boolean_false 0 +#define RedfishCS_boolean_true 1 typedef RedfishCS_int64 RedfishCS_status; -#define RedfishCS_status_success 0 +#define RedfishCS_status_success 0 #define RedfishCS_status_unsupported -1 #define RedfishCS_status_invalid_parameter-2 #define RedfishCS_status_insufficient_memory -3 @@ -39,8 +39,8 @@ typedef RedfishCS_int64 RedfishCS_status; typedef struct _RedfishCS_Link RedfishCS_Link; struct _RedfishCS_Link { - RedfishCS_Link *BackLink; - RedfishCS_Link *ForwardLink; + RedfishCS_Link*BackLink; + RedfishCS_Link*ForwardLink; }; #endif diff --git a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h index 1429643272..e2f728b26a 100644 --- a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h +++ b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h @@ -13,26 +13,11 @@ #include #include +#include #include #define REDFISH_ENABLE_SYSTEM_REBOOT() PcdSetBoolS(PcdRedfishSystemRebootRequired, TRUE) -// -// Definition of REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG -// -typedef struct { - UINTN Index; - EFI_STRINGConfigureLang; -} REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG; - -// -// Definition of REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST -// -typedef struct { - UINTN Count; - REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG*List; -} REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST; - /** Read redfish resource by given resource URI. diff --git a/RedfishClientPkg/Include/Protocol/EdkIIRedfishInterchangeData.h b/RedfishClientPkg/Include/Protocol/EdkIIRedfishInterchangeData.h index e8d0462fb7..89708eb8f1 100644 --- a/RedfishClientPkg/Include/Protocol/EdkIIRedfishInterchangeData.h +++ b/RedfishClientPkg/Include/Protocol/EdkIIRedfishInterchangeData.h @@ -2,6 +2,7 @@ This file defines the EDKII_REDFISH_FEATURE_INTERCHANGE_DATA_PROTOCOL interface. (C) Copyright 2022 Hewlett Packard Enterprise Development LP + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -10,7 +11,21 @@ #ifndef EDKII_REDFISH_FEATURE_INTERCHANGE_DATA_H_ #define EDKII_REDFISH_FEATURE_INTERCHANGE_DATA_H_ -#include +// +// Definition of REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG
[edk2-devel] [PATCH v2 RESEND] edk2-staging/RedfishClientPkg: Add Redfish.Settings support
From: "Simon Wang" BIOS feature driver cannot recognize "@Redfish.Settings", decode it and get pending setting URI. So BIOS feature driver can consume pending setting from correct place. Signed-off-by: Simon Wang Cc: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Nick Ramirez --- RedfishClientPkg/Include/RedfishResourceCommon.h| 3 + RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 216 RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c | 3 +- RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c | 3 +- 4 files changed, 136 insertions(+), 89 deletions(-) diff --git a/RedfishClientPkg/Include/RedfishResourceCommon.h b/RedfishClientPkg/Include/RedfishResourceCommon.h index af4b8091215f..9c001206cbf0 100644 --- a/RedfishClientPkg/Include/RedfishResourceCommon.h +++ b/RedfishClientPkg/Include/RedfishResourceCommon.h @@ -2,6 +2,7 @@ Redfish feature driver common header file. (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP + Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -58,6 +59,8 @@ typedef struct _REDFISH_RESOURCE_COMMON_PRIVATE { EFI_STRING RedfishVersion; } REDFISH_RESOURCE_COMMON_PRIVATE; +extern REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResourcePrivate; + #define REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_CONFIG_PROTOCOL(This) \ BASE_CR ((This), REDFISH_RESOURCE_COMMON_PRIVATE, ConfigHandler) diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c index a478061cdeb6..909c7c0c09bb 100644 --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c @@ -2,6 +2,7 @@ Redfish feature driver implementation - Bios (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP + Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -9,15 +10,13 @@ #include "../Common/BiosCommon.h" -extern REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResourcePrivate; - EFI_STATUS HandleResource ( - IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, - IN EFI_STRING Uri + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, + IN EFI_STRING Uri ); -EFI_HANDLE medfishResourceConfigProtocolHandle; +EFI_HANDLE medfishResourceConfigProtocolHandle; /** Provising redfish resource by given URI. @@ -33,16 +32,16 @@ EFI_HANDLE medfishResourceConfigProtocolHandle; **/ EFI_STATUS RedfishResourceProvisioningResource ( - IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL*This, - IN EFI_STRINGUri, - IN BOOLEAN PostMode + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, + IN EFI_STRING Uri, + IN BOOLEAN PostMode ) { - REDFISH_RESOURCE_COMMON_PRIVATE *Private; - EFI_STATUS Status; - REDFISH_RESPONSEResponse; + REDFISH_RESOURCE_COMMON_PRIVATE *Private; + EFI_STATUS Status; + REDFISH_RESPONSE Response; - if (This == NULL || IS_EMPTY_STRING (Uri)) { + if ((This == NULL) || IS_EMPTY_STRING (Uri)) { return EFI_INVALID_PARAMETER; } @@ -60,7 +59,7 @@ RedfishResourceProvisioningResource ( return Status; } - Private->Uri = Uri; + Private->Uri = Uri; Private->Payload = Response.Payload; ASSERT (Private->Payload != NULL); @@ -94,16 +93,22 @@ RedfishResourceProvisioningResource ( **/ EFI_STATUS RedfishResourceConsumeResource ( - IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL*This, - IN EFI_STRINGUri + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, + IN EFI_STRING Uri ) { - REDFISH_RESOURCE_COMMON_PRIVATE *Private; - EFI_STATUSStatus; - REDFISH_RESPONSE Response; - CHAR8 *Etag; + REDFISH_RESOURCE_COMMON_PRIVATE *Private; + EFI_STATUS Status; + REDFISH_RESPONSE Response; + REDFISH_RESPONSE *ExpectedResponse; + REDFISH_RESPONSE RedfishSettingsResponse; + CHAR8*Etag; + UINTNIndex; + EDKII_JSON_VALUE JsonValue; + EFI_STRING RedfishSettingsUri; + CONST CHAR8 *RedfishSettingsUriKeys[] = { "@Redfish.Settings", "SettingsObject", "@odata.id" }; - if (This == NULL || IS_EMPTY_STRING (Uri)) { + if ((This == NULL) || IS_EMPTY_STRING (Uri)) { return EFI_INVALID_PARAMETER; } @@ -119,8 +124,38 @@ RedfishResourceConsumeResource (
[edk2-devel] [PATCH v2] edk2-staging/RedfishClientPkg: Add Redfish.Settings support
From: "Simon Wang" BIOS feature driver cannot recognize "@Redfish.Settings", decode it and get pending setting URI. So BIOS feature driver can consume pending setting from correct place. Signed-off-by: Simon Wang Cc: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Nick Ramirez --- .../Features/Bios/v1_0_9/Dxe/BiosDxe.c| 216 +++--- .../v1_5_0/Dxe/ComputerSystemDxe.c| 3 +- .../Features/Memory/V1_7_1/Dxe/MemoryDxe.c| 3 +- .../Include/RedfishResourceCommon.h | 3 + 4 files changed, 137 insertions(+), 88 deletions(-) diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c index a478061cdeb6..c436c323c590 100644 --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c @@ -2,6 +2,7 @@ Redfish feature driver implementation - Bios (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP + Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -9,15 +10,15 @@ #include "../Common/BiosCommon.h" -extern REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResourcePrivate; + EFI_STATUS HandleResource ( - IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, - IN EFI_STRING Uri + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, + IN EFI_STRING Uri ); -EFI_HANDLE medfishResourceConfigProtocolHandle; +EFI_HANDLE medfishResourceConfigProtocolHandle; /** Provising redfish resource by given URI. @@ -33,16 +34,16 @@ EFI_HANDLE medfishResourceConfigProtocolHandle; **/ EFI_STATUS RedfishResourceProvisioningResource ( - IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL*This, - IN EFI_STRINGUri, - IN BOOLEAN PostMode + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, + IN EFI_STRING Uri, + IN BOOLEAN PostMode ) { - REDFISH_RESOURCE_COMMON_PRIVATE *Private; - EFI_STATUS Status; - REDFISH_RESPONSEResponse; + REDFISH_RESOURCE_COMMON_PRIVATE *Private; + EFI_STATUS Status; + REDFISH_RESPONSE Response; - if (This == NULL || IS_EMPTY_STRING (Uri)) { + if ((This == NULL) || IS_EMPTY_STRING (Uri)) { return EFI_INVALID_PARAMETER; } @@ -60,7 +61,7 @@ RedfishResourceProvisioningResource ( return Status; } - Private->Uri = Uri; + Private->Uri = Uri; Private->Payload = Response.Payload; ASSERT (Private->Payload != NULL); @@ -94,16 +95,22 @@ RedfishResourceProvisioningResource ( **/ EFI_STATUS RedfishResourceConsumeResource ( - IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL*This, - IN EFI_STRINGUri + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, + IN EFI_STRING Uri ) { - REDFISH_RESOURCE_COMMON_PRIVATE *Private; - EFI_STATUSStatus; - REDFISH_RESPONSE Response; - CHAR8 *Etag; + REDFISH_RESOURCE_COMMON_PRIVATE *Private; + EFI_STATUS Status; + REDFISH_RESPONSE Response; + REDFISH_RESPONSE *ExpectedResponse; + REDFISH_RESPONSE RedfishSettingsResponse; + CHAR8*Etag; + UINTNIndex; + EDKII_JSON_VALUE JsonValue; + EFI_STRING RedfishSettingsUri; + CONST CHAR8 *RedfishSettingsUriKeys[] = { "@Redfish.Settings", "SettingsObject", "@odata.id" }; - if (This == NULL || IS_EMPTY_STRING (Uri)) { + if ((This == NULL) || IS_EMPTY_STRING (Uri)) { return EFI_INVALID_PARAMETER; } @@ -119,8 +126,38 @@ RedfishResourceConsumeResource ( return Status; } - Private->Uri = Uri; - Private->Payload = Response.Payload; + ExpectedResponse = + RedfishSettingsUri = NULL; + JsonValue = RedfishJsonInPayload (Response.Payload); + + // + // Seeking RedfishSettings URI link. + // + for (Index = 0; Index < ARRAY_SIZE (RedfishSettingsUriKeys); Index++) { +if (JsonValue == NULL) { + break; +} + +JsonValue = JsonObjectGetValue (JsonValueGetObject (JsonValue), RedfishSettingsUriKeys[Index]); + } + + if (JsonValue != NULL) { +// +// Verify RedfishSettings URI link is valid to retrieve resource or not. +// +RedfishSettingsUri = JsonValueGetUnicodeString (JsonValue); + +Status = GetResourceByUri (Private->RedfishService, RedfishSettingsUri, ); +if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a, @Redfish.Settings exists, get