From nobody Tue Apr 30 00:06:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+39295+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+39295+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1555582433; cv=none; d=zoho.com; s=zohoarc; b=HNQM7I9om/R1iDqmNQrhhbmy+8DNcCYFZrsezuhfUGCPSs+0O5ViJGLeeLGYknK7Xzt6CBxtNueC/p45xdhtSoOBWoj4cnuCGqxrgnsRr5e/Xl6LTghAU2Xl5a149gybJc7XrQxt1XvWclna7iHXEkO9HnvyO3ekzwPQ6JSoo70= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555582433; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=XnON20S/EUdPfjUAY4RZcLY+hXutfO0P7f74K5Ce3kQ=; b=TIAKTUdeI1cK0tMWvUfVG59wd93g+1yC5arzstZsMBoa1yRuX5WldKtqwT4yhY1iOW9XgfaHrsOZreOiN5WK90EKWbj+j9NqMMqZGo8c5Wq58AWnK9ek08vJ3w8CwXQVzBUaMV9ep9gyGG6PE9RwfRb6ajpzQkUCp+chCEnRi8k= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+39295+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1555582433167279.84716382558076; Thu, 18 Apr 2019 03:13:53 -0700 (PDT) Return-Path: X-Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by groups.io with SMTP; Thu, 18 Apr 2019 03:13:51 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Apr 2019 03:13:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,365,1549958400"; d="scan'208";a="338708391" X-Received: from sxuex-mobl1.ccr.corp.intel.com ([10.254.214.77]) by fmsmga005.fm.intel.com with ESMTP; 18 Apr 2019 03:13:49 -0700 From: "Xue, ShengfengX" To: devel@edk2.groups.io Cc: Xue ShengfengX , Siyuan Fu , Jiaxin Wu Subject: [edk2-devel] [PATCH v5] NetworkPkg/UefiPxeBcDxe:Add two PCD to control PXE. Date: Thu, 18 Apr 2019 18:13:22 +0800 Message-Id: <542dfcb8b550488532fff7e3bf6b1cddb94feb70.1555582287.git.shengfengx.xue@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,shengfengx.xue@intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1555582432; bh=MNlSjx1oSQcTTt7LzTOEzLREnUCSX0q8/iLpD/6ShN4=; h=Cc:Date:From:Reply-To:Subject:To; b=J0sRdYvq4df1FYiY0yXhXHdQ7cNjjMCB0teM15W3RF1wdvYq+bU81rwCw5PzKR13G2w pi9D0zy0CgdpU/WhbZ/awETpDsLVSc34NmHmL1LzDpV3+uJqQNcNLHX1MPhr1XOC9FsEp I3om3SF+/f9GNORdETu30SfOTettIavNqUs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D1695 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 Cc: Siyuan Fu Cc: Jiaxin Wu Reviewed-by: Siyuan Fu --- NetworkPkg/NetworkPkg.dec | 12 +++++++++++- NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c | 12 +++++++++++- NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h | 5 ++++- NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf | 4 +++- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/NetworkPkg/NetworkPkg.dec b/NetworkPkg/NetworkPkg.dec index 9b8ece4837..1aa7c1ed31 100644 --- a/NetworkPkg/NetworkPkg.dec +++ b/NetworkPkg/NetworkPkg.dec @@ -3,7 +3,7 @@ # # This package provides network modules that conform to UEFI 2.4 specifica= tion. # -# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
# (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
# # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -117,5 +117,15 @@ # @Prompt Type Value of network boot policy used in iSCSI. gEfiNetworkPkgTokenSpaceGuid.PcdIScsiAIPNetworkBootPolicy|0x08|UINT8|0x1= 0000007 =20 + ## IPv4 PXE support + # 0x01 =3D PXE Enabled + # 0x00 =3D PXE Disabled + gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01|UINT8|0x10000009 + + ## IPv6 PXE support + # 0x01 =3D PXE Enabled + # 0x00 =3D PXE Disabled + gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01|UINT8|0x1000000a + [UserExtensions.TianoCore."ExtraFiles"] NetworkPkgExtra.uni diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c b/NetworkPkg/UefiPxeBcDx= e/PxeBcDriver.c index 3c1d400d50..b35edb687d 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c @@ -2,7 +2,7 @@ Driver Binding functions implementationfor for UefiPxeBc Driver. =20 (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -1242,6 +1242,10 @@ PxeBcDriverEntryPoint ( { EFI_STATUS Status; =20 + if ((PcdGet8(PcdIPv4PXESupport) =3D=3D PXE_DISABLED) && (PcdGet8(PcdIPv6= PXESupport) =3D=3D PXE_DISABLED)) { + return EFI_UNSUPPORTED; + } + Status =3D EfiLibInstallDriverBindingComponentName2 ( ImageHandle, SystemTable, @@ -1301,9 +1305,15 @@ PxeBcSupported ( EFI_GUID *MtftpServiceBindingGuid; =20 if (IpVersion =3D=3D IP_VERSION_4) { + if (PcdGet8(PcdIPv4PXESupport) =3D=3D PXE_DISABLED) { + return EFI_UNSUPPORTED; + } DhcpServiceBindingGuid =3D &gEfiDhcp4ServiceBindingProtocolGuid; MtftpServiceBindingGuid =3D &gEfiMtftp4ServiceBindingProtocolGuid; } else { + if (PcdGet8(PcdIPv6PXESupport) =3D=3D PXE_DISABLED) { + return EFI_UNSUPPORTED; + } DhcpServiceBindingGuid =3D &gEfiDhcp6ServiceBindingProtocolGuid; MtftpServiceBindingGuid =3D &gEfiMtftp6ServiceBindingProtocolGuid; } diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h b/NetworkPkg/UefiPxeBcDxe/= PxeBcImpl.h index f0db4a0c1a..fa4950c623 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h @@ -2,7 +2,7 @@ This EFI_PXE_BASE_CODE_PROTOCOL and EFI_LOAD_FILE_PROTOCOL. interfaces declaration. =20 - Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -78,6 +78,9 @@ typedef struct _PXEBC_VIRTUAL_NIC PXEBC_VIRTUAL_NIC; #define PXEBC_PRIVATE_DATA_FROM_ID(a) CR (a, PXEBC_PRIVATE_DATA, I= d, PXEBC_PRIVATE_DATA_SIGNATURE) #define PXEBC_VIRTUAL_NIC_FROM_LOADFILE(a) CR (a, PXEBC_VIRTUAL_NIC, Lo= adFile, PXEBC_VIRTUAL_NIC_SIGNATURE) =20 +#define PXE_ENABLED 0x01 +#define PXE_DISABLED 0x00 + typedef union { PXEBC_DHCP4_PACKET_CACHE Dhcp4; PXEBC_DHCP6_PACKET_CACHE Dhcp6; diff --git a/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf b/NetworkPkg/UefiPxeB= cDxe/UefiPxeBcDxe.inf index fc31250dea..0341f1052a 100644 --- a/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf +++ b/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf @@ -5,7 +5,7 @@ # PXE-compatible device for network access or booting. This driver suppor= ts # both IPv4 and IPv6 network stack. # -# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -102,6 +102,8 @@ [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdTftpBlockSize ## SOMETIMES_CONSUM= ES gEfiNetworkPkgTokenSpaceGuid.PcdPxeTftpWindowSize ## SOMETIMES_CONSUM= ES + gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport ## CONSUMES + gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport ## CONSUMES =20 [UserExtensions.TianoCore."ExtraFiles"] UefiPxeBcDxeExtra.uni --=20 2.16.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#39295): https://edk2.groups.io/g/devel/message/39295 Mute This Topic: https://groups.io/mt/31222014/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-