Introduce Redfish Resource Addendum Protocol to Redfish feature driver.
Feature driver uses this protocol to query OEM resource from platform in
order to support Redfish OEM property. This protocol is also used to get
addendum data that is required by BMC to manage Redfish BIOS service.

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>
---
 .../EdkIIRedfishResourceAddendumProtocol.h    | 77 +++++++++++++++++++
 RedfishClientPkg/RedfishClientPkg.dec         |  2 +
 2 files changed, 79 insertions(+)
 create mode 100644 
RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceAddendumProtocol.h

diff --git 
a/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceAddendumProtocol.h 
b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceAddendumProtocol.h
new file mode 100644
index 0000000000..462d94fdc1
--- /dev/null
+++ b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceAddendumProtocol.h
@@ -0,0 +1,77 @@
+/** @file
+  This file defines the EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL interface.
+
+  Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL_H_
+#define EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL_H_
+
+#include <Uefi.h>
+
+typedef struct _EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL 
EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL;
+
+//
+// The definition of REDFISH_SCHEMA_INFO
+//
+typedef struct {
+  CHAR8    *Uri;
+  CHAR8    *Schema;
+  CHAR8    *Version;
+} REDFISH_RESOURCE_SCHEMA_INFO;
+
+/**
+  Provising redfish resource with with addendum data in given schema.
+
+  @param[in]      This             Pointer to 
EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL instance.
+  @param[in]      SchemaInfo       Redfish schema information.
+  @param[in,out]  Json             On input, this is the Redfish data in given 
Uri in JSON object.
+                                   On output, This is the Redfish data with 
addendum information
+                                   which platform would like to add to Redfish 
service.
+
+  @retval EFI_SUCCESS              Addendum data is attached.
+  @retval EFI_UNSUPPORTED          No addendum data is required in given 
schema.
+  @retval Others                   Some error happened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_RESOURCE_ADDENDUM_PROVISIONING)(
+  IN     EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL  *This,
+  IN     REDFISH_RESOURCE_SCHEMA_INFO              *SchemaInfo,
+  IN OUT EDKII_JSON_VALUE                          Json
+  );
+
+/**
+  Provising redfish OEM resource in given schema information.
+
+  @param[in]   This             Pointer to 
EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL instance.
+  @param[in]   SchemaInfo       Redfish schema information.
+  @param[out]  Json             This is the Redfish data which is attached to 
OEM object in given
+                                schema.
+
+  @retval EFI_SUCCESS              OEM data is attached.
+  @retval EFI_UNSUPPORTED          No OEM data is required in given schema.
+  @retval Others                   Some error happened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_RESOURCE_ADDENDUM_OEM)(
+  IN   EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL  *This,
+  IN   REDFISH_RESOURCE_SCHEMA_INFO              *SchemaInfo,
+  OUT  EDKII_JSON_VALUE                          Json
+  );
+
+struct _EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL {
+  UINT64                                          Revision;
+  EDKII_REDFISH_RESOURCE_ADDENDUM_OEM             OemCallback;
+  EDKII_REDFISH_RESOURCE_ADDENDUM_PROVISIONING    ProvisioningCallback;
+};
+
+extern EFI_GUID  gEdkIIRedfishResourceAddendumProtocolGuid;
+
+#endif
diff --git a/RedfishClientPkg/RedfishClientPkg.dec 
b/RedfishClientPkg/RedfishClientPkg.dec
index d3c97ecf68..9d88680415 100644
--- a/RedfishClientPkg/RedfishClientPkg.dec
+++ b/RedfishClientPkg/RedfishClientPkg.dec
@@ -43,6 +43,8 @@
   gEdkIIRedfishConfigLangMapProtocolGuid    = { 0x1d9ba9fe, 0x5d5a, 0x4b66, 
{0x83, 0x5b, 0xe2, 0x5d, 0x13, 0x93, 0x4a, 0x9c } }
   ## Include/Protocol/EdkIIRedfishInterchangeData.h
   gEdkIIRedfishFeatureInterchangeDataProtocolGuid = { 0x4B8FF71C, 0x4A7B, 
0x9478, { 0xB7, 0x81, 0x35, 0x9B, 0x0A, 0xF2, 0x00, 0x91 } }
+  ## Include/Protocol/EdkIIRedfishResourceAddendumProtocol.h
+  gEdkIIRedfishResourceAddendumProtocolGuid = { 0xda36b12b, 0xaad4, 0x4e90, { 
0xba, 0xcb, 0xe3, 0xb5, 0x3b, 0x08, 0xbc, 0x54 } }
 
 [Guids]
   ## Include/Guid/RedfishClientPkgTokenSpace.h
-- 
2.38.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97084): https://edk2.groups.io/g/devel/message/97084
Mute This Topic: https://groups.io/mt/95516359/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to