mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 16:14:04 +02:00
NetworkPkg/SnpDxe: Shutdown SnpDxe on BeforeExitBootServices Event.
SnpDxe registers for an ExitBootServices callback and runs the PXE_OPCODE_SHUTDOWN and PXE_OPCODE_STOP commands for any network controllers that the driver is attached to. Register the SnpDxe callback for gEfiEventBeforeExitBootServicesGuid instead of gEfiEventExitBootServicesGuid to ensure the correct ordering: 1. ExitBootServices event 2. Network card shutdown sequence is completed Also, close the event to prevent rerunning the shutdown if multiple ExitBootServices events need to be called by the OS. Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
This commit is contained in:
parent
c1548908c9
commit
89d413731d
@ -32,6 +32,10 @@ SnpNotifyExitBootServices (
|
|||||||
//
|
//
|
||||||
PxeShutdown (Snp);
|
PxeShutdown (Snp);
|
||||||
PxeStop (Snp);
|
PxeStop (Snp);
|
||||||
|
|
||||||
|
// Since BeforeExitBootServices is run on each call, close event
|
||||||
|
// to prevent reentry.
|
||||||
|
gBS->CloseEvent (Event);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -655,7 +659,7 @@ SimpleNetworkDriverStart (
|
|||||||
TPL_CALLBACK,
|
TPL_CALLBACK,
|
||||||
SnpNotifyExitBootServices,
|
SnpNotifyExitBootServices,
|
||||||
Snp,
|
Snp,
|
||||||
&gEfiEventExitBootServicesGuid,
|
&gEfiEventBeforeExitBootServicesGuid,
|
||||||
&Snp->ExitBootServicesEvent
|
&Snp->ExitBootServicesEvent
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
@ -65,7 +65,7 @@
|
|||||||
NetLib
|
NetLib
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gEfiEventExitBootServicesGuid ## SOMETIMES_CONSUMES ## Event
|
gEfiEventBeforeExitBootServicesGuid ## SOMETIMES_CONSUMES ## Event
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiSimpleNetworkProtocolGuid ## BY_START
|
gEfiSimpleNetworkProtocolGuid ## BY_START
|
||||||
|
Loading…
x
Reference in New Issue
Block a user