This library is used to share code between UEFI network stack modules.\r
It provides the helper routines to access UDP service. It is used by both DHCP and MTFTP.\r
\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
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<BR>\r
UINT8 UdpVersion;\r
\r
//\r
- // Handle used to create/destory UDP child\r
+ // Handle used to create/destroy UDP child\r
//\r
EFI_HANDLE Controller;\r
EFI_HANDLE Image;\r
\r
\r
/**\r
- Destory a child of the service that is identified by ServiceBindingGuid.\r
+ Destroy a child of the service that is identified by ServiceBindingGuid.\r
\r
Get the ServiceBinding Protocol first, then use it to destroy a child.\r
\r
@param[in] Controller The controller which has the service installed.\r
@param[in] Image The image handle used to open service.\r
@param[in] ServiceBindingGuid The service's Guid.\r
- @param[in] ChildHandle The child to destory.\r
+ @param[in] ChildHandle The child to destroy.\r
\r
- @retval EFI_SUCCESS The child is successfully destoried.\r
- @retval Others Failed to destory the child.\r
+ @retval EFI_SUCCESS The child is successfully destroyed.\r
+ @retval Others Failed to destroy the child.\r
\r
**/\r
EFI_STATUS\r
}\r
\r
//\r
- // destory the child\r
+ // destroy the child\r
//\r
Status = Service->DestroyChild (Service, ChildHandle);\r
return Status;\r
/** @file\r
Help functions to access UDP service, it is used by both the DHCP and MTFTP.\r
\r
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>\r
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<BR>\r
}\r
\r
//\r
- // Close then destory the Udp4 child\r
+ // Close then destroy the Udp4 child\r
//\r
gBS->CloseProtocol (\r
UdpIo->UdpHandle,\r
}\r
\r
//\r
- // Close then destory the Udp6 child\r
+ // Close then destroy the Udp6 child\r
//\r
gBS->CloseProtocol (\r
UdpIo->UdpHandle,\r
/** @file\r
\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
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
\r
\r
/**\r
- Destory the DHCP service. The Dhcp4 service may be partly initialized,\r
+ Destroy the DHCP service. The Dhcp4 service may be partly initialized,\r
or partly destroyed. If a resource is destroyed, it is marked as so in\r
case the destroy failed and being called again later.\r
\r
- @param[in] DhcpSb The DHCP service instance to destory.\r
+ @param[in] DhcpSb The DHCP service instance to destroy.\r
\r
@retval EFI_SUCCESS Always return success.\r
\r
\r
DhcpSb->Signature = DHCP_SERVICE_SIGNATURE;\r
DhcpSb->ServiceState = DHCP_UNCONFIGED;\r
- DhcpSb->InDestory = FALSE;\r
+ DhcpSb->InDestroy = FALSE;\r
DhcpSb->Controller = Controller;\r
DhcpSb->Image = ImageHandle;\r
InitializeListHead (&DhcpSb->Children);\r
\r
DhcpSb = DHCP_SERVICE_FROM_THIS (ServiceBinding);\r
\r
- if (DhcpSb->InDestory) {\r
+ if (DhcpSb->InDestroy) {\r
return EFI_SUCCESS;\r
}\r
\r
\r
if (NumberOfChildren == 0) {\r
\r
- DhcpSb->InDestory = TRUE;\r
- DhcpSb->ServiceState = DHCP_DESTORY;\r
+ DhcpSb->InDestroy = TRUE;\r
+ DhcpSb->ServiceState = DHCP_DESTROY;\r
\r
gBS->UninstallProtocolInterface (\r
NicHandle,\r
FreePool (DhcpSb);\r
} else {\r
//\r
- // Don't use NET_LIST_FOR_EACH_SAFE here, Dhcp4ServiceBindingDestoryChild\r
+ // Don't use NET_LIST_FOR_EACH_SAFE here, Dhcp4ServiceBindingDestroyChild\r
// may cause other child to be deleted.\r
//\r
while (!IsListEmpty (&DhcpSb->Children)) {\r
InitializeListHead (&Instance->Link);\r
Instance->Handle = NULL;\r
Instance->Service = DhcpSb;\r
- Instance->InDestory = FALSE;\r
+ Instance->InDestroy = FALSE;\r
Instance->CompletionEvent = NULL;\r
Instance->RenewRebindEvent = NULL;\r
Instance->Token = NULL;\r
//\r
// A child can be destroyed more than once. For example,\r
// Dhcp4DriverBindingStop will destroy all of its children.\r
- // when caller driver is being stopped, it will destory the\r
+ // when caller driver is being stopped, it will destroy the\r
// dhcp child it opens.\r
//\r
- if (Instance->InDestory) {\r
+ if (Instance->InDestroy) {\r
return EFI_SUCCESS;\r
}\r
\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
- Instance->InDestory = TRUE;\r
+ Instance->InDestroy = TRUE;\r
\r
//\r
// Close the Udp4 protocol.\r
);\r
\r
if (EFI_ERROR (Status)) {\r
- Instance->InDestory = FALSE;\r
+ Instance->InDestroy = FALSE;\r
\r
gBS->RestoreTPL (OldTpl);\r
return Status;\r
RFC 1534: Interoperation Between DHCP and BOOTP\r
RFC 3396: Encoding Long Options in DHCP.\r
\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
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
// The state of the DHCP service. It starts as UNCONFIGED. If\r
// and active child configures the service successfully, it\r
// goes to CONFIGED. If the active child configures NULL, it\r
-// goes back to UNCONFIGED. It becomes DESTORY if it is (partly)\r
-// destoried.\r
+// goes back to UNCONFIGED. It becomes DESTROY if it is (partly)\r
+// destroyed.\r
//\r
#define DHCP_UNCONFIGED 0\r
#define DHCP_CONFIGED 1\r
-#define DHCP_DESTORY 2\r
+#define DHCP_DESTROY 2\r
\r
\r
struct _DHCP_PROTOCOL {\r
EFI_HANDLE Handle;\r
DHCP_SERVICE *Service;\r
\r
- BOOLEAN InDestory;\r
+ BOOLEAN InDestroy;\r
\r
EFI_EVENT CompletionEvent;\r
EFI_EVENT RenewRebindEvent;\r
UINT32 Signature;\r
EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;\r
\r
- INTN ServiceState; // CONFIGED, UNCONFIGED, and DESTORY\r
- BOOLEAN InDestory;\r
+ INTN ServiceState; // CONFIGED, UNCONFIGED, and DESTROY\r
+ BOOLEAN InDestroy;\r
\r
EFI_HANDLE Controller;\r
EFI_HANDLE Image;\r
/** @file\r
EFI DHCP protocol implementation.\r
\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
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
DhcpSb = (DHCP_SERVICE *) Context;\r
\r
//\r
- // Don't restart receive if error occurs or DHCP is destoried.\r
+ // Don't restart receive if error occurs or DHCP is destroyed.\r
//\r
if (EFI_ERROR (IoStatus)) {\r
return ;\r
- } else if (DhcpSb->ServiceState == DHCP_DESTORY) {\r
+ } else if (DhcpSb->ServiceState == DHCP_DESTROY) {\r
NetbufFree (UdpPacket);\r
return ;\r
}\r
/** @file\r
The driver binding and service binding protocol for IP4 driver.\r
\r
-Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>\r
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
Clean up a IP4 service binding instance. It will release all\r
the resource allocated by the instance. The instance may be\r
partly initialized, or partly destroyed. If a resource is\r
- destroyed, it is marked as that in case the destory failed and\r
+ destroyed, it is marked as that in case the destroy failed and\r
being called again later.\r
\r
@param[in] IpSb The IP4 serviceing binding instance to clean up\r
IpSb->ServiceBinding.CreateChild = Ip4ServiceBindingCreateChild;\r
IpSb->ServiceBinding.DestroyChild = Ip4ServiceBindingDestroyChild;\r
IpSb->State = IP4_SERVICE_UNSTARTED;\r
- IpSb->InDestory = FALSE;\r
+ IpSb->InDestroy = FALSE;\r
\r
IpSb->NumChildren = 0;\r
InitializeListHead (&IpSb->Children);\r
Clean up a IP4 service binding instance. It will release all\r
the resource allocated by the instance. The instance may be\r
partly initialized, or partly destroyed. If a resource is\r
- destroyed, it is marked as that in case the destory failed and\r
+ destroyed, it is marked as that in case the destroy failed and\r
being called again later.\r
\r
@param[in] IpSb The IP4 serviceing binding instance to clean up\r
\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
\r
- if (IpSb->Ip4Config != NULL && (IpSb->State != IP4_SERVICE_DESTORY)) {\r
+ if (IpSb->Ip4Config != NULL && (IpSb->State != IP4_SERVICE_DESTROY)) {\r
\r
IpSb->Ip4Config->Stop (IpSb->Ip4Config);\r
\r
\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
\r
- if (IpSb->InDestory) {\r
+ if (IpSb->InDestroy) {\r
gBS->RestoreTPL (OldTpl);\r
return EFI_SUCCESS;\r
}\r
goto ON_ERROR;\r
}\r
\r
- IpSb->InDestory = TRUE;\r
+ IpSb->InDestroy = TRUE;\r
\r
State = IpSb->State;\r
- IpSb->State = IP4_SERVICE_DESTORY;\r
+ IpSb->State = IP4_SERVICE_DESTROY;\r
\r
//\r
// Clear the variable data.\r
\r
FreePool (IpSb);\r
} else if (NumberOfChildren == 0) {\r
- IpSb->InDestory = TRUE;\r
+ IpSb->InDestroy = TRUE;\r
\r
State = IpSb->State;\r
- IpSb->State = IP4_SERVICE_DESTORY;\r
+ IpSb->State = IP4_SERVICE_DESTROY;\r
\r
//\r
// Clear the variable data.\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
\r
//\r
- // A child can be destoried more than once. For example,\r
- // Ip4DriverBindingStop will destory all of its children.\r
- // when UDP driver is being stopped, it will destory all\r
+ // A child can be destroyed more than once. For example,\r
+ // Ip4DriverBindingStop will destroy all of its children.\r
+ // when UDP driver is being stopped, it will destroy all\r
// the IP child it opens.\r
//\r
- if (IpInstance->State == IP4_STATE_DESTORY) {\r
+ if (IpInstance->State == IP4_STATE_DESTROY) {\r
gBS->RestoreTPL (OldTpl);\r
return EFI_SUCCESS;\r
}\r
\r
State = IpInstance->State;\r
- IpInstance->State = IP4_STATE_DESTORY;\r
+ IpInstance->State = IP4_STATE_DESTROY;\r
\r
//\r
// Close the Managed Network protocol.\r
/** @file\r
Implement IP4 pesudo interface.\r
\r
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>\r
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
}\r
\r
//\r
- // Destory the interface if this is the last IP instance that\r
+ // Destroy the interface if this is the last IP instance that\r
// has the address. Remove all the system transmitted packets\r
// from this interface, cancel the receive request if there is\r
- // one, and destory the ARP requests.\r
+ // one, and destroy the ARP requests.\r
//\r
Ip4CancelFrames (Interface, EFI_ABORTED, Ip4CancelInstanceFrame, NULL);\r
Ip4CancelReceive (Interface);\r
/** @file\r
Definition for IP4 pesudo interface structure.\r
\r
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>\r
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
BOOLEAN Configured;\r
\r
//\r
- // Handle used to create/destory ARP child. All the IP children\r
+ // Handle used to create/destroy ARP child. All the IP children\r
// share one MNP which is owned by IP service binding.\r
//\r
EFI_HANDLE Controller;\r
/** @file\r
\r
-Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>\r
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
Status = Ip4CleanProtocol (IpInstance);\r
\r
//\r
- // Don't change the state if it is DESTORY, consider the following\r
+ // Don't change the state if it is DESTROY, consider the following\r
// valid sequence: Mnp is unloaded-->Ip Stopped-->Udp Stopped,\r
// Configure (ThisIp, NULL). If the state is changed to UNCONFIGED,\r
// the unload fails miserably.\r
/** @file\r
Ip4 internal functions and type defintions.\r
\r
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>\r
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
//\r
// The state of IP4 protocol. It starts from UNCONFIGED. if it is\r
// successfully configured, it goes to CONFIGED. if configure NULL\r
-// is called, it becomes UNCONFIGED again. If (partly) destoried, it\r
-// becomes DESTORY.\r
+// is called, it becomes UNCONFIGED again. If (partly) destroyed, it\r
+// becomes DESTROY.\r
//\r
#define IP4_STATE_UNCONFIGED 0\r
#define IP4_STATE_CONFIGED 1\r
-#define IP4_STATE_DESTORY 2\r
+#define IP4_STATE_DESTROY 2\r
\r
//\r
// The state of IP4 service. It starts from UNSTARTED. It transits\r
// to STARTED if autoconfigure is started. If default address is\r
-// configured, it becomes CONFIGED. and if partly destoried, it goes\r
-// to DESTORY.\r
+// configured, it becomes CONFIGED. and if partly destroyed, it goes\r
+// to DESTROY.\r
//\r
#define IP4_SERVICE_UNSTARTED 0\r
#define IP4_SERVICE_STARTED 1\r
#define IP4_SERVICE_CONFIGED 2\r
-#define IP4_SERVICE_DESTORY 3\r
+#define IP4_SERVICE_DESTROY 3\r
\r
\r
///\r
UINT32 Signature;\r
EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;\r
INTN State;\r
- BOOLEAN InDestory;\r
+ BOOLEAN InDestroy;\r
\r
//\r
// List of all the IP instances and interfaces, and default\r
/** @file\r
IP4 input process.\r
\r
-Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>\r
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
IpSb = (IP4_SERVICE *) Context;\r
Option = NULL;\r
\r
- if (EFI_ERROR (IoStatus) || (IpSb->State == IP4_SERVICE_DESTORY)) {\r
+ if (EFI_ERROR (IoStatus) || (IpSb->State == IP4_SERVICE_DESTROY)) {\r
goto DROP;\r
}\r
\r
/** @file\r
Implementation of Mtftp drivers.\r
\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
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
\r
MtftpSb->Signature = MTFTP4_SERVICE_SIGNATURE;\r
MtftpSb->ServiceBinding = gMtftp4ServiceBindingTemplete;\r
- MtftpSb->InDestory = FALSE;\r
+ MtftpSb->InDestroy = FALSE;\r
MtftpSb->ChildrenNum = 0;\r
InitializeListHead (&MtftpSb->Children);\r
\r
\r
MtftpSb = MTFTP4_SERVICE_FROM_THIS (ServiceBinding);\r
\r
- if (MtftpSb->InDestory) {\r
+ if (MtftpSb->InDestroy) {\r
return EFI_SUCCESS;\r
}\r
\r
\r
if (NumberOfChildren == 0) {\r
\r
- MtftpSb->InDestory = TRUE;\r
+ MtftpSb->InDestroy = TRUE;\r
\r
gBS->UninstallProtocolInterface (\r
NicHandle,\r
InitializeListHead (&Instance->Link);\r
CopyMem (&Instance->Mtftp4, &gMtftp4ProtocolTemplate, sizeof (Instance->Mtftp4));\r
Instance->State = MTFTP4_STATE_UNCONFIGED;\r
- Instance->InDestory = FALSE;\r
+ Instance->InDestroy = FALSE;\r
Instance->Service = MtftpSb;\r
\r
InitializeListHead (&Instance->Blocks);\r
\r
\r
/**\r
- Destory one of the service binding's child.\r
+ Destroy one of the service binding's child.\r
\r
@param This The service binding instance\r
- @param ChildHandle The child handle to destory\r
+ @param ChildHandle The child handle to destroy\r
\r
@retval EFI_INVALID_PARAMETER The parameter is invaid.\r
- @retval EFI_UNSUPPORTED The child may have already been destoried.\r
- @retval EFI_SUCCESS The child is destoried and removed from the\r
+ @retval EFI_UNSUPPORTED The child may have already been destroyed.\r
+ @retval EFI_SUCCESS The child is destroyed and removed from the\r
parent's child list.\r
\r
**/\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- if (Instance->InDestory) {\r
+ if (Instance->InDestroy) {\r
return EFI_SUCCESS;\r
}\r
\r
- Instance->InDestory = TRUE;\r
+ Instance->InDestroy = TRUE;\r
\r
//\r
// Close the Udp4 protocol.\r
);\r
\r
if (EFI_ERROR (Status)) {\r
- Instance->InDestory = FALSE;\r
+ Instance->InDestroy = FALSE;\r
return Status;\r
}\r
\r
/** @file\r
Mtftp drivers function header.\r
\r
-Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
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
);\r
\r
/**\r
- Destory one of the service binding's child.\r
+ Destroy one of the service binding's child.\r
\r
@param This The service binding instance\r
- @param ChildHandle The child handle to destory\r
+ @param ChildHandle The child handle to destroy\r
\r
@retval EFI_INVALID_PARAMETER The parameter is invaid.\r
- @retval EFI_UNSUPPORTED The child may have already been destoried.\r
- @retval EFI_SUCCESS The child is destoried and removed from the\r
+ @retval EFI_UNSUPPORTED The child may have already been destroyed.\r
+ @retval EFI_SUCCESS The child is destroyed and removed from the\r
parent's child list.\r
\r
**/\r
/** @file\r
Interface routine for Mtftp4.\r
\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
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
\r
if (Instance->State == MTFTP4_STATE_UNCONFIGED) {\r
return EFI_NOT_STARTED;\r
- } else if (Instance->State == MTFTP4_STATE_DESTORY) {\r
+ } else if (Instance->State == MTFTP4_STATE_DESTROY) {\r
return EFI_DEVICE_ERROR;\r
}\r
\r
RFC2348 - TFTP Blocksize Option\r
RFC2349 - TFTP Timeout Interval and Transfer Size Options\r
\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
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
\r
#define MTFTP4_STATE_UNCONFIGED 0\r
#define MTFTP4_STATE_CONFIGED 1\r
-#define MTFTP4_STATE_DESTORY 2\r
+#define MTFTP4_STATE_DESTROY 2\r
\r
///\r
/// Mtftp service block\r
UINT32 Signature;\r
EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;\r
\r
- BOOLEAN InDestory;\r
+ BOOLEAN InDestroy;\r
\r
UINT16 ChildrenNum;\r
LIST_ENTRY Children;\r
EFI_MTFTP4_PROTOCOL Mtftp4;\r
\r
INTN State;\r
- BOOLEAN InDestory;\r
+ BOOLEAN InDestroy;\r
\r
MTFTP4_SERVICE *Service;\r
EFI_HANDLE Handle;\r
/** @file\r
Implementation of the Socket.\r
\r
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>\r
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
\r
}\r
//\r
- // Destory the RcvBuffer Queue and SendBuffer Queue\r
+ // Destroy the RcvBuffer Queue and SendBuffer Queue\r
//\r
NetbufQueFree (Sock->RcvBuffer.DataQueue);\r
NetbufQueFree (Sock->SndBuffer.DataQueue);\r
\r
DEBUG (\r
(EFI_D_INFO,\r
- "SockDestory: Delete a unaccepted socket from parent"\r
+ "SockDestroy: Delete a unaccepted socket from parent"\r
"now conncnt is %d\n",\r
Sock->Parent->ConnCnt)\r
);\r
\r
\r
/**\r
- Destory the socket Sock and its associated protocol control block.\r
+ Destroy the socket Sock and its associated protocol control block.\r
\r
@param Sock The socket to be destroyed.\r
\r
/** @file\r
Socket header file.\r
\r
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>\r
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
);\r
\r
/**\r
- Destory the socket Sock and its associated protocol control block.\r
+ Destroy the socket Sock and its associated protocol control block.\r
\r
@param Sock The socket to be destroyed.\r
\r
/** @file\r
Support for PxeBc dhcp functions.\r
\r
-Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
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
(Offer->Dhcp4.Header.BootFileName[0] != 0)) {\r
//\r
// If the bootfile is not present and bootfilename is present in dhcp packet, just parse it.\r
- // And do not count dhcp option header, or else will destory the serverhostname.\r
+ // And do not count dhcp option header, or else will destroy the serverhostname.\r
//\r
Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] = (EFI_DHCP4_PACKET_OPTION *) (&Offer->Dhcp4.Header.BootFileName[0] -\r
OFFSET_OF (EFI_DHCP4_PACKET_OPTION, Data[0]));\r
/** @file\r
The implementation for Ping6 application.\r
\r
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
}\r
\r
/**\r
- Destory the IP6 instance.\r
+ Destroy the IP6 instance.\r
\r
@param[in] Private The pointer of PING6_PRIVATE_DATA.\r
\r
**/\r
VOID\r
-Ping6DestoryIp6Instance (\r
+Ping6DestroyIp6Instance (\r
IN PING6_PRIVATE_DATA *Private\r
)\r
{\r
}\r
\r
if (Private->Ip6ChildHandle != NULL) {\r
- Ping6DestoryIp6Instance (Private);\r
+ Ping6DestroyIp6Instance (Private);\r
}\r
\r
FreePool (Private);\r
\r
\r
/**\r
- Destory the Dhcp6 service. The Dhcp6 service may be partly initialized,\r
+ Destroy the Dhcp6 service. The Dhcp6 service may be partly initialized,\r
or partly destroyed. If a resource is destroyed, it is marked as such in\r
case the destroy failed and being called again later.\r
\r
)\r
{\r
//\r
- // All children instances should have been already destoryed here.\r
+ // All children instances should have been already destroyed here.\r
//\r
ASSERT (Service->NumOfChild == 0);\r
\r
// Initialize the fields of the new Dhcp6 service.\r
//\r
Dhcp6Srv->Signature = DHCP6_SERVICE_SIGNATURE;\r
- Dhcp6Srv->InDestory = FALSE;\r
+ Dhcp6Srv->InDestroy = FALSE;\r
Dhcp6Srv->Controller = Controller;\r
Dhcp6Srv->Image = ImageHandle;\r
Dhcp6Srv->Xid = (0xffffff & NET_RANDOM (NetRandomInitSeed ()));\r
Dhcp6Ins->Signature = DHCP6_INSTANCE_SIGNATURE;\r
Dhcp6Ins->UdpSts = EFI_ALREADY_STARTED;\r
Dhcp6Ins->Service = Service;\r
- Dhcp6Ins->InDestory = FALSE;\r
+ Dhcp6Ins->InDestroy = FALSE;\r
Dhcp6Ins->MediaPresent = TRUE;\r
\r
CopyMem (\r
\r
Service = DHCP6_SERVICE_FROM_THIS (ServiceBinding);\r
\r
- if (Service->InDestory) {\r
+ if (Service->InDestroy) {\r
return EFI_SUCCESS;\r
}\r
\r
\r
if (NumberOfChildren == 0) {\r
//\r
- // Destory the service itself if no child instance left.\r
+ // Destroy the service itself if no child instance left.\r
//\r
- Service->InDestory = TRUE;\r
+ Service->InDestroy = TRUE;\r
\r
Status = gBS->UninstallProtocolInterface (\r
NicHandle,\r
);\r
\r
if (EFI_ERROR (Status)) {\r
- Service->InDestory = FALSE;\r
+ Service->InDestroy = FALSE;\r
goto ON_EXIT;\r
}\r
\r
\r
} else {\r
//\r
- // Destory all the children instances before destory the service.\r
+ // Destroy all the children instances before destroy the service.\r
//\r
while (!IsListEmpty (&Service->Child)) {\r
Instance = NET_LIST_HEAD (&Service->Child, DHCP6_INSTANCE, Link);\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- if (Instance->InDestory) {\r
+ if (Instance->InDestroy) {\r
return EFI_SUCCESS;\r
}\r
\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
\r
- Instance->InDestory = TRUE;\r
+ Instance->InDestroy = TRUE;\r
\r
Status = gBS->CloseProtocol (\r
Service->UdpIo->UdpHandle,\r
);\r
\r
if (EFI_ERROR (Status)) {\r
- Instance->InDestory = FALSE;\r
+ Instance->InDestroy = FALSE;\r
gBS->RestoreTPL (OldTpl);\r
return Status;\r
}\r
);\r
\r
if (EFI_ERROR (Status)) {\r
- Instance->InDestory = FALSE;\r
+ Instance->InDestroy = FALSE;\r
gBS->RestoreTPL (OldTpl);\r
return Status;\r
}\r
UINT8 AdPref;\r
EFI_IPv6_ADDRESS *Unicast;\r
EFI_STATUS UdpSts;\r
- BOOLEAN InDestory;\r
+ BOOLEAN InDestroy;\r
BOOLEAN MediaPresent;\r
UINT64 StartTime;\r
};\r
UINT32 Xid;\r
LIST_ENTRY Child;\r
UINTN NumOfChild;\r
- BOOLEAN InDestory;\r
+ BOOLEAN InDestroy;\r
};\r
\r
/**\r
}\r
\r
//\r
- // Save tx packet pointer, and it will be destoryed when reply received.\r
+ // Save tx packet pointer, and it will be destroyed when reply received.\r
//\r
TxCb->TxPacket = Packet;\r
TxCb->Xid = Packet->Dhcp6.Header.TransactionId;\r
ClientId = Service->ClientId;\r
Status = EFI_SUCCESS;\r
\r
- if (Instance->InDestory || Instance->Config == NULL) {\r
+ if (Instance->InDestroy || Instance->Config == NULL) {\r
goto ON_CONTINUE;\r
}\r
\r
IsMatched = FALSE;\r
InfCb = NULL;\r
\r
- if (Instance->InDestory) {\r
+ if (Instance->InDestroy) {\r
goto ON_EXIT;\r
}\r
\r
/** @file\r
Implementation for iSCSI Boot Firmware Table publication.\r
\r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
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
//\r
// Map the various v4 addresses into v6 addresses.\r
//\r
- IScsiMapV4ToV6Addr (&NvData->LocalIp, &Nic->Ip);\r
- IScsiMapV4ToV6Addr (&NvData->Gateway, &Nic->Gateway);\r
+ IScsiMapV4ToV6Addr (&NvData->LocalIp.v4, &Nic->Ip);\r
+ IScsiMapV4ToV6Addr (&NvData->Gateway.v4, &Nic->Gateway);\r
IScsiMapV4ToV6Addr (&Attempt->PrimaryDns.v4, &Nic->PrimaryDns);\r
IScsiMapV4ToV6Addr (&Attempt->SecondaryDns.v4, &Nic->SecondaryDns);\r
IScsiMapV4ToV6Addr (&Attempt->DhcpServer.v4, &Nic->DhcpServer);\r
\r
} else if (NvData->IpMode == IP_MODE_IP6 || NvData->IpMode == IP_MODE_AUTOCONFIG) {\r
- //\r
- // TODO: The subnet mask/local ip/gateway/dhcpserver for iBFT-IPv6 needs to be \r
- // confirmed with spec owner.\r
- //\r
\r
+ Nic->SubnetMaskPrefixLength = NvData->PrefixLength;\r
+ CopyMem (&Nic->Ip, &NvData->LocalIp, sizeof (EFI_IPv6_ADDRESS));\r
+ CopyMem (&Nic->Gateway, &NvData->Gateway, sizeof (EFI_IPv6_ADDRESS));\r
+ \r
CopyMem (&Nic->PrimaryDns, &Attempt->PrimaryDns, sizeof (EFI_IPv6_ADDRESS));\r
CopyMem (&Nic->SecondaryDns, &Attempt->SecondaryDns, sizeof (EFI_IPv6_ADDRESS));\r
//\r
/** @file\r
The shared head file for iSCSI driver.\r
\r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
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
#include <Protocol/DevicePath.h>\r
#include <Protocol/HiiConfigAccess.h>\r
\r
+#include <Protocol/Ip6.h>\r
#include <Protocol/Dhcp4.h>\r
#include <Protocol/Dhcp6.h>\r
#include <Protocol/Tcp4.h>\r
/** @file\r
Miscellaneous definitions for iSCSI driver.\r
\r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
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
UINT8 Enabled;\r
UINT8 IpMode;\r
\r
- EFI_IPv4_ADDRESS LocalIp;\r
+ EFI_IP_ADDRESS LocalIp;\r
EFI_IPv4_ADDRESS SubnetMask;\r
- EFI_IPv4_ADDRESS Gateway;\r
+ EFI_IP_ADDRESS Gateway;\r
\r
BOOLEAN InitiatorInfoFromDhcp;\r
BOOLEAN TargetInfoFromDhcp;\r
CHAR8 TargetName[ISCSI_NAME_MAX_SIZE];\r
EFI_IP_ADDRESS TargetIp;\r
+ UINT8 PrefixLength;\r
UINT8 BootLun[8];\r
\r
UINT16 ConnectTimeout; ///< timout value in milliseconds\r
FreePool (Conn);\r
}\r
\r
+/**\r
+ Retrieve the IPv6 Address/Prefix/Gateway from the established TCP connection, these informations\r
+ will be filled in the iSCSI Boot Firmware Table.\r
+\r
+ @param[in] Conn The connection used in the iSCSI login phase.\r
+\r
+ @retval EFI_SUCCESS Get the NIC information successfully.\r
+ @retval Others Other errors as indicated.\r
+ \r
+**/\r
+EFI_STATUS\r
+IScsiGetIp6NicInfo (\r
+ IN ISCSI_CONNECTION *Conn\r
+ )\r
+{\r
+ ISCSI_SESSION_CONFIG_NVDATA *NvData;\r
+ EFI_TCP6_PROTOCOL *Tcp6;\r
+ EFI_IP6_MODE_DATA Ip6ModeData;\r
+ EFI_STATUS Status;\r
+ EFI_IPv6_ADDRESS *TargetIp;\r
+ UINTN Index;\r
+ UINT8 SubnetPrefixLength;\r
+ UINTN RouteEntry;\r
+\r
+ NvData = &Conn->Session->ConfigData->SessionConfigData;\r
+ TargetIp = &NvData->TargetIp.v6;\r
+ Tcp6 = Conn->TcpIo.Tcp.Tcp6;\r
+\r
+ ZeroMem (&Ip6ModeData, sizeof (EFI_IP6_MODE_DATA));\r
+ Status = Tcp6->GetModeData (\r
+ Tcp6,\r
+ NULL,\r
+ NULL,\r
+ &Ip6ModeData,\r
+ NULL,\r
+ NULL\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
+\r
+ if (!Ip6ModeData.IsConfigured) {\r
+ Status = EFI_ABORTED;\r
+ goto ON_EXIT;\r
+ }\r
+\r
+ IP6_COPY_ADDRESS (&NvData->LocalIp, &Ip6ModeData.ConfigData.StationAddress);\r
+\r
+ NvData->PrefixLength = 0;\r
+ for (Index = 0; Index < Ip6ModeData.AddressCount; Index++) {\r
+ if (EFI_IP6_EQUAL (&NvData->LocalIp.v6, &Ip6ModeData.AddressList[Index].Address)) {\r
+ NvData->PrefixLength = Ip6ModeData.AddressList[Index].PrefixLength;\r
+ break;\r
+ }\r
+ }\r
+\r
+ SubnetPrefixLength = 0;\r
+ RouteEntry = Ip6ModeData.RouteCount;\r
+ for (Index = 0; Index < Ip6ModeData.RouteCount; Index++) {\r
+ if (NetIp6IsNetEqual (TargetIp, &Ip6ModeData.RouteTable[Index].Destination, Ip6ModeData.RouteTable[Index].PrefixLength)) {\r
+ if (SubnetPrefixLength < Ip6ModeData.RouteTable[Index].PrefixLength) {\r
+ SubnetPrefixLength = Ip6ModeData.RouteTable[Index].PrefixLength;\r
+ RouteEntry = Index;\r
+ }\r
+ }\r
+ }\r
+ if (RouteEntry != Ip6ModeData.RouteCount) {\r
+ IP6_COPY_ADDRESS (&NvData->Gateway, &Ip6ModeData.RouteTable[RouteEntry].Gateway);\r
+ }\r
+\r
+ON_EXIT:\r
+ if (Ip6ModeData.AddressList != NULL) {\r
+ FreePool (Ip6ModeData.AddressList);\r
+ }\r
+ if (Ip6ModeData.GroupTable!= NULL) {\r
+ FreePool (Ip6ModeData.GroupTable);\r
+ }\r
+ if (Ip6ModeData.RouteTable!= NULL) {\r
+ FreePool (Ip6ModeData.RouteTable);\r
+ }\r
+ if (Ip6ModeData.NeighborCache!= NULL) {\r
+ FreePool (Ip6ModeData.NeighborCache);\r
+ }\r
+ if (Ip6ModeData.PrefixTable!= NULL) {\r
+ FreePool (Ip6ModeData.PrefixTable);\r
+ }\r
+ if (Ip6ModeData.IcmpTypeList!= NULL) {\r
+ FreePool (Ip6ModeData.IcmpTypeList);\r
+ }\r
+\r
+ return Status;\r
+}\r
\r
/**\r
Login the iSCSI session.\r
);\r
\r
ASSERT_EFI_ERROR (Status);\r
+\r
+ if (mPrivate->Ipv6Flag) {\r
+ Status = IScsiGetIp6NicInfo (Conn);\r
+ }\r
}\r
\r
return Status;\r
/** @file\r
The implementation of EFI IPv6 Configuration Protocol.\r
\r
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
}\r
\r
/**\r
- Destory the Dhcp6 child in IP6_CONFIG_INSTANCE and release the resources.\r
+ Destroy the Dhcp6 child in IP6_CONFIG_INSTANCE and release the resources.\r
\r
@param[in, out] Instance The buffer of IP6_CONFIG_INSTANCE to be freed.\r
\r
@retval EFI_SUCCESS The child was successfully destroyed.\r
- @retval Others Failed to destory the child.\r
+ @retval Others Failed to destroy the child.\r
\r
**/\r
EFI_STATUS\r
/** @file\r
Definitions for EFI IPv6 Configuartion Protocol implementation.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
);\r
\r
/**\r
- Destory the Dhcp6 child in IP6_CONFIG_INSTANCE and release the resources.\r
+ Destroy the Dhcp6 child in IP6_CONFIG_INSTANCE and release the resources.\r
\r
@param[in, out] Instance The buffer of IP6_CONFIG_INSTANCE to be freed.\r
\r
@retval EFI_SUCCESS The child was successfully destroyed.\r
- @retval Others Failed to destory the child.\r
+ @retval Others Failed to destroy the child.\r
\r
**/\r
EFI_STATUS\r
/** @file\r
The driver binding and service binding protocol for IP6 driver.\r
\r
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
Clean up an IP6 service binding instance. It releases all\r
the resource allocated by the instance. The instance may be\r
partly initialized, or partly destroyed. If a resource is\r
- destroyed, it is marked as that in case the destory failed and\r
+ destroyed, it is marked as that in case the destroy failed and\r
being called again later.\r
\r
@param[in] IpSb The IP6 service binding instance to clean up.\r
\r
//\r
// A child can be destroyed more than once. For example,\r
- // Ip6DriverBindingStop will destory all of its children.\r
- // when UDP driver is being stopped, it will destory all\r
+ // Ip6DriverBindingStop will destroy all of its children.\r
+ // when UDP driver is being stopped, it will destroy all\r
// the IP child it opens.\r
//\r
if (IpInstance->State == IP6_STATE_DESTROY) {\r
/** @file\r
The driver binding and service binding protocol for IP6 driver.\r
\r
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
Clean up an IP6 service binding instance. It releases all\r
the resource allocated by the instance. The instance may be\r
partly initialized, or partly destroyed. If a resource is\r
- destroyed, it is marked as that in case the destory failed and\r
+ destroyed, it is marked as that in case the destroy failed and\r
being called again later.\r
\r
@param[in] IpSb The IP6 service binding instance to clean up.\r
/** @file\r
Implement IP6 pesudo interface.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
}\r
\r
//\r
- // Destory the interface if this is the last IP instance.\r
+ // Destroy the interface if this is the last IP instance.\r
// Remove all the system transmitted packets\r
// from this interface, cancel the receive request if exists.\r
//\r
/** @file\r
Implementation of EFI_IP6_PROTOCOL protocol interfaces.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
Status = Ip6CleanProtocol (IpInstance);\r
\r
//\r
- // Don't change the state if it is DESTORY, consider the following\r
+ // Don't change the state if it is DESTROY, consider the following\r
// valid sequence: Mnp is unloaded-->Ip Stopped-->Udp Stopped,\r
// Configure (ThisIp, NULL). If the state is changed to UNCONFIGED,\r
// the unload fails miserably.\r
/** @file\r
Implementation of Neighbor Discovery support routines.\r
\r
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
}\r
\r
/**\r
- Destory a IP6 prefix list entry.\r
+ Destroy a IP6 prefix list entry.\r
\r
@param[in] IpSb The pointer to IP6_SERVICE instance.\r
@param[in] PrefixEntry The to be destroyed prefix list entry.\r
/** @file\r
Definition of Neighbor Discovery support routines.\r
\r
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
);\r
\r
/**\r
- Destory a IP6 prefix list entry.\r
+ Destroy a IP6 prefix list entry.\r
\r
@param[in] IpSb The pointer to IP6_SERVICE instance.\r
@param[in] PrefixEntry The to be destroyed prefix list entry.\r
Driver Binding functions and Service Binding functions\r
implementation for Mtftp6 Driver.\r
\r
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
\r
/**\r
- Destory the MTFTP6 service. The MTFTP6 service may be partly initialized,\r
+ Destroy the MTFTP6 service. The MTFTP6 service may be partly initialized,\r
or partly destroyed. If a resource is destroyed, it is marked as such in\r
case the destroy failed and is called again later.\r
\r
)\r
{\r
//\r
- // Make sure all children instances have been already destoryed.\r
+ // Make sure all children instances have been already destroyed.\r
//\r
ASSERT (Service->ChildrenNum == 0);\r
\r
Mtftp6Srv->Signature = MTFTP6_SERVICE_SIGNATURE;\r
Mtftp6Srv->Controller = Controller;\r
Mtftp6Srv->Image = Image;\r
- Mtftp6Srv->InDestory = FALSE;\r
+ Mtftp6Srv->InDestroy = FALSE;\r
Mtftp6Srv->ChildrenNum = 0;\r
\r
CopyMem (\r
}\r
\r
Mtftp6Ins->Signature = MTFTP6_INSTANCE_SIGNATURE;\r
- Mtftp6Ins->InDestory = FALSE;\r
+ Mtftp6Ins->InDestroy = FALSE;\r
Mtftp6Ins->Service = Service;\r
\r
CopyMem (\r
\r
Service = MTFTP6_SERVICE_FROM_THIS (ServiceBinding);\r
\r
- if (Service->InDestory) {\r
+ if (Service->InDestroy) {\r
return EFI_SUCCESS;\r
}\r
\r
\r
if (NumberOfChildren == 0) {\r
//\r
- // Destory the Mtftp6 service if there is no Mtftp6 child instance left.\r
+ // Destroy the Mtftp6 service if there is no Mtftp6 child instance left.\r
//\r
- Service->InDestory = TRUE;\r
+ Service->InDestroy = TRUE;\r
\r
gBS->UninstallProtocolInterface (\r
NicHandle,\r
\r
} else {\r
//\r
- // Destory the Mtftp6 child instance one by one.\r
+ // Destroy the Mtftp6 child instance one by one.\r
//\r
while (!IsListEmpty (&Service->Children)) {\r
Instance = NET_LIST_HEAD (&Service->Children, MTFTP6_INSTANCE, Link);\r
}\r
\r
//\r
- // Check whether the instance already in destory state.\r
+ // Check whether the instance already in Destroy state.\r
//\r
- if (Instance->InDestory) {\r
+ if (Instance->InDestroy) {\r
return EFI_SUCCESS;\r
}\r
\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
\r
- Instance->InDestory = TRUE;\r
+ Instance->InDestroy = TRUE;\r
\r
gBS->CloseProtocol (\r
Service->DummyUdpIo->UdpHandle,\r
);\r
\r
if (EFI_ERROR (Status)) {\r
- Instance->InDestory = FALSE;\r
+ Instance->InDestroy = FALSE;\r
gBS->RestoreTPL (OldTpl);\r
return Status;\r
}\r
RFC2348 - TFTP Blocksize Option\r
RFC2349 - TFTP Timeout Interval and Transfer Size Options\r
\r
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
// Don't configure the udpio here because each operation might override\r
// the configuration, so delay udpio configuration in each operation.\r
//\r
- Instance->UdpIo = UdpIoCreateIo (\r
- Service->Controller,\r
- Service->Image,\r
- Mtftp6ConfigDummyUdpIo,\r
- UDP_IO_UDP6_VERSION,\r
- NULL\r
- );\r
+ if (Instance->UdpIo == NULL) {\r
+ Instance->UdpIo = UdpIoCreateIo (\r
+ Service->Controller,\r
+ Service->Image,\r
+ Mtftp6ConfigDummyUdpIo,\r
+ UDP_IO_UDP6_VERSION,\r
+ NULL\r
+ );\r
+ }\r
\r
if (Instance->UdpIo == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
Instance = MTFTP6_INSTANCE_FROM_THIS (This);\r
\r
//\r
- // Check the instance whether configured or in destory.\r
+ // Check the instance whether configured or in destroy.\r
//\r
if (Instance->Config == NULL) {\r
return EFI_NOT_STARTED;\r
- } else if (Instance->InDestory) {\r
+ } else if (Instance->InDestroy) {\r
return EFI_DEVICE_ERROR;\r
}\r
\r
/** @file\r
Mtftp6 internal data structure and definition declaration.\r
\r
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>\r
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved. <BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
EFI_TPL OldTpl;\r
BOOLEAN IsTransmitted;\r
BOOLEAN IsMaster;\r
- BOOLEAN InDestory;\r
+ BOOLEAN InDestroy;\r
};\r
\r
//\r
// mtftp driver and udp driver.\r
//\r
UDP_IO *DummyUdpIo;\r
- BOOLEAN InDestory;\r
+ BOOLEAN InDestroy;\r
};\r
\r
/**\r
);\r
\r
Instance->McastPort = ExtInfo.McastPort;\r
- Instance->McastUdpIo = UdpIoCreateIo (\r
- Instance->Service->Controller,\r
- Instance->Service->Image,\r
- Mtftp6RrqConfigMcastUdpIo,\r
- UDP_IO_UDP6_VERSION,\r
- Instance\r
- );\r
+ if (Instance->McastUdpIo == NULL) {\r
+ Instance->McastUdpIo = UdpIoCreateIo (\r
+ Instance->Service->Controller,\r
+ Instance->Service->Image,\r
+ Mtftp6RrqConfigMcastUdpIo,\r
+ UDP_IO_UDP6_VERSION,\r
+ Instance\r
+ );\r
+ }\r
\r
if (Instance->McastUdpIo == NULL) {\r
return EFI_DEVICE_ERROR;\r
/** @file\r
Implementation of the Socket.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
}\r
//\r
- // Destory the RcvBuffer Queue and SendBuffer Queue\r
+ // Destroy the RcvBuffer Queue and SendBuffer Queue\r
//\r
NetbufQueFree (Sock->RcvBuffer.DataQueue);\r
NetbufQueFree (Sock->SndBuffer.DataQueue);\r
\r
DEBUG (\r
(EFI_D_WARN,\r
- "SockDestory: Delete a unaccepted socket from parent now conncnt is %d\n",\r
+ "SockDestroy: Delete a unaccepted socket from parent now conncnt is %d\n",\r
Sock->Parent->ConnCnt)\r
);\r
\r
/** @file\r
Interface function of the Socket.\r
\r
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
}\r
\r
/**\r
- Destory the socket Sock and its associated protocol control block.\r
+ Destroy the socket Sock and its associated protocol control block.\r
\r
@param[in, out] Sock The socket to be destroyed.\r
\r
/** @file\r
Common head file for TCP socket.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
);\r
\r
/**\r
- Destory the socket Sock and its associated protocol control block.\r
+ Destroy the socket Sock and its associated protocol control block.\r
\r
@param[in, out] Sock The socket to be destroyed.\r
\r
(Offer->Dhcp4.Header.BootFileName[0] != 0)) {\r
//\r
// If the bootfile is not present and bootfilename is present in DHCPv4 packet, just parse it.\r
- // Do not count dhcp option header here, or else will destory the serverhostname.\r
+ // Do not count dhcp option header here, or else will destroy the serverhostname.\r
//\r
Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] = (EFI_DHCP4_PACKET_OPTION *)\r
(&Offer->Dhcp4.Header.BootFileName[0] -\r
Config.IaInfoEvent = NULL;\r
Config.RapidCommit = FALSE;\r
Config.ReconfigureAccept = FALSE;\r
- Config.IaDescriptor.IaId = 1;\r
+ Config.IaDescriptor.IaId = Private->IaId;\r
Config.IaDescriptor.Type = EFI_DHCP6_IA_TYPE_NA;\r
Config.SolicitRetransmission = Retransmit;\r
Retransmit->Irt = 4;\r
/** @file\r
Driver Binding functions implementationfor for UefiPxeBc Driver.\r
\r
- Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
EFI_IP6_MODE_DATA Ip6ModeData;\r
PXEBC_PRIVATE_PROTOCOL *Id;\r
EFI_SIMPLE_NETWORK_PROTOCOL *Snp;\r
+ UINTN Index;\r
\r
if (Private->Ip6Nic != NULL) {\r
//\r
goto ON_ERROR;\r
}\r
\r
+ //\r
+ // Generate a random IAID for the Dhcp6 assigned address.\r
+ //\r
+ Private->IaId = NET_RANDOM (NetRandomInitSeed ());\r
+ if (Private->Snp != NULL) {\r
+ for (Index = 0; Index < Private->Snp->Mode->HwAddressSize; Index++) {\r
+ Private->IaId |= (Private->Snp->Mode->CurrentAddress.Addr[Index] << ((Index << 3) & 31));\r
+ } \r
+ }\r
+\r
//\r
// Create Mtftp6 child and open Mtftp6 protocol for PxeBc->Mtftp.\r
//\r
// Start Pxe Base Code to initialize PXE boot.\r
//\r
Status = PxeBc->Start (PxeBc, UsingIpv6);\r
+ if (Status == EFI_ALREADY_STARTED && UsingIpv6 != PxeBc->Mode->UsingIpv6) {\r
+ //\r
+ // PxeBc protocol has already been started but not on the required IP version, restart it.\r
+ //\r
+ Status = PxeBc->Stop (PxeBc);\r
+ if (!EFI_ERROR (Status)) {\r
+ Status = PxeBc->Start (PxeBc, UsingIpv6);\r
+ }\r
+ }\r
if (Status == EFI_SUCCESS || Status == EFI_ALREADY_STARTED) {\r
Status = PxeBcLoadBootFile (Private, BufferSize, Buffer);\r
}\r
EFI_IP_ADDRESS GatewayIp;\r
EFI_IP_ADDRESS ServerIp;\r
UINT16 CurSrcPort;\r
+ UINT32 IaId;\r
\r
UINT32 Ip4MaxPacketSize;\r
UINT32 Ip6MaxPacketSize;\r
}\r
\r
/**\r
- Create an IP child, use it to start the auto configuration, then destory it.\r
+ Create an IP child, use it to start the auto configuration, then destroy it.\r
\r
@param[in] NicInfo The pointer to the NIC_INFO of the Nic to be configured.\r
\r
/** @file\r
The implementation for Ping shell command.\r
\r
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
}\r
\r
/**\r
- Destory the IP instance.\r
+ Destroy the IP instance.\r
\r
@param[in] Private The pointer of PING_PRIVATE_DATA.\r
\r
**/\r
VOID\r
EFIAPI\r
-Ping6DestoryIp6Instance (\r
+Ping6DestroyIp6Instance (\r
IN PING_PRIVATE_DATA *Private\r
)\r
{\r
}\r
\r
if (Private->IpChildHandle != NULL) {\r
- Ping6DestoryIp6Instance (Private);\r
+ Ping6DestroyIp6Instance (Private);\r
}\r
\r
FreePool (Private);\r