]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg: Add NETWORK_HTTP_ENABLE macro
authorAbner Chang <abner.chang@hpe.com>
Thu, 19 Nov 2020 01:58:10 +0000 (09:58 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 3 Dec 2020 17:08:11 +0000 (17:08 +0000)
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2917

Add NETWORK_HTTP_ENABLE macro and separate HttpDxe
and HttpUtilitiesDxe drivers from
HTTP_NETWORK_HTTP_BOOT_ENABLE macro.

Current NETWORK_HTTP_BOOT_ENABLE macro is defined to enable HTTP
boot feature in POST, this macro is not only enabling HTTP Boot
related modules but also enabling other generic HTTP modules
such as HttpDxe, HttpUtilitiesDxe and DnsDxe.
These HTTP base drivers would not be only used by HTTP boot
when we introduce the use case of Redfish implementation over
HTTP to edk2.
We should have a dedicate macro to enable generic HTTP functions
on Network stack and additionally provide NETWORK_HTTP_BOOT_ENABLE
for HTTP boot functionality for the use case that platform doesn't
require HTTP boot.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
Cc: Peter O'Hanley <peter.ohanley@hpe.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
NetworkPkg/Network.fdf.inc
NetworkPkg/NetworkComponents.dsc.inc
NetworkPkg/NetworkDefines.dsc.inc
NetworkPkg/NetworkPkg.ci.yaml

index 803a0d64fd6070980c3cd8b4712b1fb6af2596d6..8a662ad1dee636c6af887bf6db71d06a13169fa0 100644 (file)
     INF  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf\r
   !endif\r
 \r
-  !if $(NETWORK_HTTP_BOOT_ENABLE) == TRUE\r
+  !if ($(NETWORK_HTTP_BOOT_ENABLE) == TRUE) OR ($(NETWORK_HTTP_ENABLE) == TRUE)\r
     INF  NetworkPkg/DnsDxe/DnsDxe.inf\r
     INF  NetworkPkg/HttpDxe/HttpDxe.inf\r
     INF  NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf\r
+  !endif\r
+\r
+  !if $(NETWORK_HTTP_BOOT_ENABLE) == TRUE\r
     INF  NetworkPkg/HttpBootDxe/HttpBootDxe.inf\r
   !endif\r
 \r
index 40cb8ee18e63f16faa507159224d5f6670f1f17c..21cb62082fc0c5e28fef12463c57b05a1e5e09d2 100644 (file)
     NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf\r
   !endif\r
 \r
-  !if $(NETWORK_HTTP_BOOT_ENABLE) == TRUE\r
+  !if ($(NETWORK_HTTP_BOOT_ENABLE) == TRUE) OR ($(NETWORK_HTTP_ENABLE) == TRUE)\r
     NetworkPkg/DnsDxe/DnsDxe.inf\r
     NetworkPkg/HttpDxe/HttpDxe.inf\r
     NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf\r
+  !endif\r
+\r
+  !if $(NETWORK_HTTP_BOOT_ENABLE) == TRUE\r
     NetworkPkg/HttpBootDxe/HttpBootDxe.inf\r
   !endif\r
 \r
index 18921d81f63b368951747234001db9f1e37e7943..54deb6342aaa89830292b65eedec067c07bf8343 100644 (file)
 #   DEFINE NETWORK_IP4_ENABLE             = TRUE\r
 #   DEFINE NETWORK_IP6_ENABLE             = TRUE\r
 #   DEFINE NETWORK_TLS_ENABLE             = TRUE\r
+#   DEFINE NETWORK_HTTP_ENABLE            = FALSE\r
 #   DEFINE NETWORK_HTTP_BOOT_ENABLE       = TRUE\r
 #   DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE\r
 #   DEFINE NETWORK_ISCSI_ENABLE           = FALSE\r
 #   DEFINE NETWORK_VLAN_ENABLE            = TRUE\r
 #\r
 # Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
+# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>\r
 #\r
 #    SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
   DEFINE NETWORK_TLS_ENABLE = TRUE\r
 !endif\r
 \r
+!ifndef NETWORK_HTTP_ENABLE\r
+  #\r
+  # This flag is to enable or disable HTTP(S) feature.\r
+  # The default is set to FALSE to not affecting the existing\r
+  # platforms.\r
+  # NETWORK_HTTP_ENABLE set to FALSE is not affecting NETWORK_HTTP_BOOT_ENABLE\r
+  # when NETWORK_HTTP_BOOT_ENABLE is TRUE.\r
+  DEFINE NETWORK_HTTP_ENABLE = FALSE\r
+!endif\r
+\r
 !ifndef NETWORK_HTTP_BOOT_ENABLE\r
   #\r
   # This flag is to enable or disable HTTP(S) boot feature.\r
   #\r
+  #\r
   DEFINE NETWORK_HTTP_BOOT_ENABLE = TRUE\r
 !endif\r
 \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
+  !if ($(NETWORK_HTTP_BOOT_ENABLE) == TRUE) OR ($(NETWORK_HTTP_ENABLE) == TRUE)\r
+    !if ($(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 or NETWORK_HTTP_ENABLE is set to TRUE!"\r
+    !endif\r
   !endif\r
 !endif\r
index 1a3ab71792d1fa9b0bd6ab5d6b663a4091fa02aa..07dc7abd6938babf3b9fb18571ced64120ff9c82 100644 (file)
@@ -3,6 +3,7 @@
 #\r
 # Copyright (c) Microsoft Corporation\r
 # Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>\r
+# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>\r
 # SPDX-License-Identifier: BSD-2-Clause-Patent\r
 ##\r
 {\r
@@ -71,6 +72,7 @@
         "BLD_*_NETWORK_IP4_ENABLE": "TRUE",\r
         "BLD_*_NETWORK_IP6_ENABLE": "TRUE",\r
         "BLD_*_NETWORK_TLS_ENABLE": "TRUE",\r
+        "BLD_*_NETWORK_HTTP_ENABLE": "FALSE",\r
         "BLD_*_NETWORK_HTTP_BOOT_ENABLE": "TRUE",\r
         "BLD_*_NETWORK_ISCSI_ENABLE": "TRUE",\r
     }\r