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 <[email protected]>
Cc: Wu Jiaxin <[email protected]>
Cc: Fu Siyuan <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Songpeng Li <[email protected]>
---
 .../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.<BR>
+Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
 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.<BR>
+Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
 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 <Protocol/Arp.h>
 #include <Protocol/Ip4.h>
 #include <Protocol/Ip4Config2.h>
+#include <Protocol/PxeBcTag.h>
 
 #include <Library/DebugLib.h>
 #include <Library/DevicePathLib.h>
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf 
b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
index 0424019929..dc255534cb 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                       ## SOMETIMES_CONSUMES
 
 [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdTftpBlockSize  ## SOMETIMES_CONSUMES
-- 
2.18.0.windows.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to