From b58baf6bd467fdc81c16b681e1d253e6fd5ab525 Mon Sep 17 00:00:00 2001 From: vanjeff Date: Fri, 1 Aug 2008 08:16:40 +0000 Subject: [PATCH] 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 --- .../Universal/Network/MnpDxe/MnpDriver.c | 28 ++++++++++++++----- 1 file 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; }