]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg/UefiPxeBcDxe:Add two PCD to control PXE.
authorXue, ShengfengX <shengfengx.xue@intel.com>
Thu, 18 Apr 2019 10:13:22 +0000 (18:13 +0800)
committerFu Siyuan <siyuan.fu@intel.com>
Mon, 22 Apr 2019 01:14:45 +0000 (09:14 +0800)
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1695

Setup need provide an item for user to control IPV46 PXE boot.
Origin UefiPxeBcDxe driver doesn't have such interface.
This change added two PCD to control IPV4/6 PXE in PxeBcSupported().
Platform code should override this two PCD according to Setup value.
code change no side effect on current PXE function with default PCD.

Signed-off-by: Xue ShengfengX <shengfengx.xue@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
NetworkPkg/NetworkPkg.dec
NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h
NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf

index 9b8ece4837da84e69972e8627077133de3947263..1aa7c1ed316c2660c6079924f940dc8d4189580d 100644 (file)
@@ -3,7 +3,7 @@
 #\r
 # This package provides network modules that conform to UEFI 2.4 specification.\r
 #\r
-# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR>\r
 # (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP<BR>\r
 #\r
 # SPDX-License-Identifier: BSD-2-Clause-Patent\r
   # @Prompt Type Value of network boot policy used in iSCSI.\r
   gEfiNetworkPkgTokenSpaceGuid.PcdIScsiAIPNetworkBootPolicy|0x08|UINT8|0x10000007\r
 \r
+  ## IPv4 PXE support\r
+  # 0x01 = PXE Enabled\r
+  # 0x00 = PXE Disabled\r
+  gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01|UINT8|0x10000009\r
+\r
+  ## IPv6 PXE support\r
+  # 0x01 = PXE Enabled\r
+  # 0x00 = PXE Disabled\r
+  gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01|UINT8|0x1000000a\r
+\r
 [UserExtensions.TianoCore."ExtraFiles"]\r
   NetworkPkgExtra.uni\r
index 3c1d400d502ca63a08d07cbb96f90c6198498658..b35edb687d302cbd5b6b6bd4c25f98483c857e84 100644 (file)
@@ -2,7 +2,7 @@
   Driver Binding functions implementationfor for UefiPxeBc Driver.\r
 \r
   (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
-  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>\r
 \r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -1242,6 +1242,10 @@ PxeBcDriverEntryPoint (
 {\r
   EFI_STATUS  Status;\r
 \r
+  if ((PcdGet8(PcdIPv4PXESupport) == PXE_DISABLED) && (PcdGet8(PcdIPv6PXESupport) == PXE_DISABLED)) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
   Status = EfiLibInstallDriverBindingComponentName2 (\r
              ImageHandle,\r
              SystemTable,\r
@@ -1301,9 +1305,15 @@ PxeBcSupported (
   EFI_GUID                        *MtftpServiceBindingGuid;\r
 \r
   if (IpVersion == IP_VERSION_4) {\r
+    if (PcdGet8(PcdIPv4PXESupport) == PXE_DISABLED) {\r
+      return EFI_UNSUPPORTED;\r
+    }\r
     DhcpServiceBindingGuid  = &gEfiDhcp4ServiceBindingProtocolGuid;\r
     MtftpServiceBindingGuid = &gEfiMtftp4ServiceBindingProtocolGuid;\r
   } else {\r
+    if (PcdGet8(PcdIPv6PXESupport) == PXE_DISABLED) {\r
+      return EFI_UNSUPPORTED;\r
+    }\r
     DhcpServiceBindingGuid  = &gEfiDhcp6ServiceBindingProtocolGuid;\r
     MtftpServiceBindingGuid = &gEfiMtftp6ServiceBindingProtocolGuid;\r
   }\r
index f0db4a0c1adcfb8e6b903bd794b4694114e87967..fa4950c6235c547072f268e53975527e326380e5 100644 (file)
@@ -2,7 +2,7 @@
   This EFI_PXE_BASE_CODE_PROTOCOL and EFI_LOAD_FILE_PROTOCOL.\r
   interfaces declaration.\r
 \r
-  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>\r
 \r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -78,6 +78,9 @@ typedef struct _PXEBC_VIRTUAL_NIC   PXEBC_VIRTUAL_NIC;
 #define PXEBC_PRIVATE_DATA_FROM_ID(a)         CR (a, PXEBC_PRIVATE_DATA, Id, PXEBC_PRIVATE_DATA_SIGNATURE)\r
 #define PXEBC_VIRTUAL_NIC_FROM_LOADFILE(a)    CR (a, PXEBC_VIRTUAL_NIC, LoadFile, PXEBC_VIRTUAL_NIC_SIGNATURE)\r
 \r
+#define PXE_ENABLED                           0x01\r
+#define PXE_DISABLED                          0x00\r
+\r
 typedef union {\r
   PXEBC_DHCP4_PACKET_CACHE            Dhcp4;\r
   PXEBC_DHCP6_PACKET_CACHE            Dhcp6;\r
index fc31250deafa60d9060b087f92faa6a5ef7e68b5..0341f1052a21869a16972be754d7f7757d17cdeb 100644 (file)
@@ -5,7 +5,7 @@
 #  PXE-compatible device for network access or booting. This driver supports\r
 #  both IPv4 and IPv6 network stack.\r
 #\r
-#  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
 [Pcd]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdTftpBlockSize      ## SOMETIMES_CONSUMES\r
   gEfiNetworkPkgTokenSpaceGuid.PcdPxeTftpWindowSize    ## SOMETIMES_CONSUMES\r
+  gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport       ## CONSUMES\r
+  gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport       ## CONSUMES\r
 \r
 [UserExtensions.TianoCore."ExtraFiles"]\r
   UefiPxeBcDxeExtra.uni\r