1. Update the UdpIo to a combined UdpIo to support both v4 and v6 stack.
2. Update Dhcp4 and Mtftp4 driver to adopt the combined UdpIo. 3. Clean up coding style problems in combined IpIoLib/NetLib. Update Tcp4 and Udp4 to adopt the changes. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9382 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Implementation of Mtftp drivers.
|
||||
|
||||
Copyright (c) 2006 - 2007, Intel Corporation<BR>
|
||||
Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -107,7 +107,7 @@ Mtftp4DriverBindingSupported (
|
||||
Just leave the Udp child unconfigured. When UDP is unloaded,
|
||||
MTFTP will be informed with DriverBinding Stop.
|
||||
|
||||
@param UdpIo The UDP port to configure
|
||||
@param UdpIo The UDP_IO to configure
|
||||
@param Context The opaque parameter to the callback
|
||||
|
||||
@retval EFI_SUCCESS It always return EFI_SUCCESS directly.
|
||||
@ -115,7 +115,7 @@ Mtftp4DriverBindingSupported (
|
||||
**/
|
||||
EFI_STATUS
|
||||
Mtftp4ConfigNullUdp (
|
||||
IN UDP_IO_PORT *UdpIo,
|
||||
IN UDP_IO *UdpIo,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
@ -201,7 +201,13 @@ Mtftp4CreateService (
|
||||
return Status;
|
||||
}
|
||||
|
||||
MtftpSb->ConnectUdp = UdpIoCreatePort (Controller, Image, Mtftp4ConfigNullUdp, NULL);
|
||||
MtftpSb->ConnectUdp = UdpIoCreateIo (
|
||||
Controller,
|
||||
Image,
|
||||
Mtftp4ConfigNullUdp,
|
||||
UDP_IO_UDP4_VERSION,
|
||||
NULL
|
||||
);
|
||||
|
||||
if (MtftpSb->ConnectUdp == NULL) {
|
||||
gBS->CloseEvent (MtftpSb->TimerToGetMap);
|
||||
@ -226,7 +232,7 @@ Mtftp4CleanService (
|
||||
IN MTFTP4_SERVICE *MtftpSb
|
||||
)
|
||||
{
|
||||
UdpIoFreePort (MtftpSb->ConnectUdp);
|
||||
UdpIoFreeIo (MtftpSb->ConnectUdp);
|
||||
gBS->CloseEvent (MtftpSb->TimerToGetMap);
|
||||
gBS->CloseEvent (MtftpSb->Timer);
|
||||
}
|
||||
@ -467,10 +473,11 @@ Mtftp4ServiceBindingCreateChild (
|
||||
|
||||
Mtftp4InitProtocol (MtftpSb, Instance);
|
||||
|
||||
Instance->UnicastPort = UdpIoCreatePort (
|
||||
Instance->UnicastPort = UdpIoCreateIo (
|
||||
MtftpSb->Controller,
|
||||
MtftpSb->Image,
|
||||
Mtftp4ConfigNullUdp,
|
||||
UDP_IO_UDP4_VERSION,
|
||||
Instance
|
||||
);
|
||||
|
||||
@ -530,7 +537,7 @@ Mtftp4ServiceBindingCreateChild (
|
||||
ON_ERROR:
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
UdpIoFreePort (Instance->UnicastPort);
|
||||
UdpIoFreeIo (Instance->UnicastPort);
|
||||
gBS->FreePool (Instance);
|
||||
}
|
||||
|
||||
@ -623,7 +630,7 @@ Mtftp4ServiceBindingDestroyChild (
|
||||
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
|
||||
|
||||
Mtftp4CleanOperation (Instance, EFI_DEVICE_ERROR);
|
||||
UdpIoFreePort (Instance->UnicastPort);
|
||||
UdpIoFreeIo (Instance->UnicastPort);
|
||||
|
||||
RemoveEntryList (&Instance->Link);
|
||||
MtftpSb->ChildrenNum--;
|
||||
|
Reference in New Issue
Block a user