mirror of https://github.com/acidanthera/audk.git
Fix an issue that upper layer driver can not use NIC card in its driver binding stop().
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11574 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
d394581d11
commit
f415234b3b
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Initialization functions for EFI UNDI32 driver.
|
Initialization functions for EFI UNDI32 driver.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -573,7 +573,6 @@ UndiDriverStop (
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
UNDI32_DEV *UNDI32Device;
|
UNDI32_DEV *UNDI32Device;
|
||||||
EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL *NIIProtocol;
|
EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL *NIIProtocol;
|
||||||
EFI_PCI_IO_PROTOCOL *PciIo;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Complete all outstanding transactions to Controller.
|
// Complete all outstanding transactions to Controller.
|
||||||
|
@ -617,6 +616,15 @@ UndiDriverStop (
|
||||||
|
|
||||||
UNDI32Device = UNDI_DEV_FROM_THIS (NIIProtocol);
|
UNDI32Device = UNDI_DEV_FROM_THIS (NIIProtocol);
|
||||||
|
|
||||||
|
Status = gBS->UninstallMultipleProtocolInterfaces (
|
||||||
|
ChildHandleBuffer[Index],
|
||||||
|
&gEfiDevicePathProtocolGuid,
|
||||||
|
UNDI32Device->Undi32DevPath,
|
||||||
|
&gEfiNetworkInterfaceIdentifierProtocolGuid_31,
|
||||||
|
&UNDI32Device->NIIProtocol_31,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
if (!EFI_ERROR (Status)) {
|
||||||
//
|
//
|
||||||
// Restore original PCI attributes
|
// Restore original PCI attributes
|
||||||
//
|
//
|
||||||
|
@ -635,27 +643,11 @@ UndiDriverStop (
|
||||||
ChildHandleBuffer[Index]
|
ChildHandleBuffer[Index]
|
||||||
);
|
);
|
||||||
|
|
||||||
Status = gBS->UninstallMultipleProtocolInterfaces (
|
ASSERT_EFI_ERROR (Status);
|
||||||
ChildHandleBuffer[Index],
|
|
||||||
&gEfiDevicePathProtocolGuid,
|
|
||||||
UNDI32Device->Undi32DevPath,
|
|
||||||
&gEfiNetworkInterfaceIdentifierProtocolGuid_31,
|
|
||||||
&UNDI32Device->NIIProtocol_31,
|
|
||||||
NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
gBS->OpenProtocol (
|
|
||||||
Controller,
|
|
||||||
&gEfiPciIoProtocolGuid,
|
|
||||||
(VOID **) &PciIo,
|
|
||||||
This->DriverBindingHandle,
|
|
||||||
ChildHandleBuffer[Index],
|
|
||||||
EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
gBS->FreePool (UNDI32Device->Undi32DevPath);
|
gBS->FreePool (UNDI32Device->Undi32DevPath);
|
||||||
gBS->FreePool (UNDI32Device);
|
gBS->FreePool (UNDI32Device);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue