RedfishHostInterface.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /** @file
  2. This file defines the Redfish Interface Specific Data.
  3. Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
  4. (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
  5. SPDX-License-Identifier: BSD-2-Clause-Patent
  6. **/
  7. #ifndef REDFISH_HOST_INTERFACE_
  8. #define REDFISH_HOST_INTERFACE_
  9. #include <IndustryStandard/SmBios.h>
  10. #define REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB 0x02 // We don't support this type of interface.
  11. // Use REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB_V2 instead.
  12. #define REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE 0x03 // We don't support this type of interface.
  13. // Use REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2 instead.
  14. #define REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB_V2 0x04
  15. #define REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2 0x05
  16. #define REDFISH_HOST_INTERFACE_HOST_IP_ASSIGNMENT_TYPE_UNKNOWN 0x00
  17. #define REDFISH_HOST_INTERFACE_HOST_IP_ASSIGNMENT_TYPE_STATIC 0x01
  18. #define REDFISH_HOST_INTERFACE_HOST_IP_ASSIGNMENT_TYPE_DHCP 0x02
  19. #define REDFISH_HOST_INTERFACE_HOST_IP_ASSIGNMENT_TYPE_AUTO_CONFIGURE 0x03
  20. #define REDFISH_HOST_INTERFACE_HOST_IP_ASSIGNMENT_TYPE_HOST_SELECTED 0x04
  21. #define REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_UNKNOWN 0x00
  22. #define REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP4 0x01
  23. #define REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP6 0x02
  24. #pragma pack(1)
  25. ///
  26. /// Structure definitions of Host Interface device type 04h (USB Network Interface V2)
  27. ///
  28. typedef struct {
  29. UINT8 Length; ///< Length of the structure, including Device Type
  30. ///< and Length fields.
  31. UINT16 IdVendor; ///< The Vendor ID of the device, as read from the
  32. ///< idVendor field of the USB descriptor.
  33. UINT16 IdProduct; ///< The Product ID of the device, as read from the
  34. ///< idProduct field of the USB descriptor.
  35. UINT8 SecialNumberStr; ///< The string number for the Serial Number of the
  36. ///< device. The string data is read from the
  37. ///< iSerialNumber.bDescriptorType field of the USB
  38. ///< descriptor, and is converted from Unicode to ASCII
  39. ///< and is NULL terminated.
  40. UINT8 MacAddress[6]; ///< The MAC address of the PCI/PCIe network device.
  41. } USB_INTERFACE_DEVICE_DESCRIPTOR_V2;
  42. //
  43. // Structure definitions of Host Interface device type 05h (PCI/PCIE V2)
  44. //
  45. typedef struct {
  46. UINT8 Length; ///< Length of the structure, including Device Type and Length fields.
  47. UINT16 VendorId; ///< The Vendor ID of the PCI/PCIe device.
  48. UINT16 DeviceId; ///< The Device ID of the PCI/PCIe device.
  49. UINT16 SubsystemVendorId; ///< The Subsystem Vendor ID of the PCI/PCIe device.
  50. UINT16 SubsystemId; ///< The Subsystem ID of the PCI/PCIe device.
  51. UINT8 MacAddress[6]; ///< The MAC address of the PCI/PCIe network device.
  52. UINT16 SegmemtGroupNumber; ///< The Segment Group Number of the PCI/PCIe.
  53. UINT8 BusNumber; ///< The Bus Number of the PCI/PCIe device.
  54. UINT8 DeviceFunctionNumber; ///< The Device/Function Number of the PCI/PCIe.
  55. } PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2;
  56. ///
  57. /// Structure definitions of Host Interface device type 80-FFh (OEM)
  58. ///
  59. typedef struct {
  60. UINT32 VendorIana; ///< The IANA code for the vendor (MSB first).
  61. UINT8 OemDefinedData[1]; ///< OEM defined data.
  62. } OEM_DEVICE_DESCRIPTOR;
  63. ///
  64. /// Define union for the Host Interface Device Descriptor
  65. ///
  66. typedef union {
  67. USB_INTERFACE_DEVICE_DESCRIPTOR_V2 UsbDeviceV2; ///< Device type USB V2 device discriptor.
  68. PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2 PciPcieDeviceV2; ///< Device type PCI/PCIe V2 device discriptor.
  69. OEM_DEVICE_DESCRIPTOR OemDevice; ///< OEM type device discriptor.
  70. } DEVICE_DESCRITOR; /// Device descriptor data formated based on Device Type.
  71. ///
  72. /// Interface Specific Data starts at offset 06h of the SMBIOS Type 42 struct.
  73. /// This table defines the Interface Specific data for Interface Type 40h. There
  74. /// are 3 types of Device Descriptor3 defined , however only 1 may be used in
  75. /// specific Tape 42 table.
  76. ///
  77. typedef struct {
  78. UINT8 DeviceType; ///< The Device Type of the interface.
  79. DEVICE_DESCRITOR DeviceDescriptor; ///< The Device descriptor.
  80. } REDFISH_INTERFACE_DATA;
  81. //
  82. // the protocol-specific data for the "Redfish Over IP" protocol
  83. //
  84. typedef struct {
  85. EFI_GUID ServiceUuid; // same as Redfish Service UUID in Redfish Service Root resource
  86. //
  87. // Unknown=00h,
  88. // Static=01h,
  89. // DHCP=02h,
  90. // AutoConfigure=03h,
  91. // HostSelected=04h,
  92. // other values reserved
  93. //
  94. UINT8 HostIpAssignmentType;
  95. //
  96. // Unknown=00h,
  97. // Ipv4=01h,
  98. // Ipv6=02h,
  99. // other values reserved
  100. //
  101. UINT8 HostIpAddressFormat;
  102. //
  103. // Used for Static and AutoConfigure.
  104. // For IPV4, use the first 4 Bytes and zero fill the remaining bytes.
  105. //
  106. UINT8 HostIpAddress[16];
  107. //
  108. // Used for Static and AutoConfigure.
  109. // For IPV4, use the first 4 Bytes and zero fill the remaining bytes.
  110. //
  111. UINT8 HostIpMask[16];
  112. //
  113. // Unknown=00h,
  114. // Static=01h,
  115. // DHCP=02h,
  116. // AutoConfigure=03h,
  117. // HostSelected=04h,
  118. // other values reserved
  119. //
  120. UINT8 RedfishServiceIpDiscoveryType;
  121. //
  122. // Unknown=00h,
  123. // Ipv4=01h,
  124. // Ipv6=02h,
  125. // other values reserved
  126. //
  127. UINT8 RedfishServiceIpAddressFormat;
  128. //
  129. // Used for Static and AutoConfigure.
  130. // For IPV4, use the first 4 Bytes and zero fill the remaining bytes.
  131. //
  132. UINT8 RedfishServiceIpAddress[16];
  133. //
  134. // Used for Static and AutoConfigure.
  135. // For IPV4, use the first 4 Bytes and zero fill the remaining bytes.
  136. //
  137. UINT8 RedfishServiceIpMask[16];
  138. UINT16 RedfishServiceIpPort; // Used for Static and AutoConfigure.
  139. UINT32 RedfishServiceVlanId; // Used for Static and AutoConfigure.
  140. UINT8 RedfishServiceHostnameLength; // length of the following hostname string
  141. UINT8 RedfishServiceHostname[1]; // hostname of Redfish Service
  142. } REDFISH_OVER_IP_PROTOCOL_DATA;
  143. #pragma pack()
  144. #endif