]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg: Add DSC/FDF include segment files to NetworkPkg.
authorLiming Gao <liming.gao@intel.com>
Thu, 25 Apr 2019 12:37:34 +0000 (20:37 +0800)
committerLiming Gao <liming.gao@intel.com>
Wed, 8 May 2019 08:10:39 +0000 (16:10 +0800)
This patch provides a set of include segment files for platform owner to
easily enable/disable network stack support on their platform.

For DSC, there are:
- a "NetworkDefines.dsc.inc" for the [Defines] section(s),
- a "NetworkLibs.dsc.inc" for the [LibraryClasses*] section(s),
- a "NetworkPcds.dsc.inc" for the [Pcds*] section(s),
- a "NetworkComponents.dsc.inc" for the [Components*] section(s).
For FDF, there is:
- a "Network.fdf.inc" for the [Fv*] section(s).

These files can be added to the platform DSC/FDF file by using
  !include NetworkPkg/xxx
where "xxx" is the *.inc file name.

A platform DSC file can diverge from the defaults in
"NetworkDefines.dsc.inc" by setting the individual DEFINEs before
including "NetworkDefines.dsc.inc".
And, build command line ("-D FLAG=VALUE") can be used to enable or
disable related feature set, please check "NetworkDefines.dsc.inc"
for a detail description of each flag.

The default value of these flags are:
  DEFINE NETWORK_ENABLE                 = TRUE
  DEFINE NETWORK_SNP_ENABLE             = TRUE
  DEFINE NETWORK_IP4_ENABLE             = TRUE
  DEFINE NETWORK_IP6_ENABLE             = TRUE
  DEFINE NETWORK_TLS_ENABLE             = TRUE
  DEFINE NETWORK_HTTP_BOOT_ENABLE       = TRUE
  DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
  DEFINE NETWORK_ISCSI_ENABLE           = TRUE
  DEFINE NETWORK_VLAN_ENABLE            = TRUE

Related BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1293

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
NetworkPkg/Network.fdf.inc [new file with mode: 0644]
NetworkPkg/NetworkComponents.dsc.inc [new file with mode: 0644]
NetworkPkg/NetworkDefines.dsc.inc [new file with mode: 0644]
NetworkPkg/NetworkLibs.dsc.inc [new file with mode: 0644]
NetworkPkg/NetworkPcds.dsc.inc [new file with mode: 0644]

diff --git a/NetworkPkg/Network.fdf.inc b/NetworkPkg/Network.fdf.inc
new file mode 100644 (file)
index 0000000..92e2c56
--- /dev/null
@@ -0,0 +1,60 @@
+## @file\r
+# Network FDF include file for All Architectures.\r
+#\r
+# This file can be included to a platform FDF by using\r
+# "!include NetworkPkg/Network.fdf.inc" to add EDKII network stack drivers\r
+# according to the value of flags described in "NetworkPkg/Network.dsc.inc".\r
+#\r
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
+#\r
+#    SPDX-License-Identifier: BSD-2-Clause-Patent\r
+#\r
+\r
+!if $(NETWORK_ENABLE) == TRUE\r
+  INF  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf\r
+\r
+  !if $(NETWORK_SNP_ENABLE) == TRUE\r
+    INF  MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf\r
+  !endif\r
+\r
+  !if $(NETWORK_VLAN_ENABLE) == TRUE\r
+    INF  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf\r
+  !endif\r
+\r
+  INF  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf\r
+\r
+  !if $(NETWORK_IP4_ENABLE) == TRUE\r
+    INF  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf\r
+    INF  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf\r
+    INF  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf\r
+    INF  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf\r
+    INF  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf\r
+  !endif\r
+\r
+  !if $(NETWORK_IP6_ENABLE) == TRUE\r
+    INF  NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf\r
+    INF  NetworkPkg/Ip6Dxe/Ip6Dxe.inf\r
+    INF  NetworkPkg/Udp6Dxe/Udp6Dxe.inf\r
+    INF  NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf\r
+  !endif\r
+\r
+  INF  NetworkPkg/TcpDxe/TcpDxe.inf\r
+  INF  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf\r
+\r
+  !if $(NETWORK_TLS_ENABLE) == TRUE\r
+    INF  NetworkPkg/TlsDxe/TlsDxe.inf\r
+    INF  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf\r
+  !endif\r
+\r
+  !if $(NETWORK_HTTP_BOOT_ENABLE) == TRUE\r
+    INF  NetworkPkg/DnsDxe/DnsDxe.inf\r
+    INF  NetworkPkg/HttpDxe/HttpDxe.inf\r
+    INF  NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf\r
+    INF  NetworkPkg/HttpBootDxe/HttpBootDxe.inf\r
+  !endif\r
+\r
+  !if $(NETWORK_ISCSI_ENABLE) == TRUE\r
+    INF  NetworkPkg/IScsiDxe/IScsiDxe.inf\r
+  !endif\r
+\r
+!endif\r
diff --git a/NetworkPkg/NetworkComponents.dsc.inc b/NetworkPkg/NetworkComponents.dsc.inc
new file mode 100644 (file)
index 0000000..aede5ea
--- /dev/null
@@ -0,0 +1,61 @@
+## @file\r
+# Network DSC include file for [Components*] section of all Architectures.\r
+#\r
+# This file can be included to the [Components*] section(s) of a platform DSC file\r
+# by using "!include NetworkPkg/NetworkComponents.dsc.inc" to specify the INF files\r
+# of EDKII network drivers according to the value of flags described in\r
+# "NetworkDefines.dsc.inc".\r
+#\r
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
+#\r
+#    SPDX-License-Identifier: BSD-2-Clause-Patent\r
+#\r
+##\r
+\r
+!if $(NETWORK_ENABLE) == TRUE\r
+  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf\r
+\r
+  !if $(NETWORK_SNP_ENABLE) == TRUE\r
+    MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf\r
+  !endif\r
+\r
+  !if $(NETWORK_VLAN_ENABLE) == TRUE\r
+    MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf\r
+  !endif\r
+\r
+  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf\r
+\r
+  !if $(NETWORK_IP4_ENABLE) == TRUE\r
+    MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf\r
+    MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf\r
+    MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf\r
+    MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf\r
+    MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf\r
+  !endif\r
+\r
+  !if $(NETWORK_IP6_ENABLE) == TRUE\r
+    NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf\r
+    NetworkPkg/Ip6Dxe/Ip6Dxe.inf\r
+    NetworkPkg/Udp6Dxe/Udp6Dxe.inf\r
+    NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf\r
+  !endif\r
+\r
+  NetworkPkg/TcpDxe/TcpDxe.inf\r
+  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf\r
+\r
+  !if $(NETWORK_TLS_ENABLE) == TRUE\r
+    NetworkPkg/TlsDxe/TlsDxe.inf\r
+    NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf\r
+  !endif\r
+\r
+  !if $(NETWORK_HTTP_BOOT_ENABLE) == TRUE\r
+    NetworkPkg/DnsDxe/DnsDxe.inf\r
+    NetworkPkg/HttpDxe/HttpDxe.inf\r
+    NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf\r
+    NetworkPkg/HttpBootDxe/HttpBootDxe.inf\r
+  !endif\r
+\r
+  !if $(NETWORK_ISCSI_ENABLE) == TRUE\r
+    NetworkPkg/IScsiDxe/IScsiDxe.inf\r
+  !endif\r
+!endif\r
diff --git a/NetworkPkg/NetworkDefines.dsc.inc b/NetworkPkg/NetworkDefines.dsc.inc
new file mode 100644 (file)
index 0000000..a442d1b
--- /dev/null
@@ -0,0 +1,118 @@
+## @file\r
+# Network DSC include file for [Defines] section of all Architectures.\r
+#\r
+# This file can be included to the [Defines] section of a platform DSC file by\r
+# using "!include NetworkPkg/NetworkDefines.dsc.inc" to set default value of\r
+# flags if they are not defined somewhere else, and also check the value to see\r
+# if there is any conflict.\r
+#\r
+# These flags can be defined before the !include line, or changed on the command\r
+# line to enable or disable related feature support.\r
+#   -D FLAG=VALUE\r
+# The default value of these flags are:\r
+#   DEFINE NETWORK_ENABLE                 = TRUE\r
+#   DEFINE NETWORK_SNP_ENABLE             = TRUE\r
+#   DEFINE NETWORK_IP4_ENABLE             = TRUE\r
+#   DEFINE NETWORK_IP6_ENABLE             = TRUE\r
+#   DEFINE NETWORK_TLS_ENABLE             = TRUE\r
+#   DEFINE NETWORK_HTTP_BOOT_ENABLE       = TRUE\r
+#   DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE\r
+#   DEFINE NETWORK_ISCSI_ENABLE           = TRUE\r
+#   DEFINE NETWORK_VLAN_ENABLE            = TRUE\r
+#\r
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
+#\r
+#    SPDX-License-Identifier: BSD-2-Clause-Patent\r
+#\r
+##\r
+\r
+!ifndef NETWORK_ENABLE\r
+  #\r
+  # This flag is to enable or disable the whole network stack.\r
+  #\r
+  DEFINE NETWORK_ENABLE = TRUE\r
+!endif\r
+\r
+!ifndef NETWORK_SNP_ENABLE\r
+  #\r
+  # This flag is to include the common SNP driver or not.\r
+  #\r
+  DEFINE NETWORK_SNP_ENABLE = TRUE\r
+!endif\r
+\r
+!ifndef NETWORK_VLAN_ENABLE\r
+  #\r
+  # This flag is to enable or disable VLAN feature.\r
+  #\r
+  DEFINE NETWORK_VLAN_ENABLE = TRUE\r
+!endif\r
+\r
+!ifndef NETWORK_IP4_ENABLE\r
+  #\r
+  # This flag is to enable or disable IPv4 network stack.\r
+  #\r
+  DEFINE NETWORK_IP4_ENABLE = TRUE\r
+!endif\r
+\r
+!ifndef NETWORK_IP6_ENABLE\r
+  #\r
+  # This flag is to enable or disable IPv6 network stack.\r
+  #\r
+  DEFINE NETWORK_IP6_ENABLE = TRUE\r
+!endif\r
+\r
+!ifndef NETWORK_TLS_ENABLE\r
+  #\r
+  # This flag is to enable or disable TLS feature.\r
+  #\r
+  # Note: This feature depends on the OpenSSL building. To enable this feature, please\r
+  #       follow the instructions found in the file "OpenSSL-HOWTO.txt" located in\r
+  #       CryptoPkg\Library\OpensslLib to enable the OpenSSL building first.\r
+  #       The OpensslLib.inf library instance should be used since libssl is required.\r
+  #\r
+  DEFINE NETWORK_TLS_ENABLE = TRUE\r
+!endif\r
+\r
+!ifndef NETWORK_HTTP_BOOT_ENABLE\r
+  #\r
+  # This flag is to enable or disable HTTP(S) boot feature.\r
+  #\r
+  DEFINE NETWORK_HTTP_BOOT_ENABLE = TRUE\r
+!endif\r
+\r
+!ifndef NETWORK_ALLOW_HTTP_CONNECTIONS\r
+  #\r
+  # Indicates whether HTTP connections (i.e., unsecured) are permitted or not.\r
+  #\r
+  # Note: If NETWORK_ALLOW_HTTP_CONNECTIONS is TRUE, HTTP connections are allowed.\r
+  #       Both the "https://" and "http://" URI schemes are permitted. Otherwise, HTTP\r
+  #       connections are denied. Only the "https://" URI scheme is permitted.\r
+  #\r
+  DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE\r
+!endif\r
+\r
+!ifndef NETWORK_ISCSI_ENABLE\r
+  #\r
+  # This flag is to enable or disable iSCSI feature.\r
+  #\r
+  # Note: This feature depends on the OpenSSL building. To enable this feature, please\r
+  #       follow the instructions found in the file "OpenSSL-HOWTO.txt" located in\r
+  #       CryptoPkg\Library\OpensslLib to enable the OpenSSL building first.\r
+  #       Both OpensslLib.inf and OpensslLibCrypto.inf library instance can be used\r
+  #       since libssl is not required for iSCSI.\r
+  #\r
+  DEFINE NETWORK_ISCSI_ENABLE = TRUE\r
+!endif\r
+\r
+!if $(NETWORK_ENABLE) == TRUE\r
+  #\r
+  # Check the flags to see if there is any conflict.\r
+  #\r
+  !if ($(NETWORK_IP4_ENABLE) == FALSE) AND ($(NETWORK_IP6_ENABLE) == FALSE)\r
+    !error "Must enable at least IP4 or IP6 stack if NETWORK_ENABLE is set to TRUE!"\r
+  !endif\r
+\r
+  !if ($(NETWORK_HTTP_BOOT_ENABLE) == TRUE) AND ($(NETWORK_TLS_ENABLE) == FALSE) AND ($(NETWORK_ALLOW_HTTP_CONNECTIONS) == FALSE)\r
+    !error "Must enable TLS to support HTTPS, or allow unsecured HTTP connection, if NETWORK_HTTP_BOOT_ENABLE is set to TRUE!"\r
+  !endif\r
+!endif\r
diff --git a/NetworkPkg/NetworkLibs.dsc.inc b/NetworkPkg/NetworkLibs.dsc.inc
new file mode 100644 (file)
index 0000000..a23f982
--- /dev/null
@@ -0,0 +1,20 @@
+## @file\r
+# Network DSC include file for [LibraryClasses*] section of all Architectures.\r
+#\r
+# This file can be included to the [LibraryClasses*] section(s) of a platform DSC file\r
+# by using "!include NetworkPkg/NetworkLibs.dsc.inc" to specify the library instances\r
+# of EDKII network library classes.\r
+#\r
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
+#\r
+#    SPDX-License-Identifier: BSD-2-Clause-Patent\r
+#\r
+##\r
+\r
+  DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf\r
+  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf\r
+  IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf\r
+  UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf\r
+  TcpIoLib|MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.inf\r
+  # HttpLib is used for Http Boot\r
+  HttpLib|MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf\r
diff --git a/NetworkPkg/NetworkPcds.dsc.inc b/NetworkPkg/NetworkPcds.dsc.inc
new file mode 100644 (file)
index 0000000..f874b38
--- /dev/null
@@ -0,0 +1,16 @@
+## @file\r
+# Network DSC include file for [Pcds*] section of all Architectures.\r
+#\r
+# This file can be included to the [Pcds*] section(s) of a platform DSC file\r
+# by using "!include NetworkPkg/NetworkPcds.dsc.inc" to specify PCD settings\r
+# according to the value of flags described in "NetworkDefines.dsc.inc".\r
+#\r
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
+#\r
+#    SPDX-License-Identifier: BSD-2-Clause-Patent\r
+#\r
+##\r
+\r
+!if $(NETWORK_ALLOW_HTTP_CONNECTIONS) == TRUE\r
+  gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|TRUE\r
+!endif\r