1. Fix a bug in PXE driver that the PXE boot do not restart if a new boot option on the different IP stack is selected.
2. Retrieve the IP information after iSCSI TCPv6 connection established and fill it into iBFT table. 3. Generate a random IAID for each NIC port to require different IPv6 address in PXE driver. 4. Update function EfiMtftp6Configure() and Mtftp6RrqHandleOack() to allocate at most one UdpIo. 5. Fix a typo from “destory” to “destroy” in network code. Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Ouyang Qian <qian.ouyang@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13859 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
The implementation for Ping6 application.
|
||||
|
||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
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);
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Implementation for iSCSI Boot Firmware Table publication.
|
||||
|
||||
Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
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));
|
||||
//
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
The shared head file for iSCSI driver.
|
||||
|
||||
Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
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 <Protocol/DevicePath.h>
|
||||
#include <Protocol/HiiConfigAccess.h>
|
||||
|
||||
#include <Protocol/Ip6.h>
|
||||
#include <Protocol/Dhcp4.h>
|
||||
#include <Protocol/Dhcp6.h>
|
||||
#include <Protocol/Tcp4.h>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Miscellaneous definitions for iSCSI driver.
|
||||
|
||||
Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@@ -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;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
The implementation of EFI IPv6 Configuration Protocol.
|
||||
|
||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
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
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Definitions for EFI IPv6 Configuartion Protocol implementation.
|
||||
|
||||
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
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
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
The driver binding and service binding protocol for IP6 driver.
|
||||
|
||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
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) {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
The driver binding and service binding protocol for IP6 driver.
|
||||
|
||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
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.
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Implement IP6 pesudo interface.
|
||||
|
||||
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
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.
|
||||
//
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Implementation of EFI_IP6_PROTOCOL protocol interfaces.
|
||||
|
||||
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
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.
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Implementation of Neighbor Discovery support routines.
|
||||
|
||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
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.
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Definition of Neighbor Discovery support routines.
|
||||
|
||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
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.
|
||||
|
@@ -2,7 +2,7 @@
|
||||
Driver Binding functions and Service Binding functions
|
||||
implementation for Mtftp6 Driver.
|
||||
|
||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
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;
|
||||
}
|
||||
|
@@ -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.<BR>
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Mtftp6 internal data structure and definition declaration.
|
||||
|
||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved. <BR>
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -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;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Implementation of the Socket.
|
||||
|
||||
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
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)
|
||||
);
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Interface function of the Socket.
|
||||
|
||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
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.
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Common head file for TCP socket.
|
||||
|
||||
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
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.
|
||||
|
||||
|
@@ -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] -
|
||||
|
@@ -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;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Driver Binding functions implementationfor for UefiPxeBc Driver.
|
||||
|
||||
Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
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.
|
||||
//
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -165,6 +165,7 @@ struct _PXEBC_PRIVATE_DATA {
|
||||
EFI_IP_ADDRESS GatewayIp;
|
||||
EFI_IP_ADDRESS ServerIp;
|
||||
UINT16 CurSrcPort;
|
||||
UINT32 IaId;
|
||||
|
||||
UINT32 Ip4MaxPacketSize;
|
||||
UINT32 Ip6MaxPacketSize;
|
||||
|
Reference in New Issue
Block a user