RedfishPkg: Redfish discover driver improvement

Bug fix:
- function stack fault
- properly handle "SubnetAddrInfoIPv6" when there is no IPv6 support
- copy-n-paste error in RedfishGetHostInterfaceProtocolData()
- fix typo
Enhancement:
- Redfish discover driver now can configure host IP address based on
  the information from SMBIOS type 42 record. This saves the effort of
  configuring host IP address in setup menu.
- Performance improvement to driver binding process. Redfish discover
  driver will wait until all required drivers are ready and do driver
  binding start().
- Use CopyGuid() to copy GUID instead of intrinsic function.
- Error handling when SMBIOS data is corrupted.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
This commit is contained in:
Nickle Wang
2023-03-27 22:28:58 +08:00
committed by mergify[bot]
parent c2abf77116
commit 0cd7542a69
3 changed files with 120 additions and 57 deletions

View File

@@ -4,6 +4,7 @@
Discover Redfish SMBIOS Host Interface.
(C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -22,7 +23,7 @@ SMBIOS_TABLE_TYPE42 *mType42Record;
@param[out] DeviceDescriptor Pointer to REDFISH_INTERFACE_DATA.
@param[out] ProtocolData Pointer to REDFISH_OVER_IP_PROTOCOL_DATA.
@retval EFI_SUCCESS Get host interface succesfully.
@retval EFI_SUCCESS Get host interface successfully.
@retval Otherwise Fail to tet host interface.
**/
@@ -69,9 +70,15 @@ RedfishGetHostInterfaceProtocolData (
//
if ((*RecordTmp == REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2) || (*RecordTmp == REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB_V2)) {
if (*RecordTmp == REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2) {
ASSERT (SpecificDataLen == sizeof (PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2) + 1);
if (SpecificDataLen != sizeof (PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2) + 1) {
ASSERT (SpecificDataLen == sizeof (PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2) + 1);
return EFI_VOLUME_CORRUPTED;
}
} else {
ASSERT (SpecificDataLen > sizeof (REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB_V2) + 1);
if (SpecificDataLen != sizeof (USB_INTERFACE_DEVICE_DESCRIPTOR_V2) + 1) {
ASSERT (SpecificDataLen == sizeof (USB_INTERFACE_DEVICE_DESCRIPTOR_V2) + 1);
return EFI_VOLUME_CORRUPTED;
}
}
*DeviceDescriptor = (REDFISH_INTERFACE_DATA *)RecordTmp;