Clean up the following module msa files, they are three networt and two PCD modules.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2551 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
<GuidValue>A3f436EA-A127-4EF8-957C-8048606FF670</GuidValue>
|
||||
<Version>1.0</Version>
|
||||
<Abstract>Component description file for BC module.</Abstract>
|
||||
<Description>This module provides basic network capability.</Description>
|
||||
<Copyright>Copyright (c) 2006, Intel Corporation</Copyright>
|
||||
<Description>This module provides PXE basic network capability and start EfiPxeBaseCodeProtocol.</Description>
|
||||
<Copyright>Copyright (c) 2006 - 2007, Intel Corporation</Copyright>
|
||||
<License>All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -22,8 +22,9 @@
|
||||
<OutputFileBasename>BC</OutputFileBasename>
|
||||
</ModuleDefinitions>
|
||||
<LibraryClassDefinitions>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED" RecommendedInstanceGuid="bda39d3a-451b-4350-8266-81ab10fa0523">
|
||||
<Keyword>DebugLib</Keyword>
|
||||
<HelpText>Recommended libary Instance is PeiDxeDebugLibReportStatusCode instance in MdePkg.</HelpText>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiDriverModelLib</Keyword>
|
||||
@@ -37,8 +38,9 @@
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>BaseLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED" RecommendedInstanceGuid="a86fbfca-0183-4eeb-aa8a-762e3b7da1f3">
|
||||
<Keyword>PrintLib</Keyword>
|
||||
<HelpText>Recommended libary Instance is BasePrintLib instance in MdePkg.</HelpText>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>BaseMemoryLib</Keyword>
|
||||
@@ -65,36 +67,35 @@
|
||||
<Filename>Bc.h</Filename>
|
||||
<Filename>ip.h</Filename>
|
||||
<Filename>ComponentName.c</Filename>
|
||||
<Filename>Print.c</Filename>
|
||||
</SourceFiles>
|
||||
<PackageDependencies>
|
||||
<Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
|
||||
<Package PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d"/>
|
||||
</PackageDependencies>
|
||||
<Protocols>
|
||||
<Protocol Usage="TO_START">
|
||||
<ProtocolCName>gEfiBisProtocolGuid</ProtocolCName>
|
||||
<Protocol Usage="BY_START">
|
||||
<ProtocolCName>gEfiPxeBaseCodeProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="BY_START">
|
||||
<ProtocolCName>gEfiLoadFileProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="SOMETIMES_PRODUCED">
|
||||
<ProtocolCName>gEfiPxeBaseCodeCallbackProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="TO_START">
|
||||
<ProtocolCName>gEfiBisProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="TO_START">
|
||||
<ProtocolCName>gEfiSimpleNetworkProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="TO_START">
|
||||
<ProtocolCName>gEfiDevicePathProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="SOMETIMES_CONSUMED">
|
||||
<ProtocolCName>gEfiNetworkInterfaceIdentifierProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="SOMETIMES_CONSUMED">
|
||||
<Protocol Usage="TO_START">
|
||||
<ProtocolCName>gEfiNetworkInterfaceIdentifierProtocolGuid_31</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="BY_START">
|
||||
<ProtocolCName>gEfiPxeBaseCodeProtocolGuid</ProtocolCName>
|
||||
<Protocol Usage="ALWAYS_CONSUMED">
|
||||
<ProtocolCName>gEfiDevicePathProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="SOMETIMES_PRODUCED">
|
||||
<ProtocolCName>gEfiPxeBaseCodeCallbackProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
</Protocols>
|
||||
<SystemTables>
|
||||
@@ -102,11 +103,6 @@
|
||||
<SystemTableCName>gEfiSmbiosTableGuid</SystemTableCName>
|
||||
</SystemTableCNames>
|
||||
</SystemTables>
|
||||
<Guids>
|
||||
<GuidCNames Usage="ALWAYS_CONSUMED">
|
||||
<GuidCName>gEfiSmbiosTableGuid</GuidCName>
|
||||
</GuidCNames>
|
||||
</Guids>
|
||||
<Externs>
|
||||
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
|
||||
<Specification>EDK_RELEASE_VERSION 0x00020000</Specification>
|
||||
|
@@ -411,14 +411,6 @@ PxeBcLibGetSmbiosSystemGuidAndSerialNumber (
|
||||
)
|
||||
;
|
||||
|
||||
UINTN
|
||||
EFIAPI
|
||||
AsciiPrint (
|
||||
IN CONST CHAR8 *Format,
|
||||
...
|
||||
)
|
||||
;
|
||||
|
||||
//
|
||||
// Define SMBIOS tables.
|
||||
//
|
||||
|
@@ -822,7 +822,7 @@ Returns:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (BisHandleCount != sizeof BisHandleBuffer) {
|
||||
if (BisHandleCount != sizeof (BisHandleBuffer)) {
|
||||
//
|
||||
// This really should never happen, but I am paranoid.
|
||||
//
|
||||
@@ -1186,7 +1186,6 @@ BcStart (
|
||||
{
|
||||
EFI_SIMPLE_NETWORK_PROTOCOL *SnpPtr;
|
||||
EFI_SIMPLE_NETWORK_MODE *SnpModePtr;
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS StatCode;
|
||||
PXE_BASECODE_DEVICE *Private;
|
||||
|
||||
@@ -1364,54 +1363,34 @@ BcStart (
|
||||
//
|
||||
// Allocate Tx/Rx buffers
|
||||
//
|
||||
Status = gBS->AllocatePool (
|
||||
EfiBootServicesData,
|
||||
BUFFER_ALLOCATE_SIZE,
|
||||
(VOID **) &Private->TransmitBufferPtr
|
||||
);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
ZeroMem (Private->TransmitBufferPtr, BUFFER_ALLOCATE_SIZE);
|
||||
} else {
|
||||
Private->TransmitBufferPtr = AllocateZeroPool (BUFFER_ALLOCATE_SIZE);
|
||||
if (Private->TransmitBufferPtr == NULL) {
|
||||
DEBUG ((EFI_D_NET, "\nBcStart() Could not alloc TxBuf.\n"));
|
||||
EfiReleaseLock (&Private->Lock);
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
Status = gBS->AllocatePool (
|
||||
EfiBootServicesData,
|
||||
BUFFER_ALLOCATE_SIZE,
|
||||
(VOID **) &Private->ReceiveBufferPtr
|
||||
);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
ZeroMem (Private->ReceiveBufferPtr, BUFFER_ALLOCATE_SIZE);
|
||||
} else {
|
||||
Private->ReceiveBufferPtr = AllocateZeroPool (BUFFER_ALLOCATE_SIZE);
|
||||
if (Private->ReceiveBufferPtr == NULL) {
|
||||
DEBUG ((EFI_D_NET, "\nBcStart() Could not alloc RxBuf.\n"));
|
||||
gBS->FreePool (Private->TransmitBufferPtr);
|
||||
FreePool (Private->TransmitBufferPtr);
|
||||
EfiReleaseLock (&Private->Lock);
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
Status = gBS->AllocatePool (
|
||||
EfiBootServicesData,
|
||||
256,
|
||||
(VOID **) &Private->TftpErrorBuffer
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
gBS->FreePool (Private->ReceiveBufferPtr);
|
||||
gBS->FreePool (Private->TransmitBufferPtr);
|
||||
Private->TftpErrorBuffer = AllocatePool (256);
|
||||
if (Private->TftpErrorBuffer == NULL) {
|
||||
FreePool (Private->ReceiveBufferPtr);
|
||||
FreePool (Private->TransmitBufferPtr);
|
||||
EfiReleaseLock (&Private->Lock);
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
Status = gBS->AllocatePool (EfiBootServicesData, 256, (VOID **) &Private->TftpAckBuffer);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
gBS->FreePool (Private->TftpErrorBuffer);
|
||||
gBS->FreePool (Private->ReceiveBufferPtr);
|
||||
gBS->FreePool (Private->TransmitBufferPtr);
|
||||
Private->TftpAckBuffer = AllocatePool (256);
|
||||
if (Private->TftpAckBuffer == NULL) {
|
||||
FreePool (Private->TftpErrorBuffer);
|
||||
FreePool (Private->ReceiveBufferPtr);
|
||||
FreePool (Private->TransmitBufferPtr);
|
||||
EfiReleaseLock (&Private->Lock);
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
@@ -1546,27 +1525,27 @@ BcStop (
|
||||
}
|
||||
|
||||
if (Private->TransmitBufferPtr != NULL) {
|
||||
gBS->FreePool (Private->TransmitBufferPtr);
|
||||
FreePool (Private->TransmitBufferPtr);
|
||||
Private->TransmitBufferPtr = NULL;
|
||||
}
|
||||
|
||||
if (Private->ReceiveBufferPtr != NULL) {
|
||||
gBS->FreePool (Private->ReceiveBufferPtr);
|
||||
FreePool (Private->ReceiveBufferPtr);
|
||||
Private->ReceiveBufferPtr = NULL;
|
||||
}
|
||||
|
||||
if (Private->ArpBuffer != NULL) {
|
||||
gBS->FreePool (Private->ArpBuffer);
|
||||
FreePool (Private->ArpBuffer);
|
||||
Private->ArpBuffer = NULL;
|
||||
}
|
||||
|
||||
if (Private->TftpErrorBuffer != NULL) {
|
||||
gBS->FreePool (Private->TftpErrorBuffer);
|
||||
FreePool (Private->TftpErrorBuffer);
|
||||
Private->TftpErrorBuffer = NULL;
|
||||
}
|
||||
|
||||
if (Private->TftpAckBuffer != NULL) {
|
||||
gBS->FreePool (Private->TftpAckBuffer);
|
||||
FreePool (Private->TftpAckBuffer);
|
||||
Private->TftpAckBuffer = NULL;
|
||||
}
|
||||
|
||||
@@ -2118,46 +2097,26 @@ PxeBcDriverStart (
|
||||
//
|
||||
// Allocate structures needed by BaseCode and LoadFile protocols.
|
||||
//
|
||||
Status = gBS->AllocatePool (
|
||||
EfiBootServicesData,
|
||||
sizeof (PXE_BASECODE_DEVICE),
|
||||
(VOID **) &Private
|
||||
);
|
||||
Private = AllocateZeroPool (sizeof (PXE_BASECODE_DEVICE));
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
ZeroMem (Private, sizeof (PXE_BASECODE_DEVICE));
|
||||
} else {
|
||||
if (Private == NULL ) {
|
||||
DEBUG ((EFI_D_NET, "\nBcNotifySnp() Could not alloc PXE_BASECODE_DEVICE structure.\n"));
|
||||
return Status;
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
Status = gBS->AllocatePool (
|
||||
EfiBootServicesData,
|
||||
sizeof (LOADFILE_DEVICE),
|
||||
(VOID **) &pLF
|
||||
);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
ZeroMem (pLF, sizeof (LOADFILE_DEVICE));
|
||||
} else {
|
||||
pLF = AllocateZeroPool (sizeof (LOADFILE_DEVICE));
|
||||
if (pLF == NULL) {
|
||||
DEBUG ((EFI_D_NET, "\nBcNotifySnp() Could not alloc LOADFILE_DEVICE structure.\n"));
|
||||
gBS->FreePool (Private);
|
||||
return Status;
|
||||
FreePool (Private);
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
Status = gBS->AllocatePool (
|
||||
EfiBootServicesData,
|
||||
sizeof (EFI_PXE_BASE_CODE_MODE),
|
||||
(VOID **) &Private->EfiBc.Mode
|
||||
);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
ZeroMem (Private->EfiBc.Mode, sizeof (EFI_PXE_BASE_CODE_MODE));
|
||||
} else {
|
||||
Private->EfiBc.Mode = AllocateZeroPool (sizeof (EFI_PXE_BASE_CODE_MODE));
|
||||
if (Private->EfiBc.Mode == NULL) {
|
||||
DEBUG ((EFI_D_NET, "\nBcNotifySnp() Could not alloc Mode structure.\n"));
|
||||
gBS->FreePool (Private);
|
||||
gBS->FreePool (pLF);
|
||||
return Status;
|
||||
FreePool (Private);
|
||||
FreePool (pLF);
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
//
|
||||
// Lock access, just in case
|
||||
@@ -2298,9 +2257,9 @@ PxeBcDriverStart (
|
||||
return Status;
|
||||
|
||||
PxeBcError: ;
|
||||
gBS->FreePool (Private->EfiBc.Mode);
|
||||
gBS->FreePool (Private);
|
||||
gBS->FreePool (pLF);
|
||||
FreePool (Private->EfiBc.Mode);
|
||||
FreePool (Private);
|
||||
FreePool (pLF);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -2370,9 +2329,9 @@ PxeBcDriverStop (
|
||||
Controller
|
||||
);
|
||||
|
||||
gBS->FreePool (LoadDevice->Private->EfiBc.Mode);
|
||||
gBS->FreePool (LoadDevice->Private);
|
||||
gBS->FreePool (LoadDevice);
|
||||
FreePool (LoadDevice->Private->EfiBc.Mode);
|
||||
FreePool (LoadDevice->Private);
|
||||
FreePool (LoadDevice);
|
||||
}
|
||||
|
||||
return Status;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
Copyright (c) 2006 - 2007, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -340,7 +340,6 @@ Returns:
|
||||
EFI_PXE_BASE_CODE_MODE *PxeBcMode;
|
||||
EFI_SIMPLE_NETWORK_MODE *SnpMode;
|
||||
ARP_PACKET *ArpPacket;
|
||||
EFI_STATUS Status;
|
||||
UINTN HardwareAddrLength;
|
||||
UINT8 *SrcProtocolAddrPtr;
|
||||
UINT8 *DestHardwareAddrptr;
|
||||
@@ -357,14 +356,9 @@ Returns:
|
||||
// Allocate ARP buffer
|
||||
//
|
||||
if (Private->ArpBuffer == NULL) {
|
||||
Status = gBS->AllocatePool (
|
||||
EfiBootServicesData,
|
||||
SnpMode->MediaHeaderSize + sizeof (ARP_PACKET),
|
||||
(VOID **) &Private->ArpBuffer
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
Private->ArpBuffer = AllocatePool (SnpMode->MediaHeaderSize + sizeof (ARP_PACKET));
|
||||
if (Private->ArpBuffer == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
Copyright (c) 2006 - 2007, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -2223,12 +2223,12 @@ FreeMem (
|
||||
)
|
||||
{
|
||||
if (Private->TransmitBuffer != NULL) {
|
||||
gBS->FreePool (Private->TransmitBuffer);
|
||||
FreePool (Private->TransmitBuffer);
|
||||
Private->TransmitBuffer = NULL;
|
||||
}
|
||||
|
||||
if (Private->ReceiveBuffers != NULL) {
|
||||
gBS->FreePool (Private->ReceiveBuffers);
|
||||
FreePool (Private->ReceiveBuffers);
|
||||
Private->ReceiveBuffers = NULL;
|
||||
}
|
||||
}
|
||||
@@ -2240,48 +2240,29 @@ GetMem (
|
||||
PXE_BASECODE_DEVICE *Private
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
if (Private->DhcpPacketBuffer == NULL) {
|
||||
Status = gBS->AllocatePool (
|
||||
EfiBootServicesData,
|
||||
sizeof (DHCP_RECEIVE_BUFFER) * (PXE_BIS_INDEX + 1),
|
||||
&Private->DhcpPacketBuffer
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status) || Private->DhcpPacketBuffer == NULL) {
|
||||
Private->DhcpPacketBuffer = NULL;
|
||||
Private->DhcpPacketBuffer = AllocatePool (sizeof (DHCP_RECEIVE_BUFFER) * (PXE_BIS_INDEX + 1));
|
||||
if (Private->DhcpPacketBuffer == NULL) {
|
||||
FreeMem (Private);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
Status = gBS->AllocatePool (
|
||||
EfiBootServicesData,
|
||||
sizeof (EFI_PXE_BASE_CODE_PACKET),
|
||||
&Private->TransmitBuffer
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status) || Private->TransmitBuffer == NULL) {
|
||||
gBS->FreePool (Private->DhcpPacketBuffer);
|
||||
Private->TransmitBuffer = AllocatePool (sizeof (EFI_PXE_BASE_CODE_PACKET));
|
||||
if (Private->TransmitBuffer == NULL) {
|
||||
FreePool (Private->DhcpPacketBuffer);
|
||||
Private->DhcpPacketBuffer = NULL;
|
||||
Private->TransmitBuffer = NULL;
|
||||
FreeMem (Private);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Status = gBS->AllocatePool (
|
||||
EfiBootServicesData,
|
||||
sizeof (DHCP_RECEIVE_BUFFER) * (MAX_OFFERS),
|
||||
&Private->ReceiveBuffers
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status) || Private->ReceiveBuffers == NULL) {
|
||||
gBS->FreePool (Private->TransmitBuffer);
|
||||
gBS->FreePool (Private->DhcpPacketBuffer);
|
||||
Private->ReceiveBuffers = AllocatePool (sizeof (DHCP_RECEIVE_BUFFER) * (MAX_OFFERS));
|
||||
if (Private->ReceiveBuffers == NULL) {
|
||||
FreePool (Private->TransmitBuffer);
|
||||
FreePool (Private->DhcpPacketBuffer);
|
||||
Private->DhcpPacketBuffer = NULL;
|
||||
Private->TransmitBuffer = NULL;
|
||||
Private->ReceiveBuffers = NULL;
|
||||
FreeMem (Private);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2920,7 +2901,6 @@ Returns:
|
||||
PXE_SERVER_LISTS DefaultSrvList;
|
||||
PXE_SERVER_LISTS *ServerListPtr;
|
||||
PXE_SERVER_LISTS *McastServerListPtr;
|
||||
EFI_STATUS Status;
|
||||
UNION_PTR LocalPtr;
|
||||
UINTN Index;
|
||||
UINTN Index2;
|
||||
@@ -3120,14 +3100,11 @@ Returns:
|
||||
}
|
||||
|
||||
if (ServerListPtr == NULL) {
|
||||
Status = gBS->AllocatePool (
|
||||
EfiBootServicesData,
|
||||
sizeof (PXEV4_SERVER_LIST) + (Index2 - 1) * sizeof (EFI_IPv4_ADDRESS),
|
||||
(VOID **) &ServerListPtr
|
||||
ServerListPtr = AllocatePool (
|
||||
sizeof (PXEV4_SERVER_LIST) + (Index2 - 1) * sizeof (EFI_IPv4_ADDRESS)
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status) || ServerListPtr == NULL) {
|
||||
ServerListPtr = NULL;
|
||||
if (ServerListPtr == NULL) {
|
||||
EfiReleaseLock (&Private->Lock);
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
@@ -3173,7 +3150,7 @@ Returns:
|
||||
);
|
||||
|
||||
if (AcquiredSrvList) {
|
||||
gBS->FreePool (ServerListPtr);
|
||||
FreePool (ServerListPtr);
|
||||
}
|
||||
|
||||
FreeMem (Private);
|
||||
@@ -3219,7 +3196,6 @@ Returns:
|
||||
--*/
|
||||
{
|
||||
EFI_PXE_BASE_CODE_MODE *PxebcMode;
|
||||
EFI_STATUS Status;
|
||||
PXE_BASECODE_DEVICE *Private;
|
||||
|
||||
//
|
||||
@@ -3249,14 +3225,8 @@ Returns:
|
||||
PxebcMode = Private->EfiBc.Mode;
|
||||
|
||||
if (Private->DhcpPacketBuffer == NULL) {
|
||||
Status = gBS->AllocatePool (
|
||||
EfiBootServicesData,
|
||||
sizeof (DHCP_RECEIVE_BUFFER) * (PXE_BIS_INDEX + 1),
|
||||
&Private->DhcpPacketBuffer
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status) || Private->DhcpPacketBuffer == NULL) {
|
||||
Private->DhcpPacketBuffer = NULL;
|
||||
Private->DhcpPacketBuffer = AllocatePool (sizeof (DHCP_RECEIVE_BUFFER) * (PXE_BIS_INDEX + 1));
|
||||
if (Private->DhcpPacketBuffer == NULL) {
|
||||
EfiReleaseLock (&Private->Lock);
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
@@ -1963,7 +1963,6 @@ Returns:
|
||||
{
|
||||
EFI_PXE_BASE_CODE_IP_FILTER Filter;
|
||||
EFI_STATUS StatCode;
|
||||
EFI_STATUS Status;
|
||||
UINT64 BufferSizeLocal;
|
||||
UINTN PacketSize;
|
||||
UINT8 *BufferPtrLocal;
|
||||
@@ -2082,13 +2081,8 @@ Returns:
|
||||
}
|
||||
|
||||
if (DontUseBuffer) {
|
||||
Status = gBS->AllocatePool (
|
||||
EfiBootServicesData,
|
||||
BUFFER_ALLOCATE_SIZE,
|
||||
(VOID **) &BufferPtrLocal
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status) || BufferPtrLocal == NULL) {
|
||||
BufferPtrLocal = AllocatePool (BUFFER_ALLOCATE_SIZE);
|
||||
if (BufferPtrLocal == NULL) {
|
||||
DEBUG ((EFI_D_NET, "\nPxeBcMtftp() Exit #4"));
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
@@ -2267,7 +2261,7 @@ Returns:
|
||||
}
|
||||
|
||||
if (DontUseBuffer) {
|
||||
gBS->FreePool (BufferPtrLocal);
|
||||
FreePool (BufferPtrLocal);
|
||||
}
|
||||
|
||||
if (StatCode != EFI_SUCCESS) {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
Copyright (c) 2006 - 2007, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -1168,14 +1168,9 @@ Returns:
|
||||
//
|
||||
// Allocate credential file buffer.
|
||||
//
|
||||
Status = gBS->AllocatePool (
|
||||
EfiBootServicesData,
|
||||
(UINTN) CredentialLen,
|
||||
&CredentialBuffer
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
CredentialBuffer = AllocatePool ((UINTN) CredentialLen);
|
||||
if (CredentialBuffer == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
//
|
||||
// Download credential file.
|
||||
@@ -1196,7 +1191,7 @@ Returns:
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
gBS->FreePool (CredentialBuffer);
|
||||
FreePool (CredentialBuffer);
|
||||
return Status;
|
||||
}
|
||||
//
|
||||
@@ -1211,7 +1206,7 @@ Returns:
|
||||
Status = EFI_PROTOCOL_ERROR;
|
||||
}
|
||||
|
||||
gBS->FreePool (CredentialBuffer);
|
||||
FreePool (CredentialBuffer);
|
||||
}
|
||||
|
||||
return Status;
|
||||
|
Reference in New Issue
Block a user