diff options
Diffstat (limited to 'MdeModulePkg/Universal/Network/SnpDxe/Snp.c')
-rw-r--r-- | MdeModulePkg/Universal/Network/SnpDxe/Snp.c | 16 |
1 files changed, 15 insertions, 1 deletions
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.<BR>
+Copyright (c) 2004 - 2016, 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
@@ -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,
|