From f57ebb80644056eef33508ff09ea1945ef1321c4 Mon Sep 17 00:00:00 2001 From: Nickle Wang Date: Thu, 12 Oct 2023 20:46:21 +0800 Subject: [PATCH] RedfishClientPkg/Features: use RedfishProtocolFeaturesLib - Use RedfishProtocolFeaturesLib in collection feature driver to get resource all together. - Use Redfish Resource Config2 Protocol in non-collection feature driver to receive the resource from collection feature driver. Signed-off-by: Nickle Wang Reviewed-by: Simon Wang (SW-GPU) Reviewed-by: Nick Ramirez --- .../v1_0_1/Common/SecureBootDatabaseCommon.c | 15 +-- .../v1_0_1/Dxe/SecureBootDatabaseDxe.c | 102 +++++++++++------- .../v1_0_1/Dxe/SecureBootDatabaseDxe.inf | 2 +- .../SecureBootDatabaseCollectionDxe.c | 53 +++++++-- .../SecureBootDatabaseCollectionDxe.inf | 1 + .../Include/RedfishCollectionCommon.h | 1 + .../Include/RedfishResourceCommon.h | 27 +++-- 7 files changed, 129 insertions(+), 72 deletions(-) diff --git a/RedfishClientPkg/Features/SecureBootDatabase/v1_0_1/Common/SecureBootDatabaseCommon.c b/RedfishClientPkg/Features/SecureBootDatabase/v1_0_1/Common/SecureBootDatabaseCommon.c index c36c397d4d..c3f9969374 100644 --- a/RedfishClientPkg/Features/SecureBootDatabase/v1_0_1/Common/SecureBootDatabaseCommon.c +++ b/RedfishClientPkg/Features/SecureBootDatabase/v1_0_1/Common/SecureBootDatabaseCommon.c @@ -10,9 +10,9 @@ #include "SecureBootDatabaseCommon.h" -REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResourcePrivate = NULL; -EFI_HANDLE mRedfishResourceConfigProtocolHandle = NULL; -EDKII_REDFISH_TASK_PROTOCOL *mRedfishTaskProtocol = NULL; +REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResourcePrivate = NULL; +EFI_HANDLE mRedfishResourceConfig2ProtocolHandle = NULL; +EDKII_REDFISH_TASK_PROTOCOL *mRedfishTaskProtocol = NULL; /** This function return the "Members@odata.count" in given collection URI. @@ -693,11 +693,6 @@ RedfishProvisioningResourceCommon ( return EFI_INVALID_PARAMETER; } - Private->Json = JsonDumpString (RedfishJsonInPayload (Private->Payload), EDKII_JSON_COMPACT); - if (IS_EMPTY_STRING (Private->Json)) { - return EFI_OUT_OF_RESOURCES; - } - RedfishSecureBootKey = NULL; SecureBootKeyName = NULL; SecureBootDatabase = NULL; @@ -773,10 +768,6 @@ RedfishProvisioningResourceCommon ( ); } - if (Private->Json != NULL) { - FreePool (Private->Json); - } - if (SecureBootKeyName != NULL) { FreePool (SecureBootKeyName); } diff --git a/RedfishClientPkg/Features/SecureBootDatabase/v1_0_1/Dxe/SecureBootDatabaseDxe.c b/RedfishClientPkg/Features/SecureBootDatabase/v1_0_1/Dxe/SecureBootDatabaseDxe.c index 36f04bf761..4ad9bdc510 100644 --- a/RedfishClientPkg/Features/SecureBootDatabase/v1_0_1/Dxe/SecureBootDatabaseDxe.c +++ b/RedfishClientPkg/Features/SecureBootDatabase/v1_0_1/Dxe/SecureBootDatabaseDxe.c @@ -11,16 +11,18 @@ #include "../Common/SecureBootDatabaseCommon.h" extern REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResourcePrivate; -extern EFI_HANDLE mRedfishResourceConfigProtocolHandle; +extern EFI_HANDLE mRedfishResourceConfig2ProtocolHandle; extern EDKII_REDFISH_TASK_PROTOCOL *mRedfishTaskProtocol; /** Provision redfish resource by given URI. - @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCOL instance. + @param[in] This Pointer to EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance. @param[in] Uri Target URI to create resource. - @param[in] PostMode TRUE if the resource does not exist, post method is used. - FALSE if the resource exist but property is missing, put method is used. + @param[in] JsonText The JSON data in ASCII string format. This is optional. + @param[in] HttpPostMode TRUE if resource does not exist, HTTP POST method is used. + FALSE if the resource exist but some of properties are missing, + HTTP PUT method is used. @retval EFI_SUCCESS Value is returned successfully. @retval Others Some error happened. @@ -28,9 +30,10 @@ extern EDKII_REDFISH_TASK_PROTOCOL *mRedfishTaskProtocol; **/ EFI_STATUS RedfishResourceProvisioningResource ( - IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, - IN EFI_STRING Uri, - IN BOOLEAN PostMode + IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL *This, + IN EFI_STRING Uri, + IN CHAR8 *JsonText OPTIONAL, + IN BOOLEAN HttpPostMode ) { REDFISH_RESOURCE_COMMON_PRIVATE *Private; @@ -42,23 +45,34 @@ RedfishResourceProvisioningResource ( } ZeroMem (&Response, sizeof (Response)); - Private = REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_RESOURCE_PROTOCOL (This); + Private = REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_RESOURCE2_PROTOCOL (This); if (Private->RedfishService == NULL) { return EFI_NOT_READY; } - Status = RedfishHttpGetResource (Private->RedfishService, Uri, &Response, TRUE); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a: get resource from: %s failed\n", __func__, Uri)); - return Status; + Private->Uri = Uri; + if (IS_EMPTY_STRING (JsonText)) { + Status = RedfishHttpGetResource (Private->RedfishService, Uri, &Response, TRUE); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: get resource from: %s failed\n", __func__, Uri)); + return Status; + } + + Private->Payload = Response.Payload; + if (Private->Payload != NULL) { + Private->Json = JsonDumpString (RedfishJsonInPayload (Private->Payload), EDKII_JSON_COMPACT); + } + } else { + Private->Payload = NULL; + Private->Json = AllocateCopyPool (AsciiStrSize (JsonText), JsonText); } - Private->Uri = Uri; - Private->Payload = Response.Payload; - ASSERT (Private->Payload != NULL); + if (IS_EMPTY_STRING (Private->Json)) { + return EFI_OUT_OF_RESOURCES; + } - Status = RedfishProvisioningResourceCommon (Private, !PostMode); + Status = RedfishProvisioningResourceCommon (Private, !HttpPostMode); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a: failed to provision resource to: %s: %r\n", __func__, Uri, Status)); } @@ -71,6 +85,11 @@ RedfishResourceProvisioningResource ( Private->Payload = NULL; } + if (Private->Json != NULL) { + FreePool (Private->Json); + Private->Json = NULL; + } + return Status; } @@ -89,8 +108,8 @@ RedfishResourceProvisioningResource ( **/ EFI_STATUS RedfishResourceGetInfo ( - IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, - OUT REDFISH_SCHEMA_INFO *Info + IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL *This, + OUT REDFISH_SCHEMA_INFO *Info ) { if ((This == NULL) || (Info == NULL)) { @@ -108,8 +127,9 @@ RedfishResourceGetInfo ( /** Consume resource from given URI. - @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCOL instance. + @param[in] This Pointer to EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance. @param[in] Uri The target URI to consume. + @param[in] JsonText The JSON data in ASCII string format. This is optional. @retval EFI_SUCCESS Value is returned successfully. @retval Others Some error happened. @@ -117,8 +137,9 @@ RedfishResourceGetInfo ( **/ EFI_STATUS RedfishResourceConsumeResource ( - IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, - IN EFI_STRING Uri + IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL *This, + IN EFI_STRING Uri, + IN CHAR8 *JsonText OPTIONAL ) { return EFI_UNSUPPORTED; @@ -127,8 +148,9 @@ RedfishResourceConsumeResource ( /** Update resource to given URI. - @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCOL instance. + @param[in] This Pointer to EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance. @param[in] Uri The target URI to consume. + @param[in] JsonText The JSON data in ASCII string format. This is optional. @retval EFI_SUCCESS Value is returned successfully. @retval Others Some error happened. @@ -136,8 +158,9 @@ RedfishResourceConsumeResource ( **/ EFI_STATUS RedfishResourceUpdate ( - IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, - IN EFI_STRING Uri + IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL *This, + IN EFI_STRING Uri, + IN CHAR8 *JsonText OPTIONAL ) { return EFI_UNSUPPORTED; @@ -146,8 +169,9 @@ RedfishResourceUpdate ( /** Check resource on given URI. - @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCOL instance. + @param[in] This Pointer to EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance. @param[in] Uri The target URI to consume. + @param[in] JsonText The JSON data in ASCII string format. This is optional. @retval EFI_SUCCESS Value is returned successfully. @retval Others Some error happened. @@ -155,8 +179,9 @@ RedfishResourceUpdate ( **/ EFI_STATUS RedfishResourceCheck ( - IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, - IN EFI_STRING Uri + IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL *This, + IN EFI_STRING Uri, + IN CHAR8 *JsonText OPTIONAL ) { return EFI_UNSUPPORTED; @@ -165,8 +190,9 @@ RedfishResourceCheck ( /** Identify resource on given URI. - @param[in] This Pointer to EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL instance. + @param[in] This Pointer to EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance. @param[in] Uri The target URI to consume. + @param[in] JsonText The JSON data in ASCII string format. This is optional. @retval EFI_SUCCESS This is target resource which we want to handle. @retval EFI_UNSUPPORTED This is not the target resource. @@ -175,14 +201,16 @@ RedfishResourceCheck ( **/ EFI_STATUS RedfishResourceIdentify ( - IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, - IN EFI_STRING Uri + IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL *This, + IN EFI_STRING Uri, + IN CHAR8 *JsonText OPTIONAL ) { return EFI_SUCCESS; } -EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL mRedfishResourceConfig = { +EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL mRedfishResourceConfig2 = { + EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_REVISION, RedfishResourceProvisioningResource, RedfishResourceConsumeResource, RedfishResourceUpdate, @@ -402,8 +430,8 @@ RedfishResourceUnload ( ImageHandle, &gEdkIIRedfishConfigHandlerProtocolGuid, ConfigHandler, - &gEdkIIRedfishResourceConfigProtocolGuid, - &mRedfishResourcePrivate->RedfishResourceConfig, + &gEdkIIRedfishResourceConfig2ProtocolGuid, + &mRedfishResourcePrivate->RedfishResourceConfig2, NULL ); @@ -439,7 +467,7 @@ RedfishResourceEntryPoint ( return EFI_ALREADY_STARTED; } - mRedfishResourceConfigProtocolHandle = ImageHandle; + mRedfishResourceConfig2ProtocolHandle = ImageHandle; mRedfishResourcePrivate = AllocateZeroPool (sizeof (REDFISH_RESOURCE_COMMON_PRIVATE)); if (mRedfishResourcePrivate == NULL) { @@ -447,7 +475,7 @@ RedfishResourceEntryPoint ( } CopyMem (&mRedfishResourcePrivate->ConfigHandler, &mRedfishConfigHandler, sizeof (EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL)); - CopyMem (&mRedfishResourcePrivate->RedfishResourceConfig, &mRedfishResourceConfig, sizeof (EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL)); + CopyMem (&mRedfishResourcePrivate->RedfishResourceConfig2, &mRedfishResourceConfig2, sizeof (EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL)); // // Publish config handler protocol and resource protocol. @@ -456,8 +484,8 @@ RedfishResourceEntryPoint ( &ImageHandle, &gEdkIIRedfishConfigHandlerProtocolGuid, &mRedfishResourcePrivate->ConfigHandler, - &gEdkIIRedfishResourceConfigProtocolGuid, - &mRedfishResourcePrivate->RedfishResourceConfig, + &gEdkIIRedfishResourceConfig2ProtocolGuid, + &mRedfishResourcePrivate->RedfishResourceConfig2, NULL ); if (EFI_ERROR (Status)) { diff --git a/RedfishClientPkg/Features/SecureBootDatabase/v1_0_1/Dxe/SecureBootDatabaseDxe.inf b/RedfishClientPkg/Features/SecureBootDatabase/v1_0_1/Dxe/SecureBootDatabaseDxe.inf index ea04ef8c5c..dfa373e99c 100644 --- a/RedfishClientPkg/Features/SecureBootDatabase/v1_0_1/Dxe/SecureBootDatabaseDxe.inf +++ b/RedfishClientPkg/Features/SecureBootDatabase/v1_0_1/Dxe/SecureBootDatabaseDxe.inf @@ -44,7 +44,7 @@ [Protocols] gEdkIIRedfishConfigHandlerProtocolGuid ## PRODUCED gEfiRestJsonStructureProtocolGuid ## CONSUMED - gEdkIIRedfishResourceConfigProtocolGuid ## PRODUCED + gEdkIIRedfishResourceConfig2ProtocolGuid ## PRODUCED gEdkIIRedfishTaskProtocolGuid ## CONSUMED [Pcd] diff --git a/RedfishClientPkg/Features/SecureBootDatabaseCollectionDxe/SecureBootDatabaseCollectionDxe.c b/RedfishClientPkg/Features/SecureBootDatabaseCollectionDxe/SecureBootDatabaseCollectionDxe.c index 909f38c829..7416821875 100644 --- a/RedfishClientPkg/Features/SecureBootDatabaseCollectionDxe/SecureBootDatabaseCollectionDxe.c +++ b/RedfishClientPkg/Features/SecureBootDatabaseCollectionDxe/SecureBootDatabaseCollectionDxe.c @@ -18,6 +18,7 @@ REDFISH_COLLECTION_PRIVATE *mRedfishCollectionPrivate = NULL; @param[in] Private Pointer to private instance @param[in] Uri The secure boot database URI. + @param[in] JsonText Json text data. @retval EFI_SUCCESS Secure boot database resource is processed. @retval Others Some errors happened. @@ -26,7 +27,8 @@ REDFISH_COLLECTION_PRIVATE *mRedfishCollectionPrivate = NULL; EFI_STATUS HandleResource ( IN REDFISH_COLLECTION_PRIVATE *Private, - IN EFI_STRING Uri + IN EFI_STRING Uri, + IN CHAR8 *JsonText OPTIONAL ) { EFI_STATUS Status; @@ -38,7 +40,7 @@ HandleResource ( DEBUG ((REDFISH_DEBUG_TRACE, "%a: process resource for: %s\n", __func__, Uri)); - Status = GetRedfishSchemaInfo (Private->RedfishService, Private->JsonStructProtocol, Uri, &SchemaInfo); + Status = GetRedfishSchemaInfo (Private->RedfishService, Private->JsonStructProtocol, Uri, JsonText, &SchemaInfo); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a: failed to get schema information from: %s %r\n", __func__, Uri, Status)); return Status; @@ -48,7 +50,7 @@ HandleResource ( // The target property does not exist, do the provision to create property. // DEBUG ((REDFISH_DEBUG_TRACE, "%a provision for %s\n", __func__, Uri)); - Status = EdkIIRedfishResourceConfigProvisioning (&SchemaInfo, Uri, NULL, Private->InformationExchange, FALSE); + Status = EdkIIRedfishResourceConfigProvisioning (&SchemaInfo, Uri, JsonText, Private->InformationExchange, FALSE); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a: failed to provision with GET mode: %r\n", __func__, Status)); } @@ -77,7 +79,10 @@ HandleCollectionResource ( RedfishCS_Link *List; RedfishCS_Header *Header; RedfishCS_Type_Uri_Data *UriData; + RedfishCS_Type_JSON_Data *JsonData; EFI_STRING MemberUri; + EDKII_JSON_VALUE JsonValue; + EDKII_JSON_VALUE OdataId; if (Private == NULL) { return EFI_INVALID_PARAMETER; @@ -115,22 +120,38 @@ HandleCollectionResource ( List = GetFirstLink (&CollectionCs->Members); while (TRUE) { - Header = (RedfishCS_Header *)List; + Header = (RedfishCS_Header *)List; + MemberUri = NULL; + JsonData = NULL; + UriData = NULL; if (Header->ResourceType == RedfishCS_Type_Uri) { UriData = (RedfishCS_Type_Uri_Data *)Header; - MemberUri = NULL; MemberUri = StrAsciiToUnicode (UriData->Uri); ASSERT (MemberUri != NULL); - if (MemberUri != NULL) { - Status = HandleResource (Private, MemberUri); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a: process resource: %a failed: %r\n", __func__, UriData->Uri, Status)); + } else if (Header->ResourceType == RedfishCS_Type_JSON) { + JsonData = (RedfishCS_Type_JSON_Data *)Header; + JsonValue = JsonLoadString (JsonData->JsonText, 0, NULL); + if (JsonValueIsObject (JsonValue)) { + OdataId = JsonObjectGetValue (JsonValueGetObject (JsonValue), "@odata.id"); + if (JsonValueIsString (OdataId)) { + MemberUri = JsonValueGetUnicodeString (OdataId); } - FreePool (MemberUri); + JsonValueFree (JsonValue); + } else { + DEBUG ((DEBUG_ERROR, "%a: malformat JSON text\n", __func__)); } } + if (MemberUri != NULL) { + Status = HandleResource (Private, MemberUri, (JsonData == NULL ? NULL : JsonData->JsonText)); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: process resource: %s failed: %r\n", __func__, MemberUri, Status)); + } + + FreePool (MemberUri); + } + if (IsLinkAtEnd (&CollectionCs->Members, List)) { break; } @@ -208,6 +229,7 @@ CollectionHandler ( ) { EFI_STATUS Status; + CHAR16 UriExpand[MAX_URI_LENGTH]; if (Private == NULL) { return EFI_INVALID_PARAMETER; @@ -215,10 +237,19 @@ CollectionHandler ( DEBUG ((REDFISH_DEBUG_TRACE, "%a: collection handler for %s\n", __func__, Private->CollectionUri)); + // + // If BMC supports $expand parameter, use this parameter for our query. + // + if (RedfishNoLinksSupported (Private->RedfishService)) { + UnicodeSPrint (UriExpand, MAX_URI_LENGTH * sizeof (CHAR16), L"%s%s", Private->CollectionUri, REDFISH_EXPAND_PARAMETER); + } else { + StrCpyS (UriExpand, MAX_URI_LENGTH, Private->CollectionUri); + } + // // Query collection from Redfish service. // - Status = RedfishHttpGetResource (Private->RedfishService, Private->CollectionUri, &Private->Response, TRUE); + Status = RedfishHttpGetResource (Private->RedfishService, UriExpand, &Private->Response, TRUE); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a: unable to get resource from: %s :%r\n", __func__, Private->CollectionUri, Status)); goto ON_RELEASE; diff --git a/RedfishClientPkg/Features/SecureBootDatabaseCollectionDxe/SecureBootDatabaseCollectionDxe.inf b/RedfishClientPkg/Features/SecureBootDatabaseCollectionDxe/SecureBootDatabaseCollectionDxe.inf index 80d5c6b0af..afb15992e3 100644 --- a/RedfishClientPkg/Features/SecureBootDatabaseCollectionDxe/SecureBootDatabaseCollectionDxe.inf +++ b/RedfishClientPkg/Features/SecureBootDatabaseCollectionDxe/SecureBootDatabaseCollectionDxe.inf @@ -41,6 +41,7 @@ EdkIIRedfishResourceConfigLib RedfishVersionLib RedfishHttpLib + RedfishProtocolFeaturesLib [Protocols] gEdkIIRedfishConfigHandlerProtocolGuid ## CONSUMED diff --git a/RedfishClientPkg/Include/RedfishCollectionCommon.h b/RedfishClientPkg/Include/RedfishCollectionCommon.h index 0bc86b3245..87b60ca130 100644 --- a/RedfishClientPkg/Include/RedfishCollectionCommon.h +++ b/RedfishClientPkg/Include/RedfishCollectionCommon.h @@ -28,6 +28,7 @@ #include #include #include +#include // // Protocols diff --git a/RedfishClientPkg/Include/RedfishResourceCommon.h b/RedfishClientPkg/Include/RedfishResourceCommon.h index d9f41be6e1..e92483affe 100644 --- a/RedfishClientPkg/Include/RedfishResourceCommon.h +++ b/RedfishClientPkg/Include/RedfishResourceCommon.h @@ -40,24 +40,26 @@ #include #include #include +#include #include #include typedef struct _REDFISH_RESOURCE_COMMON_PRIVATE { - REDFISH_SERVICE RedfishService; - EFI_REST_JSON_STRUCTURE_PROTOCOL *JsonStructProtocol; - EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL RedfishResourceConfig; - EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL ConfigHandler; - EFI_EVENT Event; - EFI_STRING Uri; - CHAR8 *Json; - REDFISH_PAYLOAD Payload; + REDFISH_SERVICE RedfishService; + EFI_REST_JSON_STRUCTURE_PROTOCOL *JsonStructProtocol; + EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL RedfishResourceConfig; + EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL RedfishResourceConfig2; + EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL ConfigHandler; + EFI_EVENT Event; + EFI_STRING Uri; + CHAR8 *Json; + REDFISH_PAYLOAD Payload; // // Below are used for the external resource. // - EDKII_REDFISH_FEATURE_PROTOCOL *FeatureProtocol; - RESOURCE_INFORMATION_EXCHANGE *InformationExchange; - EFI_STRING RedfishVersion; + EDKII_REDFISH_FEATURE_PROTOCOL *FeatureProtocol; + RESOURCE_INFORMATION_EXCHANGE *InformationExchange; + EFI_STRING RedfishVersion; } REDFISH_RESOURCE_COMMON_PRIVATE; #define REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_CONFIG_PROTOCOL(This) \ @@ -66,6 +68,9 @@ typedef struct _REDFISH_RESOURCE_COMMON_PRIVATE { #define REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_RESOURCE_PROTOCOL(This) \ BASE_CR ((This), REDFISH_RESOURCE_COMMON_PRIVATE, RedfishResourceConfig) +#define REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_RESOURCE2_PROTOCOL(This) \ + BASE_CR ((This), REDFISH_RESOURCE_COMMON_PRIVATE, RedfishResourceConfig2) + /** Consume resource from given URI.