38 EFI_SMBIOS_HANDLE SmbiosHandle;
43 UINT8 SpecificDataLen;
45 if ((Smbios ==
NULL) || (ProtocolData ==
NULL)) {
46 return EFI_INVALID_PARAMETER;
50 Status = Smbios->GetNext (Smbios, &SmbiosHandle,
NULL, &Record,
NULL);
52 if (Record->Type == SMBIOS_TYPE_MANAGEMENT_CONTROLLER_HOST_INTERFACE) {
57 if (mType42Record->
InterfaceType == MCHostInterfaceTypeNetworkHostInterface) {
58 ASSERT (Record->Length >= 9);
59 Offset = REDFISH_HI_ITERFACE_SPECIFIC_DATA_LENGTH_OFFSET;
60 RecordTmp = (UINT8 *)Record + Offset;
64 SpecificDataLen = *RecordTmp;
66 RecordTmp = (UINT8 *)Record + Offset;
71 if ((*RecordTmp == REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2) || (*RecordTmp == REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB_V2)) {
72 if (*RecordTmp == REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2) {
76 return EFI_VOLUME_CORRUPTED;
82 return EFI_VOLUME_CORRUPTED;
87 Offset = Offset + SpecificDataLen;
88 RecordTmp = (UINT8 *)Record + Offset;
92 ASSERT (*RecordTmp == 1);
94 RecordTmp = (UINT8 *)Record + Offset;
98 if (*RecordTmp == MCHostInterfaceProtocolTypeRedfishOverIP) {
100 RecordTmp = (UINT8 *)Record + Offset;
101 ProtocolLength = *RecordTmp;
104 RecordTmp = (UINT8 *)Record + Offset;
113 "%a: Length of protocol specific data is not match: %d != ProtocolLength(%d).\n",
118 return EFI_SECURITY_VIOLATION;
121 Offset += ProtocolLength;
125 if (Offset > mType42Record->Hdr.Length) {
128 "%a: Offset (%d) > mType42Record->Hdr.Length (%d).\n",
131 mType42Record->Hdr.Length
133 return EFI_SECURITY_VIOLATION;
143 Status = Smbios->GetNext (Smbios, &SmbiosHandle,
NULL, &Record,
NULL);
146 *ProtocolData =
NULL;
147 return EFI_NOT_FOUND;
#define SMBIOS_HANDLE_PI_RESERVED
#define DEBUG(Expression)
EFI_STATUS RedfishGetHostInterfaceProtocolData(IN EFI_SMBIOS_PROTOCOL *Smbios, OUT REDFISH_INTERFACE_DATA **DeviceDescriptor, OUT REDFISH_OVER_IP_PROTOCOL_DATA **ProtocolData)
Device descriptor data formated based on Device Type.
UINT8 InterfaceType
The enumeration value from MC_HOST_INTERFACE_TYPE.