X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FNetwork%2FSnpDxe%2FSnp.c;fp=MdeModulePkg%2FUniversal%2FNetwork%2FSnpDxe%2FSnp.c;h=5ff294f8b59b47d503edbc49e3f819c6c605eeb2;hp=db5b6267a613111bae3407cfc95c20a1e20b7699;hb=7b4b93a24790a3a802138d75167a8e55f3181d70;hpb=c2967d35d84fce6caf6691d2d892d20e8c273601 diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Snp.c b/MdeModulePkg/Universal/Network/SnpDxe/Snp.c index db5b6267a6..5ff294f8b5 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Snp.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Snp.c @@ -1,7 +1,7 @@ /** @file Implementation of driver entry point and driver binding protocol. -Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2016, 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 @@ -403,6 +403,14 @@ SimpleNetworkDriverStart ( Snp->TxRxBufferSize = 0; Snp->TxRxBuffer = NULL; + + Snp->RecycledTxBuf = AllocatePool (sizeof (UINT64) * SNP_TX_BUFFER_INCREASEMENT); + if (Snp->RecycledTxBuf == NULL) { + Status = EFI_OUT_OF_RESOURCES; + goto Error_DeleteSNP; + } + Snp->MaxRecycledTxBuf = SNP_TX_BUFFER_INCREASEMENT; + Snp->RecycledTxBufCount = 0; if (Nii->Revision >= EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION) { Snp->IfNum = Nii->IfNum; @@ -678,6 +686,10 @@ SimpleNetworkDriverStart ( Error_DeleteSNP: + if (Snp->RecycledTxBuf != NULL) { + FreePool (Snp->RecycledTxBuf); + } + PciIo->FreeBuffer ( PciIo, SNP_MEM_PAGES (sizeof (SNP_DRIVER)), @@ -790,6 +802,8 @@ SimpleNetworkDriverStop ( PxeShutdown (Snp); PxeStop (Snp); + FreePool (Snp->RecycledTxBuf); + PciIo = Snp->PciIo; PciIo->FreeBuffer ( PciIo,