public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Abner Chang" <abner.chang@hpe.com>
To: devel@edk2.groups.io
Cc: Jiaxin Wu <jiaxin.wu@intel.com>, Siyuan Fu <siyuan.fu@intel.com>,
	Fan Wang <fan.wang@intel.com>, Jiewen Yao <jiewen.yao@intel.com>,
	Nickle Wang <nickle.wang@hpe.com>
Subject: [EFI Redfish Host Interface PATCH 1/5] RedfishPkg/Include: Definitions of SMBIOS Redfish Host Interface
Date: Tue, 13 Oct 2020 12:08:01 +0800	[thread overview]
Message-ID: <20201013040805.20523-2-abner.chang@hpe.com> (raw)
In-Reply-To: <20201013040805.20523-1-abner.chang@hpe.com>

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


  reply	other threads:[~2020-10-13  4:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2020-10-29  6:07   ` [EFI Redfish Host Interface PATCH 1/5] RedfishPkg/Include: Definitions of SMBIOS Redfish Host Interface 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

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20201013040805.20523-2-abner.chang@hpe.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

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

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