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 --- MdeModulePkg/Include/Library/UdpIoLib.h | 4 +- MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 10 +-- MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.c | 6 +- .../Universal/Network/Dhcp4Dxe/Dhcp4Driver.c | 26 +++--- .../Universal/Network/Dhcp4Dxe/Dhcp4Impl.h | 14 ++-- MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c | 6 +- MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c | 30 +++---- MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c | 6 +- MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h | 4 +- MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c | 4 +- MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h | 16 ++-- MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c | 4 +- .../Universal/Network/Mtftp4Dxe/Mtftp4Driver.c | 24 +++--- .../Universal/Network/Mtftp4Dxe/Mtftp4Driver.h | 10 +-- .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.c | 4 +- .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.h | 8 +- MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c | 6 +- .../Universal/Network/Tcp4Dxe/SockInterface.c | 2 +- MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h | 4 +- .../Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c | 4 +- NetworkPkg/Application/Ping6/Ping6.c | 8 +- NetworkPkg/Dhcp6Dxe/Dhcp6Driver.c | 26 +++--- NetworkPkg/Dhcp6Dxe/Dhcp6Impl.h | 4 +- NetworkPkg/Dhcp6Dxe/Dhcp6Io.c | 6 +- NetworkPkg/IScsiDxe/IScsiIbft.c | 14 ++-- NetworkPkg/IScsiDxe/IScsiImpl.h | 3 +- NetworkPkg/IScsiDxe/IScsiMisc.h | 7 +- NetworkPkg/IScsiDxe/IScsiProto.c | 96 ++++++++++++++++++++++ NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c | 6 +- NetworkPkg/Ip6Dxe/Ip6ConfigImpl.h | 6 +- NetworkPkg/Ip6Dxe/Ip6Driver.c | 8 +- NetworkPkg/Ip6Dxe/Ip6Driver.h | 4 +- NetworkPkg/Ip6Dxe/Ip6If.c | 4 +- NetworkPkg/Ip6Dxe/Ip6Impl.c | 4 +- NetworkPkg/Ip6Dxe/Ip6Nd.c | 4 +- NetworkPkg/Ip6Dxe/Ip6Nd.h | 4 +- NetworkPkg/Mtftp6Dxe/Mtftp6Driver.c | 26 +++--- NetworkPkg/Mtftp6Dxe/Mtftp6Impl.c | 22 ++--- NetworkPkg/Mtftp6Dxe/Mtftp6Impl.h | 6 +- NetworkPkg/Mtftp6Dxe/Mtftp6Rrq.c | 16 ++-- NetworkPkg/TcpDxe/SockImpl.c | 6 +- NetworkPkg/TcpDxe/SockInterface.c | 4 +- NetworkPkg/TcpDxe/Socket.h | 4 +- NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c | 2 +- NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c | 2 +- NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c | 13 ++- NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c | 9 ++ NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h | 1 + .../UefiShellNetwork1CommandsLib/Ifconfig.c | 2 +- .../Library/UefiShellNetwork1CommandsLib/Ping.c | 8 +- 50 files changed, 320 insertions(+), 197 deletions(-) diff --git a/MdeModulePkg/Include/Library/UdpIoLib.h b/MdeModulePkg/Include/Library/UdpIoLib.h index 32d61e505a..e0b44ce18e 100644 --- a/MdeModulePkg/Include/Library/UdpIoLib.h +++ b/MdeModulePkg/Include/Library/UdpIoLib.h @@ -2,7 +2,7 @@ This library is used to share code between UEFI network stack modules. It provides the helper routines to access UDP service. It is used by both DHCP and MTFTP. -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 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 which accompanies this distribution. The full text of the license may be found at
@@ -137,7 +137,7 @@ struct _UDP_IO { UINT8 UdpVersion; // - // Handle used to create/destory UDP child + // Handle used to create/destroy UDP child // EFI_HANDLE Controller; EFI_HANDLE Image; diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c index f74dcdaeae..956f733400 100644 --- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c @@ -1829,7 +1829,7 @@ NetLibCreateServiceChild ( /** - Destory a child of the service that is identified by ServiceBindingGuid. + Destroy a child of the service that is identified by ServiceBindingGuid. Get the ServiceBinding Protocol first, then use it to destroy a child. @@ -1838,10 +1838,10 @@ NetLibCreateServiceChild ( @param[in] Controller The controller which has the service installed. @param[in] Image The image handle used to open service. @param[in] ServiceBindingGuid The service's Guid. - @param[in] ChildHandle The child to destory. + @param[in] ChildHandle The child to destroy. - @retval EFI_SUCCESS The child is successfully destoried. - @retval Others Failed to destory the child. + @retval EFI_SUCCESS The child is successfully destroyed. + @retval Others Failed to destroy the child. **/ EFI_STATUS @@ -1875,7 +1875,7 @@ NetLibDestroyServiceChild ( } // - // destory the child + // destroy the child // Status = Service->DestroyChild (Service, ChildHandle); return Status; diff --git a/MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.c b/MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.c index bb3955949c..e1d72f3f1c 100644 --- a/MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.c +++ b/MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.c @@ -1,7 +1,7 @@ /** @file Help functions to access UDP service, it is used by both the DHCP and MTFTP. -Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 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 which accompanies this distribution. The full text of the license may be found at
@@ -804,7 +804,7 @@ UdpIoFreeIo ( } // - // Close then destory the Udp4 child + // Close then destroy the Udp4 child // gBS->CloseProtocol ( UdpIo->UdpHandle, @@ -827,7 +827,7 @@ UdpIoFreeIo ( } // - // Close then destory the Udp6 child + // Close then destroy the Udp6 child // gBS->CloseProtocol ( UdpIo->UdpHandle, diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c index cd4fbbd196..8a773d9461 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c @@ -1,6 +1,6 @@ /** @file -Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 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 which accompanies this distribution. The full text of the license may be found at @@ -146,11 +146,11 @@ DhcpConfigUdpIo ( /** - Destory the DHCP service. The Dhcp4 service may be partly initialized, + Destroy the DHCP service. The Dhcp4 service may be partly initialized, or partly destroyed. If a resource is destroyed, it is marked as so in case the destroy failed and being called again later. - @param[in] DhcpSb The DHCP service instance to destory. + @param[in] DhcpSb The DHCP service instance to destroy. @retval EFI_SUCCESS Always return success. @@ -212,7 +212,7 @@ Dhcp4CreateService ( DhcpSb->Signature = DHCP_SERVICE_SIGNATURE; DhcpSb->ServiceState = DHCP_UNCONFIGED; - DhcpSb->InDestory = FALSE; + DhcpSb->InDestroy = FALSE; DhcpSb->Controller = Controller; DhcpSb->Image = ImageHandle; InitializeListHead (&DhcpSb->Children); @@ -414,7 +414,7 @@ Dhcp4DriverBindingStop ( DhcpSb = DHCP_SERVICE_FROM_THIS (ServiceBinding); - if (DhcpSb->InDestory) { + if (DhcpSb->InDestroy) { return EFI_SUCCESS; } @@ -422,8 +422,8 @@ Dhcp4DriverBindingStop ( if (NumberOfChildren == 0) { - DhcpSb->InDestory = TRUE; - DhcpSb->ServiceState = DHCP_DESTORY; + DhcpSb->InDestroy = TRUE; + DhcpSb->ServiceState = DHCP_DESTROY; gBS->UninstallProtocolInterface ( NicHandle, @@ -436,7 +436,7 @@ Dhcp4DriverBindingStop ( FreePool (DhcpSb); } else { // - // Don't use NET_LIST_FOR_EACH_SAFE here, Dhcp4ServiceBindingDestoryChild + // Don't use NET_LIST_FOR_EACH_SAFE here, Dhcp4ServiceBindingDestroyChild // may cause other child to be deleted. // while (!IsListEmpty (&DhcpSb->Children)) { @@ -473,7 +473,7 @@ DhcpInitProtocol ( InitializeListHead (&Instance->Link); Instance->Handle = NULL; Instance->Service = DhcpSb; - Instance->InDestory = FALSE; + Instance->InDestroy = FALSE; Instance->CompletionEvent = NULL; Instance->RenewRebindEvent = NULL; Instance->Token = NULL; @@ -640,15 +640,15 @@ Dhcp4ServiceBindingDestroyChild ( // // A child can be destroyed more than once. For example, // Dhcp4DriverBindingStop will destroy all of its children. - // when caller driver is being stopped, it will destory the + // when caller driver is being stopped, it will destroy the // dhcp child it opens. // - if (Instance->InDestory) { + if (Instance->InDestroy) { return EFI_SUCCESS; } OldTpl = gBS->RaiseTPL (TPL_CALLBACK); - Instance->InDestory = TRUE; + Instance->InDestroy = TRUE; // // Close the Udp4 protocol. @@ -670,7 +670,7 @@ Dhcp4ServiceBindingDestroyChild ( ); if (EFI_ERROR (Status)) { - Instance->InDestory = FALSE; + Instance->InDestroy = FALSE; gBS->RestoreTPL (OldTpl); return Status; diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h index 438f4cddf7..08faff0206 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h @@ -6,7 +6,7 @@ RFC 1534: Interoperation Between DHCP and BOOTP RFC 3396: Encoding Long Options in DHCP. -Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 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 which accompanies this distribution. The full text of the license may be found at @@ -48,12 +48,12 @@ typedef struct _DHCP_PROTOCOL DHCP_PROTOCOL; // The state of the DHCP service. It starts as UNCONFIGED. If // and active child configures the service successfully, it // goes to CONFIGED. If the active child configures NULL, it -// goes back to UNCONFIGED. It becomes DESTORY if it is (partly) -// destoried. +// goes back to UNCONFIGED. It becomes DESTROY if it is (partly) +// destroyed. // #define DHCP_UNCONFIGED 0 #define DHCP_CONFIGED 1 -#define DHCP_DESTORY 2 +#define DHCP_DESTROY 2 struct _DHCP_PROTOCOL { @@ -63,7 +63,7 @@ struct _DHCP_PROTOCOL { EFI_HANDLE Handle; DHCP_SERVICE *Service; - BOOLEAN InDestory; + BOOLEAN InDestroy; EFI_EVENT CompletionEvent; EFI_EVENT RenewRebindEvent; @@ -83,8 +83,8 @@ struct _DHCP_SERVICE { UINT32 Signature; EFI_SERVICE_BINDING_PROTOCOL ServiceBinding; - INTN ServiceState; // CONFIGED, UNCONFIGED, and DESTORY - BOOLEAN InDestory; + INTN ServiceState; // CONFIGED, UNCONFIGED, and DESTROY + BOOLEAN InDestroy; EFI_HANDLE Controller; EFI_HANDLE Image; diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c index b3ac646446..19ad101d54 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c @@ -1,7 +1,7 @@ /** @file EFI DHCP protocol implementation. -Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 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 which accompanies this distribution. The full text of the license may be found at @@ -972,11 +972,11 @@ DhcpInput ( DhcpSb = (DHCP_SERVICE *) Context; // - // Don't restart receive if error occurs or DHCP is destoried. + // Don't restart receive if error occurs or DHCP is destroyed. // if (EFI_ERROR (IoStatus)) { return ; - } else if (DhcpSb->ServiceState == DHCP_DESTORY) { + } else if (DhcpSb->ServiceState == DHCP_DESTROY) { NetbufFree (UdpPacket); return ; } diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c index 2d69dcfe37..4ce85a3f51 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c @@ -1,7 +1,7 @@ /** @file The driver binding and service binding protocol for IP4 driver. -Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 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 which accompanies this distribution. The full text of the license may be found at @@ -118,7 +118,7 @@ Ip4DriverBindingSupported ( Clean up a IP4 service binding instance. It will release all the resource allocated by the instance. The instance may be partly initialized, or partly destroyed. If a resource is - destroyed, it is marked as that in case the destory failed and + destroyed, it is marked as that in case the destroy failed and being called again later. @param[in] IpSb The IP4 serviceing binding instance to clean up @@ -176,7 +176,7 @@ Ip4CreateService ( IpSb->ServiceBinding.CreateChild = Ip4ServiceBindingCreateChild; IpSb->ServiceBinding.DestroyChild = Ip4ServiceBindingDestroyChild; IpSb->State = IP4_SERVICE_UNSTARTED; - IpSb->InDestory = FALSE; + IpSb->InDestroy = FALSE; IpSb->NumChildren = 0; InitializeListHead (&IpSb->Children); @@ -315,7 +315,7 @@ ON_ERROR: Clean up a IP4 service binding instance. It will release all the resource allocated by the instance. The instance may be partly initialized, or partly destroyed. If a resource is - destroyed, it is marked as that in case the destory failed and + destroyed, it is marked as that in case the destroy failed and being called again later. @param[in] IpSb The IP4 serviceing binding instance to clean up @@ -581,7 +581,7 @@ Ip4DriverBindingStop ( OldTpl = gBS->RaiseTPL (TPL_CALLBACK); - if (IpSb->Ip4Config != NULL && (IpSb->State != IP4_SERVICE_DESTORY)) { + if (IpSb->Ip4Config != NULL && (IpSb->State != IP4_SERVICE_DESTROY)) { IpSb->Ip4Config->Stop (IpSb->Ip4Config); @@ -651,7 +651,7 @@ Ip4DriverBindingStop ( OldTpl = gBS->RaiseTPL (TPL_CALLBACK); - if (IpSb->InDestory) { + if (IpSb->InDestroy) { gBS->RestoreTPL (OldTpl); return EFI_SUCCESS; } @@ -668,10 +668,10 @@ Ip4DriverBindingStop ( goto ON_ERROR; } - IpSb->InDestory = TRUE; + IpSb->InDestroy = TRUE; State = IpSb->State; - IpSb->State = IP4_SERVICE_DESTORY; + IpSb->State = IP4_SERVICE_DESTROY; // // Clear the variable data. @@ -696,10 +696,10 @@ Ip4DriverBindingStop ( FreePool (IpSb); } else if (NumberOfChildren == 0) { - IpSb->InDestory = TRUE; + IpSb->InDestroy = TRUE; State = IpSb->State; - IpSb->State = IP4_SERVICE_DESTORY; + IpSb->State = IP4_SERVICE_DESTROY; // // Clear the variable data. @@ -912,18 +912,18 @@ Ip4ServiceBindingDestroyChild ( OldTpl = gBS->RaiseTPL (TPL_CALLBACK); // - // A child can be destoried more than once. For example, - // Ip4DriverBindingStop will destory all of its children. - // when UDP driver is being stopped, it will destory all + // A child can be destroyed more than once. For example, + // Ip4DriverBindingStop will destroy all of its children. + // when UDP driver is being stopped, it will destroy all // the IP child it opens. // - if (IpInstance->State == IP4_STATE_DESTORY) { + if (IpInstance->State == IP4_STATE_DESTROY) { gBS->RestoreTPL (OldTpl); return EFI_SUCCESS; } State = IpInstance->State; - IpInstance->State = IP4_STATE_DESTORY; + IpInstance->State = IP4_STATE_DESTROY; // // Close the Managed Network protocol. diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c index d97ab412cb..224244164e 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c @@ -1,7 +1,7 @@ /** @file Implement IP4 pesudo interface. -Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 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 which accompanies this distribution. The full text of the license may be found at @@ -745,10 +745,10 @@ Ip4FreeInterface ( } // - // Destory the interface if this is the last IP instance that + // Destroy the interface if this is the last IP instance that // has the address. Remove all the system transmitted packets // from this interface, cancel the receive request if there is - // one, and destory the ARP requests. + // one, and destroy the ARP requests. // Ip4CancelFrames (Interface, EFI_ABORTED, Ip4CancelInstanceFrame, NULL); Ip4CancelReceive (Interface); diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h index d35e5688c5..998fb25bc5 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h @@ -1,7 +1,7 @@ /** @file Definition for IP4 pesudo interface structure. -Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 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 which accompanies this distribution. The full text of the license may be found at @@ -154,7 +154,7 @@ struct _IP4_INTERFACE { BOOLEAN Configured; // - // Handle used to create/destory ARP child. All the IP children + // Handle used to create/destroy ARP child. All the IP children // share one MNP which is owned by IP service binding. // EFI_HANDLE Controller; diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c index 2cad1f3bb9..f4ce3ea025 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c @@ -1,6 +1,6 @@ /** @file -Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 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 which accompanies this distribution. The full text of the license may be found at @@ -1256,7 +1256,7 @@ EfiIp4Configure ( Status = Ip4CleanProtocol (IpInstance); // - // Don't change the state if it is DESTORY, consider the following + // Don't change the state if it is DESTROY, consider the following // valid sequence: Mnp is unloaded-->Ip Stopped-->Udp Stopped, // Configure (ThisIp, NULL). If the state is changed to UNCONFIGED, // the unload fails miserably. diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h index 86e6385ecf..563cf7f91f 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h @@ -1,7 +1,7 @@ /** @file Ip4 internal functions and type defintions. -Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 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 which accompanies this distribution. The full text of the license may be found at @@ -50,23 +50,23 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // // The state of IP4 protocol. It starts from UNCONFIGED. if it is // successfully configured, it goes to CONFIGED. if configure NULL -// is called, it becomes UNCONFIGED again. If (partly) destoried, it -// becomes DESTORY. +// is called, it becomes UNCONFIGED again. If (partly) destroyed, it +// becomes DESTROY. // #define IP4_STATE_UNCONFIGED 0 #define IP4_STATE_CONFIGED 1 -#define IP4_STATE_DESTORY 2 +#define IP4_STATE_DESTROY 2 // // The state of IP4 service. It starts from UNSTARTED. It transits // to STARTED if autoconfigure is started. If default address is -// configured, it becomes CONFIGED. and if partly destoried, it goes -// to DESTORY. +// configured, it becomes CONFIGED. and if partly destroyed, it goes +// to DESTROY. // #define IP4_SERVICE_UNSTARTED 0 #define IP4_SERVICE_STARTED 1 #define IP4_SERVICE_CONFIGED 2 -#define IP4_SERVICE_DESTORY 3 +#define IP4_SERVICE_DESTROY 3 /// @@ -160,7 +160,7 @@ struct _IP4_SERVICE { UINT32 Signature; EFI_SERVICE_BINDING_PROTOCOL ServiceBinding; INTN State; - BOOLEAN InDestory; + BOOLEAN InDestroy; // // List of all the IP instances and interfaces, and default diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c index 0990d18035..bd15fc2e17 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c @@ -1,7 +1,7 @@ /** @file IP4 input process. -Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 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 which accompanies this distribution. The full text of the license may be found at @@ -845,7 +845,7 @@ Ip4AccpetFrame ( IpSb = (IP4_SERVICE *) Context; Option = NULL; - if (EFI_ERROR (IoStatus) || (IpSb->State == IP4_SERVICE_DESTORY)) { + if (EFI_ERROR (IoStatus) || (IpSb->State == IP4_SERVICE_DESTROY)) { goto DROP; } diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c index 1c74b5b083..2a12b1d5e7 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c @@ -1,7 +1,7 @@ /** @file Implementation of Mtftp drivers. -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 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 which accompanies this distribution. The full text of the license may be found at @@ -159,7 +159,7 @@ Mtftp4CreateService ( MtftpSb->Signature = MTFTP4_SERVICE_SIGNATURE; MtftpSb->ServiceBinding = gMtftp4ServiceBindingTemplete; - MtftpSb->InDestory = FALSE; + MtftpSb->InDestroy = FALSE; MtftpSb->ChildrenNum = 0; InitializeListHead (&MtftpSb->Children); @@ -374,7 +374,7 @@ Mtftp4DriverBindingStop ( MtftpSb = MTFTP4_SERVICE_FROM_THIS (ServiceBinding); - if (MtftpSb->InDestory) { + if (MtftpSb->InDestroy) { return EFI_SUCCESS; } @@ -382,7 +382,7 @@ Mtftp4DriverBindingStop ( if (NumberOfChildren == 0) { - MtftpSb->InDestory = TRUE; + MtftpSb->InDestroy = TRUE; gBS->UninstallProtocolInterface ( NicHandle, @@ -429,7 +429,7 @@ Mtftp4InitProtocol ( InitializeListHead (&Instance->Link); CopyMem (&Instance->Mtftp4, &gMtftp4ProtocolTemplate, sizeof (Instance->Mtftp4)); Instance->State = MTFTP4_STATE_UNCONFIGED; - Instance->InDestory = FALSE; + Instance->InDestroy = FALSE; Instance->Service = MtftpSb; InitializeListHead (&Instance->Blocks); @@ -548,14 +548,14 @@ ON_ERROR: /** - Destory one of the service binding's child. + Destroy one of the service binding's child. @param This The service binding instance - @param ChildHandle The child handle to destory + @param ChildHandle The child handle to destroy @retval EFI_INVALID_PARAMETER The parameter is invaid. - @retval EFI_UNSUPPORTED The child may have already been destoried. - @retval EFI_SUCCESS The child is destoried and removed from the + @retval EFI_UNSUPPORTED The child may have already been destroyed. + @retval EFI_SUCCESS The child is destroyed and removed from the parent's child list. **/ @@ -599,11 +599,11 @@ Mtftp4ServiceBindingDestroyChild ( return EFI_INVALID_PARAMETER; } - if (Instance->InDestory) { + if (Instance->InDestroy) { return EFI_SUCCESS; } - Instance->InDestory = TRUE; + Instance->InDestroy = TRUE; // // Close the Udp4 protocol. @@ -625,7 +625,7 @@ Mtftp4ServiceBindingDestroyChild ( ); if (EFI_ERROR (Status)) { - Instance->InDestory = FALSE; + Instance->InDestroy = FALSE; return Status; } diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.h b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.h index 392ea51668..63828bd433 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.h +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.h @@ -1,7 +1,7 @@ /** @file Mtftp drivers function header. -Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 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 which accompanies this distribution. The full text of the license may be found at @@ -113,14 +113,14 @@ Mtftp4ServiceBindingCreateChild ( ); /** - Destory one of the service binding's child. + Destroy one of the service binding's child. @param This The service binding instance - @param ChildHandle The child handle to destory + @param ChildHandle The child handle to destroy @retval EFI_INVALID_PARAMETER The parameter is invaid. - @retval EFI_UNSUPPORTED The child may have already been destoried. - @retval EFI_SUCCESS The child is destoried and removed from the + @retval EFI_UNSUPPORTED The child may have already been destroyed. + @retval EFI_SUCCESS The child is destroyed and removed from the parent's child list. **/ diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c index 3c68235d42..5183e1a5b3 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c @@ -1,7 +1,7 @@ /** @file Interface routine for Mtftp4. -Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 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 which accompanies this distribution. The full text of the license may be found at @@ -1073,7 +1073,7 @@ EfiMtftp4Poll ( if (Instance->State == MTFTP4_STATE_UNCONFIGED) { return EFI_NOT_STARTED; - } else if (Instance->State == MTFTP4_STATE_DESTORY) { + } else if (Instance->State == MTFTP4_STATE_DESTROY) { return EFI_DEVICE_ERROR; } diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h index 502fcaa53a..41f524abb0 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h @@ -9,7 +9,7 @@ RFC2348 - TFTP Blocksize Option RFC2349 - TFTP Timeout Interval and Transfer Size Options -Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 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 which accompanies this distribution. The full text of the license may be found at @@ -59,7 +59,7 @@ typedef struct _MTFTP4_PROTOCOL MTFTP4_PROTOCOL; #define MTFTP4_STATE_UNCONFIGED 0 #define MTFTP4_STATE_CONFIGED 1 -#define MTFTP4_STATE_DESTORY 2 +#define MTFTP4_STATE_DESTROY 2 /// /// Mtftp service block @@ -68,7 +68,7 @@ struct _MTFTP4_SERVICE { UINT32 Signature; EFI_SERVICE_BINDING_PROTOCOL ServiceBinding; - BOOLEAN InDestory; + BOOLEAN InDestroy; UINT16 ChildrenNum; LIST_ENTRY Children; @@ -99,7 +99,7 @@ struct _MTFTP4_PROTOCOL { EFI_MTFTP4_PROTOCOL Mtftp4; INTN State; - BOOLEAN InDestory; + BOOLEAN InDestroy; MTFTP4_SERVICE *Service; EFI_HANDLE Handle; diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c index c627a140a8..2e31643821 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c @@ -1,7 +1,7 @@ /** @file Implementation of the Socket. -Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 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 which accompanies this distribution. The full text of the license may be found at @@ -739,7 +739,7 @@ SockDestroy ( } // - // Destory the RcvBuffer Queue and SendBuffer Queue + // Destroy the RcvBuffer Queue and SendBuffer Queue // NetbufQueFree (Sock->RcvBuffer.DataQueue); NetbufQueFree (Sock->SndBuffer.DataQueue); @@ -754,7 +754,7 @@ SockDestroy ( DEBUG ( (EFI_D_INFO, - "SockDestory: Delete a unaccepted socket from parent" + "SockDestroy: Delete a unaccepted socket from parent" "now conncnt is %d\n", Sock->Parent->ConnCnt) ); diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c index d17bfa8b9d..ac36460da8 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c @@ -131,7 +131,7 @@ SockBufferToken ( /** - Destory the socket Sock and its associated protocol control block. + Destroy the socket Sock and its associated protocol control block. @param Sock The socket to be destroyed. diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h index 0317efa322..b8ace790ca 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h @@ -1,7 +1,7 @@ /** @file Socket header file. -Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 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 which accompanies this distribution. The full text of the license may be found at @@ -723,7 +723,7 @@ SockCreateChild ( ); /** - Destory the socket Sock and its associated protocol control block. + Destroy the socket Sock and its associated protocol control block. @param Sock The socket to be destroyed. diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c index 5f3d913547..fa3594d36b 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c @@ -1,7 +1,7 @@ /** @file Support for PxeBc dhcp functions. -Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 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 which accompanies this distribution. The full text of the license may be found at @@ -203,7 +203,7 @@ PxeBcParseCachedDhcpPacket ( (Offer->Dhcp4.Header.BootFileName[0] != 0)) { // // If the bootfile is not present and bootfilename is present in dhcp packet, just parse it. - // And do not count dhcp option header, or else will destory the serverhostname. + // And do not count dhcp option header, or else will destroy the serverhostname. // Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] = (EFI_DHCP4_PACKET_OPTION *) (&Offer->Dhcp4.Header.BootFileName[0] - OFFSET_OF (EFI_DHCP4_PACKET_OPTION, Data[0])); diff --git a/NetworkPkg/Application/Ping6/Ping6.c b/NetworkPkg/Application/Ping6/Ping6.c index e0f6cd89e5..0de332fcce 100644 --- a/NetworkPkg/Application/Ping6/Ping6.c +++ b/NetworkPkg/Application/Ping6/Ping6.c @@ -1,7 +1,7 @@ /** @file The implementation for Ping6 application. - 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 @@ -802,13 +802,13 @@ ON_ERROR: } /** - Destory the IP6 instance. + Destroy the IP6 instance. @param[in] Private The pointer of PING6_PRIVATE_DATA. **/ VOID -Ping6DestoryIp6Instance ( +Ping6DestroyIp6Instance ( IN PING6_PRIVATE_DATA *Private ) { @@ -1019,7 +1019,7 @@ ON_EXIT: } if (Private->Ip6ChildHandle != NULL) { - Ping6DestoryIp6Instance (Private); + Ping6DestroyIp6Instance (Private); } FreePool (Private); diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Driver.c b/NetworkPkg/Dhcp6Dxe/Dhcp6Driver.c index b789f2a478..346986bd15 100644 --- a/NetworkPkg/Dhcp6Dxe/Dhcp6Driver.c +++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Driver.c @@ -82,7 +82,7 @@ Dhcp6ConfigureUdpIo ( /** - Destory the Dhcp6 service. The Dhcp6 service may be partly initialized, + Destroy the Dhcp6 service. The Dhcp6 service may be partly initialized, or partly destroyed. If a resource is destroyed, it is marked as such in case the destroy failed and being called again later. @@ -95,7 +95,7 @@ Dhcp6DestroyService ( ) { // - // All children instances should have been already destoryed here. + // All children instances should have been already destroyed here. // ASSERT (Service->NumOfChild == 0); @@ -155,7 +155,7 @@ Dhcp6CreateService ( // Initialize the fields of the new Dhcp6 service. // Dhcp6Srv->Signature = DHCP6_SERVICE_SIGNATURE; - Dhcp6Srv->InDestory = FALSE; + Dhcp6Srv->InDestroy = FALSE; Dhcp6Srv->Controller = Controller; Dhcp6Srv->Image = ImageHandle; Dhcp6Srv->Xid = (0xffffff & NET_RANDOM (NetRandomInitSeed ())); @@ -294,7 +294,7 @@ Dhcp6CreateInstance ( Dhcp6Ins->Signature = DHCP6_INSTANCE_SIGNATURE; Dhcp6Ins->UdpSts = EFI_ALREADY_STARTED; Dhcp6Ins->Service = Service; - Dhcp6Ins->InDestory = FALSE; + Dhcp6Ins->InDestroy = FALSE; Dhcp6Ins->MediaPresent = TRUE; CopyMem ( @@ -528,7 +528,7 @@ Dhcp6DriverBindingStop ( Service = DHCP6_SERVICE_FROM_THIS (ServiceBinding); - if (Service->InDestory) { + if (Service->InDestroy) { return EFI_SUCCESS; } @@ -536,9 +536,9 @@ Dhcp6DriverBindingStop ( if (NumberOfChildren == 0) { // - // Destory the service itself if no child instance left. + // Destroy the service itself if no child instance left. // - Service->InDestory = TRUE; + Service->InDestroy = TRUE; Status = gBS->UninstallProtocolInterface ( NicHandle, @@ -547,7 +547,7 @@ Dhcp6DriverBindingStop ( ); if (EFI_ERROR (Status)) { - Service->InDestory = FALSE; + Service->InDestroy = FALSE; goto ON_EXIT; } @@ -555,7 +555,7 @@ Dhcp6DriverBindingStop ( } else { // - // Destory all the children instances before destory the service. + // Destroy all the children instances before destroy the service. // while (!IsListEmpty (&Service->Child)) { Instance = NET_LIST_HEAD (&Service->Child, DHCP6_INSTANCE, Link); @@ -747,13 +747,13 @@ Dhcp6ServiceBindingDestroyChild ( return EFI_INVALID_PARAMETER; } - if (Instance->InDestory) { + if (Instance->InDestroy) { return EFI_SUCCESS; } OldTpl = gBS->RaiseTPL (TPL_CALLBACK); - Instance->InDestory = TRUE; + Instance->InDestroy = TRUE; Status = gBS->CloseProtocol ( Service->UdpIo->UdpHandle, @@ -763,7 +763,7 @@ Dhcp6ServiceBindingDestroyChild ( ); if (EFI_ERROR (Status)) { - Instance->InDestory = FALSE; + Instance->InDestroy = FALSE; gBS->RestoreTPL (OldTpl); return Status; } @@ -778,7 +778,7 @@ Dhcp6ServiceBindingDestroyChild ( ); if (EFI_ERROR (Status)) { - Instance->InDestory = FALSE; + Instance->InDestroy = FALSE; gBS->RestoreTPL (OldTpl); return Status; } diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.h b/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.h index 0e206cd504..d4e9746be8 100644 --- a/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.h +++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.h @@ -246,7 +246,7 @@ struct _DHCP6_INSTANCE { UINT8 AdPref; EFI_IPv6_ADDRESS *Unicast; EFI_STATUS UdpSts; - BOOLEAN InDestory; + BOOLEAN InDestroy; BOOLEAN MediaPresent; UINT64 StartTime; }; @@ -266,7 +266,7 @@ struct _DHCP6_SERVICE { UINT32 Xid; LIST_ENTRY Child; UINTN NumOfChild; - BOOLEAN InDestory; + BOOLEAN InDestroy; }; /** diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c b/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c index 656fd83908..f2e33f335f 100644 --- a/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c +++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c @@ -52,7 +52,7 @@ Dhcp6EnqueueRetry ( } // - // Save tx packet pointer, and it will be destoryed when reply received. + // Save tx packet pointer, and it will be destroyed when reply received. // TxCb->TxPacket = Packet; TxCb->Xid = Packet->Dhcp6.Header.TransactionId; @@ -2510,7 +2510,7 @@ Dhcp6HandleStateful ( ClientId = Service->ClientId; Status = EFI_SUCCESS; - if (Instance->InDestory || Instance->Config == NULL) { + if (Instance->InDestroy || Instance->Config == NULL) { goto ON_CONTINUE; } @@ -2624,7 +2624,7 @@ Dhcp6HandleStateless ( IsMatched = FALSE; InfCb = NULL; - if (Instance->InDestory) { + if (Instance->InDestroy) { goto ON_EXIT; } diff --git a/NetworkPkg/IScsiDxe/IScsiIbft.c b/NetworkPkg/IScsiDxe/IScsiIbft.c index e90c982bc2..879d310cc9 100644 --- a/NetworkPkg/IScsiDxe/IScsiIbft.c +++ b/NetworkPkg/IScsiDxe/IScsiIbft.c @@ -1,7 +1,7 @@ /** @file Implementation for iSCSI Boot Firmware Table publication. -Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 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 which accompanies this distribution. The full text of the license may be found at @@ -310,18 +310,18 @@ IScsiFillNICAndTargetSections ( // // Map the various v4 addresses into v6 addresses. // - IScsiMapV4ToV6Addr (&NvData->LocalIp, &Nic->Ip); - IScsiMapV4ToV6Addr (&NvData->Gateway, &Nic->Gateway); + IScsiMapV4ToV6Addr (&NvData->LocalIp.v4, &Nic->Ip); + IScsiMapV4ToV6Addr (&NvData->Gateway.v4, &Nic->Gateway); IScsiMapV4ToV6Addr (&Attempt->PrimaryDns.v4, &Nic->PrimaryDns); IScsiMapV4ToV6Addr (&Attempt->SecondaryDns.v4, &Nic->SecondaryDns); IScsiMapV4ToV6Addr (&Attempt->DhcpServer.v4, &Nic->DhcpServer); } else if (NvData->IpMode == IP_MODE_IP6 || NvData->IpMode == IP_MODE_AUTOCONFIG) { - // - // TODO: The subnet mask/local ip/gateway/dhcpserver for iBFT-IPv6 needs to be - // confirmed with spec owner. - // + Nic->SubnetMaskPrefixLength = NvData->PrefixLength; + CopyMem (&Nic->Ip, &NvData->LocalIp, sizeof (EFI_IPv6_ADDRESS)); + CopyMem (&Nic->Gateway, &NvData->Gateway, sizeof (EFI_IPv6_ADDRESS)); + CopyMem (&Nic->PrimaryDns, &Attempt->PrimaryDns, sizeof (EFI_IPv6_ADDRESS)); CopyMem (&Nic->SecondaryDns, &Attempt->SecondaryDns, sizeof (EFI_IPv6_ADDRESS)); // diff --git a/NetworkPkg/IScsiDxe/IScsiImpl.h b/NetworkPkg/IScsiDxe/IScsiImpl.h index ccb83edb84..7c8eb37842 100644 --- a/NetworkPkg/IScsiDxe/IScsiImpl.h +++ b/NetworkPkg/IScsiDxe/IScsiImpl.h @@ -1,7 +1,7 @@ /** @file The shared head file for iSCSI driver. -Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 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 which accompanies this distribution. The full text of the license may be found at @@ -23,6 +23,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include +#include #include #include #include diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.h b/NetworkPkg/IScsiDxe/IScsiMisc.h index 8646f666a4..c9ff96da6c 100644 --- a/NetworkPkg/IScsiDxe/IScsiMisc.h +++ b/NetworkPkg/IScsiDxe/IScsiMisc.h @@ -1,7 +1,7 @@ /** @file Miscellaneous definitions for iSCSI driver. -Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 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 which accompanies this distribution. The full text of the license may be found at @@ -23,14 +23,15 @@ typedef struct _ISCSI_SESSION_CONFIG_NVDATA { UINT8 Enabled; UINT8 IpMode; - EFI_IPv4_ADDRESS LocalIp; + EFI_IP_ADDRESS LocalIp; EFI_IPv4_ADDRESS SubnetMask; - EFI_IPv4_ADDRESS Gateway; + EFI_IP_ADDRESS Gateway; BOOLEAN InitiatorInfoFromDhcp; BOOLEAN TargetInfoFromDhcp; CHAR8 TargetName[ISCSI_NAME_MAX_SIZE]; EFI_IP_ADDRESS TargetIp; + UINT8 PrefixLength; UINT8 BootLun[8]; UINT16 ConnectTimeout; ///< timout value in milliseconds diff --git a/NetworkPkg/IScsiDxe/IScsiProto.c b/NetworkPkg/IScsiDxe/IScsiProto.c index 72c90a7fe8..3dabb00d4a 100644 --- a/NetworkPkg/IScsiDxe/IScsiProto.c +++ b/NetworkPkg/IScsiDxe/IScsiProto.c @@ -308,6 +308,98 @@ IScsiDestroyConnection ( FreePool (Conn); } +/** + Retrieve the IPv6 Address/Prefix/Gateway from the established TCP connection, these informations + will be filled in the iSCSI Boot Firmware Table. + + @param[in] Conn The connection used in the iSCSI login phase. + + @retval EFI_SUCCESS Get the NIC information successfully. + @retval Others Other errors as indicated. + +**/ +EFI_STATUS +IScsiGetIp6NicInfo ( + IN ISCSI_CONNECTION *Conn + ) +{ + ISCSI_SESSION_CONFIG_NVDATA *NvData; + EFI_TCP6_PROTOCOL *Tcp6; + EFI_IP6_MODE_DATA Ip6ModeData; + EFI_STATUS Status; + EFI_IPv6_ADDRESS *TargetIp; + UINTN Index; + UINT8 SubnetPrefixLength; + UINTN RouteEntry; + + NvData = &Conn->Session->ConfigData->SessionConfigData; + TargetIp = &NvData->TargetIp.v6; + Tcp6 = Conn->TcpIo.Tcp.Tcp6; + + ZeroMem (&Ip6ModeData, sizeof (EFI_IP6_MODE_DATA)); + Status = Tcp6->GetModeData ( + Tcp6, + NULL, + NULL, + &Ip6ModeData, + NULL, + NULL + ); + if (EFI_ERROR (Status)) { + return Status; + } + + if (!Ip6ModeData.IsConfigured) { + Status = EFI_ABORTED; + goto ON_EXIT; + } + + IP6_COPY_ADDRESS (&NvData->LocalIp, &Ip6ModeData.ConfigData.StationAddress); + + NvData->PrefixLength = 0; + for (Index = 0; Index < Ip6ModeData.AddressCount; Index++) { + if (EFI_IP6_EQUAL (&NvData->LocalIp.v6, &Ip6ModeData.AddressList[Index].Address)) { + NvData->PrefixLength = Ip6ModeData.AddressList[Index].PrefixLength; + break; + } + } + + SubnetPrefixLength = 0; + RouteEntry = Ip6ModeData.RouteCount; + for (Index = 0; Index < Ip6ModeData.RouteCount; Index++) { + if (NetIp6IsNetEqual (TargetIp, &Ip6ModeData.RouteTable[Index].Destination, Ip6ModeData.RouteTable[Index].PrefixLength)) { + if (SubnetPrefixLength < Ip6ModeData.RouteTable[Index].PrefixLength) { + SubnetPrefixLength = Ip6ModeData.RouteTable[Index].PrefixLength; + RouteEntry = Index; + } + } + } + if (RouteEntry != Ip6ModeData.RouteCount) { + IP6_COPY_ADDRESS (&NvData->Gateway, &Ip6ModeData.RouteTable[RouteEntry].Gateway); + } + +ON_EXIT: + if (Ip6ModeData.AddressList != NULL) { + FreePool (Ip6ModeData.AddressList); + } + if (Ip6ModeData.GroupTable!= NULL) { + FreePool (Ip6ModeData.GroupTable); + } + if (Ip6ModeData.RouteTable!= NULL) { + FreePool (Ip6ModeData.RouteTable); + } + if (Ip6ModeData.NeighborCache!= NULL) { + FreePool (Ip6ModeData.NeighborCache); + } + if (Ip6ModeData.PrefixTable!= NULL) { + FreePool (Ip6ModeData.PrefixTable); + } + if (Ip6ModeData.IcmpTypeList!= NULL) { + FreePool (Ip6ModeData.IcmpTypeList); + } + + return Status; +} /** Login the iSCSI session. @@ -395,6 +487,10 @@ IScsiSessionLogin ( ); ASSERT_EFI_ERROR (Status); + + if (mPrivate->Ipv6Flag) { + Status = IScsiGetIp6NicInfo (Conn); + } } return Status; diff --git a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c index 8b389772d9..b9840444bb 100644 --- a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c +++ b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c @@ -1,7 +1,7 @@ /** @file The implementation of EFI IPv6 Configuration Protocol. - 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 @@ -2316,12 +2316,12 @@ Ip6ConfigCleanInstance ( } /** - Destory the Dhcp6 child in IP6_CONFIG_INSTANCE and release the resources. + Destroy the Dhcp6 child in IP6_CONFIG_INSTANCE and release the resources. @param[in, out] Instance The buffer of IP6_CONFIG_INSTANCE to be freed. @retval EFI_SUCCESS The child was successfully destroyed. - @retval Others Failed to destory the child. + @retval Others Failed to destroy the child. **/ EFI_STATUS diff --git a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.h b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.h index 5ae483931a..ccb09ccc77 100644 --- a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.h +++ b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.h @@ -1,7 +1,7 @@ /** @file Definitions for EFI IPv6 Configuartion Protocol implementation. - Copyright (c) 2009 - 2010, 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 @@ -279,12 +279,12 @@ Ip6ConfigCleanInstance ( ); /** - Destory the Dhcp6 child in IP6_CONFIG_INSTANCE and release the resources. + Destroy the Dhcp6 child in IP6_CONFIG_INSTANCE and release the resources. @param[in, out] Instance The buffer of IP6_CONFIG_INSTANCE to be freed. @retval EFI_SUCCESS The child was successfully destroyed. - @retval Others Failed to destory the child. + @retval Others Failed to destroy the child. **/ EFI_STATUS diff --git a/NetworkPkg/Ip6Dxe/Ip6Driver.c b/NetworkPkg/Ip6Dxe/Ip6Driver.c index 502c32bd0d..d242b153df 100644 --- a/NetworkPkg/Ip6Dxe/Ip6Driver.c +++ b/NetworkPkg/Ip6Dxe/Ip6Driver.c @@ -1,7 +1,7 @@ /** @file The driver binding and service binding protocol for IP6 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 @@ -94,7 +94,7 @@ Ip6DriverBindingSupported ( Clean up an IP6 service binding instance. It releases all the resource allocated by the instance. The instance may be partly initialized, or partly destroyed. If a resource is - destroyed, it is marked as that in case the destory failed and + destroyed, it is marked as that in case the destroy failed and being called again later. @param[in] IpSb The IP6 service binding instance to clean up. @@ -852,8 +852,8 @@ Ip6ServiceBindingDestroyChild ( // // A child can be destroyed more than once. For example, - // Ip6DriverBindingStop will destory all of its children. - // when UDP driver is being stopped, it will destory all + // Ip6DriverBindingStop will destroy all of its children. + // when UDP driver is being stopped, it will destroy all // the IP child it opens. // if (IpInstance->State == IP6_STATE_DESTROY) { diff --git a/NetworkPkg/Ip6Dxe/Ip6Driver.h b/NetworkPkg/Ip6Dxe/Ip6Driver.h index 48ffe7b06b..4a23d836b8 100644 --- a/NetworkPkg/Ip6Dxe/Ip6Driver.h +++ b/NetworkPkg/Ip6Dxe/Ip6Driver.h @@ -1,7 +1,7 @@ /** @file The driver binding and service binding protocol for IP6 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 @@ -24,7 +24,7 @@ extern EFI_COMPONENT_NAME2_PROTOCOL gIp6ComponentName2; Clean up an IP6 service binding instance. It releases all the resource allocated by the instance. The instance may be partly initialized, or partly destroyed. If a resource is - destroyed, it is marked as that in case the destory failed and + destroyed, it is marked as that in case the destroy failed and being called again later. @param[in] IpSb The IP6 service binding instance to clean up. diff --git a/NetworkPkg/Ip6Dxe/Ip6If.c b/NetworkPkg/Ip6Dxe/Ip6If.c index 198b547ed2..a934188479 100644 --- a/NetworkPkg/Ip6Dxe/Ip6If.c +++ b/NetworkPkg/Ip6Dxe/Ip6If.c @@ -1,7 +1,7 @@ /** @file Implement IP6 pesudo interface. - Copyright (c) 2009 - 2010, 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 @@ -314,7 +314,7 @@ Ip6CleanInterface ( } // - // Destory the interface if this is the last IP instance. + // Destroy the interface if this is the last IP instance. // Remove all the system transmitted packets // from this interface, cancel the receive request if exists. // diff --git a/NetworkPkg/Ip6Dxe/Ip6Impl.c b/NetworkPkg/Ip6Dxe/Ip6Impl.c index 9775aec778..44e0392511 100644 --- a/NetworkPkg/Ip6Dxe/Ip6Impl.c +++ b/NetworkPkg/Ip6Dxe/Ip6Impl.c @@ -1,7 +1,7 @@ /** @file Implementation of EFI_IP6_PROTOCOL protocol interfaces. - Copyright (c) 2009 - 2010, 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 @@ -689,7 +689,7 @@ EfiIp6Configure ( Status = Ip6CleanProtocol (IpInstance); // - // Don't change the state if it is DESTORY, consider the following + // Don't change the state if it is DESTROY, consider the following // valid sequence: Mnp is unloaded-->Ip Stopped-->Udp Stopped, // Configure (ThisIp, NULL). If the state is changed to UNCONFIGED, // the unload fails miserably. diff --git a/NetworkPkg/Ip6Dxe/Ip6Nd.c b/NetworkPkg/Ip6Dxe/Ip6Nd.c index 4bcf1a6d44..d510f330c1 100644 --- a/NetworkPkg/Ip6Dxe/Ip6Nd.c +++ b/NetworkPkg/Ip6Dxe/Ip6Nd.c @@ -1,7 +1,7 @@ /** @file Implementation of Neighbor Discovery support routines. - 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 @@ -261,7 +261,7 @@ Ip6CreatePrefixListEntry ( } /** - Destory a IP6 prefix list entry. + Destroy a IP6 prefix list entry. @param[in] IpSb The pointer to IP6_SERVICE instance. @param[in] PrefixEntry The to be destroyed prefix list entry. diff --git a/NetworkPkg/Ip6Dxe/Ip6Nd.h b/NetworkPkg/Ip6Dxe/Ip6Nd.h index 1ec022ba64..982203ca5f 100644 --- a/NetworkPkg/Ip6Dxe/Ip6Nd.h +++ b/NetworkPkg/Ip6Dxe/Ip6Nd.h @@ -1,7 +1,7 @@ /** @file Definition of Neighbor Discovery support routines. - 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 @@ -336,7 +336,7 @@ Ip6CreatePrefixListEntry ( ); /** - Destory a IP6 prefix list entry. + Destroy a IP6 prefix list entry. @param[in] IpSb The pointer to IP6_SERVICE instance. @param[in] PrefixEntry The to be destroyed prefix list entry. 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; diff --git a/NetworkPkg/TcpDxe/SockImpl.c b/NetworkPkg/TcpDxe/SockImpl.c index 7fad042be6..f941556402 100644 --- a/NetworkPkg/TcpDxe/SockImpl.c +++ b/NetworkPkg/TcpDxe/SockImpl.c @@ -1,7 +1,7 @@ /** @file Implementation of the Socket. - Copyright (c) 2009 - 2010, 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 @@ -787,7 +787,7 @@ SockDestroy ( } // - // Destory the RcvBuffer Queue and SendBuffer Queue + // Destroy the RcvBuffer Queue and SendBuffer Queue // NetbufQueFree (Sock->RcvBuffer.DataQueue); NetbufQueFree (Sock->SndBuffer.DataQueue); @@ -802,7 +802,7 @@ SockDestroy ( DEBUG ( (EFI_D_WARN, - "SockDestory: Delete a unaccepted socket from parent now conncnt is %d\n", + "SockDestroy: Delete a unaccepted socket from parent now conncnt is %d\n", Sock->Parent->ConnCnt) ); diff --git a/NetworkPkg/TcpDxe/SockInterface.c b/NetworkPkg/TcpDxe/SockInterface.c index ebab8c7f18..075e9ada6a 100644 --- a/NetworkPkg/TcpDxe/SockInterface.c +++ b/NetworkPkg/TcpDxe/SockInterface.c @@ -1,7 +1,7 @@ /** @file Interface function of the Socket. - 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 @@ -129,7 +129,7 @@ SockBufferToken ( } /** - Destory the socket Sock and its associated protocol control block. + Destroy the socket Sock and its associated protocol control block. @param[in, out] Sock The socket to be destroyed. diff --git a/NetworkPkg/TcpDxe/Socket.h b/NetworkPkg/TcpDxe/Socket.h index a00625244e..9e2d907150 100644 --- a/NetworkPkg/TcpDxe/Socket.h +++ b/NetworkPkg/TcpDxe/Socket.h @@ -1,7 +1,7 @@ /** @file Common head file for TCP socket. - Copyright (c) 2009 - 2010, 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 @@ -696,7 +696,7 @@ SockCreateChild ( ); /** - Destory the socket Sock and its associated protocol control block. + Destroy the socket Sock and its associated protocol control block. @param[in, out] Sock The socket to be destroyed. diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c index ecafc86a03..23682b2451 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c @@ -532,7 +532,7 @@ PxeBcParseDhcp4Packet ( (Offer->Dhcp4.Header.BootFileName[0] != 0)) { // // If the bootfile is not present and bootfilename is present in DHCPv4 packet, just parse it. - // Do not count dhcp option header here, or else will destory the serverhostname. + // Do not count dhcp option header here, or else will destroy the serverhostname. // Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] = (EFI_DHCP4_PACKET_OPTION *) (&Offer->Dhcp4.Header.BootFileName[0] - diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c index 6ab2afa088..1eb64a6a0f 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c @@ -1748,7 +1748,7 @@ PxeBcDhcp6Sarr ( Config.IaInfoEvent = NULL; Config.RapidCommit = FALSE; Config.ReconfigureAccept = FALSE; - Config.IaDescriptor.IaId = 1; + Config.IaDescriptor.IaId = Private->IaId; Config.IaDescriptor.Type = EFI_DHCP6_IA_TYPE_NA; Config.SolicitRetransmission = Retransmit; Retransmit->Irt = 4; diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c index 179009f91c..080b751cb1 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c @@ -1,7 +1,7 @@ /** @file Driver Binding functions implementationfor for UefiPxeBc Driver. - Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2007 - 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 @@ -779,6 +779,7 @@ PxeBcCreateIp6Children ( EFI_IP6_MODE_DATA Ip6ModeData; PXEBC_PRIVATE_PROTOCOL *Id; EFI_SIMPLE_NETWORK_PROTOCOL *Snp; + UINTN Index; if (Private->Ip6Nic != NULL) { // @@ -821,6 +822,16 @@ PxeBcCreateIp6Children ( goto ON_ERROR; } + // + // Generate a random IAID for the Dhcp6 assigned address. + // + Private->IaId = NET_RANDOM (NetRandomInitSeed ()); + if (Private->Snp != NULL) { + for (Index = 0; Index < Private->Snp->Mode->HwAddressSize; Index++) { + Private->IaId |= (Private->Snp->Mode->CurrentAddress.Addr[Index] << ((Index << 3) & 31)); + } + } + // // Create Mtftp6 child and open Mtftp6 protocol for PxeBc->Mtftp. // diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c index 5f693729d6..183dc0ced7 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c @@ -2348,6 +2348,15 @@ EfiPxeLoadFile ( // Start Pxe Base Code to initialize PXE boot. // Status = PxeBc->Start (PxeBc, UsingIpv6); + if (Status == EFI_ALREADY_STARTED && UsingIpv6 != PxeBc->Mode->UsingIpv6) { + // + // PxeBc protocol has already been started but not on the required IP version, restart it. + // + Status = PxeBc->Stop (PxeBc); + if (!EFI_ERROR (Status)) { + Status = PxeBc->Start (PxeBc, UsingIpv6); + } + } if (Status == EFI_SUCCESS || Status == EFI_ALREADY_STARTED) { Status = PxeBcLoadBootFile (Private, BufferSize, Buffer); } diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h index bea4931efb..1d4381a1f5 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h @@ -165,6 +165,7 @@ struct _PXEBC_PRIVATE_DATA { EFI_IP_ADDRESS GatewayIp; EFI_IP_ADDRESS ServerIp; UINT16 CurSrcPort; + UINT32 IaId; UINT32 Ip4MaxPacketSize; UINT32 Ip6MaxPacketSize; diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c index 7d03b68d91..32a4f7fb43 100644 --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c @@ -1042,7 +1042,7 @@ TimeoutToGetMap ( } /** - Create an IP child, use it to start the auto configuration, then destory it. + Create an IP child, use it to start the auto configuration, then destroy it. @param[in] NicInfo The pointer to the NIC_INFO of the Nic to be configured. diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c index f24a55c87a..fd4aa8d81e 100644 --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c @@ -1,7 +1,7 @@ /** @file The implementation for Ping shell command. - 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 @@ -1190,14 +1190,14 @@ ON_ERROR: } /** - Destory the IP instance. + Destroy the IP instance. @param[in] Private The pointer of PING_PRIVATE_DATA. **/ VOID EFIAPI -Ping6DestoryIp6Instance ( +Ping6DestroyIp6Instance ( IN PING_PRIVATE_DATA *Private ) { @@ -1414,7 +1414,7 @@ ON_EXIT: } if (Private->IpChildHandle != NULL) { - Ping6DestoryIp6Instance (Private); + Ping6DestroyIp6Instance (Private); } FreePool (Private); -- cgit v1.2.3