From 75dce340624dba5e4a79b2e5b2dbe943bae0d0e9 Mon Sep 17 00:00:00 2001 From: sfu5 Date: Wed, 17 Oct 2012 08:23:41 +0000 Subject: =?UTF-8?q?1.=20Fix=20a=20bug=20in=20PXE=20driver=20that=20the=20P?= =?UTF-8?q?XE=20boot=20do=20not=20restart=20if=20a=20new=20boot=20option?= =?UTF-8?q?=20on=20the=20different=20IP=20stack=20is=20selected.=202.=20Re?= =?UTF-8?q?trieve=20the=20IP=20information=20after=20iSCSI=20TCPv6=20conne?= =?UTF-8?q?ction=20established=20and=20fill=20it=20into=20iBFT=20table.=20?= =?UTF-8?q?3.=20Generate=20a=20random=20IAID=20for=20each=20NIC=20port=20t?= =?UTF-8?q?o=20require=20different=20IPv6=20address=20in=20PXE=20driver.?= =?UTF-8?q?=204.=20Update=20function=20EfiMtftp6Configure()=20and=20Mtftp6?= =?UTF-8?q?RrqHandleOack()=20to=20allocate=20at=20most=20one=20UdpIo.=205.?= =?UTF-8?q?=20Fix=20a=20typo=20from=20=E2=80=9Cdestory=E2=80=9D=20to=20?= =?UTF-8?q?=E2=80=9Cdestroy=E2=80=9D=20in=20network=20code.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fu Siyuan Reviewed-by: Ye Ting Reviewed-by: Ouyang Qian git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13859 6f19259b-4bc3-4df7-8a09-765794883524 --- NetworkPkg/Mtftp6Dxe/Mtftp6Driver.c | 26 +++++++++++++------------- NetworkPkg/Mtftp6Dxe/Mtftp6Impl.c | 22 ++++++++++++---------- NetworkPkg/Mtftp6Dxe/Mtftp6Impl.h | 6 +++--- NetworkPkg/Mtftp6Dxe/Mtftp6Rrq.c | 16 +++++++++------- 4 files changed, 37 insertions(+), 33 deletions(-) (limited to 'NetworkPkg/Mtftp6Dxe') diff --git a/NetworkPkg/Mtftp6Dxe/Mtftp6Driver.c b/NetworkPkg/Mtftp6Dxe/Mtftp6Driver.c index 28aacf198a..432eea9cd4 100644 --- a/NetworkPkg/Mtftp6Dxe/Mtftp6Driver.c +++ b/NetworkPkg/Mtftp6Dxe/Mtftp6Driver.c @@ -2,7 +2,7 @@ Driver Binding functions and Service Binding functions implementation for Mtftp6 Driver. - Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -33,7 +33,7 @@ EFI_SERVICE_BINDING_PROTOCOL gMtftp6ServiceBindingTemplate = { /** - Destory the MTFTP6 service. The MTFTP6 service may be partly initialized, + Destroy the MTFTP6 service. The MTFTP6 service may be partly initialized, or partly destroyed. If a resource is destroyed, it is marked as such in case the destroy failed and is called again later. @@ -46,7 +46,7 @@ Mtftp6DestroyService ( ) { // - // Make sure all children instances have been already destoryed. + // Make sure all children instances have been already destroyed. // ASSERT (Service->ChildrenNum == 0); @@ -98,7 +98,7 @@ Mtftp6CreateService ( Mtftp6Srv->Signature = MTFTP6_SERVICE_SIGNATURE; Mtftp6Srv->Controller = Controller; Mtftp6Srv->Image = Image; - Mtftp6Srv->InDestory = FALSE; + Mtftp6Srv->InDestroy = FALSE; Mtftp6Srv->ChildrenNum = 0; CopyMem ( @@ -219,7 +219,7 @@ Mtftp6CreateInstance ( } Mtftp6Ins->Signature = MTFTP6_INSTANCE_SIGNATURE; - Mtftp6Ins->InDestory = FALSE; + Mtftp6Ins->InDestroy = FALSE; Mtftp6Ins->Service = Service; CopyMem ( @@ -460,7 +460,7 @@ Mtftp6DriverBindingStop ( Service = MTFTP6_SERVICE_FROM_THIS (ServiceBinding); - if (Service->InDestory) { + if (Service->InDestroy) { return EFI_SUCCESS; } @@ -468,9 +468,9 @@ Mtftp6DriverBindingStop ( if (NumberOfChildren == 0) { // - // Destory the Mtftp6 service if there is no Mtftp6 child instance left. + // Destroy the Mtftp6 service if there is no Mtftp6 child instance left. // - Service->InDestory = TRUE; + Service->InDestroy = TRUE; gBS->UninstallProtocolInterface ( NicHandle, @@ -482,7 +482,7 @@ Mtftp6DriverBindingStop ( } else { // - // Destory the Mtftp6 child instance one by one. + // Destroy the Mtftp6 child instance one by one. // while (!IsListEmpty (&Service->Children)) { Instance = NET_LIST_HEAD (&Service->Children, MTFTP6_INSTANCE, Link); @@ -657,15 +657,15 @@ Mtftp6ServiceBindingDestroyChild ( } // - // Check whether the instance already in destory state. + // Check whether the instance already in Destroy state. // - if (Instance->InDestory) { + if (Instance->InDestroy) { return EFI_SUCCESS; } OldTpl = gBS->RaiseTPL (TPL_CALLBACK); - Instance->InDestory = TRUE; + Instance->InDestroy = TRUE; gBS->CloseProtocol ( Service->DummyUdpIo->UdpHandle, @@ -684,7 +684,7 @@ Mtftp6ServiceBindingDestroyChild ( ); if (EFI_ERROR (Status)) { - Instance->InDestory = FALSE; + Instance->InDestroy = FALSE; gBS->RestoreTPL (OldTpl); return Status; } diff --git a/NetworkPkg/Mtftp6Dxe/Mtftp6Impl.c b/NetworkPkg/Mtftp6Dxe/Mtftp6Impl.c index 79ae6e0741..4a4e5b192c 100644 --- a/NetworkPkg/Mtftp6Dxe/Mtftp6Impl.c +++ b/NetworkPkg/Mtftp6Dxe/Mtftp6Impl.c @@ -8,7 +8,7 @@ RFC2348 - TFTP Blocksize Option RFC2349 - TFTP Timeout Interval and Transfer Size Options - Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -189,13 +189,15 @@ EfiMtftp6Configure ( // Don't configure the udpio here because each operation might override // the configuration, so delay udpio configuration in each operation. // - Instance->UdpIo = UdpIoCreateIo ( - Service->Controller, - Service->Image, - Mtftp6ConfigDummyUdpIo, - UDP_IO_UDP6_VERSION, - NULL - ); + if (Instance->UdpIo == NULL) { + Instance->UdpIo = UdpIoCreateIo ( + Service->Controller, + Service->Image, + Mtftp6ConfigDummyUdpIo, + UDP_IO_UDP6_VERSION, + NULL + ); + } if (Instance->UdpIo == NULL) { Status = EFI_OUT_OF_RESOURCES; @@ -620,11 +622,11 @@ EfiMtftp6Poll ( Instance = MTFTP6_INSTANCE_FROM_THIS (This); // - // Check the instance whether configured or in destory. + // Check the instance whether configured or in destroy. // if (Instance->Config == NULL) { return EFI_NOT_STARTED; - } else if (Instance->InDestory) { + } else if (Instance->InDestroy) { return EFI_DEVICE_ERROR; } diff --git a/NetworkPkg/Mtftp6Dxe/Mtftp6Impl.h b/NetworkPkg/Mtftp6Dxe/Mtftp6Impl.h index 626aea0e34..68fa0da115 100644 --- a/NetworkPkg/Mtftp6Dxe/Mtftp6Impl.h +++ b/NetworkPkg/Mtftp6Dxe/Mtftp6Impl.h @@ -1,7 +1,7 @@ /** @file Mtftp6 internal data structure and definition declaration. - Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -94,7 +94,7 @@ struct _MTFTP6_INSTANCE { EFI_TPL OldTpl; BOOLEAN IsTransmitted; BOOLEAN IsMaster; - BOOLEAN InDestory; + BOOLEAN InDestroy; }; // @@ -117,7 +117,7 @@ struct _MTFTP6_SERVICE { // mtftp driver and udp driver. // UDP_IO *DummyUdpIo; - BOOLEAN InDestory; + BOOLEAN InDestroy; }; /** diff --git a/NetworkPkg/Mtftp6Dxe/Mtftp6Rrq.c b/NetworkPkg/Mtftp6Dxe/Mtftp6Rrq.c index 348a8f29c7..7fc613a665 100644 --- a/NetworkPkg/Mtftp6Dxe/Mtftp6Rrq.c +++ b/NetworkPkg/Mtftp6Dxe/Mtftp6Rrq.c @@ -547,13 +547,15 @@ Mtftp6RrqHandleOack ( ); Instance->McastPort = ExtInfo.McastPort; - Instance->McastUdpIo = UdpIoCreateIo ( - Instance->Service->Controller, - Instance->Service->Image, - Mtftp6RrqConfigMcastUdpIo, - UDP_IO_UDP6_VERSION, - Instance - ); + if (Instance->McastUdpIo == NULL) { + Instance->McastUdpIo = UdpIoCreateIo ( + Instance->Service->Controller, + Instance->Service->Image, + Mtftp6RrqConfigMcastUdpIo, + UDP_IO_UDP6_VERSION, + Instance + ); + } if (Instance->McastUdpIo == NULL) { return EFI_DEVICE_ERROR; -- cgit v1.2.3