summaryrefslogtreecommitdiffstats
path: root/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c
diff options
context:
space:
mode:
authorNickle Wang <nicklew@nvidia.com>2023-03-27 22:28:58 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-03-29 09:22:35 +0000
commit0cd7542a69943c8c006316b4aa1cc74cc1748155 (patch)
tree4c753add33482fc74627310d9a6f42be7b484ade /RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c
parentc2abf77116df96e1202cd132230a0c9031e1016f (diff)
downloadedk2-0cd7542a69943c8c006316b4aa1cc74cc1748155.tar.gz
edk2-0cd7542a69943c8c006316b4aa1cc74cc1748155.tar.bz2
edk2-0cd7542a69943c8c006316b4aa1cc74cc1748155.zip
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>
Diffstat (limited to 'RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c')
-rw-r--r--RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c b/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c
index 88cec1f416..0d6edc7dc3 100644
--- a/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c
+++ b/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c
@@ -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;