fixed DMA not be stopped issue when gBS->ExitBootServices called.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8058 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Implementation of driver entry point and driver binding protocol.
|
||||
|
||||
Copyright (c) 2004 - 2008, Intel Corporation. <BR>
|
||||
Copyright (c) 2004 - 2009, Intel Corporation. <BR>
|
||||
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,6 +22,30 @@ V2P *mV2p = NULL; // undi3.0 map_list head
|
||||
// End Global variables
|
||||
//
|
||||
|
||||
/**
|
||||
One notified function to stop UNDI device when gBS->ExitBootServices() called.
|
||||
|
||||
@param Event Pointer to this event
|
||||
@param Context Event hanlder private data
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
SnpNotifyExitBootServices (
|
||||
EFI_EVENT Event,
|
||||
VOID *Context
|
||||
)
|
||||
{
|
||||
SNP_DRIVER *Snp;
|
||||
|
||||
Snp = (SNP_DRIVER *)Context;
|
||||
|
||||
//
|
||||
// Shutdown and stop UNDI driver
|
||||
//
|
||||
PxeShutdown (Snp);
|
||||
PxeStop (Snp);
|
||||
}
|
||||
|
||||
/**
|
||||
Send command to UNDI. It does nothing currently.
|
||||
@@ -634,6 +658,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;
|
||||
}
|
||||
|
||||
//
|
||||
// add SNP to the undi handle
|
||||
//
|
||||
@@ -738,6 +777,11 @@ SimpleNetworkDriverStop (
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Close EXIT_BOOT_SERIVES Event
|
||||
//
|
||||
gBS->CloseEvent (Snp->ExitBootServicesEvent);
|
||||
|
||||
Status = gBS->CloseProtocol (
|
||||
Controller,
|
||||
&gEfiNetworkInterfaceIdentifierProtocolGuid_31,
|
||||
|
Reference in New Issue
Block a user