public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch 0/2] Fix the issue in MdeModulePkg/UefiPxeBcDxe
@ 2017-05-22  7:36 Jiaxin Wu
  2017-05-22  7:36 ` [Patch 1/2] MdeModulePkg/UefiPxeBcDxe: Fix the PXE BootMenu selection issue Jiaxin Wu
  2017-05-22  7:36 ` [Patch 2/2] MdeModulePkg/UefiPxeBcDxe: Refine the PXE boot displayed information Jiaxin Wu
  0 siblings, 2 replies; 7+ messages in thread
From: Jiaxin Wu @ 2017-05-22  7:36 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ye Ting, Fu Siyuan, Wu Jiaxin

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>

Jiaxin Wu (2):
  MdeModulePkg/UefiPxeBcDxe: Fix the PXE BootMenu selection issue
  MdeModulePkg/UefiPxeBcDxe: Refine the PXE boot displayed information

 .../Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c     |  6 +++---
 .../Universal/Network/UefiPxeBcDxe/PxeBcImpl.c     | 18 ++++++++++++++++++
 .../Universal/Network/UefiPxeBcDxe/PxeBcSupport.c  | 22 +++++++++++++++++++++-
 .../Universal/Network/UefiPxeBcDxe/PxeBcSupport.h  | 16 +++++++++++++++-
 4 files changed, 57 insertions(+), 5 deletions(-)

-- 
1.9.5.msysgit.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Patch 1/2] MdeModulePkg/UefiPxeBcDxe: Fix the PXE BootMenu selection issue
  2017-05-22  7:36 [Patch 0/2] Fix the issue in MdeModulePkg/UefiPxeBcDxe Jiaxin Wu
@ 2017-05-22  7:36 ` Jiaxin Wu
  2017-06-05  7:39   ` Ye, Ting
  2017-05-22  7:36 ` [Patch 2/2] MdeModulePkg/UefiPxeBcDxe: Refine the PXE boot displayed information Jiaxin Wu
  1 sibling, 1 reply; 7+ messages in thread
From: Jiaxin Wu @ 2017-05-22  7:36 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ye Ting, Fu Siyuan, Wu Jiaxin

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 <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c b/MdeModulePkg/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.
 
 Copyright (c) 2013, Red Hat, Inc.
-Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
 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
 
@@ -1843,11 +1843,11 @@ PxeBcSelectBootMenu (
   CHAR8                      Blank[70];
   PXEBC_BOOT_MENU_ENTRY      *MenuItem;
   PXEBC_BOOT_MENU_ENTRY      *MenuArray[PXEBC_MAX_MENU_NUM];
 
   Finish  = FALSE;
-  Select  = 1;
+  Select  = 0;
   Index   = 0;
   *Type   = 0;
 
   if (Private->PxeBc.Mode->ProxyOfferReceived) {
 
@@ -1912,11 +1912,11 @@ PxeBcSelectBootMenu (
 
     while (gST->ConIn->ReadKeyStroke (gST->ConIn, &InputKey) == EFI_NOT_READY) {
       gBS->Stall (10 * TICKS_PER_MS);
     }
 
-    if (InputKey.ScanCode != 0) {
+    if (InputKey.ScanCode == 0) {
       switch (InputKey.UnicodeChar) {
       case CTRL ('c'):
         InputKey.ScanCode = SCAN_ESC;
         break;
 
-- 
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Patch 2/2] MdeModulePkg/UefiPxeBcDxe: Refine the PXE boot displayed information
  2017-05-22  7:36 [Patch 0/2] Fix the issue in MdeModulePkg/UefiPxeBcDxe Jiaxin Wu
  2017-05-22  7:36 ` [Patch 1/2] MdeModulePkg/UefiPxeBcDxe: Fix the PXE BootMenu selection issue Jiaxin Wu
@ 2017-05-22  7:36 ` Jiaxin Wu
  2017-06-05  7:38   ` Ye, Ting
  2017-06-05  8:02   ` Fu, Siyuan
  1 sibling, 2 replies; 7+ messages in thread
From: Jiaxin Wu @ 2017-05-22  7:36 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ye Ting, Fu Siyuan, Wu Jiaxin

This path is to refine the PXE boot displayed information so as to
in line with NetworkPkg/UefiPxeBcDxe driver.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 .../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/MdeModulePkg/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;
   }
 
+  AsciiPrint ("\n>>Start PXE over IPv4");
+
   //
   // Configure the udp4 instance to let it receive data
   //
   Status = Private->Udp4Read->Configure (
                                Private->Udp4Read,
@@ -665,10 +667,15 @@ EfiPxeBcDhcp (
   // Check the selected offer to see whether BINL is required, if no or BINL is
   // finished, set the various Mode members.
   //
   Status = PxeBcCheckSelectedOffer (Private);
 
+  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 (
                       );
   }
 
   Private->FileSize = (UINTN) *BufferSize;
 
+  //
+  // 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;
 }
 
 /**
   Causes the driver to load a specified file.
@@ -2853,10 +2868,11 @@ EfiPxeLoadFile (
     Status      = DiscoverBootFile (Private, &TmpBufSize, Buffer);
 
     if (sizeof (UINTN) < sizeof (UINT64) && (TmpBufSize > 0xFFFFFFFF)) {
       Status = EFI_DEVICE_ERROR;
     } else if (TmpBufSize > 0 && *BufferSize >= (UINTN) TmpBufSize && Buffer != NULL) {
+      AsciiPrint ("\n Downloading NBP file...\n");
       *BufferSize = (UINTN) TmpBufSize;
       Status = PxeBc->Mtftp (
                         PxeBc,
                         EFI_PXE_BASE_CODE_TFTP_READ_FILE,
                         Buffer,
@@ -2877,10 +2893,11 @@ EfiPxeLoadFile (
     Status      = EFI_BUFFER_TOO_SMALL;
   } else {
     //
     // Download the file.
     //
+    AsciiPrint ("\n Downloading NBP file...\n");
     TmpBufSize = (UINT64) (*BufferSize);
     Status = PxeBc->Mtftp (
                       PxeBc,
                       EFI_PXE_BASE_CODE_TFTP_READ_FILE,
                       Buffer,
@@ -2911,10 +2928,11 @@ EfiPxeLoadFile (
 
   //
   // Check download status
   //
   if (Status == 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 programs which 
     // 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/MdeModulePkg/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.
 
-Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
 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
 
@@ -112,10 +112,30 @@ PxeBcConfigureUdpWriteInstance (
   }
 
   return Status;
 }
 
+/**
+  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 = 0; Index < 4; Index++) {
+    AsciiPrint ("%d", Ip->Addr[Index]);
+    if (Index < 3) {
+      AsciiPrint (".");
+    }
+  }
+}
 
 /**
   Convert number to ASCII value.
 
   @param  Number              Numeric value to convert to decimal ASCII value.
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.h b/MdeModulePkg/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.<BR>
+Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
 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
 
@@ -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
+  );
+  
+
 /**
   Convert number to ASCII value.
 
   @param  Number              Numeric value to convert to decimal ASCII value.
   @param  Buffer              Buffer to place ASCII version of the Number.
-- 
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Patch 2/2] MdeModulePkg/UefiPxeBcDxe: Refine the PXE boot displayed information
  2017-05-22  7:36 ` [Patch 2/2] MdeModulePkg/UefiPxeBcDxe: Refine the PXE boot displayed information Jiaxin Wu
@ 2017-06-05  7:38   ` Ye, Ting
  2017-06-05  8:02   ` Fu, Siyuan
  1 sibling, 0 replies; 7+ messages in thread
From: Ye, Ting @ 2017-06-05  7:38 UTC (permalink / raw)
  To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Fu, Siyuan

Reviewed-by: Ye Ting <ting.ye@intel.com> 

-----Original Message-----
From: Wu, Jiaxin 
Sent: Monday, May 22, 2017 3:36 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [Patch 2/2] MdeModulePkg/UefiPxeBcDxe: Refine the PXE boot displayed information

This path is to refine the PXE boot displayed information so as to in line with NetworkPkg/UefiPxeBcDxe driver.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 .../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/MdeModulePkg/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;
   }
 
+  AsciiPrint ("\n>>Start PXE over IPv4");
+
   //
   // Configure the udp4 instance to let it receive data
   //
   Status = Private->Udp4Read->Configure (
                                Private->Udp4Read, @@ -665,10 +667,15 @@ EfiPxeBcDhcp (
   // Check the selected offer to see whether BINL is required, if no or BINL is
   // finished, set the various Mode members.
   //
   Status = PxeBcCheckSelectedOffer (Private);
 
+  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 (
                       );
   }
 
   Private->FileSize = (UINTN) *BufferSize;
 
+  //
+  // 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;
 }
 
 /**
   Causes the driver to load a specified file.
@@ -2853,10 +2868,11 @@ EfiPxeLoadFile (
     Status      = DiscoverBootFile (Private, &TmpBufSize, Buffer);
 
     if (sizeof (UINTN) < sizeof (UINT64) && (TmpBufSize > 0xFFFFFFFF)) {
       Status = EFI_DEVICE_ERROR;
     } else if (TmpBufSize > 0 && *BufferSize >= (UINTN) TmpBufSize && Buffer != NULL) {
+      AsciiPrint ("\n Downloading NBP file...\n");
       *BufferSize = (UINTN) TmpBufSize;
       Status = PxeBc->Mtftp (
                         PxeBc,
                         EFI_PXE_BASE_CODE_TFTP_READ_FILE,
                         Buffer,
@@ -2877,10 +2893,11 @@ EfiPxeLoadFile (
     Status      = EFI_BUFFER_TOO_SMALL;
   } else {
     //
     // Download the file.
     //
+    AsciiPrint ("\n Downloading NBP file...\n");
     TmpBufSize = (UINT64) (*BufferSize);
     Status = PxeBc->Mtftp (
                       PxeBc,
                       EFI_PXE_BASE_CODE_TFTP_READ_FILE,
                       Buffer,
@@ -2911,10 +2928,11 @@ EfiPxeLoadFile (
 
   //
   // Check download status
   //
   if (Status == 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 programs which 
     // 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/MdeModulePkg/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.
 
-Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
 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
 
@@ -112,10 +112,30 @@ PxeBcConfigureUdpWriteInstance (
   }
 
   return Status;
 }
 
+/**
+  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 = 0; Index < 4; Index++) {
+    AsciiPrint ("%d", Ip->Addr[Index]);
+    if (Index < 3) {
+      AsciiPrint (".");
+    }
+  }
+}
 
 /**
   Convert number to ASCII value.
 
   @param  Number              Numeric value to convert to decimal ASCII value.
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.h b/MdeModulePkg/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.<BR>
+Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
 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
 
@@ -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
+  );
+  
+
 /**
   Convert number to ASCII value.
 
   @param  Number              Numeric value to convert to decimal ASCII value.
   @param  Buffer              Buffer to place ASCII version of the Number.
--
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Patch 1/2] MdeModulePkg/UefiPxeBcDxe: Fix the PXE BootMenu selection issue
  2017-05-22  7:36 ` [Patch 1/2] MdeModulePkg/UefiPxeBcDxe: Fix the PXE BootMenu selection issue Jiaxin Wu
@ 2017-06-05  7:39   ` Ye, Ting
  2017-06-05  8:16     ` Fu, Siyuan
  0 siblings, 1 reply; 7+ messages in thread
From: Ye, Ting @ 2017-06-05  7:39 UTC (permalink / raw)
  To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Fu, Siyuan

Reviewed-by: Ye Ting <ting.ye@intel.com> 


-----Original Message-----
From: Wu, Jiaxin 
Sent: Monday, May 22, 2017 3:36 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [Patch 1/2] MdeModulePkg/UefiPxeBcDxe: Fix the PXE BootMenu selection issue

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 <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c b/MdeModulePkg/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.
 
 Copyright (c) 2013, Red Hat, Inc.
-Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
 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
 
@@ -1843,11 +1843,11 @@ PxeBcSelectBootMenu (
   CHAR8                      Blank[70];
   PXEBC_BOOT_MENU_ENTRY      *MenuItem;
   PXEBC_BOOT_MENU_ENTRY      *MenuArray[PXEBC_MAX_MENU_NUM];
 
   Finish  = FALSE;
-  Select  = 1;
+  Select  = 0;
   Index   = 0;
   *Type   = 0;
 
   if (Private->PxeBc.Mode->ProxyOfferReceived) {
 
@@ -1912,11 +1912,11 @@ PxeBcSelectBootMenu (
 
     while (gST->ConIn->ReadKeyStroke (gST->ConIn, &InputKey) == EFI_NOT_READY) {
       gBS->Stall (10 * TICKS_PER_MS);
     }
 
-    if (InputKey.ScanCode != 0) {
+    if (InputKey.ScanCode == 0) {
       switch (InputKey.UnicodeChar) {
       case CTRL ('c'):
         InputKey.ScanCode = SCAN_ESC;
         break;
 
--
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Patch 2/2] MdeModulePkg/UefiPxeBcDxe: Refine the PXE boot displayed information
  2017-05-22  7:36 ` [Patch 2/2] MdeModulePkg/UefiPxeBcDxe: Refine the PXE boot displayed information Jiaxin Wu
  2017-06-05  7:38   ` Ye, Ting
@ 2017-06-05  8:02   ` Fu, Siyuan
  1 sibling, 0 replies; 7+ messages in thread
From: Fu, Siyuan @ 2017-06-05  8:02 UTC (permalink / raw)
  To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Ye, Ting

Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>


-----Original Message-----
From: Wu, Jiaxin 
Sent: 2017年5月22日 15:36
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [Patch 2/2] MdeModulePkg/UefiPxeBcDxe: Refine the PXE boot displayed information

This path is to refine the PXE boot displayed information so as to in line with NetworkPkg/UefiPxeBcDxe driver.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 .../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/MdeModulePkg/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;
   }
 
+  AsciiPrint ("\n>>Start PXE over IPv4");
+
   //
   // Configure the udp4 instance to let it receive data
   //
   Status = Private->Udp4Read->Configure (
                                Private->Udp4Read, @@ -665,10 +667,15 @@ EfiPxeBcDhcp (
   // Check the selected offer to see whether BINL is required, if no or BINL is
   // finished, set the various Mode members.
   //
   Status = PxeBcCheckSelectedOffer (Private);
 
+  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 (
                       );
   }
 
   Private->FileSize = (UINTN) *BufferSize;
 
+  //
+  // 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;
 }
 
 /**
   Causes the driver to load a specified file.
@@ -2853,10 +2868,11 @@ EfiPxeLoadFile (
     Status      = DiscoverBootFile (Private, &TmpBufSize, Buffer);
 
     if (sizeof (UINTN) < sizeof (UINT64) && (TmpBufSize > 0xFFFFFFFF)) {
       Status = EFI_DEVICE_ERROR;
     } else if (TmpBufSize > 0 && *BufferSize >= (UINTN) TmpBufSize && Buffer != NULL) {
+      AsciiPrint ("\n Downloading NBP file...\n");
       *BufferSize = (UINTN) TmpBufSize;
       Status = PxeBc->Mtftp (
                         PxeBc,
                         EFI_PXE_BASE_CODE_TFTP_READ_FILE,
                         Buffer,
@@ -2877,10 +2893,11 @@ EfiPxeLoadFile (
     Status      = EFI_BUFFER_TOO_SMALL;
   } else {
     //
     // Download the file.
     //
+    AsciiPrint ("\n Downloading NBP file...\n");
     TmpBufSize = (UINT64) (*BufferSize);
     Status = PxeBc->Mtftp (
                       PxeBc,
                       EFI_PXE_BASE_CODE_TFTP_READ_FILE,
                       Buffer,
@@ -2911,10 +2928,11 @@ EfiPxeLoadFile (
 
   //
   // Check download status
   //
   if (Status == 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 programs which 
     // 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/MdeModulePkg/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.
 
-Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
 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
 
@@ -112,10 +112,30 @@ PxeBcConfigureUdpWriteInstance (
   }
 
   return Status;
 }
 
+/**
+  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 = 0; Index < 4; Index++) {
+    AsciiPrint ("%d", Ip->Addr[Index]);
+    if (Index < 3) {
+      AsciiPrint (".");
+    }
+  }
+}
 
 /**
   Convert number to ASCII value.
 
   @param  Number              Numeric value to convert to decimal ASCII value.
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.h b/MdeModulePkg/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.<BR>
+Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
 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
 
@@ -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
+  );
+  
+
 /**
   Convert number to ASCII value.
 
   @param  Number              Numeric value to convert to decimal ASCII value.
   @param  Buffer              Buffer to place ASCII version of the Number.
--
1.9.5.msysgit.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Patch 1/2] MdeModulePkg/UefiPxeBcDxe: Fix the PXE BootMenu selection issue
  2017-06-05  7:39   ` Ye, Ting
@ 2017-06-05  8:16     ` Fu, Siyuan
  0 siblings, 0 replies; 7+ messages in thread
From: Fu, Siyuan @ 2017-06-05  8:16 UTC (permalink / raw)
  To: Ye, Ting, Wu, Jiaxin, edk2-devel@lists.01.org

Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>


-----Original Message-----
From: Ye, Ting 
Sent: 2017年6月5日 15:39
To: Wu, Jiaxin <jiaxin.wu@intel.com>; edk2-devel@lists.01.org
Cc: Fu, Siyuan <siyuan.fu@intel.com>
Subject: RE: [Patch 1/2] MdeModulePkg/UefiPxeBcDxe: Fix the PXE BootMenu selection issue

Reviewed-by: Ye Ting <ting.ye@intel.com> 


-----Original Message-----
From: Wu, Jiaxin 
Sent: Monday, May 22, 2017 3:36 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [Patch 1/2] MdeModulePkg/UefiPxeBcDxe: Fix the PXE BootMenu selection issue

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 <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c b/MdeModulePkg/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.
 
 Copyright (c) 2013, Red Hat, Inc.
-Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
 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
 
@@ -1843,11 +1843,11 @@ PxeBcSelectBootMenu (
   CHAR8                      Blank[70];
   PXEBC_BOOT_MENU_ENTRY      *MenuItem;
   PXEBC_BOOT_MENU_ENTRY      *MenuArray[PXEBC_MAX_MENU_NUM];
 
   Finish  = FALSE;
-  Select  = 1;
+  Select  = 0;
   Index   = 0;
   *Type   = 0;
 
   if (Private->PxeBc.Mode->ProxyOfferReceived) {
 
@@ -1912,11 +1912,11 @@ PxeBcSelectBootMenu (
 
     while (gST->ConIn->ReadKeyStroke (gST->ConIn, &InputKey) == EFI_NOT_READY) {
       gBS->Stall (10 * TICKS_PER_MS);
     }
 
-    if (InputKey.ScanCode != 0) {
+    if (InputKey.ScanCode == 0) {
       switch (InputKey.UnicodeChar) {
       case CTRL ('c'):
         InputKey.ScanCode = SCAN_ESC;
         break;
 
--
1.9.5.msysgit.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-06-05  8:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-22  7:36 [Patch 0/2] Fix the issue in MdeModulePkg/UefiPxeBcDxe Jiaxin Wu
2017-05-22  7:36 ` [Patch 1/2] MdeModulePkg/UefiPxeBcDxe: Fix the PXE BootMenu selection issue Jiaxin Wu
2017-06-05  7:39   ` Ye, Ting
2017-06-05  8:16     ` Fu, Siyuan
2017-05-22  7:36 ` [Patch 2/2] MdeModulePkg/UefiPxeBcDxe: Refine the PXE boot displayed information Jiaxin Wu
2017-06-05  7:38   ` Ye, Ting
2017-06-05  8:02   ` Fu, Siyuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox