public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] MdeModulePkg/IpIoDxe: Update API description to match the function implementation.
@ 2017-12-13  7:30 Fu Siyuan
  2017-12-21  8:52 ` Wu, Jiaxin
  0 siblings, 1 reply; 2+ messages in thread
From: Fu Siyuan @ 2017-12-13  7:30 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ye Ting, Wu Jiaxin, Wang Fan

This patch updates some API descriptions in DxeIpIoLib to match the real
implementation.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Cc: Wang Fan <fan.wang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
---
 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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch] MdeModulePkg/IpIoDxe: Update API description to match the function implementation.
  2017-12-13  7:30 [Patch] MdeModulePkg/IpIoDxe: Update API description to match the function implementation Fu Siyuan
@ 2017-12-21  8:52 ` Wu, Jiaxin
  0 siblings, 0 replies; 2+ messages in thread
From: Wu, Jiaxin @ 2017-12-21  8:52 UTC (permalink / raw)
  To: Fu, Siyuan, edk2-devel@lists.01.org; +Cc: Ye, Ting, Wang, Fan

Hi Siyuan ,

I can't apply this patch, but looks good to me.

Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>


Thanks,
Jiaxin

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Fu,
> Siyuan
> Sent: Wednesday, December 13, 2017 3:31 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting.ye@intel.com>; Wang, Fan <fan.wang@intel.com>; Wu,
> Jiaxin <jiaxin.wu@intel.com>
> Subject: [edk2] [Patch] MdeModulePkg/IpIoDxe: Update API description to
> match the function implementation.
> 
> This patch updates some API descriptions in DxeIpIoLib to match the real
> implementation.
> 
> Cc: Ye Ting <ting.ye@intel.com>
> Cc: Wu Jiaxin <jiaxin.wu@intel.com>
> Cc: Wang Fan <fan.wang@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
> ---
>  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
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-21  8:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-13  7:30 [Patch] MdeModulePkg/IpIoDxe: Update API description to match the function implementation Fu Siyuan
2017-12-21  8:52 ` Wu, Jiaxin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox