]> git.proxmox.com Git - mirror_edk2.git/commitdiff
RedfishPkg/Include: Definitions of SMBIOS Redfish Host Interface
authorAbner Chang <abner.chang@hpe.com>
Tue, 13 Oct 2020 01:22:16 +0000 (09:22 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 2 Nov 2020 05:50:17 +0000 (05:50 +0000)
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>
Reviewed-by: Nickle Wang <nickle.wang@hpe.com>
RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h [new file with mode: 0644]

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