summaryrefslogtreecommitdiff
path: root/NetworkPkg/SnpDxe
diff options
context:
space:
mode:
Diffstat (limited to 'NetworkPkg/SnpDxe')
-rw-r--r--NetworkPkg/SnpDxe/Snp.c40
-rw-r--r--NetworkPkg/SnpDxe/Snp.h3
-rw-r--r--NetworkPkg/SnpDxe/SnpDxe.inf5
3 files changed, 28 insertions, 20 deletions
diff --git a/NetworkPkg/SnpDxe/Snp.c b/NetworkPkg/SnpDxe/Snp.c
index a23af05..9fb007f 100644
--- a/NetworkPkg/SnpDxe/Snp.c
+++ b/NetworkPkg/SnpDxe/Snp.c
@@ -1,7 +1,7 @@
/** @file
Implementation of driver entry point and driver binding protocol.
-Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -647,19 +647,21 @@ SimpleNetworkDriverStart (
PxeShutdown (Snp);
PxeStop (Snp);
- //
- // Create EXIT_BOOT_SERIVES Event
- //
- Status = gBS->CreateEventEx (
- EVT_NOTIFY_SIGNAL,
- TPL_NOTIFY,
- SnpNotifyExitBootServices,
- Snp,
- &gEfiEventExitBootServicesGuid,
- &Snp->ExitBootServicesEvent
- );
- if (EFI_ERROR (Status)) {
- goto Error_DeleteSNP;
+ if (FixedPcdGetBool (PcdSnpCreateExitBootServicesEvent)) {
+ //
+ // Create EXIT_BOOT_SERIVES Event
+ //
+ Status = gBS->CreateEventEx (
+ EVT_NOTIFY_SIGNAL,
+ TPL_NOTIFY,
+ SnpNotifyExitBootServices,
+ Snp,
+ &gEfiEventExitBootServicesGuid,
+ &Snp->ExitBootServicesEvent
+ );
+ if (EFI_ERROR (Status)) {
+ goto Error_DeleteSNP;
+ }
}
//
@@ -778,10 +780,12 @@ SimpleNetworkDriverStop (
return Status;
}
- //
- // Close EXIT_BOOT_SERIVES Event
- //
- gBS->CloseEvent (Snp->ExitBootServicesEvent);
+ if (FixedPcdGetBool (PcdSnpCreateExitBootServicesEvent)) {
+ //
+ // Close EXIT_BOOT_SERIVES Event
+ //
+ gBS->CloseEvent (Snp->ExitBootServicesEvent);
+ }
Status = gBS->CloseProtocol (
Controller,
diff --git a/NetworkPkg/SnpDxe/Snp.h b/NetworkPkg/SnpDxe/Snp.h
index e6b6293..9e4b7d6 100644
--- a/NetworkPkg/SnpDxe/Snp.h
+++ b/NetworkPkg/SnpDxe/Snp.h
@@ -1,7 +1,7 @@
/** @file
Declaration of strctures and functions for SnpDxe driver.
-Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -26,6 +26,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Library/UefiLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PrintLib.h>
+#include <Library/PcdLib.h>
#include <IndustryStandard/Pci.h>
#include <IndustryStandard/Acpi.h>
diff --git a/NetworkPkg/SnpDxe/SnpDxe.inf b/NetworkPkg/SnpDxe/SnpDxe.inf
index afeb152..d16f188 100644
--- a/NetworkPkg/SnpDxe/SnpDxe.inf
+++ b/NetworkPkg/SnpDxe/SnpDxe.inf
@@ -4,7 +4,7 @@
# This module produces Simple Network Protocol upon EFI Network Interface
# Identifier Protocol, to provide a packet level interface to a network adapter.
#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
@@ -73,5 +73,8 @@
gEfiNetworkInterfaceIdentifierProtocolGuid_31 ## TO_START
gEfiPciIoProtocolGuid ## TO_START
+[Pcd]
+ gEfiNetworkPkgTokenSpaceGuid.PcdSnpCreateExitBootServicesEvent ## CONSUMES
+
[UserExtensions.TianoCore."ExtraFiles"]
SnpDxeExtra.uni