]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c
1. Update the UdpIo to a combined UdpIo to support both v4 and v6 stack.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Mtftp4Dxe / Mtftp4Driver.c
index 56c993eee7a6e995c458e88606072c0b83d874d8..63dcc6c5dfd83ddacb5376a12d598da2dba7c2c2 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Implementation of Mtftp drivers.\r
   \r
-Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
+Copyright (c) 2006 - 2009, Intel Corporation<BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -107,7 +107,7 @@ Mtftp4DriverBindingSupported (
   Just leave the Udp child unconfigured. When UDP is unloaded, \r
     MTFTP will be informed with DriverBinding Stop.\r
 \r
-  @param  UdpIo                  The UDP port to configure\r
+  @param  UdpIo                  The UDP_IO to configure\r
   @param  Context                The opaque parameter to the callback\r
 \r
   @retval EFI_SUCCESS            It always return EFI_SUCCESS directly.\r
@@ -115,7 +115,7 @@ Mtftp4DriverBindingSupported (
 **/\r
 EFI_STATUS\r
 Mtftp4ConfigNullUdp (\r
-  IN UDP_IO_PORT            *UdpIo,\r
+  IN UDP_IO                 *UdpIo,\r
   IN VOID                   *Context\r
   )\r
 {\r
@@ -201,7 +201,13 @@ Mtftp4CreateService (
     return Status;\r
   }\r
 \r
-  MtftpSb->ConnectUdp = UdpIoCreatePort (Controller, Image, Mtftp4ConfigNullUdp, NULL);\r
+  MtftpSb->ConnectUdp = UdpIoCreateIo (\r
+                          Controller,\r
+                          Image,\r
+                          Mtftp4ConfigNullUdp,\r
+                          UDP_IO_UDP4_VERSION,\r
+                          NULL\r
+                          );\r
 \r
   if (MtftpSb->ConnectUdp == NULL) {\r
     gBS->CloseEvent (MtftpSb->TimerToGetMap);\r
@@ -226,7 +232,7 @@ Mtftp4CleanService (
   IN MTFTP4_SERVICE     *MtftpSb\r
   )\r
 {\r
-  UdpIoFreePort (MtftpSb->ConnectUdp);\r
+  UdpIoFreeIo (MtftpSb->ConnectUdp);\r
   gBS->CloseEvent (MtftpSb->TimerToGetMap);\r
   gBS->CloseEvent (MtftpSb->Timer);\r
 }\r
@@ -467,10 +473,11 @@ Mtftp4ServiceBindingCreateChild (
 \r
   Mtftp4InitProtocol (MtftpSb, Instance);\r
 \r
-  Instance->UnicastPort = UdpIoCreatePort (\r
+  Instance->UnicastPort = UdpIoCreateIo (\r
                             MtftpSb->Controller,\r
                             MtftpSb->Image,\r
                             Mtftp4ConfigNullUdp,\r
+                            UDP_IO_UDP4_VERSION,\r
                             Instance\r
                             );\r
 \r
@@ -530,7 +537,7 @@ Mtftp4ServiceBindingCreateChild (
 ON_ERROR:\r
 \r
   if (EFI_ERROR (Status)) {\r
-    UdpIoFreePort (Instance->UnicastPort);\r
+    UdpIoFreeIo (Instance->UnicastPort);\r
     gBS->FreePool (Instance);\r
   }\r
 \r
@@ -623,7 +630,7 @@ Mtftp4ServiceBindingDestroyChild (
   OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
 \r
   Mtftp4CleanOperation (Instance, EFI_DEVICE_ERROR);\r
-  UdpIoFreePort (Instance->UnicastPort);\r
+  UdpIoFreeIo (Instance->UnicastPort);\r
 \r
   RemoveEntryList (&Instance->Link);\r
   MtftpSb->ChildrenNum--;\r