public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [EFI Redfish Host Interface PATCH 0/5] Create SMBIOS type 42 record
@ 2020-10-13  4:08 Abner Chang
  2020-10-13  4:08 ` [EFI Redfish Host Interface PATCH 1/5] RedfishPkg/Include: Definitions of SMBIOS Redfish Host Interface Abner Chang
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Abner Chang @ 2020-10-13  4:08 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
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 (5):
  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

 .../IndustryStandard/RedfishHostInterface.h   | 165 ++++++++++++
 .../Include/Library/RedfishHostInterfaceLib.h |  52 ++++
 .../PlatformHostInterfaceLibNull.c            |  53 ++++
 .../PlatformHostInterfaceLibNull.inf          |  34 +++
 .../RedfishHostInterfaceDxe.c                 | 243 ++++++++++++++++++
 .../RedfishHostInterfaceDxe.inf               |  50 ++++
 RedfishPkg/RedfishPkg.dec                     |   3 +
 RedfishPkg/RedfishPkg.dsc                     |   6 +
 8 files changed, 606 insertions(+)
 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] 14+ messages in thread

* [EFI Redfish Host Interface PATCH 1/5] RedfishPkg/Include: Definitions of SMBIOS Redfish Host Interface
  2020-10-13  4:08 [EFI Redfish Host Interface PATCH 0/5] Create SMBIOS type 42 record Abner Chang
@ 2020-10-13  4:08 ` Abner Chang
  2020-10-29  6:07   ` Nickle Wang
  2020-10-13  4:08 ` [EFI Redfish Host Interface PATCH 2/5] RedfishPkg/Include: PlatformHostInterfaceLib header file Abner Chang
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Abner Chang @ 2020-10-13  4:08 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   | 165 ++++++++++++++++++
 RedfishPkg/RedfishPkg.dec                     |   3 +
 2 files changed, 168 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..981f8a0cfb
--- /dev/null
+++ b/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h
@@ -0,0 +1,165 @@
+/** @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;
+
+///
+///  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.
+  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.
+  } DeviceDescriptor; /// Device descriptor data formated based on Device Type.
+
+} 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
+
diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index e95ec5fe10..de3611252e 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -13,6 +13,9 @@
   PACKAGE_GUID      = c432b76e-5232-11e7-9010-005056c00008
   PACKAGE_VERSION   = 1.0
 
+[Includes]
+  Include
+
 [Guids]
   gEfiRedfishPkgTokenSpaceGuid      = { 0x4fdbccb7, 0xe829, 0x4b4c, { 0x88, 0x87, 0xb2, 0x3f, 0xd7, 0x25, 0x4b, 0x85 }}
 
-- 
2.17.1


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

* [EFI Redfish Host Interface PATCH 2/5] RedfishPkg/Include: PlatformHostInterfaceLib header file
  2020-10-13  4:08 [EFI Redfish Host Interface PATCH 0/5] Create SMBIOS type 42 record Abner Chang
  2020-10-13  4:08 ` [EFI Redfish Host Interface PATCH 1/5] RedfishPkg/Include: Definitions of SMBIOS Redfish Host Interface Abner Chang
@ 2020-10-13  4:08 ` Abner Chang
  2020-10-29  6:24   ` Nickle Wang
  2020-10-13  4:08 ` [EFI Redfish Host Interface PATCH 3/5] RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib Abner Chang
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Abner Chang @ 2020-10-13  4:08 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..870109e09a
--- /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[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
+);
+/**
+  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
+);
+#endif
-- 
2.17.1


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

* [EFI Redfish Host Interface PATCH 3/5] RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib
  2020-10-13  4:08 [EFI Redfish Host Interface PATCH 0/5] Create SMBIOS type 42 record Abner Chang
  2020-10-13  4:08 ` [EFI Redfish Host Interface PATCH 1/5] RedfishPkg/Include: Definitions of SMBIOS Redfish Host Interface Abner Chang
  2020-10-13  4:08 ` [EFI Redfish Host Interface PATCH 2/5] RedfishPkg/Include: PlatformHostInterfaceLib header file Abner Chang
@ 2020-10-13  4:08 ` Abner Chang
  2020-10-29  6:27   ` Nickle Wang
  2020-10-13  4:08 ` [EFI Redfish Host Interface PATCH 4/5] RedfishPkg/RedfishHostInterfaceDxe: Create SMBIOS type 42 record Abner Chang
  2020-10-13  4:08 ` [EFI Redfish Host Interface PATCH 5/5] RedfishPkg: Add RedfishHostInterfaceDxe to RedfishPkg Abner Chang
  4 siblings, 1 reply; 14+ messages in thread
From: Abner Chang @ 2020-10-13  4:08 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            | 53 +++++++++++++++++++
 .../PlatformHostInterfaceLibNull.inf          | 34 ++++++++++++
 2 files changed, 87 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..7653f22d25
--- /dev/null
+++ b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.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/RedfishHostInterfaceLib.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/PlatformHostInterfaceLibNull.inf b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.inf
new file mode 100644
index 0000000000..bb840ce3cb
--- /dev/null
+++ b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.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
+#
+
+[Sources]
+  PlatformHostInterfaceLibNull.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  RedfishPkg/RedfishPkg.dec
+
+[LibraryClasses]
+  UefiLib
+  BaseLib
+  DebugLib
+
-- 
2.17.1


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

* [EFI Redfish Host Interface PATCH 4/5] RedfishPkg/RedfishHostInterfaceDxe: Create SMBIOS type 42 record
  2020-10-13  4:08 [EFI Redfish Host Interface PATCH 0/5] Create SMBIOS type 42 record Abner Chang
                   ` (2 preceding siblings ...)
  2020-10-13  4:08 ` [EFI Redfish Host Interface PATCH 3/5] RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib Abner Chang
@ 2020-10-13  4:08 ` Abner Chang
  2020-10-29  6:30   ` Nickle Wang
  2020-10-13  4:08 ` [EFI Redfish Host Interface PATCH 5/5] RedfishPkg: Add RedfishHostInterfaceDxe to RedfishPkg Abner Chang
  4 siblings, 1 reply; 14+ messages in thread
From: Abner Chang @ 2020-10-13  4:08 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..6c1f60bca5
--- /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] 14+ messages in thread

* [EFI Redfish Host Interface PATCH 5/5] RedfishPkg: Add RedfishHostInterfaceDxe to RedfishPkg
  2020-10-13  4:08 [EFI Redfish Host Interface PATCH 0/5] Create SMBIOS type 42 record Abner Chang
                   ` (3 preceding siblings ...)
  2020-10-13  4:08 ` [EFI Redfish Host Interface PATCH 4/5] RedfishPkg/RedfishHostInterfaceDxe: Create SMBIOS type 42 record Abner Chang
@ 2020-10-13  4:08 ` Abner Chang
  2020-10-29  6:37   ` Nickle Wang
  4 siblings, 1 reply; 14+ messages in thread
From: Abner Chang @ 2020-10-13  4:08 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.dsc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc
index 8acadddefc..be6996b203 100644
--- a/RedfishPkg/RedfishPkg.dsc
+++ b/RedfishPkg/RedfishPkg.dsc
@@ -38,3 +38,9 @@
   DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
   DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
   ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
+  RedfishPlatformHostInterfaceLib|RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.inf
+
+[Components]
+  RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.inf
+
+  RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf
-- 
2.17.1


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

* Re: [EFI Redfish Host Interface PATCH 1/5] RedfishPkg/Include: Definitions of SMBIOS Redfish Host Interface
  2020-10-13  4:08 ` [EFI Redfish Host Interface PATCH 1/5] RedfishPkg/Include: Definitions of SMBIOS Redfish Host Interface Abner Chang
@ 2020-10-29  6:07   ` Nickle Wang
  0 siblings, 0 replies; 14+ messages in thread
From: Nickle Wang @ 2020-10-29  6:07 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: Tuesday, October 13, 2020 12:08 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 1/5] RedfishPkg/Include:
> Definitions of SMBIOS Redfish Host Interface
> 
> 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   | 165 ++++++++++++++++++
>  RedfishPkg/RedfishPkg.dec                     |   3 +
>  2 files changed, 168 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..981f8a0cfb
> --- /dev/null
> +++ b/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h
> @@ -0,0 +1,165 @@
> +/** @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_CONFIGU
> RE     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;
> +
> +///
> +///  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.
> +  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.
> +  } DeviceDescriptor; /// Device descriptor data formated based on Device
> Type.
> +
> +} 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
> +
> diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
> index e95ec5fe10..de3611252e 100644
> --- a/RedfishPkg/RedfishPkg.dec
> +++ b/RedfishPkg/RedfishPkg.dec
> @@ -13,6 +13,9 @@
>    PACKAGE_GUID      = c432b76e-5232-11e7-9010-005056c00008
>    PACKAGE_VERSION   = 1.0
> 
> +[Includes]
> +  Include
> +
>  [Guids]
>    gEfiRedfishPkgTokenSpaceGuid      = { 0x4fdbccb7, 0xe829, 0x4b4c, { 0x88,
> 0x87, 0xb2, 0x3f, 0xd7, 0x25, 0x4b, 0x85 }}
> 
> --
> 2.17.1


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

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

Hi Abner,

I found that the parameter is not defined as it is described in function header. Please check my comment inline below.

Thanks,
Nickle

> -----Original Message-----
> From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> Sent: Tuesday, October 13, 2020 12:08 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 2/5] 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..870109e09a
> --- /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[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
In the function header, they are OUT parameter but they are defined as IN here.

> +);
> +/**
> +  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,
This is IN and OUT, right? If not, the function header needs modification.

> +  IN UINT8  IndexOfProtocolData
> +);
> +#endif
> --
> 2.17.1


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

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

Hi Abner,

I do not see any usage of DEBUG macro in this NULL library so maybe "DebugLib" could be removed from INF file.

Thanks,
Nickle

> -----Original Message-----
> From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> Sent: Tuesday, October 13, 2020 12:08 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 3/5]
> 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            | 53 +++++++++++++++++++
>  .../PlatformHostInterfaceLibNull.inf          | 34 ++++++++++++
>  2 files changed, 87 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..7653f22d25
> --- /dev/null
> +++
> b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLi
> bNull.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/RedfishHostInterfaceLib.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/PlatformHostInterfaceLi
> bNull.inf
> b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLi
> bNull.inf
> new file mode 100644
> index 0000000000..bb840ce3cb
> --- /dev/null
> +++
> b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLi
> bNull.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
> +#
> +
> +[Sources]
> +  PlatformHostInterfaceLibNull.c
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  RedfishPkg/RedfishPkg.dec
> +
> +[LibraryClasses]
> +  UefiLib
> +  BaseLib
> +  DebugLib
> +
> --
> 2.17.1


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

* Re: [EFI Redfish Host Interface PATCH 4/5] RedfishPkg/RedfishHostInterfaceDxe: Create SMBIOS type 42 record
  2020-10-13  4:08 ` [EFI Redfish Host Interface PATCH 4/5] RedfishPkg/RedfishHostInterfaceDxe: Create SMBIOS type 42 record Abner Chang
@ 2020-10-29  6:30   ` Nickle Wang
  0 siblings, 0 replies; 14+ messages in thread
From: Nickle Wang @ 2020-10-29  6:30 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: Tuesday, October 13, 2020 12:08 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 4/5]
> RedfishPkg/RedfishHostInterfaceDxe: Create SMBIOS type 42 record
> 
> 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..6c1f60bca5
> --- /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	[flat|nested] 14+ messages in thread

* Re: [EFI Redfish Host Interface PATCH 5/5] RedfishPkg: Add RedfishHostInterfaceDxe to RedfishPkg
  2020-10-13  4:08 ` [EFI Redfish Host Interface PATCH 5/5] RedfishPkg: Add RedfishHostInterfaceDxe to RedfishPkg Abner Chang
@ 2020-10-29  6:37   ` Nickle Wang
  2020-10-29 14:59     ` Abner Chang
  0 siblings, 1 reply; 14+ messages in thread
From: Nickle Wang @ 2020-10-29  6:37 UTC (permalink / raw)
  To: Chang, Abner (HPS SW/FW Technologist), devel@edk2.groups.io
  Cc: Jiaxin Wu, Siyuan Fu, Fan Wang, Jiewen Yao

Hi Abner,

Do we need to specify the library instance under [Components] section when they are specified in [LibraryClasses] already?

Thanks,
Nickle

> -----Original Message-----
> From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> Sent: Tuesday, October 13, 2020 12:08 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 5/5] 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.dsc | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc
> index 8acadddefc..be6996b203 100644
> --- a/RedfishPkg/RedfishPkg.dsc
> +++ b/RedfishPkg/RedfishPkg.dsc
> @@ -38,3 +38,9 @@
> 
> DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTabl
> eLib.inf
>    DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
> 
> ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/Dx
> eReportStatusCodeLib.inf
> +
> RedfishPlatformHostInterfaceLib|RedfishPkg/Library/PlatformHostInterface
> LibNull/PlatformHostInterfaceLibNull.inf
> +
> +[Components]
> +
> RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibN
> ull.inf
> +
> +  RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf
> --
> 2.17.1


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

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



> -----Original Message-----
> From: Wang, Nickle (HPS SW)
> Sent: Thursday, October 29, 2020 2:37 PM
> To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> 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>
> Subject: RE: [EFI Redfish Host Interface PATCH 5/5] RedfishPkg: Add
> RedfishHostInterfaceDxe to RedfishPkg
> 
> Hi Abner,
> 
> Do we need to specify the library instance under [Components] section
> when they are specified in [LibraryClasses] already?
Yes, we have to list the library provided by this package in [Components] section, CI also checks this.
> 
> Thanks,
> Nickle
> 
> > -----Original Message-----
> > From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> > Sent: Tuesday, October 13, 2020 12:08 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 5/5] 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.dsc | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc
> > index 8acadddefc..be6996b203 100644
> > --- a/RedfishPkg/RedfishPkg.dsc
> > +++ b/RedfishPkg/RedfishPkg.dsc
> > @@ -38,3 +38,9 @@
> >
> >
> DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTabl
> > eLib.inf
> >    DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
> >
> >
> ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/Dx
> > eReportStatusCodeLib.inf
> > +
> > RedfishPlatformHostInterfaceLib|RedfishPkg/Library/PlatformHostInterfa
> > RedfishPlatformHostInterfaceLib|ce
> > LibNull/PlatformHostInterfaceLibNull.inf
> > +
> > +[Components]
> > +
> > RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceL
> > ibN
> > ull.inf
> > +
> > +  RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf
> > --
> > 2.17.1


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

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

Hi Nickle,
I have addressed the feedbacks you gave to v1 on the v2 patches set.
Thanks
Abner

> -----Original Message-----
> From: Wang, Nickle (HPS SW)
> Sent: Thursday, October 29, 2020 2:27 PM
> To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> 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>
> Subject: RE: [EFI Redfish Host Interface PATCH 3/5]
> RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib
> 
> Hi Abner,
> 
> I do not see any usage of DEBUG macro in this NULL library so maybe
> "DebugLib" could be removed from INF file.
> 
> Thanks,
> Nickle
> 
> > -----Original Message-----
> > From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> > Sent: Tuesday, October 13, 2020 12:08 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 3/5]
> > 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            | 53 +++++++++++++++++++
> >  .../PlatformHostInterfaceLibNull.inf          | 34 ++++++++++++
> >  2 files changed, 87 insertions(+)
> >  create mode 100644
> > RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceL
> > ibN
> > ull.c
> >  create mode 100644
> > RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceL
> > ibN
> > ull.inf
> >
> > diff --git
> > a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfac
> > eLi
> > bNull.c
> > b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfac
> > eLi
> > bNull.c
> > new file mode 100644
> > index 0000000000..7653f22d25
> > --- /dev/null
> > +++
> > b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfac
> > eLi
> > bNull.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/RedfishHostInterfaceLib.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/PlatformHostInterfac
> > eLi
> > bNull.inf
> > b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfac
> > eLi
> > bNull.inf
> > new file mode 100644
> > index 0000000000..bb840ce3cb
> > --- /dev/null
> > +++
> > b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfac
> > eLi
> > bNull.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
> > +#
> > +
> > +[Sources]
> > +  PlatformHostInterfaceLibNull.c
> > +
> > +[Packages]
> > +  MdePkg/MdePkg.dec
> > +  MdeModulePkg/MdeModulePkg.dec
> > +  RedfishPkg/RedfishPkg.dec
> > +
> > +[LibraryClasses]
> > +  UefiLib
> > +  BaseLib
> > +  DebugLib
> > +
> > --
> > 2.17.1


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

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

Got it. Thanks.

Nickle

> -----Original Message-----
> From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> Sent: Thursday, October 29, 2020 10:59 PM
> To: Wang, Nickle (HPS SW) <nickle.wang@hpe.com>; 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>
> Subject: RE: [EFI Redfish Host Interface PATCH 5/5] RedfishPkg: Add
> RedfishHostInterfaceDxe to RedfishPkg
> 
> 
> 
> > -----Original Message-----
> > From: Wang, Nickle (HPS SW)
> > Sent: Thursday, October 29, 2020 2:37 PM
> > To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> > 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>
> > Subject: RE: [EFI Redfish Host Interface PATCH 5/5] RedfishPkg: Add
> > RedfishHostInterfaceDxe to RedfishPkg
> >
> > Hi Abner,
> >
> > Do we need to specify the library instance under [Components] section
> > when they are specified in [LibraryClasses] already?
> Yes, we have to list the library provided by this package in [Components]
> section, CI also checks this.
> >
> > Thanks,
> > Nickle
> >
> > > -----Original Message-----
> > > From: Chang, Abner (HPS SW/FW Technologist)
> <abner.chang@hpe.com>
> > > Sent: Tuesday, October 13, 2020 12:08 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 5/5] 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.dsc | 6 ++++++
> > >  1 file changed, 6 insertions(+)
> > >
> > > diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc
> > > index 8acadddefc..be6996b203 100644
> > > --- a/RedfishPkg/RedfishPkg.dsc
> > > +++ b/RedfishPkg/RedfishPkg.dsc
> > > @@ -38,3 +38,9 @@
> > >
> > >
> >
> DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTabl
> > > eLib.inf
> > >    DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
> > >
> > >
> >
> ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/Dx
> > > eReportStatusCodeLib.inf
> > > +
> > > RedfishPlatformHostInterfaceLib|RedfishPkg/Library/PlatformHostInter
> > > RedfishPlatformHostInterfaceLib|fa
> > > RedfishPlatformHostInterfaceLib|ce
> > > LibNull/PlatformHostInterfaceLibNull.inf
> > > +
> > > +[Components]
> > > +
> > > RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfac
> > > eL
> > > ibN
> > > ull.inf
> > > +
> > > +  RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf
> > > --
> > > 2.17.1


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

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

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

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