public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [EFI Redfish Host Interface PATCH v2 0/6] Create SMBIOS type 42 record
@ 2020-10-30 10:02 Abner Chang
  2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 1/6] RedfishPkg/Include: Definitions of SMBIOS Redfish Host Interface Abner Chang
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Abner Chang @ 2020-10-30 10:02 UTC (permalink / raw)
  To: devel; +Cc: Jiaxin Wu, Siyuan Fu, Fan Wang, Jiewen Yao, Nickle Wang

In v2:
      - Address comments given by Nickle v1
      - Add accepted dependency of RedfishPkg in RedfishPkg CI
        yaml file for CI test.
      - Fix some CI test errors.

This is the abstract driver to consume the contents of SMBIOS type 42h
provided by PlatformHostInterfaceLib and create SMBIOS type 42 record
through EFI SMBIOS protocol.

Due to the way firmware to obtain Redfish service host interface
information is platform implementation specific and the information
could be obtained through the platform proprietary transport to BMC
or the out-of-band service, platform integrator has to implement
PlatformHostInterfaceLib to provide the Redfish host interface
information to EFI Redfish Host Interface DXE driver.

EFI Redfish Host Interface DXE Driver doesn't require any UEFI spec
changes. This driver is the EDK2 implementation to collaborate with
EFI Redfish Discover Driver (UEFI spec 31.1).

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

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: Jiewen Yao <jiewen.yao@intel.com>
Cc: Nickle Wang <nickle.wang@hpe.com>

Abner Chang (6):
  RedfishPkg/Include: Definitions of SMBIOS Redfish Host Interface
  RedfishPkg/Include: PlatformHostInterfaceLib header file
  RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib
  RedfishPkg/RedfishHostInterfaceDxe: Create SMBIOS type 42 record
  RedfishPkg: Add RedfishHostInterfaceDxe to RedfishPkg
  RedfishPkg: Changes on RedfishPkg for CI test

 .../IndustryStandard/RedfishHostInterface.h   | 169 ++++++++++++
 .../Include/Library/RedfishHostInterfaceLib.h |  52 ++++
 .../PlatformHostInterfaceLibNull.c            |  52 ++++
 .../PlatformHostInterfaceLibNull.inf          |  33 +++
 .../RedfishHostInterfaceDxe.c                 | 243 ++++++++++++++++++
 .../RedfishHostInterfaceDxe.inf               |  50 ++++
 RedfishPkg/RedfishPkg.ci.yaml                 |   3 +-
 RedfishPkg/RedfishPkg.dec                     |   5 +
 RedfishPkg/RedfishPkg.dsc                     |  14 +
 9 files changed, 620 insertions(+), 1 deletion(-)
 create mode 100644 RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h
 create mode 100644 RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
 create mode 100644 RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c
 create mode 100644 RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.inf
 create mode 100644 RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
 create mode 100644 RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf

-- 
2.17.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [EFI Redfish Host Interface PATCH v2 1/6] RedfishPkg/Include: Definitions of SMBIOS Redfish Host Interface
  2020-10-30 10:02 [EFI Redfish Host Interface PATCH v2 0/6] Create SMBIOS type 42 record Abner Chang
@ 2020-10-30 10:02 ` Abner Chang
  2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 2/6] RedfishPkg/Include: PlatformHostInterfaceLib header file Abner Chang
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Abner Chang @ 2020-10-30 10:02 UTC (permalink / raw)
  To: devel; +Cc: Jiaxin Wu, Siyuan Fu, Fan Wang, Jiewen Yao, Nickle Wang

Add definitions of SMBIOS Type 42 Host Interface.

Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Signed-off-by: Siyuan Fu <siyuan.fu@intel.com>
Signed-off-by: Fan Wang <fan.wang@intel.com>
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: Jiewen Yao <jiewen.yao@intel.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
---
 .../IndustryStandard/RedfishHostInterface.h   | 169 ++++++++++++++++++
 1 file changed, 169 insertions(+)
 create mode 100644 RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h

diff --git a/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h b/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h
new file mode 100644
index 0000000000..3eec7a0b0e
--- /dev/null
+++ b/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h
@@ -0,0 +1,169 @@
+/** @file
+  This file defines the Redfish Interface Specific Data.
+
+  Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+  (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef REDFISH_HOST_INTERFACE_
+#define REDFISH_HOST_INTERFACE_
+
+#include <IndustryStandard/SmBios.h>
+
+#define REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB         0x02 // We don't support this type of interface.
+                                                            // Use REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB_V2 instead.
+#define REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE    0x03 // We don't support this type of interface.
+                                                            // Use REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2 instead.
+#define REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB_V2      0x04
+#define REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2 0x05
+
+#define REDFISH_HOST_INTERFACE_HOST_IP_ASSIGNMENT_TYPE_UNKNOWN            0x00
+#define REDFISH_HOST_INTERFACE_HOST_IP_ASSIGNMENT_TYPE_STATIC             0x01
+#define REDFISH_HOST_INTERFACE_HOST_IP_ASSIGNMENT_TYPE_DHCP               0x02
+#define REDFISH_HOST_INTERFACE_HOST_IP_ASSIGNMENT_TYPE_AUTO_CONFIGURE     0x03
+#define REDFISH_HOST_INTERFACE_HOST_IP_ASSIGNMENT_TYPE_HOST_SELECTED      0x04
+
+#define REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_UNKNOWN      0x00
+#define REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP4          0x01
+#define REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP6          0x02
+
+#pragma pack(1)
+///
+/// Structure definitions of Host Interface device type 04h (USB Network Interface V2)
+///
+typedef struct {
+  UINT8                   Length;          ///< Length of the structure, including Device Type
+                                           ///< and Length fields.
+  UINT16                  IdVendor;        ///< The Vendor ID of the device, as read from the
+                                           ///< idVendor field of the USB descriptor.
+  UINT16                  IdProduct;       ///< The Product ID of the device, as read from the
+                                           ///< idProduct field of the USB descriptor.
+  UINT8                   SecialNumberStr; ///< The string number for the Serial Number of the
+                                           ///< device. The string data is read from the
+                                           ///< iSerialNumber.bDescriptorType field of the USB
+                                           ///< descriptor, and is converted from Unicode to ASCII
+                                           ///< and is NULL terminated.
+  UINT8                   MacAddress [6];  ///< The MAC address of the PCI/PCIe network device.
+} USB_INTERFACE_DEVICE_DESCRIPTOR_V2;
+
+//
+// Structure definitions of Host Interface device type 05h (PCI/PCIE V2)
+//
+typedef struct {
+  UINT8                   Length;               ///< Length of the structure, including Device Type and Length fields.
+  UINT16                  VendorId;             ///< The Vendor ID of the PCI/PCIe device.
+  UINT16                  DeviceId;             ///< The Device ID of the PCI/PCIe device.
+  UINT16                  SubsystemVendorId;    ///< The Subsystem Vendor ID of the PCI/PCIe device.
+  UINT16                  SubsystemId;          ///< The Subsystem ID of the PCI/PCIe device.
+  UINT8                   MacAddress [6];       ///< The MAC address of the PCI/PCIe network device.
+  UINT16                  SegmemtGroupNumber;   ///< The Segment Group Number of the PCI/PCIe.
+  UINT8                   BusNumber;            ///< The Bus Number of the PCI/PCIe device.
+  UINT8                   DeviceFunctionNumber; ///< The Device/Function Number of the PCI/PCIe.
+} PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2;
+
+///
+/// Structure definitions of Host Interface device type 80-FFh (OEM)
+///
+typedef struct {
+  UINT32                  VendorIana;          ///< The IANA code for the vendor (MSB first).
+  UINT8                   OemDefinedData[1];   ///< OEM defined data.
+} OEM_DEVICE_DESCRIPTOR;
+
+///
+/// Define union for the Host Interface Device Descriptor
+///
+typedef union {
+    USB_INTERFACE_DEVICE_DESCRIPTOR_V2          UsbDeviceV2;     ///< Device type USB V2 device discriptor.
+    PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2  PciPcieDeviceV2; ///< Device type PCI/PCIe V2 device discriptor.
+    OEM_DEVICE_DESCRIPTOR                       OemDevice;       ///< OEM type device discriptor.
+} DEVICE_DESCRITOR; /// Device descriptor data formated based on Device Type.
+
+///
+///  Interface Specific Data starts at offset 06h of the SMBIOS Type 42 struct.
+///  This table defines the Interface Specific data for Interface Type 40h. There
+///  are 3 types of Device Descriptor3 defined , however only 1 may be used in
+///  specific Tape 42 table.
+///
+typedef struct {
+  UINT8            DeviceType;        ///< The Device Type of the interface.
+  DEVICE_DESCRITOR DeviceDescriptor;  ///< The Device descriptor.
+} REDFISH_INTERFACE_DATA;
+
+//
+//  the protocol-specific data for the "Redfish Over IP" protocol
+//
+typedef struct {
+  EFI_GUID            ServiceUuid;  //same as Redfish Service UUID in Redfish Service Root resource
+
+  //
+  //  Unknown=00h,
+  //  Static=01h,
+  //  DHCP=02h,
+  //  AutoConfigure=03h,
+  //  HostSelected=04h,
+  //  other values reserved
+  //
+  UINT8               HostIpAssignmentType;
+
+  //
+  //  Unknown=00h,
+  //  Ipv4=01h,
+  //  Ipv6=02h,
+  //  other values reserved
+  //
+  UINT8               HostIpAddressFormat;
+
+  //
+  //  Used for Static and AutoConfigure.
+  //  For IPV4, use the first 4 Bytes and zero fill the remaining bytes.
+  //
+  UINT8               HostIpAddress[16];
+
+  //
+  //  Used for Static and AutoConfigure.
+  //  For IPV4, use the first 4 Bytes and zero fill the remaining bytes.
+  //
+  UINT8               HostIpMask[16];
+
+  //
+  //  Unknown=00h,
+  //  Static=01h,
+  //  DHCP=02h,
+  //  AutoConfigure=03h,
+  //  HostSelected=04h,
+  //  other values reserved
+  //
+  UINT8               RedfishServiceIpDiscoveryType;
+
+  //
+  //  Unknown=00h,
+  //  Ipv4=01h,
+  //  Ipv6=02h,
+  //  other values reserved
+  //
+  UINT8               RedfishServiceIpAddressFormat;
+
+  //
+  //  Used for Static and AutoConfigure.
+  //  For IPV4, use the first 4 Bytes and zero fill the remaining bytes.
+  //
+  UINT8               RedfishServiceIpAddress[16];
+
+  //
+  //  Used for Static and AutoConfigure.
+  //  For IPV4, use the first 4 Bytes and zero fill the remaining bytes.
+  //
+  UINT8               RedfishServiceIpMask[16];
+
+  UINT16              RedfishServiceIpPort;  // Used for Static and AutoConfigure.
+  UINT32              RedfishServiceVlanId;  // Used for Static and AutoConfigure.
+  UINT8               RedfishServiceHostnameLength;   // length of the following hostname string
+  UINT8               RedfishServiceHostname[1];  // hostname of Redfish Service
+} REDFISH_OVER_IP_PROTOCOL_DATA;
+
+#pragma pack()
+
+#endif
+
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [EFI Redfish Host Interface PATCH v2 2/6] RedfishPkg/Include: PlatformHostInterfaceLib header file
  2020-10-30 10:02 [EFI Redfish Host Interface PATCH v2 0/6] Create SMBIOS type 42 record Abner Chang
  2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 1/6] RedfishPkg/Include: Definitions of SMBIOS Redfish Host Interface Abner Chang
@ 2020-10-30 10:02 ` Abner Chang
  2020-11-02  3:51   ` Nickle Wang
  2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 3/6] RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib Abner Chang
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Abner Chang @ 2020-10-30 10:02 UTC (permalink / raw)
  To: devel; +Cc: Jiaxin Wu, Siyuan Fu, Fan Wang, Jiewen Yao, Nickle Wang

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: Jiewen Yao <jiewen.yao@intel.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
---
 .../Include/Library/RedfishHostInterfaceLib.h | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 RedfishPkg/Include/Library/RedfishHostInterfaceLib.h

diff --git a/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h b/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
new file mode 100644
index 0000000000..fe37b2739a
--- /dev/null
+++ b/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
@@ -0,0 +1,52 @@
+/** @file
+  Definitinos of RedfishHostInterfaceDxe driver.
+
+  (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+#ifndef REDFISH_HOST_INTERFACE_LIB_H_
+#define REDFISH_HOST_INTERFACE_LIB_H_
+
+#include <Uefi.h>
+#include <IndustryStandard/RedfishHostInterface.h>
+#include <IndustryStandard/SmBios.h>
+
+#include <Protocol/Smbios.h>
+
+/**
+  Get platform Redfish host interface device descriptor.
+
+  @param[in] 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,
+  OUT REDFISH_INTERFACE_DATA  **DeviceDescriptor
+);
+/**
+  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 OUT MC_HOST_INTERFACE_PROTOCOL_RECORD **ProtocolRecord,
+  IN UINT8  IndexOfProtocolData
+);
+#endif
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [EFI Redfish Host Interface PATCH v2 3/6] RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib
  2020-10-30 10:02 [EFI Redfish Host Interface PATCH v2 0/6] Create SMBIOS type 42 record Abner Chang
  2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 1/6] RedfishPkg/Include: Definitions of SMBIOS Redfish Host Interface Abner Chang
  2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 2/6] RedfishPkg/Include: PlatformHostInterfaceLib header file Abner Chang
@ 2020-10-30 10:02 ` Abner Chang
  2020-11-02  3:51   ` Nickle Wang
  2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 4/6] RedfishPkg/RedfishHostInterfaceDxe: Create SMBIOS type 42 record Abner Chang
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Abner Chang @ 2020-10-30 10:02 UTC (permalink / raw)
  To: devel; +Cc: Jiaxin Wu, Siyuan Fu, Fan Wang, Jiewen Yao, Nickle Wang

NULL instance of PlatformHostInterfaceLib.

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: Jiewen Yao <jiewen.yao@intel.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
---
 .../PlatformHostInterfaceLibNull.c            | 52 +++++++++++++++++++
 .../PlatformHostInterfaceLibNull.inf          | 33 ++++++++++++
 2 files changed, 85 insertions(+)
 create mode 100644 RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c
 create mode 100644 RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.inf

diff --git a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c
new file mode 100644
index 0000000000..5c93a003e3
--- /dev/null
+++ b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c
@@ -0,0 +1,52 @@
+/** @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/RedfishHostInterfaceLib.h>
+#include <Library/UefiLib.h>
+
+/**
+  Get platform Redfish host interface device descriptor.
+
+  @param[in] 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_NOT_FOUND   No Redfish host interface descriptor provided on this platform.
+
+**/
+EFI_STATUS
+RedfishPlatformHostInterfaceDeviceDescriptor (
+  IN UINT8 *DeviceType,
+  OUT 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_NOT_FOUND   No more protocol records.
+
+**/
+EFI_STATUS
+RedfishPlatformHostInterfaceProtocolData (
+  IN OUT MC_HOST_INTERFACE_PROTOCOL_RECORD **ProtocolRecord,
+  IN UINT8  IndexOfProtocolData
+)
+{
+  return EFI_NOT_FOUND;
+}
diff --git a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.inf b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.inf
new file mode 100644
index 0000000000..b42e5335ee
--- /dev/null
+++ b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.inf
@@ -0,0 +1,33 @@
+## @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]
+  PlatformHostInterfaceLibNull.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  RedfishPkg/RedfishPkg.dec
+
+[LibraryClasses]
+  UefiLib
+  BaseLib
+
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [EFI Redfish Host Interface PATCH v2 4/6] RedfishPkg/RedfishHostInterfaceDxe: Create SMBIOS type 42 record
  2020-10-30 10:02 [EFI Redfish Host Interface PATCH v2 0/6] Create SMBIOS type 42 record Abner Chang
                   ` (2 preceding siblings ...)
  2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 3/6] RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib Abner Chang
@ 2020-10-30 10:02 ` Abner Chang
  2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 5/6] RedfishPkg: Add RedfishHostInterfaceDxe to RedfishPkg Abner Chang
  2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 6/6] RedfishPkg: Changes on RedfishPkg for CI test Abner Chang
  5 siblings, 0 replies; 11+ messages in thread
From: Abner Chang @ 2020-10-30 10:02 UTC (permalink / raw)
  To: devel; +Cc: Jiaxin Wu, Siyuan Fu, Fan Wang, Jiewen Yao, Nickle Wang

This is the abstract driver to consume the contents of SMBIOS type 42h
device descriptor and protocol type data which provided by
PlatformHostInterfaceLib, and create SMBIOS type 42 record through
EFI SMBIOS protocol.

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: Jiewen Yao <jiewen.yao@intel.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
---
 .../RedfishHostInterfaceDxe.c                 | 243 ++++++++++++++++++
 .../RedfishHostInterfaceDxe.inf               |  50 ++++
 2 files changed, 293 insertions(+)
 create mode 100644 RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
 create mode 100644 RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf

diff --git a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
new file mode 100644
index 0000000000..ec7faefed7
--- /dev/null
+++ b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
@@ -0,0 +1,243 @@
+/** @file
+  RedfishHostInterfaceDxe builds up SMBIOS Type 42h host interface
+  record for Redfish service host interface using EFI MBIOS Protocol.
+  RedfishHostInterfacePlatformLib is the platform-level library which
+  provides the content of Redfish host interface type 42h record.
+
+  Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+  (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/BaseMemoryLib.h>
+#include <Library/DebugLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/PrintLib.h>
+#include <Library/RedfishHostInterfaceLib.h>
+#include <Library/UefiLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/UefiRuntimeServicesTableLib.h>
+
+/**
+  Create SMBIOS type 42 record for Redfish host interface.
+
+  @retval EFI_SUCESS     SMBIOS type 42 record is created.
+  @retval Others         Fail to create SMBIOS 42 record.
+
+**/
+EFI_STATUS
+RedfishCreateSmbiosTable42 (
+  VOID
+  )
+{
+  REDFISH_INTERFACE_DATA *DeviceDescriptor;
+  UINT8 DeviceDataLength;
+  UINT8 DeviceType;
+  EFI_STATUS Status;
+  MC_HOST_INTERFACE_PROTOCOL_RECORD *ProtocolRecord;
+  VOID *ProtocolRecords;
+  VOID *NewProtocolRecords;
+  UINT8 ProtocolCount;
+  UINT8 CurrentProtocolsDataLength;
+  UINT8 NewProtocolsDataLength;
+  UINT8 ProtocolDataSize;
+  SMBIOS_TABLE_TYPE42 *Type42Record;
+  EFI_SMBIOS_PROTOCOL *Smbios;
+  EFI_SMBIOS_HANDLE MemArrayMappedAddrSmbiosHandle;
+
+  //
+  // Get platform Redfish host interface device type descriptor data.
+  //
+  Status = RedfishPlatformHostInterfaceDeviceDescriptor (&DeviceType, &DeviceDescriptor);
+  if (EFI_ERROR (Status)) {
+    if (Status == EFI_NOT_FOUND) {
+      DEBUG ((DEBUG_ERROR, "%a: No Redfish host interface descriptor is provided on this platform.", __FUNCTION__));
+      return EFI_NOT_FOUND;
+    }
+    DEBUG((DEBUG_ERROR, "%a: Fail to get device descriptor, %r.", __FUNCTION__, Status));
+    return Status;
+  }
+  if (DeviceType != REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB_V2 &&
+      DeviceType != REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2
+    ) {
+    DEBUG ((DEBUG_ERROR, "%a: Only support either protocol type 04h or 05h as Redfish host interface.", __FUNCTION__));
+    return EFI_UNSUPPORTED;
+  }
+  if (DeviceType == REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2) {
+    DeviceDataLength = DeviceDescriptor->DeviceDescriptor.PciPcieDeviceV2.Length;
+  } else {
+    DeviceDataLength = DeviceDescriptor->DeviceDescriptor.UsbDeviceV2.Length;
+  }
+  //
+  // Loop to get platform Redfish host interface protocol type data.
+  //
+  ProtocolRecord = NULL;
+  ProtocolRecords = NULL;
+  NewProtocolRecords = NULL;
+  Type42Record = NULL;
+  ProtocolCount = 0;
+  CurrentProtocolsDataLength = 0;
+  NewProtocolsDataLength = 0;
+  while (TRUE) {
+    Status = RedfishPlatformHostInterfaceProtocolData (&ProtocolRecord, ProtocolCount);
+    if (Status == EFI_NOT_FOUND) {
+      break;
+    }
+    if (EFI_ERROR(Status)) {
+      DEBUG ((DEBUG_ERROR, "%a: Fail to get Redfish host interafce protocol type data.", __FUNCTION__));
+      if (ProtocolRecords != NULL) {
+        FreePool (ProtocolRecords);
+      }
+      if (ProtocolRecord != NULL) {
+        FreePool (ProtocolRecord);
+      }
+      return Status;
+    }
+    ProtocolDataSize = sizeof (MC_HOST_INTERFACE_PROTOCOL_RECORD) - sizeof(ProtocolRecord->ProtocolTypeData) + ProtocolRecord->ProtocolTypeDataLen;
+    NewProtocolsDataLength += ProtocolDataSize;
+    if (ProtocolRecords == NULL) {
+      ProtocolRecords = AllocateZeroPool (NewProtocolsDataLength);
+      if (ProtocolRecords == NULL) {
+        FreePool (ProtocolRecord);
+        return EFI_OUT_OF_RESOURCES;
+      }
+      CopyMem ((VOID *)ProtocolRecords, (VOID *)ProtocolRecord, ProtocolDataSize);
+      NewProtocolRecords = ProtocolRecords;
+    } else {
+      NewProtocolRecords = ReallocatePool(CurrentProtocolsDataLength, NewProtocolsDataLength, (VOID *)ProtocolRecords);
+      if (NewProtocolRecords == NULL) {
+        DEBUG ((DEBUG_ERROR, "%a: Fail to allocate memory for Redfish host interface protocol data."));
+        FreePool (ProtocolRecords);
+        FreePool (ProtocolRecord);
+        return EFI_OUT_OF_RESOURCES;
+      }
+      CopyMem (
+        (VOID *)((UINT8 *)NewProtocolRecords + CurrentProtocolsDataLength),
+        (VOID *)ProtocolRecord,
+        ProtocolDataSize
+        );
+    }
+    FreePool (ProtocolRecord);
+    CurrentProtocolsDataLength = NewProtocolsDataLength;
+    ProtocolCount ++;
+  };
+  if (ProtocolCount == 0) {
+    goto ON_EXIT;
+  }
+  //
+  // Construct SMBIOS Type 42h for Redfish host inteface.
+  //
+  // SMBIOS type 42 Record for Redfish Interface
+  // 00h Type BYTE 42 Management Controller Host Interface structure indicator
+  // 01h Length BYTE Varies Length of the structure, a minimum of 09h
+  // 02h Handle WORD Varies
+  // 04h Interface Type BYTE Varies Management Controller Interface Type.
+  // 05h Interface Specific Data Length (n)
+  // 06h Interface Specific data
+  // 06h+n number of protocols defined for the host interface (typically 1)
+  // 07h+n Include a Protocol Record for each protocol supported.
+  //
+  Type42Record = (SMBIOS_TABLE_TYPE42 *) AllocateZeroPool (
+                                           sizeof (SMBIOS_TABLE_TYPE42) - 4
+                                           + DeviceDataLength
+                                           + 1 /// For Protocol Record Count
+                                           + CurrentProtocolsDataLength
+                                           + 2 /// Double NULL terminator/
+                                           );
+  if (Type42Record == NULL) {
+    Status = EFI_OUT_OF_RESOURCES;
+    goto ON_EXIT;
+  }
+
+  Type42Record->Hdr.Type   = EFI_SMBIOS_TYPE_MANAGEMENT_CONTROLLER_HOST_INTERFACE;
+  Type42Record->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE42) - 4
+                               + DeviceDataLength
+                               + 1
+                               + CurrentProtocolsDataLength;
+  Type42Record->Hdr.Handle = 0;
+  Type42Record->InterfaceType = MCHostInterfaceTypeNetworkHostInterface; // Network Host Interface
+
+  //
+  // Fill in InterfaceTypeSpecificDataLength field
+  //
+  Type42Record->InterfaceTypeSpecificDataLength = DeviceDataLength;
+
+  //
+  // Fill in InterfaceTypeSpecificData field
+  //
+  CopyMem (Type42Record->InterfaceTypeSpecificData, DeviceDescriptor, DeviceDataLength);
+  FreePool (DeviceDescriptor);
+  DeviceDescriptor = NULL;
+
+  //
+  // Fill in InterfaceTypeSpecificData Protocol Count field
+  //
+  *(Type42Record->InterfaceTypeSpecificData + DeviceDataLength) = ProtocolCount;
+
+  //
+  // Fill in Redfish Protocol Data
+  //
+  CopyMem (
+    Type42Record->InterfaceTypeSpecificData + DeviceDataLength + 1,
+    NewProtocolRecords,
+    CurrentProtocolsDataLength
+    );
+
+  //
+  // 5. Add Redfish interface data record to SMBIOS table 42
+  //
+  Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID**)&Smbios);
+  if (EFI_ERROR (Status)) {
+    goto ON_EXIT;
+  }
+
+  MemArrayMappedAddrSmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
+  Status = Smbios->Add (
+                    Smbios,
+                    NULL,
+                    &MemArrayMappedAddrSmbiosHandle,
+                    (EFI_SMBIOS_TABLE_HEADER*) Type42Record
+                    );
+  DEBUG ((DEBUG_INFO, "RedfishPlatformDxe: Smbios->Add() - %r\n", Status));
+  if (EFI_ERROR (Status)) {
+    goto ON_EXIT;
+  }
+  Status = EFI_SUCCESS;
+
+ON_EXIT:
+  if (DeviceDescriptor != NULL) {
+    FreePool (DeviceDescriptor);
+  }
+  if (NewProtocolRecords != NULL) {
+    FreePool (NewProtocolRecords);
+  }
+  if (Type42Record != NULL) {
+    FreePool (Type42Record);
+  }
+  return Status;
+}
+
+/**
+  Main entry for this driver.
+
+  @param ImageHandle     Image handle this driver.
+  @param SystemTable     Pointer to SystemTable.
+
+  @retval EFI_SUCESS     This function always complete successfully.
+
+**/
+EFI_STATUS
+EFIAPI
+RedfishHostInterfaceDxeEntryPoint (
+  IN EFI_HANDLE         ImageHandle,
+  IN EFI_SYSTEM_TABLE   *SystemTable
+  )
+{
+  //
+  // Create SMBIOS type 42 record.
+  //
+  return RedfishCreateSmbiosTable42 ();
+}
diff --git a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf
new file mode 100644
index 0000000000..1cdae149aa
--- /dev/null
+++ b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf
@@ -0,0 +1,50 @@
+## @file
+#  RedfishHostInterfaceDxe builds up SMBIOS Type 42h host interface
+#  record for Redfish service host interface using SMBIOS Protocol.
+#  RedfishHostInterfacePlatformLib is the platform-level library which
+#  provides the content of Redfish host interface type 42h record.
+#
+#  Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+#  (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x0001000b
+  BASE_NAME                      = RedfishHostInterfaceDxe
+  FILE_GUID                      = 592626DA-4A1E-8B39-28BA-FEAD92C4A0A4
+  MODULE_TYPE                    = DXE_DRIVER
+  VERSION_STRING                 = 1.0
+  ENTRY_POINT                    = RedfishHostInterfaceDxeEntryPoint
+
+#
+#  VALID_ARCHITECTURES           = IA32 X64 ARM AARCH64 RISCV64
+#
+
+[Sources]
+  RedfishHostInterfaceDxe.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  RedfishPkg/RedfishPkg.dec
+
+[LibraryClasses]
+  BaseLib
+  BaseMemoryLib
+  DebugLib
+  MemoryAllocationLib
+  PrintLib
+  RedfishPlatformHostInterfaceLib
+  UefiBootServicesTableLib
+  UefiDriverEntryPoint
+  UefiLib
+
+[Protocols]
+  gEfiSmbiosProtocolGuid                ## TO_START
+
+[Depex]
+  gEfiSmbiosProtocolGuid
+
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [EFI Redfish Host Interface PATCH v2 5/6] RedfishPkg: Add RedfishHostInterfaceDxe to RedfishPkg
  2020-10-30 10:02 [EFI Redfish Host Interface PATCH v2 0/6] Create SMBIOS type 42 record Abner Chang
                   ` (3 preceding siblings ...)
  2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 4/6] RedfishPkg/RedfishHostInterfaceDxe: Create SMBIOS type 42 record Abner Chang
@ 2020-10-30 10:02 ` Abner Chang
  2020-11-02  3:52   ` Nickle Wang
  2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 6/6] RedfishPkg: Changes on RedfishPkg for CI test Abner Chang
  5 siblings, 1 reply; 11+ messages in thread
From: Abner Chang @ 2020-10-30 10:02 UTC (permalink / raw)
  To: devel; +Cc: Jiaxin Wu, Siyuan Fu, Fan Wang, Jiewen Yao, Nickle Wang

Add RedfishHostInterfaceDxe and PlatformHostInterfaceLibNull to Redfish
package.

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: Jiewen Yao <jiewen.yao@intel.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
---
 RedfishPkg/RedfishPkg.dec |  5 +++++
 RedfishPkg/RedfishPkg.dsc | 14 ++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index de3611252e..65e21f6bd6 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -16,6 +16,11 @@
 [Includes]
   Include
 
+[LibraryClasses]
+  ##  @libraryclass Platform Redfish Host Interface Library
+  #   Platform implementation-specific Redfish Host Interface.
+  RedfishPlatformHostInterfaceLib|Include/Library/RedfishHostInterfaceLib.h
+
 [Guids]
   gEfiRedfishPkgTokenSpaceGuid      = { 0x4fdbccb7, 0xe829, 0x4b4c, { 0x88, 0x87, 0xb2, 0x3f, 0xd7, 0x25, 0x4b, 0x85 }}
 
diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc
index 8acadddefc..cd40812d24 100644
--- a/RedfishPkg/RedfishPkg.dsc
+++ b/RedfishPkg/RedfishPkg.dsc
@@ -38,3 +38,17 @@
   DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
   DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
   ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
+  RedfishPlatformHostInterfaceLib|RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.inf
+
+[LibraryClasses.ARM, LibraryClasses.AARCH64]
+  #
+  # This library provides the instrinsic functions generated by a given compiler.
+  #
+  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+  NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
+  ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
+
+[Components]
+  RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.inf
+
+  RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [EFI Redfish Host Interface PATCH v2 6/6] RedfishPkg: Changes on RedfishPkg for CI test
  2020-10-30 10:02 [EFI Redfish Host Interface PATCH v2 0/6] Create SMBIOS type 42 record Abner Chang
                   ` (4 preceding siblings ...)
  2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 5/6] RedfishPkg: Add RedfishHostInterfaceDxe to RedfishPkg Abner Chang
@ 2020-10-30 10:02 ` Abner Chang
  2020-11-02  3:52   ` Nickle Wang
  5 siblings, 1 reply; 11+ messages in thread
From: Abner Chang @ 2020-10-30 10:02 UTC (permalink / raw)
  To: devel; +Cc: Jiaxin Wu, Siyuan Fu, Fan Wang, Jiewen Yao, Nickle Wang

Add accepted dependency of RedfishPkg in RedfishPkg CI
yaml file.

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: Jiewen Yao <jiewen.yao@intel.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
Reviewed-by: Nickle Wang <nickle.wang@hpe.com>
---
 RedfishPkg/RedfishPkg.ci.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/RedfishPkg/RedfishPkg.ci.yaml b/RedfishPkg/RedfishPkg.ci.yaml
index 75c3b6a8ad..bb3b8b6746 100644
--- a/RedfishPkg/RedfishPkg.ci.yaml
+++ b/RedfishPkg/RedfishPkg.ci.yaml
@@ -29,7 +29,8 @@
         "AcceptableDependencies": [
             "MdePkg/MdePkg.dec",
             "MdeModulePkg/MdeModulePkg.dec",
-            "NetworkPkg/NetworkPkg.dec"
+            "NetworkPkg/NetworkPkg.dec",
+            "RedfishPkg/RedfishPkg.dec"
         ],
         # For host based unit tests
         "AcceptableDependencies-HOST_APPLICATION":[],
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [EFI Redfish Host Interface PATCH v2 3/6] RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib
  2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 3/6] RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib Abner Chang
@ 2020-11-02  3:51   ` Nickle Wang
  0 siblings, 0 replies; 11+ messages in thread
From: Nickle Wang @ 2020-11-02  3:51 UTC (permalink / raw)
  To: Chang, Abner (HPS SW/FW Technologist), devel@edk2.groups.io
  Cc: Jiaxin Wu, Siyuan Fu, Fan Wang, Jiewen Yao

Reviewed-by: Nickle Wang <nickle.wang@hpe.com>

> -----Original Message-----
> From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> Sent: Friday, October 30, 2020 6:02 PM
> To: devel@edk2.groups.io
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>; Siyuan Fu <siyuan.fu@intel.com>; Fan
> Wang <fan.wang@intel.com>; Jiewen Yao <jiewen.yao@intel.com>; Wang,
> Nickle (HPS SW) <nickle.wang@hpe.com>
> Subject: [EFI Redfish Host Interface PATCH v2 3/6]
> RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib
> 
> NULL instance of PlatformHostInterfaceLib.
> 
> 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: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Nickle Wang <nickle.wang@hpe.com>
> ---
>  .../PlatformHostInterfaceLibNull.c            | 52 +++++++++++++++++++
>  .../PlatformHostInterfaceLibNull.inf          | 33 ++++++++++++
>  2 files changed, 85 insertions(+)
>  create mode 100644
> RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibN
> ull.c
>  create mode 100644
> RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibN
> ull.inf
> 
> diff --git
> a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLi
> bNull.c
> b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLi
> bNull.c
> new file mode 100644
> index 0000000000..5c93a003e3
> --- /dev/null
> +++ b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterf
> +++ aceLibNull.c
> @@ -0,0 +1,52 @@
> +/** @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/RedfishHostInterfaceLib.h>
> +#include <Library/UefiLib.h>
> +
> +/**
> +  Get platform Redfish host interface device descriptor.
> +
> +  @param[in] 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_NOT_FOUND   No Redfish host interface descriptor provided
> on this platform.
> +
> +**/
> +EFI_STATUS
> +RedfishPlatformHostInterfaceDeviceDescriptor (
> +  IN UINT8 *DeviceType,
> +  OUT 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_NOT_FOUND   No more protocol records.
> +
> +**/
> +EFI_STATUS
> +RedfishPlatformHostInterfaceProtocolData (
> +  IN OUT MC_HOST_INTERFACE_PROTOCOL_RECORD **ProtocolRecord,
> +  IN UINT8  IndexOfProtocolData
> +)
> +{
> +  return EFI_NOT_FOUND;
> +}
> diff --git
> a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLi
> bNull.inf
> b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLi
> bNull.inf
> new file mode 100644
> index 0000000000..b42e5335ee
> --- /dev/null
> +++ b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterf
> +++ aceLibNull.inf
> @@ -0,0 +1,33 @@
> +## @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]
> +  PlatformHostInterfaceLibNull.c
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  RedfishPkg/RedfishPkg.dec
> +
> +[LibraryClasses]
> +  UefiLib
> +  BaseLib
> +
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [EFI Redfish Host Interface PATCH v2 2/6] RedfishPkg/Include: PlatformHostInterfaceLib header file
  2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 2/6] RedfishPkg/Include: PlatformHostInterfaceLib header file Abner Chang
@ 2020-11-02  3:51   ` Nickle Wang
  0 siblings, 0 replies; 11+ messages in thread
From: Nickle Wang @ 2020-11-02  3:51 UTC (permalink / raw)
  To: Chang, Abner (HPS SW/FW Technologist), devel@edk2.groups.io
  Cc: Jiaxin Wu, Siyuan Fu, Fan Wang, Jiewen Yao

Reviewed-by: Nickle Wang <nickle.wang@hpe.com>

> -----Original Message-----
> From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> Sent: Friday, October 30, 2020 6:02 PM
> To: devel@edk2.groups.io
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>; Siyuan Fu <siyuan.fu@intel.com>; Fan
> Wang <fan.wang@intel.com>; Jiewen Yao <jiewen.yao@intel.com>; Wang,
> Nickle (HPS SW) <nickle.wang@hpe.com>
> Subject: [EFI Redfish Host Interface PATCH v2 2/6] RedfishPkg/Include:
> PlatformHostInterfaceLib header file
> 
> 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: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Nickle Wang <nickle.wang@hpe.com>
> ---
>  .../Include/Library/RedfishHostInterfaceLib.h | 52 +++++++++++++++++++
>  1 file changed, 52 insertions(+)
>  create mode 100644 RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
> 
> diff --git a/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
> b/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
> new file mode 100644
> index 0000000000..fe37b2739a
> --- /dev/null
> +++ b/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h
> @@ -0,0 +1,52 @@
> +/** @file
> +  Definitinos of RedfishHostInterfaceDxe driver.
> +
> +  (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +#ifndef REDFISH_HOST_INTERFACE_LIB_H_
> +#define REDFISH_HOST_INTERFACE_LIB_H_
> +
> +#include <Uefi.h>
> +#include <IndustryStandard/RedfishHostInterface.h>
> +#include <IndustryStandard/SmBios.h>
> +
> +#include <Protocol/Smbios.h>
> +
> +/**
> +  Get platform Redfish host interface device descriptor.
> +
> +  @param[in] 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,
> +  OUT REDFISH_INTERFACE_DATA  **DeviceDescriptor );
> +/**
> +  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 OUT MC_HOST_INTERFACE_PROTOCOL_RECORD **ProtocolRecord,
> +  IN UINT8  IndexOfProtocolData
> +);
> +#endif
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [EFI Redfish Host Interface PATCH v2 5/6] RedfishPkg: Add RedfishHostInterfaceDxe to RedfishPkg
  2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 5/6] RedfishPkg: Add RedfishHostInterfaceDxe to RedfishPkg Abner Chang
@ 2020-11-02  3:52   ` Nickle Wang
  0 siblings, 0 replies; 11+ messages in thread
From: Nickle Wang @ 2020-11-02  3:52 UTC (permalink / raw)
  To: Chang, Abner (HPS SW/FW Technologist), devel@edk2.groups.io
  Cc: Jiaxin Wu, Siyuan Fu, Fan Wang, Jiewen Yao

Reviewed-by: Nickle Wang <nickle.wang@hpe.com>

> -----Original Message-----
> From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> Sent: Friday, October 30, 2020 6:02 PM
> To: devel@edk2.groups.io
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>; Siyuan Fu <siyuan.fu@intel.com>; Fan
> Wang <fan.wang@intel.com>; Jiewen Yao <jiewen.yao@intel.com>; Wang,
> Nickle (HPS SW) <nickle.wang@hpe.com>
> Subject: [EFI Redfish Host Interface PATCH v2 5/6] RedfishPkg: Add
> RedfishHostInterfaceDxe to RedfishPkg
> 
> Add RedfishHostInterfaceDxe and PlatformHostInterfaceLibNull to Redfish
> package.
> 
> 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: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Nickle Wang <nickle.wang@hpe.com>
> ---
>  RedfishPkg/RedfishPkg.dec |  5 +++++
>  RedfishPkg/RedfishPkg.dsc | 14 ++++++++++++++
>  2 files changed, 19 insertions(+)
> 
> diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec index
> de3611252e..65e21f6bd6 100644
> --- a/RedfishPkg/RedfishPkg.dec
> +++ b/RedfishPkg/RedfishPkg.dec
> @@ -16,6 +16,11 @@
>  [Includes]
>    Include
> 
> +[LibraryClasses]
> +  ##  @libraryclass Platform Redfish Host Interface Library
> +  #   Platform implementation-specific Redfish Host Interface.
> +
> +RedfishPlatformHostInterfaceLib|Include/Library/RedfishHostInterfaceLib
> +.h
> +
>  [Guids]
>    gEfiRedfishPkgTokenSpaceGuid      = { 0x4fdbccb7, 0xe829, 0x4b4c, { 0x88,
> 0x87, 0xb2, 0x3f, 0xd7, 0x25, 0x4b, 0x85 }}
> 
> diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc index
> 8acadddefc..cd40812d24 100644
> --- a/RedfishPkg/RedfishPkg.dsc
> +++ b/RedfishPkg/RedfishPkg.dsc
> @@ -38,3 +38,17 @@
> 
> DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTabl
> eLib.inf
>    DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
> 
> ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/Dx
> eReportStatusCodeLib.inf
> +
> + RedfishPlatformHostInterfaceLib|RedfishPkg/Library/PlatformHostInterfa
> + ceLibNull/PlatformHostInterfaceLibNull.inf
> +
> +[LibraryClasses.ARM, LibraryClasses.AARCH64]
> +  #
> +  # This library provides the instrinsic functions generated by a given
> compiler.
> +  #
> +  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> +  NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
> +  ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
> +
> +[Components]
> +
> +RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLi
> +bNull.inf
> +
> +  RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [EFI Redfish Host Interface PATCH v2 6/6] RedfishPkg: Changes on RedfishPkg for CI test
  2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 6/6] RedfishPkg: Changes on RedfishPkg for CI test Abner Chang
@ 2020-11-02  3:52   ` Nickle Wang
  0 siblings, 0 replies; 11+ messages in thread
From: Nickle Wang @ 2020-11-02  3:52 UTC (permalink / raw)
  To: Chang, Abner (HPS SW/FW Technologist), devel@edk2.groups.io
  Cc: Jiaxin Wu, Siyuan Fu, Fan Wang, Jiewen Yao

Reviewed-by: Nickle Wang <nickle.wang@hpe.com>

> -----Original Message-----
> From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> Sent: Friday, October 30, 2020 6:02 PM
> To: devel@edk2.groups.io
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>; Siyuan Fu <siyuan.fu@intel.com>; Fan
> Wang <fan.wang@intel.com>; Jiewen Yao <jiewen.yao@intel.com>; Wang,
> Nickle (HPS SW) <nickle.wang@hpe.com>
> Subject: [EFI Redfish Host Interface PATCH v2 6/6] RedfishPkg: Changes on
> RedfishPkg for CI test
> 
> Add accepted dependency of RedfishPkg in RedfishPkg CI yaml file.
> 
> 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: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Nickle Wang <nickle.wang@hpe.com>
> Reviewed-by: Nickle Wang <nickle.wang@hpe.com>
> ---
>  RedfishPkg/RedfishPkg.ci.yaml | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/RedfishPkg/RedfishPkg.ci.yaml b/RedfishPkg/RedfishPkg.ci.yaml
> index 75c3b6a8ad..bb3b8b6746 100644
> --- a/RedfishPkg/RedfishPkg.ci.yaml
> +++ b/RedfishPkg/RedfishPkg.ci.yaml
> @@ -29,7 +29,8 @@
>          "AcceptableDependencies": [
>              "MdePkg/MdePkg.dec",
>              "MdeModulePkg/MdeModulePkg.dec",
> -            "NetworkPkg/NetworkPkg.dec"
> +            "NetworkPkg/NetworkPkg.dec",
> +            "RedfishPkg/RedfishPkg.dec"
>          ],
>          # For host based unit tests
>          "AcceptableDependencies-HOST_APPLICATION":[],
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-11-02  3:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-30 10:02 [EFI Redfish Host Interface PATCH v2 0/6] Create SMBIOS type 42 record Abner Chang
2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 1/6] RedfishPkg/Include: Definitions of SMBIOS Redfish Host Interface Abner Chang
2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 2/6] RedfishPkg/Include: PlatformHostInterfaceLib header file Abner Chang
2020-11-02  3:51   ` Nickle Wang
2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 3/6] RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib Abner Chang
2020-11-02  3:51   ` Nickle Wang
2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 4/6] RedfishPkg/RedfishHostInterfaceDxe: Create SMBIOS type 42 record Abner Chang
2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 5/6] RedfishPkg: Add RedfishHostInterfaceDxe to RedfishPkg Abner Chang
2020-11-02  3:52   ` Nickle Wang
2020-10-30 10:02 ` [EFI Redfish Host Interface PATCH v2 6/6] RedfishPkg: Changes on RedfishPkg for CI test Abner Chang
2020-11-02  3:52   ` Nickle Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox