From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Permerror (SPF Permanent Error: More than 10 MX records returned) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=siyuan.fu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5491B220EE103 for ; Tue, 12 Dec 2017 23:26:20 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Dec 2017 23:30:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,397,1508828400"; d="scan'208";a="11437919" Received: from sfu5-mobl.ccr.corp.intel.com ([10.239.192.226]) by FMSMGA003.fm.intel.com with ESMTP; 12 Dec 2017 23:30:58 -0800 From: Fu Siyuan To: edk2-devel@lists.01.org Cc: Ye Ting , Wu Jiaxin , Wang Fan Date: Wed, 13 Dec 2017 15:30:55 +0800 Message-Id: <20171213073055.13668-1-siyuan.fu@intel.com> X-Mailer: git-send-email 2.13.0.windows.1 Subject: [Patch] MdeModulePkg/IpIoDxe: Update API description to match the function implementation. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Dec 2017 07:26:20 -0000 This patch updates some API descriptions in DxeIpIoLib to match the real implementation. Cc: Ye Ting Cc: Wu Jiaxin Cc: Wang Fan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan --- MdeModulePkg/Include/Library/IpIoLib.h | 4 ++++ MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c | 34 +++++++++++++++++++++------- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/MdeModulePkg/Include/Library/IpIoLib.h b/MdeModulePkg/Include/Library/IpIoLib.h index aab0c68059..ecb3f11e5c 100644 --- a/MdeModulePkg/Include/Library/IpIoLib.h +++ b/MdeModulePkg/Include/Library/IpIoLib.h @@ -385,6 +385,7 @@ IpIoStop ( successfully. @retval EFI_ACCESS_DENIED The IP_IO instance is configured; avoid reopening it. + @retval EFI_UNSUPPORTED IPv4 RawData mode is no supported. @retval Others An error condition occurred. **/ @@ -416,6 +417,7 @@ IpIoOpen ( @retval EFI_SUCCESS The operation completed successfully. @retval EFI_NOT_STARTED The IpIo is not configured. @retval EFI_OUT_OF_RESOURCES Failed due to resource limitations. + @retval Others Error condition occurred. **/ EFI_STATUS @@ -541,6 +543,7 @@ IpIoFindSender ( @param[out] IsHard If TRUE, indicates that it is a hard error. @param[out] Notify If TRUE, SockError needs to be notified. + @retval EFI_UNSUPPORTED Unrecognizable ICMP error code @return The ICMP Error Status, such as EFI_NETWORK_UNREACHABLE. **/ @@ -574,6 +577,7 @@ IpIoGetIcmpErrStatus ( @retval EFI_INVALID_PARAMETER The Neighbor Address is invalid. @retval EFI_NOT_FOUND The neighbor cache entry is not in the neighbor table. + @retval EFI_UNSUPPORTED IP version is IPv4, which doesn't support neighbor cache refresh. @retval EFI_OUT_OF_RESOURCES Failed due to resource limitations. **/ diff --git a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c index abc07fb0ff..c880818d42 100644 --- a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c +++ b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c @@ -129,6 +129,7 @@ IpIoTransmitHandler ( @retval EFI_SUCCESS The IP child is created and the IP protocol interface is retrieved. + @retval EFI_UNSUPPORTED Upsupported IpVersion. @retval Others The required operation failed. **/ @@ -206,6 +207,7 @@ IpIoCreateIpChildOpenProtocol ( @retval EFI_SUCCESS The IP protocol is closed and the relevant IP child is destroyed. + @retval EFI_UNSUPPORTED Upsupported IpVersion. @retval Others The required operation failed. **/ @@ -1276,6 +1278,7 @@ ReleaseIpIo: successfully. @retval EFI_ACCESS_DENIED The IP_IO instance is configured, avoid to reopen it. + @retval EFI_UNSUPPORTED IPv4 RawData mode is no supported. @retval Others Error condition occurred. **/ @@ -1488,20 +1491,28 @@ IpIoDestroy ( IN OUT IP_IO *IpIo ) { + EFI_STATUS Status; + // // Stop the IpIo. // - IpIoStop (IpIo); + Status = IpIoStop (IpIo); + if (EFI_ERROR (Status)) { + return Status; + } // // Close the IP protocol and destroy the child. // - IpIoCloseProtocolDestroyIpChild ( - IpIo->Controller, - IpIo->Image, - IpIo->ChildHandle, - IpIo->IpVersion - ); + Status = IpIoCloseProtocolDestroyIpChild ( + IpIo->Controller, + IpIo->Image, + IpIo->ChildHandle, + IpIo->IpVersion + ); + if (EFI_ERROR (Status)) { + return Status; + } gBS->FreePool (IpIo); @@ -1530,6 +1541,7 @@ IpIoDestroy ( @retval EFI_SUCCESS The operation is completed successfully. @retval EFI_NOT_STARTED The IpIo is not configured. @retval EFI_OUT_OF_RESOURCES Failed due to resource limit. + @retval Others Error condition occurred. **/ EFI_STATUS @@ -2044,6 +2056,7 @@ IpIoFindSender ( @param[out] IsHard If TRUE, indicates that it is a hard error. @param[out] Notify If TRUE, SockError needs to be notified. + @retval EFI_UNSUPPORTED Unrecognizable ICMP error code. @return ICMP Error Status, such as EFI_NETWORK_UNREACHABLE. **/ @@ -2162,6 +2175,7 @@ IpIoGetIcmpErrStatus ( @retval EFI_INVALID_PARAMETER Neighbor Address is invalid. @retval EFI_NOT_FOUND The neighbor cache entry is not in the neighbor table. + @retval EFI_UNSUPPORTED IP version is IPv4, which doesn't support neighbor cache refresh. @retval EFI_OUT_OF_RESOURCES Failed due to resource limit. **/ @@ -2174,10 +2188,14 @@ IpIoRefreshNeighbor ( { EFI_IP6_PROTOCOL *Ip; - if (!IpIo->IsConfigured || IpIo->IpVersion != IP_VERSION_6) { + if (!IpIo->IsConfigured) { return EFI_NOT_STARTED; } + if (IpIo->IpVersion != IP_VERSION_6) { + return EFI_UNSUPPORTED; + } + Ip = IpIo->Ip.Ip6; return Ip->Neighbors (Ip, FALSE, &Neighbor->v6, NULL, Timeout, TRUE); -- 2.13.0.windows.1