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