public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Abner Chang" <abner.chang@hpe.com>
To: devel@edk2.groups.io
Cc: abner.chang@hpe.com, Jiaxin Wu <jiaxin.wu@intel.com>,
	Siyuan Fu <siyuan.fu@intel.com>, Fan Wang <fan.wang@intel.com>,
	Yao Jiewen <jiewen.yao@intel.com>,
	Nickle Wang <nickle.wang@hpe.com>
Subject: [edk2-staging/RedfishHostInterfaceDxe PATCH 3/5] RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib
Date: Sun, 27 Sep 2020 23:16:43 +0800	[thread overview]
Message-ID: <20200927151643.458716-1-abner.chang@hpe.com> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=unknown-8bit, Size: 4544 bytes --]

https://bugzilla.tianocore.org/show_bug.cgi?id=2912

NULL instance of PlatformHostInterfaceLib.

PlatformHostInterfaceLib is consumed by RedfishHostInterfaceDxe driver,
this library provide the platform-specific implementation for building up
Redfish Host Inteface information.

Signed-off-by: Abner Chang <abner.chang@hpe.com>

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Fan Wang <fan.wang@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
---
 .../BZ2912PlatformHostInterfaceLibNull.c      | 53 +++++++++++++++++++
 .../BZ2912PlatformHostInterfaceLibNull.inf    | 34 ++++++++++++
 2 files changed, 87 insertions(+)
 create mode 100644 RedfishPkg/Library/PlatformHostInterfaceLibNull/BZ2912PlatformHostInterfaceLibNull.c
 create mode 100644 RedfishPkg/Library/PlatformHostInterfaceLibNull/BZ2912PlatformHostInterfaceLibNull.inf

diff --git a/RedfishPkg/Library/PlatformHostInterfaceLibNull/BZ2912PlatformHostInterfaceLibNull.c b/RedfishPkg/Library/PlatformHostInterfaceLibNull/BZ2912PlatformHostInterfaceLibNull.c
new file mode 100644
index 00000000000..8afe24c7389
--- /dev/null
+++ b/RedfishPkg/Library/PlatformHostInterfaceLibNull/BZ2912PlatformHostInterfaceLibNull.c
@@ -0,0 +1,53 @@
+/** @file
+  NULL instace of RedfishPlatformHostInterfaceLib
+
+  (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+#include <Uefi.h>
+#include <Library/BaseLib.h>
+#include <Library/BZ2912RedfishHostInterfaceLib.h>
+#include <Library/UefiLib.h>
+
+/**
+  Get platform Redfish host interface device descriptor.
+
+  @param[out] DeviceType        Pointer to retrieve device type.
+  @param[out] DeviceDescriptor  Pointer to retrieve REDFISH_INTERFACE_DATA, caller has to free
+                                this memory using FreePool().
+  @retval EFI_SUCCESS     Device descriptor is returned successfully in DeviceDescriptor.
+  @retval EFI_NOT_FOUND   No Redfish host interface descriptor provided on this platform.
+  @retval Others          Fail to get device descriptor.
+**/
+EFI_STATUS
+RedfishPlatformHostInterfaceDeviceDescriptor (
+  IN UINT8 *DeviceType,
+  IN REDFISH_INTERFACE_DATA  **DeviceDescriptor
+)
+{
+  return EFI_NOT_FOUND;
+}
+/**
+  Get platform Redfish host interface protocol data.
+  Caller should pass NULL in ProtocolRecord to retrive the first protocol record.
+  Then continuously pass previous ProtocolRecord for retrieving the next ProtocolRecord.
+
+  @param[in, out] ProtocolRecord  Pointer to retrieve the first or the next protocol record.
+                                  caller has to free the new protocol record returned from
+                                  this function using FreePool().
+  param[in] IndexOfProtocolData   The index of protocol data.
+
+  @retval EFI_SUCESS      Protocol records are all returned.
+  @retval EFI_NOT_FOUND   No more protocol records.
+  @retval Others          Fail to get protocol records.
+**/
+EFI_STATUS
+RedfishPlatformHostInterfaceProtocolData (
+  IN MC_HOST_INTERFACE_PROTOCOL_RECORD **ProtocolRecord,
+  IN UINT8  IndexOfProtocolData
+)
+{
+  return EFI_NOT_FOUND;
+}
diff --git a/RedfishPkg/Library/PlatformHostInterfaceLibNull/BZ2912PlatformHostInterfaceLibNull.inf b/RedfishPkg/Library/PlatformHostInterfaceLibNull/BZ2912PlatformHostInterfaceLibNull.inf
new file mode 100644
index 00000000000..f1537b5aac6
--- /dev/null
+++ b/RedfishPkg/Library/PlatformHostInterfaceLibNull/BZ2912PlatformHostInterfaceLibNull.inf
@@ -0,0 +1,34 @@
+## @file
+#  NULL instance of RedfishPlatformHostInterfaceLib
+#
+#  (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x0001000b
+  BASE_NAME                      = RedfishPlatformHostInterfaceLibNull
+  FILE_GUID                      = 851229BF-4D8B-30F3-DD0D-20AFAF99A77B
+  MODULE_TYPE                    = DXE_DRIVER
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = RedfishPlatformHostInterfaceLib
+
+#
+#  VALID_ARCHITECTURES           = IA32 X64 ARM AARCH64 RISCV64
+#
+
+[Sources]
+  BZ2912PlatformHostInterfaceLibNull.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  RedfishPkg/RedfishPkg.dec
+
+[LibraryClasses]
+  UefiLib
+  BaseLib
+  DebugLib
+
-- 
2.21.0.windows.1


                 reply	other threads:[~2020-09-27 15:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200927151643.458716-1-abner.chang@hpe.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