NetworkPkg: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
UEFI Component Name(2) protocol implementation for UefiPxeBc driver.
|
||||
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2018, 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
|
||||
@@ -324,7 +324,7 @@ PxeBcComponentNameGetControllerName (
|
||||
if (ControllerHandle == NULL || ChildHandle != NULL) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
|
||||
NicHandle = PxeBcGetNicByIp4Children (ControllerHandle);
|
||||
if (NicHandle == NULL) {
|
||||
NicHandle = PxeBcGetNicByIp6Children (ControllerHandle);
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Boot functions implementation for UefiPxeBc Driver.
|
||||
|
||||
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
@@ -102,14 +102,14 @@ PxeBcSelectBootPrompt (
|
||||
//
|
||||
// According to the PXE specification 2.1, Table 2-1 PXE DHCP Options,
|
||||
// we must not consider a boot prompt or boot menu if all of the following hold:
|
||||
// - the PXE_DISCOVERY_CONTROL tag(6) is present inside the Vendor Options(43), and has bit 3 set
|
||||
// - the PXE_DISCOVERY_CONTROL tag(6) is present inside the Vendor Options(43), and has bit 3 set
|
||||
// - a boot file name has been presented in the initial DHCP or ProxyDHCP offer packet.
|
||||
//
|
||||
if (IS_DISABLE_PROMPT_MENU (VendorOpt->DiscoverCtrl) &&
|
||||
Cache->Dhcp4.OptList[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] != NULL) {
|
||||
return EFI_ABORTED;
|
||||
}
|
||||
|
||||
|
||||
if (!IS_VALID_BOOT_PROMPT (VendorOpt->BitMap)) {
|
||||
return EFI_TIMEOUT;
|
||||
}
|
||||
@@ -471,7 +471,7 @@ PxeBcDhcp4BootInfo (
|
||||
UINT16 Value;
|
||||
PXEBC_VENDOR_OPTION *VendorOpt;
|
||||
PXEBC_BOOT_SVR_ENTRY *Entry;
|
||||
|
||||
|
||||
PxeBc = &Private->PxeBc;
|
||||
Mode = PxeBc->Mode;
|
||||
Status = EFI_SUCCESS;
|
||||
@@ -789,8 +789,8 @@ PxeBcExtractDiscoverInfo (
|
||||
if (Info->IpCnt >= 1) {
|
||||
*DiscoverInfo = AllocatePool (sizeof (*Info) + (Info->IpCnt - 1) * sizeof (**SrvList));
|
||||
if (*DiscoverInfo == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
CopyMem (*DiscoverInfo, Info, sizeof (*Info));
|
||||
Info = *DiscoverInfo;
|
||||
}
|
||||
@@ -951,7 +951,7 @@ PxeBcDiscoverBootFile (
|
||||
&Mode->ProxyOffer.Dhcpv4,
|
||||
&Mode->PxeReply.Dhcpv4,
|
||||
Private->PxeReply.Dhcp4.Packet.Ack.Length
|
||||
);
|
||||
);
|
||||
}
|
||||
Mode->ProxyOfferReceived = TRUE;
|
||||
}
|
||||
|
@@ -438,7 +438,7 @@ PxeBcCacheDhcp4Packet (
|
||||
if (Dst->Size < Src->Length) {
|
||||
return EFI_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
|
||||
CopyMem (&Dst->Dhcp4, &Src->Dhcp4, Src->Length);
|
||||
Dst->Length = Src->Length;
|
||||
|
||||
@@ -492,7 +492,7 @@ PxeBcParseDhcp4Packet (
|
||||
);
|
||||
}
|
||||
//
|
||||
// Second, Check if bootfilename and serverhostname is overloaded to carry DHCP options refers to rfc-2132.
|
||||
// Second, Check if bootfilename and serverhostname is overloaded to carry DHCP options refers to rfc-2132.
|
||||
// If yes, try to parse options from the BootFileName field, then ServerName field.
|
||||
//
|
||||
Option = Options[PXEBC_DHCP4_TAG_INDEX_OVERLOAD];
|
||||
@@ -657,7 +657,7 @@ PxeBcCopyDhcp4Ack (
|
||||
CopyMem (&Mode->DhcpAck.Dhcpv4, &Ack->Dhcp4, Ack->Length);
|
||||
Mode->DhcpAckReceived = TRUE;
|
||||
}
|
||||
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -695,7 +695,7 @@ PxeBcCopyProxyOffer (
|
||||
if (EFI_ERROR(Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
PxeBcParseDhcp4Packet (&Private->ProxyOffer.Dhcp4);
|
||||
|
||||
//
|
||||
@@ -871,7 +871,7 @@ PxeBcCacheDhcp4Offer (
|
||||
//
|
||||
Private->OfferIndex[OfferType][Private->OfferCount[OfferType]] = Private->OfferNum;
|
||||
Private->OfferCount[OfferType]++;
|
||||
} else if ((OfferType == PxeOfferTypeProxyPxe10 || OfferType == PxeOfferTypeProxyWfm11a) &&
|
||||
} else if ((OfferType == PxeOfferTypeProxyPxe10 || OfferType == PxeOfferTypeProxyWfm11a) &&
|
||||
Private->OfferCount[OfferType] < 1) {
|
||||
//
|
||||
// Only cache the first PXE10/WFM11a offer, and discard the others.
|
||||
@@ -1274,7 +1274,7 @@ PxeBcDhcp4CallBack (
|
||||
Status = EFI_ABORTED;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (Mode->SendGUID) {
|
||||
//
|
||||
// Send the system Guid instead of the MAC address as the hardware address if required.
|
||||
@@ -1310,7 +1310,7 @@ PxeBcDhcp4CallBack (
|
||||
|
||||
case Dhcp4SelectOffer:
|
||||
ASSERT (NewPacket != NULL);
|
||||
|
||||
|
||||
//
|
||||
// Select offer by the default policy or by order, and record the SelectIndex
|
||||
// and SelectProxyType.
|
||||
@@ -1586,7 +1586,7 @@ PxeBcDhcp4Discover (
|
||||
}
|
||||
}
|
||||
ON_EXIT:
|
||||
|
||||
|
||||
if (Token.ResponseList != NULL) {
|
||||
FreePool (Token.ResponseList);
|
||||
}
|
||||
@@ -1606,7 +1606,7 @@ ON_EXIT:
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcSetIp4Policy (
|
||||
PxeBcSetIp4Policy (
|
||||
IN PXEBC_PRIVATE_DATA *Private
|
||||
)
|
||||
{
|
||||
@@ -1626,7 +1626,7 @@ PxeBcSetIp4Policy (
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
if (Policy != Ip4Config2PolicyStatic) {
|
||||
Policy = Ip4Config2PolicyStatic;
|
||||
Status= Ip4Config2->SetData (
|
||||
@@ -1637,7 +1637,7 @@ PxeBcSetIp4Policy (
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
@@ -1713,7 +1713,7 @@ PxeBcDhcp4Dora (
|
||||
if (Status == EFI_TIMEOUT && Private->OfferNum > 0) {
|
||||
Status = EFI_NO_RESPONSE;
|
||||
}
|
||||
|
||||
|
||||
goto ON_EXIT;
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Functions declaration related with DHCPv4 for UefiPxeBc Driver.
|
||||
|
||||
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2018, 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
|
||||
@@ -108,7 +108,7 @@ typedef enum {
|
||||
|
||||
#define IS_VALID_BOOT_SERVERS(x) \
|
||||
((((x)[0]) & BIT (PXEBC_VENDOR_TAG_BOOT_SERVERS)) \
|
||||
== BIT (PXEBC_VENDOR_TAG_BOOT_SERVERS))
|
||||
== BIT (PXEBC_VENDOR_TAG_BOOT_SERVERS))
|
||||
|
||||
#define IS_VALID_BOOT_PROMPT(x) \
|
||||
((((x)[0]) & BIT (PXEBC_VENDOR_TAG_MENU_PROMPT)) \
|
||||
@@ -346,7 +346,7 @@ PxeBcDhcp4Discover (
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcSetIp4Policy (
|
||||
PxeBcSetIp4Policy (
|
||||
IN PXEBC_PRIVATE_DATA *Private
|
||||
);
|
||||
|
||||
|
@@ -236,13 +236,13 @@ PxeBcFreeBootFileOption (
|
||||
@retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
|
||||
@retval EFI_DEVICE_ERROR An unexpected network error occurred.
|
||||
@retval Others Other errors as indicated.
|
||||
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcDns6 (
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN CHAR16 *HostName,
|
||||
OUT EFI_IPv6_ADDRESS *IpAddress
|
||||
OUT EFI_IPv6_ADDRESS *IpAddress
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
@@ -252,7 +252,7 @@ PxeBcDns6 (
|
||||
EFI_HANDLE Dns6Handle;
|
||||
EFI_IPv6_ADDRESS *DnsServerList;
|
||||
BOOLEAN IsDone;
|
||||
|
||||
|
||||
Dns6 = NULL;
|
||||
Dns6Handle = NULL;
|
||||
DnsServerList = Private->DnsServer;
|
||||
@@ -269,8 +269,8 @@ PxeBcDns6 (
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
Dns6Handle,
|
||||
&gEfiDns6ProtocolGuid,
|
||||
@@ -331,7 +331,7 @@ PxeBcDns6 (
|
||||
//
|
||||
// Name resolution is done, check result.
|
||||
//
|
||||
Status = Token.Status;
|
||||
Status = Token.Status;
|
||||
if (!EFI_ERROR (Status)) {
|
||||
if (Token.RspData.H2AData == NULL) {
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
@@ -347,7 +347,7 @@ PxeBcDns6 (
|
||||
IP6_COPY_ADDRESS (IpAddress, Token.RspData.H2AData->IpList);
|
||||
Status = EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Exit:
|
||||
FreePool (HostName);
|
||||
|
||||
@@ -363,7 +363,7 @@ Exit:
|
||||
|
||||
if (Dns6 != NULL) {
|
||||
Dns6->Configure (Dns6, NULL);
|
||||
|
||||
|
||||
gBS->CloseProtocol (
|
||||
Dns6Handle,
|
||||
&gEfiDns6ProtocolGuid,
|
||||
@@ -384,8 +384,8 @@ Exit:
|
||||
if (DnsServerList != NULL) {
|
||||
FreePool (DnsServerList);
|
||||
}
|
||||
|
||||
return Status;
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -474,14 +474,14 @@ PxeBcExtractBootFileUrl (
|
||||
while (*ServerAddress != '\0' && *ServerAddress != PXEBC_ADDR_END_DELIMITER) {
|
||||
ServerAddress++;
|
||||
}
|
||||
|
||||
|
||||
if (*ServerAddress != PXEBC_ADDR_END_DELIMITER) {
|
||||
FreePool (TmpStr);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
||||
*ServerAddress = '\0';
|
||||
|
||||
|
||||
//
|
||||
// Convert the string of server address to Ipv6 address format and store it.
|
||||
//
|
||||
@@ -941,7 +941,7 @@ PxeBcRequestBootService (
|
||||
//
|
||||
// Find Server ID Option from ProxyOffer.
|
||||
//
|
||||
if (Private->OfferBuffer[Index].Dhcp6.OfferType == PxeOfferTypeProxyBinl) {
|
||||
if (Private->OfferBuffer[Index].Dhcp6.OfferType == PxeOfferTypeProxyBinl) {
|
||||
Option = PxeBcDhcp6SeekOption (
|
||||
IndexOffer->Dhcp6.Option,
|
||||
IndexOffer->Length - 4,
|
||||
@@ -950,7 +950,7 @@ PxeBcRequestBootService (
|
||||
if (Option == NULL) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Add Server ID Option.
|
||||
//
|
||||
@@ -979,7 +979,7 @@ PxeBcRequestBootService (
|
||||
}
|
||||
|
||||
//
|
||||
// Update Elapsed option in the package
|
||||
// Update Elapsed option in the package
|
||||
//
|
||||
Option = PxeBcDhcp6SeekOption (
|
||||
Discover->DhcpOptions,
|
||||
@@ -989,7 +989,7 @@ PxeBcRequestBootService (
|
||||
if (Option != NULL) {
|
||||
CalcElapsedTime (Private);
|
||||
WriteUnaligned16 ((UINT16*)(Option + 4), HTONS((UINT16) Private->ElapsedTime));
|
||||
}
|
||||
}
|
||||
|
||||
Status = PxeBc->UdpWrite (
|
||||
PxeBc,
|
||||
@@ -1023,7 +1023,7 @@ PxeBcRequestBootService (
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
|
||||
Status = PxeBc->UdpRead (
|
||||
PxeBc,
|
||||
EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP | EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_IP,
|
||||
@@ -1051,7 +1051,7 @@ PxeBcRequestBootService (
|
||||
Reply->Length = (UINT32) ReadSize;
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
||||
|
||||
ON_ERROR:
|
||||
if (Discover != NULL) {
|
||||
FreePool (Discover);
|
||||
@@ -1208,7 +1208,7 @@ PxeBcCacheDhcp6Offer (
|
||||
//
|
||||
Private->OfferIndex[OfferType][Private->OfferCount[OfferType]] = Private->OfferNum;
|
||||
Private->OfferCount[OfferType]++;
|
||||
} else if ((OfferType == PxeOfferTypeProxyPxe10 || OfferType == PxeOfferTypeProxyWfm11a) &&
|
||||
} else if ((OfferType == PxeOfferTypeProxyPxe10 || OfferType == PxeOfferTypeProxyWfm11a) &&
|
||||
Private->OfferCount[OfferType] < 1) {
|
||||
//
|
||||
// Only cache the first PXE10/WFM11a offer, and discard the others.
|
||||
@@ -1499,7 +1499,7 @@ PxeBcUnregisterIp6Address (
|
||||
|
||||
/**
|
||||
Check whether IP driver could route the message which will be sent to ServerIp address.
|
||||
|
||||
|
||||
This function will check the IP6 route table every 1 seconds until specified timeout is expired, if a valid
|
||||
route is found in IP6 route table, the address will be filed in GatewayAddr and return.
|
||||
|
||||
@@ -1510,7 +1510,7 @@ PxeBcUnregisterIp6Address (
|
||||
@retval EFI_SUCCESS Found a valid gateway address successfully.
|
||||
@retval EFI_TIMEOUT The operation is time out.
|
||||
@retval Other Unexpect error happened.
|
||||
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcCheckRouteTable (
|
||||
@@ -1571,13 +1571,13 @@ PxeBcCheckRouteTable (
|
||||
if (Ip6ModeData.IcmpTypeList != NULL) {
|
||||
FreePool (Ip6ModeData.IcmpTypeList);
|
||||
}
|
||||
|
||||
|
||||
if (GatewayIsFound || RetryCount == TimeOutInSecond) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
RetryCount++;
|
||||
|
||||
|
||||
//
|
||||
// Delay 1 second then recheck it again.
|
||||
//
|
||||
@@ -1602,19 +1602,19 @@ PxeBcCheckRouteTable (
|
||||
Ip6->Poll (Ip6);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ON_EXIT:
|
||||
if (TimeOutEvt != NULL) {
|
||||
gBS->CloseEvent (TimeOutEvt);
|
||||
}
|
||||
|
||||
|
||||
if (GatewayIsFound) {
|
||||
Status = EFI_SUCCESS;
|
||||
} else if (RetryCount == TimeOutInSecond) {
|
||||
Status = EFI_TIMEOUT;
|
||||
}
|
||||
|
||||
return Status;
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1668,7 +1668,7 @@ PxeBcRegisterIp6Address (
|
||||
if (EFI_ERROR (Status)) {
|
||||
NoGateway = TRUE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// There is no channel between IP6 and PXE driver about address setting,
|
||||
// so it has to set the new address by Ip6ConfigProtocol manually.
|
||||
@@ -1767,7 +1767,7 @@ PxeBcRegisterIp6Address (
|
||||
goto ON_EXIT;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Set the default gateway address back if needed.
|
||||
//
|
||||
@@ -1854,7 +1854,7 @@ PxeBcSetIp6Policy (
|
||||
|
||||
/**
|
||||
This function will register the station IP address and flush IP instance to start using the new IP address.
|
||||
|
||||
|
||||
@param[in] Private The pointer to PXEBC_PRIVATE_DATA.
|
||||
|
||||
@retval EFI_SUCCESS The new IP address has been configured successfully.
|
||||
@@ -1868,7 +1868,7 @@ PxeBcSetIp6Address (
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_DHCP6_PROTOCOL *Dhcp6;
|
||||
|
||||
|
||||
Dhcp6 = Private->Dhcp6;
|
||||
|
||||
CopyMem (&Private->StationIp.v6, &Private->TmpStationIp.v6, sizeof (EFI_IPv6_ADDRESS));
|
||||
@@ -1972,7 +1972,7 @@ PxeBcDhcp6CallBack (
|
||||
Status = EFI_ABORTED;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Record the first Solicate msg time
|
||||
//
|
||||
@@ -2011,7 +2011,7 @@ PxeBcDhcp6CallBack (
|
||||
Status = EFI_ABORTED;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Store the request packet as seed packet for discover.
|
||||
//
|
||||
@@ -2188,7 +2188,7 @@ PxeBcDhcp6Discover (
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
|
||||
Status = PxeBc->UdpRead (
|
||||
PxeBc,
|
||||
EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_IP,
|
||||
@@ -2345,13 +2345,13 @@ PxeBcDhcp6Sarr (
|
||||
}
|
||||
|
||||
do {
|
||||
|
||||
|
||||
TimerStatus = gBS->CheckEvent (Timer);
|
||||
if (!EFI_ERROR (TimerStatus)) {
|
||||
Status = Dhcp6->Start (Dhcp6);
|
||||
}
|
||||
} while (TimerStatus == EFI_NOT_READY);
|
||||
|
||||
|
||||
gBS->CloseEvent (Timer);
|
||||
}
|
||||
if (EFI_ERROR (Status)) {
|
||||
@@ -2376,7 +2376,7 @@ PxeBcDhcp6Sarr (
|
||||
// DHCP6 doesn't have an option to specify the router address on the subnet, the only way to get the
|
||||
// router address in IP6 is the router discovery mechanism (the RS and RA, which only be handled when
|
||||
// the IP policy is Automatic). So we just hold the station IP address here and leave the IP policy as
|
||||
// Automatic, until we get the server IP address. This could let IP6 driver finish the router discovery
|
||||
// Automatic, until we get the server IP address. This could let IP6 driver finish the router discovery
|
||||
// to find a valid router address.
|
||||
//
|
||||
CopyMem (&Private->TmpStationIp.v6, &Mode.Ia->IaAddress[0].IpAddress, sizeof (EFI_IPv6_ADDRESS));
|
||||
@@ -2394,6 +2394,6 @@ PxeBcDhcp6Sarr (
|
||||
Dhcp6->Stop (Dhcp6);
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Functions declaration related with DHCPv6 for UefiPxeBc Driver.
|
||||
|
||||
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2018, 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
|
||||
@@ -253,7 +253,7 @@ PxeBcSetIp6Policy (
|
||||
|
||||
/**
|
||||
This function will register the station IP address and flush IP instance to start using the new IP address.
|
||||
|
||||
|
||||
@param[in] Private The pointer to PXEBC_PRIVATE_DATA.
|
||||
|
||||
@retval EFI_SUCCESS The new IP address has been configured successfully.
|
||||
|
@@ -256,7 +256,7 @@ PxeBcDestroyIp4Children (
|
||||
);
|
||||
FreePool (Private->Ip4Nic->DevicePath);
|
||||
|
||||
if (Private->Snp != NULL) {
|
||||
if (Private->Snp != NULL) {
|
||||
//
|
||||
// Close SNP from the child virtual handle
|
||||
//
|
||||
@@ -266,7 +266,7 @@ PxeBcDestroyIp4Children (
|
||||
This->DriverBindingHandle,
|
||||
Private->Ip4Nic->Controller
|
||||
);
|
||||
|
||||
|
||||
gBS->UninstallProtocolInterface (
|
||||
Private->Ip4Nic->Controller,
|
||||
&gEfiSimpleNetworkProtocolGuid,
|
||||
@@ -416,7 +416,7 @@ PxeBcDestroyIp6Children (
|
||||
NULL
|
||||
);
|
||||
FreePool (Private->Ip6Nic->DevicePath);
|
||||
|
||||
|
||||
if (Private->Snp != NULL) {
|
||||
//
|
||||
// Close SNP from the child virtual handle
|
||||
@@ -489,7 +489,7 @@ PxeBcCheckIpv6Support (
|
||||
|
||||
//
|
||||
// Get the NIC handle by SNP protocol.
|
||||
//
|
||||
//
|
||||
Handle = NetLibGetSnpHandle (ControllerHandle, NULL);
|
||||
if (Handle == NULL) {
|
||||
return EFI_NOT_FOUND;
|
||||
@@ -535,7 +535,7 @@ PxeBcCheckIpv6Support (
|
||||
if (EFI_ERROR (Status) || InfoBlock == NULL) {
|
||||
FreePool (InfoBlock);
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
|
||||
*Ipv6Support = ((EFI_ADAPTER_INFO_UNDI_IPV6_SUPPORT *) InfoBlock)->Ipv6Support;
|
||||
FreePool (InfoBlock);
|
||||
@@ -814,7 +814,7 @@ PxeBcCreateIp4Children (
|
||||
}
|
||||
|
||||
//
|
||||
// Open SNP on the child handle BY_DRIVER. It will prevent any additionally
|
||||
// Open SNP on the child handle BY_DRIVER. It will prevent any additionally
|
||||
// layering to perform the experiment.
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
@@ -951,7 +951,7 @@ PxeBcCreateIp6Children (
|
||||
if (Private->Snp != NULL) {
|
||||
for (Index = 0; Index < Private->Snp->Mode->HwAddressSize; Index++) {
|
||||
Private->IaId |= (Private->Snp->Mode->CurrentAddress.Addr[Index] << ((Index << 3) & 31));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1140,7 +1140,7 @@ PxeBcCreateIp6Children (
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
|
||||
if (Private->Snp != NULL) {
|
||||
//
|
||||
// Install SNP protocol on purpose is for some OS loader backward
|
||||
@@ -1157,7 +1157,7 @@ PxeBcCreateIp6Children (
|
||||
}
|
||||
|
||||
//
|
||||
// Open SNP on the child handle BY_DRIVER. It will prevent any additionally
|
||||
// Open SNP on the child handle BY_DRIVER. It will prevent any additionally
|
||||
// layering to perform the experiment.
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
@@ -1293,7 +1293,7 @@ PxeBcDriverEntryPoint (
|
||||
@param[in] RemainingDevicePath Optional parameter used to pick a specific child
|
||||
device to be started.
|
||||
@param[in] IpVersion IP_VERSION_4 or IP_VERSION_6.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS This driver supports this device.
|
||||
@retval EFI_UNSUPPORTED This driver does not support this device.
|
||||
|
||||
@@ -1310,7 +1310,7 @@ PxeBcSupported (
|
||||
EFI_STATUS Status;
|
||||
EFI_GUID *DhcpServiceBindingGuid;
|
||||
EFI_GUID *MtftpServiceBindingGuid;
|
||||
|
||||
|
||||
if (IpVersion == IP_VERSION_4) {
|
||||
DhcpServiceBindingGuid = &gEfiDhcp4ServiceBindingProtocolGuid;
|
||||
MtftpServiceBindingGuid = &gEfiMtftp4ServiceBindingProtocolGuid;
|
||||
@@ -1453,7 +1453,7 @@ PxeBcStart (
|
||||
|
||||
//
|
||||
// Install PxeBaseCodePrivate protocol onto the real NIC handler.
|
||||
// PxeBaseCodePrivate protocol is only used to keep the relationship between
|
||||
// PxeBaseCodePrivate protocol is only used to keep the relationship between
|
||||
// NIC handle and virtual child handles.
|
||||
// gEfiCallerIdGuid will be used as its protocol guid.
|
||||
//
|
||||
@@ -1470,7 +1470,7 @@ PxeBcStart (
|
||||
//
|
||||
// Try to locate SNP protocol.
|
||||
//
|
||||
NetLibGetSnpHandle(ControllerHandle, &Private->Snp);
|
||||
NetLibGetSnpHandle(ControllerHandle, &Private->Snp);
|
||||
}
|
||||
|
||||
if (IpVersion == IP_VERSION_4) {
|
||||
|
@@ -91,7 +91,7 @@ EfiPxeBcStart (
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Configure block size for TFTP as a default value to handle all link layers.
|
||||
//
|
||||
@@ -144,7 +144,7 @@ EfiPxeBcStart (
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Configure block size for TFTP as a default value to handle all link layers.
|
||||
//
|
||||
@@ -206,10 +206,10 @@ EfiPxeBcStart (
|
||||
}
|
||||
|
||||
//
|
||||
//DHCP4 service allows only one of its children to be configured in
|
||||
//the active state, If the DHCP4 D.O.R.A started by IP4 auto
|
||||
//configuration and has not been completed, the Dhcp4 state machine
|
||||
//will not be in the right state for the PXE to start a new round D.O.R.A.
|
||||
//DHCP4 service allows only one of its children to be configured in
|
||||
//the active state, If the DHCP4 D.O.R.A started by IP4 auto
|
||||
//configuration and has not been completed, the Dhcp4 state machine
|
||||
//will not be in the right state for the PXE to start a new round D.O.R.A.
|
||||
//so we need to switch it's policy to static.
|
||||
//
|
||||
Status = PxeBcSetIp4Policy (Private);
|
||||
@@ -745,13 +745,13 @@ ON_EXIT:
|
||||
if (NewCreatedInfo != NULL && NewCreatedInfo != &DefaultInfo) {
|
||||
FreePool (NewCreatedInfo);
|
||||
}
|
||||
|
||||
|
||||
if (Mode->UsingIpv6) {
|
||||
Private->Udp6Read->Configure (Private->Udp6Read, &Private->Udp6CfgData);
|
||||
} else {
|
||||
Private->Udp4Read->Configure (Private->Udp4Read, &Private->Udp4CfgData);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Dhcp(), Discover(), and Mtftp() set the IP filter, and return with the IP
|
||||
// receive filter list emptied and the filter set to EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP.
|
||||
@@ -1093,7 +1093,7 @@ EfiPxeBcUdpWrite (
|
||||
DoNotFragment = TRUE;
|
||||
}
|
||||
|
||||
if (!Mode->UsingIpv6 && GatewayIp != NULL && Mode->SubnetMask.Addr[0] != 0 &&
|
||||
if (!Mode->UsingIpv6 && GatewayIp != NULL && Mode->SubnetMask.Addr[0] != 0 &&
|
||||
!NetIp4IsUnicast (NTOHL (GatewayIp->Addr[0]), EFI_NTOHL(Mode->SubnetMask))) {
|
||||
//
|
||||
// Gateway is provided but it's not a unicast IPv4 address, while it will be ignored for IPv6.
|
||||
@@ -1659,13 +1659,13 @@ EfiPxeBcSetIpFilter (
|
||||
//
|
||||
Udp4Cfg = &Private->Udp4CfgData;
|
||||
if ((AcceptPromiscuous != Udp4Cfg->AcceptPromiscuous) ||
|
||||
(AcceptBroadcast != Udp4Cfg->AcceptBroadcast) || MultiCastUpdate) {
|
||||
(AcceptBroadcast != Udp4Cfg->AcceptBroadcast) || MultiCastUpdate) {
|
||||
//
|
||||
// Clear the UDP4 instance configuration, all joined groups will be left
|
||||
// during the operation.
|
||||
//
|
||||
Private->Udp4Read->Configure (Private->Udp4Read, NULL);
|
||||
|
||||
|
||||
//
|
||||
// Configure the UDP instance with the new configuration.
|
||||
//
|
||||
@@ -1675,7 +1675,7 @@ EfiPxeBcSetIpFilter (
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// In not Promiscuous mode, need to join the new multicast group.
|
||||
//
|
||||
@@ -1704,7 +1704,7 @@ EfiPxeBcSetIpFilter (
|
||||
// during the operation.
|
||||
//
|
||||
Private->Udp6Read->Configure (Private->Udp6Read, NULL);
|
||||
|
||||
|
||||
//
|
||||
// Configure the UDP instance with the new configuration.
|
||||
//
|
||||
@@ -1713,7 +1713,7 @@ EfiPxeBcSetIpFilter (
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// In not Promiscuous mode, need to join the new multicast group.
|
||||
//
|
||||
@@ -2023,13 +2023,13 @@ EfiPxeBcSetStationIP (
|
||||
}
|
||||
|
||||
if (!Mode->UsingIpv6 && NewStationIp != NULL) {
|
||||
if (IP4_IS_UNSPECIFIED(NTOHL (NewStationIp->Addr[0])) ||
|
||||
if (IP4_IS_UNSPECIFIED(NTOHL (NewStationIp->Addr[0])) ||
|
||||
IP4_IS_LOCAL_BROADCAST(NTOHL (NewStationIp->Addr[0])) ||
|
||||
(NewSubnetMask != NULL && NewSubnetMask->Addr[0] != 0 && !NetIp4IsUnicast (NTOHL (NewStationIp->Addr[0]), NTOHL (NewSubnetMask->Addr[0])))) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!Mode->Started) {
|
||||
return EFI_NOT_STARTED;
|
||||
}
|
||||
@@ -2058,7 +2058,7 @@ EfiPxeBcSetStationIP (
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Private->IsAddressOk = TRUE;
|
||||
}
|
||||
|
||||
|
||||
ON_EXIT:
|
||||
return Status;
|
||||
}
|
||||
@@ -2343,14 +2343,14 @@ EfiPxeLoadFile (
|
||||
if (This == NULL || BufferSize == NULL || FilePath == NULL || !IsDevicePathEnd (FilePath)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Only support BootPolicy
|
||||
//
|
||||
if (!BootPolicy) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
|
||||
VirtualNic = PXEBC_VIRTUAL_NIC_FROM_LOADFILE (This);
|
||||
Private = VirtualNic->Private;
|
||||
PxeBc = &Private->PxeBc;
|
||||
@@ -2403,7 +2403,7 @@ EfiPxeLoadFile (
|
||||
} else {
|
||||
//
|
||||
// The DHCP4 can have only one configured child instance so we need to stop
|
||||
// reset the DHCP4 child before we return. Otherwise these programs which
|
||||
// reset the DHCP4 child before we return. Otherwise these programs which
|
||||
// also need to use DHCP4 will be impacted.
|
||||
//
|
||||
if (!PxeBc->Mode->UsingIpv6) {
|
||||
|
@@ -2,7 +2,7 @@
|
||||
This EFI_PXE_BASE_CODE_PROTOCOL and EFI_LOAD_FILE_PROTOCOL.
|
||||
interfaces declaration.
|
||||
|
||||
Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2018, 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
|
||||
@@ -107,7 +107,7 @@ struct _PXEBC_PRIVATE_DATA {
|
||||
EFI_HANDLE Image;
|
||||
|
||||
PXEBC_PRIVATE_PROTOCOL Id;
|
||||
EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
|
||||
EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
|
||||
|
||||
PXEBC_VIRTUAL_NIC *Ip4Nic;
|
||||
PXEBC_VIRTUAL_NIC *Ip6Nic;
|
||||
|
@@ -48,7 +48,7 @@ PxeBcFlushStationIp (
|
||||
//
|
||||
CopyMem (&Private->Udp6CfgData.StationAddress, StationIp, sizeof (EFI_IPv6_ADDRESS));
|
||||
CopyMem (&Private->Ip6CfgData.StationAddress, StationIp, sizeof (EFI_IPv6_ADDRESS));
|
||||
|
||||
|
||||
//
|
||||
// Reconfigure the Ip6 instance to capture background ICMP6 packets with new station Ip address.
|
||||
//
|
||||
@@ -79,7 +79,7 @@ PxeBcFlushStationIp (
|
||||
CopyMem (&Private->Udp4CfgData.StationAddress, StationIp, sizeof (EFI_IPv4_ADDRESS));
|
||||
CopyMem (&Private->Ip4CfgData.StationAddress, StationIp, sizeof (EFI_IPv4_ADDRESS));
|
||||
}
|
||||
|
||||
|
||||
if (SubnetMask != NULL) {
|
||||
//
|
||||
// Overwrite Udp4CfgData/Ip4CfgData SubnetMask.
|
||||
@@ -97,7 +97,7 @@ PxeBcFlushStationIp (
|
||||
Mode->RouteTable[0].SubnetMask.Addr[0] = SubnetMask->Addr[0];
|
||||
Mode->RouteTable[0].GwAddr.Addr[0] = 0;
|
||||
}
|
||||
|
||||
|
||||
if (StationIp != NULL || SubnetMask != NULL) {
|
||||
//
|
||||
// Reconfigure the Ip4 instance to capture background ICMP packets with new station Ip address.
|
||||
@@ -306,7 +306,7 @@ PxeBcIcmpErrorDpcHandle (
|
||||
//
|
||||
goto ON_RECYCLE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// The protocol has been configured to only receive ICMP packet.
|
||||
//
|
||||
@@ -482,7 +482,7 @@ PxeBcIcmp6ErrorDpcHandle (
|
||||
|
||||
ON_RECYCLE:
|
||||
gBS->SignalEvent (RxData->RecycleSignal);
|
||||
|
||||
|
||||
ON_EXIT:
|
||||
Private->Icmp6Token.Status = EFI_NOT_READY;
|
||||
Ip6->Receive (Ip6, &Private->Icmp6Token);
|
||||
@@ -517,7 +517,7 @@ PxeBcIcmp6ErrorUpdate (
|
||||
@param[in, out] SrcPort The pointer to the source port.
|
||||
@param[in] DoNotFragment If TRUE, fragment is not enabled.
|
||||
Otherwise, fragment is enabled.
|
||||
@param[in] Ttl The time to live field of the IP header.
|
||||
@param[in] Ttl The time to live field of the IP header.
|
||||
@param[in] ToS The type of service field of the IP header.
|
||||
|
||||
@retval EFI_SUCCESS Successfully configured this instance.
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Support functions declaration for UefiPxeBc Driver.
|
||||
|
||||
Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2018, 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
|
||||
@@ -135,7 +135,7 @@ PxeBcIcmp6ErrorUpdate (
|
||||
@param[in, out] SrcPort The pointer to the source port.
|
||||
@param[in] DoNotFragment If TRUE, fragment is not enabled.
|
||||
Otherwise, fragment is enabled.
|
||||
@param[in] Ttl The time to live field of the IP header.
|
||||
@param[in] Ttl The time to live field of the IP header.
|
||||
@param[in] ToS The type of service field of the IP header.
|
||||
|
||||
@retval EFI_SUCCESS Successfully configured this instance.
|
||||
@@ -453,7 +453,7 @@ PxeBcUintnToAscDecWithFormat (
|
||||
@param[in] Number Numeric value to be converted.
|
||||
@param[in] Buffer Pointer to the buffer for ASCII string.
|
||||
@param[in] BufferSize The maxsize of the buffer.
|
||||
|
||||
|
||||
@return Length The actual length of the ASCII string.
|
||||
|
||||
**/
|
||||
|
@@ -1,12 +1,12 @@
|
||||
## @file
|
||||
# Access PXE-compatible devices for network access and network booting.
|
||||
#
|
||||
#
|
||||
# This driver provides PXE Base Code Protocol which is used to accessing
|
||||
# PXE-compatible device for network access or booting. It could work together
|
||||
# with an IPv4 stack, an IPv6 stack or both.
|
||||
#
|
||||
#
|
||||
# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2007 - 2018, 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
|
||||
@@ -73,7 +73,7 @@
|
||||
[Protocols]
|
||||
## TO_START
|
||||
## SOMETIMES_CONSUMES
|
||||
gEfiDevicePathProtocolGuid
|
||||
gEfiDevicePathProtocolGuid
|
||||
gEfiNetworkInterfaceIdentifierProtocolGuid_31 ## SOMETIMES_CONSUMES
|
||||
gEfiArpServiceBindingProtocolGuid ## TO_START
|
||||
gEfiArpProtocolGuid ## TO_START
|
||||
|
@@ -5,13 +5,13 @@
|
||||
// PXE-compatible device for network access or booting. It could work together
|
||||
// with an IPv4 stack, an IPv6 stack or both.
|
||||
//
|
||||
// Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
// Copyright (c) 2007 - 2018, 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
|
||||
// http://opensource.org/licenses/bsd-license.php.
|
||||
//
|
||||
//
|
||||
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
//
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// /** @file
|
||||
// UefiPxeBcDxe Localized Strings and Content
|
||||
//
|
||||
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
// Copyright (c) 2013 - 2018, 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
|
||||
@@ -13,8 +13,8 @@
|
||||
//
|
||||
// **/
|
||||
|
||||
#string STR_PROPERTIES_MODULE_NAME
|
||||
#language en-US
|
||||
#string STR_PROPERTIES_MODULE_NAME
|
||||
#language en-US
|
||||
"Uefi PXE DXE"
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user