summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/Network/MnpDxe
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-08-01 08:16:40 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-08-01 08:16:40 +0000
commitb58baf6bd467fdc81c16b681e1d253e6fd5ab525 (patch)
tree2135e3782a77f72f308437641a229353f56ac64b /MdeModulePkg/Universal/Network/MnpDxe
parent75b046c3d4aca166de580f5b80c42a14fcbd60eb (diff)
downloadedk2-b58baf6bd467fdc81c16b681e1d253e6fd5ab525.tar.gz
edk2-b58baf6bd467fdc81c16b681e1d253e6fd5ab525.tar.bz2
edk2-b58baf6bd467fdc81c16b681e1d253e6fd5ab525.zip
In Supported(), try to test open SNP protocol BY_DRIVER instead of using TEST_PROTOCOL.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5601 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/MnpDxe')
-rw-r--r--MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.c b/MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.c
index fe6b63beac..0ca41516c7 100644
--- a/MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.c
+++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.c
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2005 - 2007, Intel Corporation
+Copyright (c) 2005 - 2008, Intel Corporation
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
@@ -53,7 +53,8 @@ MnpDriverBindingSupported (
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
+ EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
//
// Test to see if MNP is already installed.
@@ -67,23 +68,36 @@ MnpDriverBindingSupported (
EFI_OPEN_PROTOCOL_TEST_PROTOCOL
);
if (!EFI_ERROR (Status)) {
-
return EFI_ALREADY_STARTED;
}
//
- // Test to see if SNP is installed.
+ // Test to open the Simple Network protocol BY_DRIVER.
//
Status = gBS->OpenProtocol (
ControllerHandle,
&gEfiSimpleNetworkProtocolGuid,
- NULL,
+ (VOID **) &Snp,
This->DriverBindingHandle,
ControllerHandle,
- EFI_OPEN_PROTOCOL_TEST_PROTOCOL
+ EFI_OPEN_PROTOCOL_BY_DRIVER
);
- return Status;
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ //
+ // Close the openned SNP protocol.
+ //
+ gBS->CloseProtocol (
+ ControllerHandle,
+ &gEfiSimpleNetworkProtocolGuid,
+ This->DriverBindingHandle,
+ ControllerHandle
+ );
+
+ return EFI_SUCCESS;
}