From: "Siyuan, Fu" <siyuan.fu@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"Xue, ShengfengX" <shengfengx.xue@intel.com>
Cc: "Wu, Jiaxin" <jiaxin.wu@intel.com>
Subject: Re: [edk2-devel] [PATCH v5] NetworkPkg/UefiPxeBcDxe:Add two PCD to control PXE.
Date: Mon, 22 Apr 2019 01:09:27 +0000 [thread overview]
Message-ID: <B1FF2E9001CE9041BD10B825821D5BC58B72F4F8@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <542dfcb8b550488532fff7e3bf6b1cddb94feb70.1555582287.git.shengfengx.xue@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Xue,
> ShengfengX
> Sent: Thursday, April 18, 2019 6:13 PM
> To: devel@edk2.groups.io
> Cc: Xue, ShengfengX <shengfengx.xue@intel.com>; Fu, Siyuan
> <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
> Subject: [edk2-devel] [PATCH v5] NetworkPkg/UefiPxeBcDxe:Add two PCD to
> control PXE.
>
> 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>
> ---
> 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
> specification.
> #
> -# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR>
> # (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP<BR>
> #
> # 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|0x1000000
> 7
>
> + ## IPv4 PXE support
> + # 0x01 = PXE Enabled
> + # 0x00 = PXE Disabled
> + gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01|UINT8|0x10000009
> +
> + ## IPv6 PXE support
> + # 0x01 = PXE Enabled
> + # 0x00 = PXE Disabled
> + gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01|UINT8|0x1000000a
> +
> [UserExtensions.TianoCore."ExtraFiles"]
> NetworkPkgExtra.uni
> diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
> b/NetworkPkg/UefiPxeBcDxe/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.
>
> (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
> - Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
> + Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> @@ -1242,6 +1242,10 @@ PxeBcDriverEntryPoint (
> {
> EFI_STATUS Status;
>
> + if ((PcdGet8(PcdIPv4PXESupport) == PXE_DISABLED) &&
> (PcdGet8(PcdIPv6PXESupport) == PXE_DISABLED)) {
> + return EFI_UNSUPPORTED;
> + }
> +
> Status = EfiLibInstallDriverBindingComponentName2 (
> ImageHandle,
> SystemTable,
> @@ -1301,9 +1305,15 @@ PxeBcSupported (
> EFI_GUID *MtftpServiceBindingGuid;
>
> if (IpVersion == IP_VERSION_4) {
> + if (PcdGet8(PcdIPv4PXESupport) == PXE_DISABLED) {
> + return EFI_UNSUPPORTED;
> + }
> DhcpServiceBindingGuid = &gEfiDhcp4ServiceBindingProtocolGuid;
> MtftpServiceBindingGuid = &gEfiMtftp4ServiceBindingProtocolGuid;
> } else {
> + if (PcdGet8(PcdIPv6PXESupport) == PXE_DISABLED) {
> + return EFI_UNSUPPORTED;
> + }
> DhcpServiceBindingGuid = &gEfiDhcp6ServiceBindingProtocolGuid;
> MtftpServiceBindingGuid = &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.
>
> - Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
> + Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> @@ -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)
> #define PXEBC_VIRTUAL_NIC_FROM_LOADFILE(a) CR (a, PXEBC_VIRTUAL_NIC,
> LoadFile, PXEBC_VIRTUAL_NIC_SIGNATURE)
>
> +#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/UefiPxeBcDxe/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 supports
> # both IPv4 and IPv6 network stack.
> #
> -# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
> #
> # SPDX-License-Identifier: BSD-2-Clause-Patent
> #
> @@ -102,6 +102,8 @@
> [Pcd]
> gEfiMdeModulePkgTokenSpaceGuid.PcdTftpBlockSize ## SOMETIMES_CONSUMES
> gEfiNetworkPkgTokenSpaceGuid.PcdPxeTftpWindowSize ## SOMETIMES_CONSUMES
> + gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport ## CONSUMES
> + gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport ## CONSUMES
>
> [UserExtensions.TianoCore."ExtraFiles"]
> UefiPxeBcDxeExtra.uni
> --
> 2.16.2.windows.1
>
>
>
prev parent reply other threads:[~2019-04-22 1:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-18 10:13 [PATCH v5] NetworkPkg/UefiPxeBcDxe:Add two PCD to control PXE Xue, ShengfengX
2019-04-22 1:09 ` Siyuan, Fu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=B1FF2E9001CE9041BD10B825821D5BC58B72F4F8@SHSMSX103.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox