public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Nickle Wang" <nicklew@nvidia.com>
To: <devel@edk2.groups.io>
Cc: Abner Chang <abner.chang@amd.com>,
	Igor Kulchytskyy <igork@ami.com>,
	"Nick Ramirez" <nramirez@nvidia.com>
Subject: [edk2-staging][PATCH 1/3] edk2-staging/RedfishClientPkg: Add Redfish Resource Addendum Protocol
Date: Wed, 7 Dec 2022 22:40:39 +0800	[thread overview]
Message-ID: <20221207144039.310-1-nicklew@nvidia.com> (raw)

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 <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@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


             reply	other threads:[~2022-12-07 14:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 14:40 Nickle Wang [this message]
2022-12-12  2:50 ` [edk2-staging][PATCH 1/3] edk2-staging/RedfishClientPkg: Add Redfish Resource Addendum Protocol Chang, Abner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221207144039.310-1-nicklew@nvidia.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox