From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=songpeng.li@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3B33221184ACB for ; Sun, 28 Oct 2018 22:48:35 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Oct 2018 22:48:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,438,1534834800"; d="scan'208";a="276441174" Received: from songpeng.ccr.corp.intel.com ([10.239.158.28]) by fmsmga006.fm.intel.com with ESMTP; 28 Oct 2018 22:48:34 -0700 From: Songpeng Li To: edk2-devel@lists.01.org Cc: Ye Ting , Wu Jiaxin , Fu Siyuan Date: Mon, 29 Oct 2018 13:48:00 +0800 Message-Id: <20181029054802.68148-3-songpeng.li@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 In-Reply-To: <20181029054802.68148-1-songpeng.li@intel.com> References: <20181029054802.68148-1-songpeng.li@intel.com> Subject: [PATCH v2 2/4] MdeModulePkg/UefiPxeBcDxe: Add Conflict Detection Process. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 05:48:35 -0000 v2: Modify UefiPxeBcDxe.inf file: tag protocol guid should be marked as BY_START The current PxeBc Driver in MdeModulePkg and NetworkPkg has no conflict detection when both installed in platform, this process is for conflict driver detect. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1278 Cc: Ye Ting Cc: Wu Jiaxin Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Songpeng Li --- .../Network/UefiPxeBcDxe/PxeBcDriver.c | 19 ++++++++++++++++++- .../Network/UefiPxeBcDxe/PxeBcImpl.h | 3 ++- .../Network/UefiPxeBcDxe/UefiPxeBcDxe.inf | 1 + 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c index 76c140d8e3..bd16f8b2e2 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c @@ -1,7 +1,7 @@ /** @file The driver binding for UEFI PXEBC protocol. -Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2018, 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 @@ -84,6 +84,19 @@ PxeBcDriverBindingSupported ( EFI_PXE_BASE_CODE_PROTOCOL *PxeBc; EFI_STATUS Status; + Status = gBS->OpenProtocol ( + ControllerHandle, + &gEdkiiPxeBcTagProtocolGuid, + NULL, + This->DriverBindingHandle, + ControllerHandle, + EFI_OPEN_PROTOCOL_TEST_PROTOCOL + ); + + if (!EFI_ERROR (Status)) { + return EFI_ALREADY_STARTED; + } + Status = gBS->OpenProtocol ( ControllerHandle, &gEfiPxeBaseCodeProtocolGuid, @@ -370,6 +383,8 @@ PxeBcDriverBindingStart ( &Private->PxeBc, &gEfiLoadFileProtocolGuid, &Private->LoadFile, + &gEdkiiPxeBcTagProtocolGuid, + NULL, NULL ); if (EFI_ERROR (Status)) { @@ -573,6 +588,8 @@ PxeBcDriverBindingStop ( &Private->PxeBc, &gEfiLoadFileProtocolGuid, &Private->LoadFile, + &gEdkiiPxeBcTagProtocolGuid, + NULL, NULL ); diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.h b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.h index e96b6f2c5d..0fceb35b82 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.h +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.h @@ -1,6 +1,6 @@ /** @file -Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2018, 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 @@ -32,6 +32,7 @@ typedef struct _PXEBC_PRIVATE_DATA PXEBC_PRIVATE_DATA; #include #include #include +#include #include #include diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf index 0424019929..fbbec6c6b0 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf @@ -94,6 +94,7 @@ gEfiIp4ServiceBindingProtocolGuid ## TO_START gEfiIp4ProtocolGuid ## TO_START gEfiIp4Config2ProtocolGuid ## TO_START + gEdkiiPxeBcTagProtocolGuid ## BY_START [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdTftpBlockSize ## SOMETIMES_CONSUMES -- 2.18.0.windows.1