From nobody Mon Apr 29 04:56:18 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1495438584400869.0426742001852; Mon, 22 May 2017 00:36:24 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3A16D21A0913E; Mon, 22 May 2017 00:36:21 -0700 (PDT) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D1D6321A16E4F for ; Mon, 22 May 2017 00:36:19 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 May 2017 00:36:19 -0700 Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.66]) by FMSMGA003.fm.intel.com with ESMTP; 22 May 2017 00:36:18 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,377,1491289200"; d="scan'208";a="859850674" From: Jiaxin Wu To: edk2-devel@lists.01.org Date: Mon, 22 May 2017 15:36:14 +0800 Message-Id: <1495438575-9900-2-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1495438575-9900-1-git-send-email-jiaxin.wu@intel.com> References: <1495438575-9900-1-git-send-email-jiaxin.wu@intel.com> Subject: [edk2] [Patch 1/2] MdeModulePkg/UefiPxeBcDxe: Fix the PXE BootMenu selection issue X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ye Ting , Fu Siyuan , Wu Jiaxin MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Currently implementation doesn't accept the input during the user is trying to select the PXE BootMenu from option 43. This path is to fix that problem. Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin Reviewed-by: Fu Siyuan Reviewed-by: Ye Ting =20 --- MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c b/MdeM= odulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c index f0720e5..c5f3437 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c @@ -1,10 +1,10 @@ /** @file Support for PxeBc dhcp functions. =20 Copyright (c) 2013, Red Hat, Inc. -Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD = License which accompanies this distribution. The full text of the license may be = found at http://opensource.org/licenses/bsd-license.php =20 @@ -1843,11 +1843,11 @@ PxeBcSelectBootMenu ( CHAR8 Blank[70]; PXEBC_BOOT_MENU_ENTRY *MenuItem; PXEBC_BOOT_MENU_ENTRY *MenuArray[PXEBC_MAX_MENU_NUM]; =20 Finish =3D FALSE; - Select =3D 1; + Select =3D 0; Index =3D 0; *Type =3D 0; =20 if (Private->PxeBc.Mode->ProxyOfferReceived) { =20 @@ -1912,11 +1912,11 @@ PxeBcSelectBootMenu ( =20 while (gST->ConIn->ReadKeyStroke (gST->ConIn, &InputKey) =3D=3D EFI_NO= T_READY) { gBS->Stall (10 * TICKS_PER_MS); } =20 - if (InputKey.ScanCode !=3D 0) { + if (InputKey.ScanCode =3D=3D 0) { switch (InputKey.UnicodeChar) { case CTRL ('c'): InputKey.ScanCode =3D SCAN_ESC; break; =20 --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Mon Apr 29 04:56:18 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1495438586861114.18354315598083; Mon, 22 May 2017 00:36:26 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6BF3721A02F48; Mon, 22 May 2017 00:36:23 -0700 (PDT) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0F4F421A0BA9C for ; Mon, 22 May 2017 00:36:21 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 May 2017 00:36:20 -0700 Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.66]) by FMSMGA003.fm.intel.com with ESMTP; 22 May 2017 00:36:19 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,377,1491289200"; d="scan'208";a="859850682" From: Jiaxin Wu To: edk2-devel@lists.01.org Date: Mon, 22 May 2017 15:36:15 +0800 Message-Id: <1495438575-9900-3-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1495438575-9900-1-git-send-email-jiaxin.wu@intel.com> References: <1495438575-9900-1-git-send-email-jiaxin.wu@intel.com> Subject: [edk2] [Patch 2/2] MdeModulePkg/UefiPxeBcDxe: Refine the PXE boot displayed information X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ye Ting , Fu Siyuan , Wu Jiaxin MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This path is to refine the PXE boot displayed information so as to in line with NetworkPkg/UefiPxeBcDxe driver. Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin Reviewed-by: Fu Siyuan Reviewed-by: Ye Ting =20 --- .../Universal/Network/UefiPxeBcDxe/PxeBcImpl.c | 18 ++++++++++++++++++ .../Universal/Network/UefiPxeBcDxe/PxeBcSupport.c | 22 ++++++++++++++++++= +++- .../Universal/Network/UefiPxeBcDxe/PxeBcSupport.h | 16 +++++++++++++++- 3 files changed, 54 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c b/MdeM= odulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c index 259568e..6d4f33f 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c @@ -336,10 +336,12 @@ EfiPxeBcStart ( // IPv6 is not supported now. // return EFI_UNSUPPORTED; } =20 + AsciiPrint ("\n>>Start PXE over IPv4"); + // // Configure the udp4 instance to let it receive data // Status =3D Private->Udp4Read->Configure ( Private->Udp4Read, @@ -665,10 +667,15 @@ EfiPxeBcDhcp ( // Check the selected offer to see whether BINL is required, if no or BI= NL is // finished, set the various Mode members. // Status =3D PxeBcCheckSelectedOffer (Private); =20 + AsciiPrint ("\n Station IP address is "); + + PxeBcShowIp4Addr (&Private->StationIp.v4); + AsciiPrint ("\n"); + ON_EXIT: if (EFI_ERROR (Status)) { Dhcp4->Stop (Dhcp4); Dhcp4->Configure (Dhcp4, NULL); } else { @@ -2738,10 +2745,18 @@ DiscoverBootFile ( ); } =20 Private->FileSize =3D (UINTN) *BufferSize; =20 + // + // Display all the information: boot server address, boot file name and = boot file size. + // + AsciiPrint ("\n Server IP address is "); + PxeBcShowIp4Addr (&Private->ServerIp.v4); + AsciiPrint ("\n NBP filename is %a", Private->BootFileName); + AsciiPrint ("\n NBP filesize is %d Bytes", Private->FileSize); + return Status; } =20 /** Causes the driver to load a specified file. @@ -2853,10 +2868,11 @@ EfiPxeLoadFile ( Status =3D DiscoverBootFile (Private, &TmpBufSize, Buffer); =20 if (sizeof (UINTN) < sizeof (UINT64) && (TmpBufSize > 0xFFFFFFFF)) { Status =3D EFI_DEVICE_ERROR; } else if (TmpBufSize > 0 && *BufferSize >=3D (UINTN) TmpBufSize && Bu= ffer !=3D NULL) { + AsciiPrint ("\n Downloading NBP file...\n"); *BufferSize =3D (UINTN) TmpBufSize; Status =3D PxeBc->Mtftp ( PxeBc, EFI_PXE_BASE_CODE_TFTP_READ_FILE, Buffer, @@ -2877,10 +2893,11 @@ EfiPxeLoadFile ( Status =3D EFI_BUFFER_TOO_SMALL; } else { // // Download the file. // + AsciiPrint ("\n Downloading NBP file...\n"); TmpBufSize =3D (UINT64) (*BufferSize); Status =3D PxeBc->Mtftp ( PxeBc, EFI_PXE_BASE_CODE_TFTP_READ_FILE, Buffer, @@ -2911,10 +2928,11 @@ EfiPxeLoadFile ( =20 // // Check download status // if (Status =3D=3D EFI_SUCCESS) { + AsciiPrint ("\n NBP file downloaded successfully.\n"); // // The DHCP4 can have only one configured child instance so we need to= stop // reset the DHCP4 child before we return. Otherwise the other program= s which=20 // also need to use DHCP4 will be impacted. // The functionality of PXE Base Code protocol will not be stopped, diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.c b/M= deModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.c index 0779056..c1cabca 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.c @@ -1,9 +1,9 @@ /** @file Support routines for PxeBc. =20 -Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD = License which accompanies this distribution. The full text of the license may be = found at http://opensource.org/licenses/bsd-license.php =20 @@ -112,10 +112,30 @@ PxeBcConfigureUdpWriteInstance ( } =20 return Status; } =20 +/** + This function is to display the IPv4 address. + + @param[in] Ip The pointer to the IPv4 address. + +**/ +VOID +PxeBcShowIp4Addr ( + IN EFI_IPv4_ADDRESS *Ip + ) +{ + UINTN Index; + + for (Index =3D 0; Index < 4; Index++) { + AsciiPrint ("%d", Ip->Addr[Index]); + if (Index < 3) { + AsciiPrint ("."); + } + } +} =20 /** Convert number to ASCII value. =20 @param Number Numeric value to convert to decimal ASCII va= lue. diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.h b/M= deModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.h index 16ac05e..59e9b32 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.h +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.h @@ -1,8 +1,8 @@ /** @file Support routines for PxeBc. -Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD = License which accompanies this distribution. The full text of the license may be = found at http://opensource.org/licenses/bsd-license.php =20 @@ -65,10 +65,24 @@ PxeBcConfigureUdpWriteInstance ( IN EFI_IPv4_ADDRESS *Gateway, IN OUT UINT16 *SrcPort, IN UINT8 Ttl, IN UINT8 ToS ); + + +/** + This function is to display the IPv4 address. + + @param[in] Ip The pointer to the IPv4 address. + +**/ +VOID +PxeBcShowIp4Addr ( + IN EFI_IPv4_ADDRESS *Ip + ); + =20 + /** Convert number to ASCII value. =20 @param Number Numeric value to convert to decimal ASCII va= lue. @param Buffer Buffer to place ASCII version of the Number. --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel