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

@@ -3,6 +3,7 @@
(C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
Copyright (c) 2022, AMD Incorporated. All rights reserved.
Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -102,7 +103,7 @@ typedef struct {
UINT32 SubnetAddrInfoIPv6Number; ///< IPv6 address info number.
EFI_IP6_ADDRESS_INFO *SubnetAddrInfoIPv6; ///< IPv6 address info.
//
// Network interface protocol and REST EX infor.
// Network interface protocol and REST EX info.
//
UINT32 NetworkProtocolType; ///< Network protocol type. Refer to
///< NETWORK_INTERFACE_PROTOCOL_TYPE.
@@ -112,7 +113,7 @@ typedef struct {
// EFI_REDFISH_DISCOVER_PROTOCOL instance installed
// on this network interface.
//
EFI_HANDLE EfiRedfishDiscoverProtocolHandle; ///< EFI_REDFISH_DISCOVER_PROTOTOCOL instance installed
EFI_HANDLE EfiRedfishDiscoverProtocolHandle; ///< EFI_REDFISH_DISCOVER_PROTOCOL instance installed
///< on this network interface.
} EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL;
@@ -123,7 +124,7 @@ typedef struct {
LIST_ENTRY Entry; ///< Link list entry.
EFI_HANDLE OpenDriverAgentHandle; ///< The agent to open network protocol.
EFI_HANDLE OpenDriverControllerHandle; ///< The controller handle to open network protocol.
EFI_HANDLE RestExChildHandle; ///< The child handle created throught REST EX Service Protocol.
EFI_HANDLE RestExChildHandle; ///< The child handle created through REST EX Service Protocol.
EFI_HANDLE RestExControllerHandle; ///< The controller handle which provide REST EX protocol.
EFI_REST_EX_PROTOCOL *RestExProtocolInterface; ///< Pointer to EFI_REST_EX_PROTOCOL.
UINT32 RestExId; ///< The identifier installed on REST EX controller handle.
@@ -178,15 +179,18 @@ typedef struct {
EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *NetworkInterface; ///< EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL
///< instance used to discover Redfish service.
//
// Below for Host insterface discovery.
// Below for Host interface discovery.
//
BOOLEAN HostIntfValidation; ///< Indicates whether to validate Redfish Host interface.
EFI_IP_ADDRESS TargetIpAddress; ///< Target IP address reported in Redfish Host interface.
UINT8 HostAddrFormat; ///< Unknown=00h, Ipv4=01h, Ipv6=02h.
EFI_IP_ADDRESS HostIpAddress; ///< Host IP address reported in Redfish Host interface.
EFI_IP_ADDRESS HostSubnetMask; ///< Host subnet mask address reported in Redfish Host interface.
} EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE;
/**
The function adds a new foudn Redfish service to internal list and
notify clinet.
The function adds a new found Redfish service to internal list and
notify client.
It simply frees the packet.
@@ -197,7 +201,7 @@ typedef struct {
@param[in] Os OS string.
@param[in] OsVer OS version string.
@param[in] Product Product string.
@param[in] ProductVer Product verison string.
@param[in] ProductVer Product version string.
@param[in] UseHttps Redfish service requires secured connection.
@retval EFI_SUCCESS Redfish service is added to list successfully.
@@ -224,7 +228,7 @@ AddAndSignalNewRedfishService (
@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.
**/