]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/UefiPxeBcDxe: Refine the PXE boot displayed information
authorJiaxin Wu <jiaxin.wu@intel.com>
Mon, 22 May 2017 01:25:57 +0000 (09:25 +0800)
committerJiaxin Wu <jiaxin.wu@intel.com>
Mon, 5 Jun 2017 08:28:51 +0000 (16:28 +0800)
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>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.c
MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.h

index 259568edae53373d1abd0531cd30116a48567969..6d4f33f0dbaef59d5e578fb64d422e6445202c07 100644 (file)
@@ -338,6 +338,8 @@ EfiPxeBcStart (
     return EFI_UNSUPPORTED;\r
   }\r
 \r
+  AsciiPrint ("\n>>Start PXE over IPv4");\r
+\r
   //\r
   // Configure the udp4 instance to let it receive data\r
   //\r
@@ -667,6 +669,11 @@ EfiPxeBcDhcp (
   //\r
   Status = PxeBcCheckSelectedOffer (Private);\r
 \r
+  AsciiPrint ("\n  Station IP address is ");\r
+\r
+  PxeBcShowIp4Addr (&Private->StationIp.v4);\r
+  AsciiPrint ("\n");\r
+\r
 ON_EXIT:\r
   if (EFI_ERROR (Status)) {\r
     Dhcp4->Stop (Dhcp4);\r
@@ -2740,6 +2747,14 @@ DiscoverBootFile (
 \r
   Private->FileSize = (UINTN) *BufferSize;\r
 \r
+  //\r
+  // Display all the information: boot server address, boot file name and boot file size.\r
+  //\r
+  AsciiPrint ("\n  Server IP address is ");\r
+  PxeBcShowIp4Addr (&Private->ServerIp.v4);\r
+  AsciiPrint ("\n  NBP filename is %a", Private->BootFileName);\r
+  AsciiPrint ("\n  NBP filesize is %d Bytes", Private->FileSize);\r
+\r
   return Status;\r
 }\r
 \r
@@ -2855,6 +2870,7 @@ EfiPxeLoadFile (
     if (sizeof (UINTN) < sizeof (UINT64) && (TmpBufSize > 0xFFFFFFFF)) {\r
       Status = EFI_DEVICE_ERROR;\r
     } else if (TmpBufSize > 0 && *BufferSize >= (UINTN) TmpBufSize && Buffer != NULL) {\r
+      AsciiPrint ("\n Downloading NBP file...\n");\r
       *BufferSize = (UINTN) TmpBufSize;\r
       Status = PxeBc->Mtftp (\r
                         PxeBc,\r
@@ -2879,6 +2895,7 @@ EfiPxeLoadFile (
     //\r
     // Download the file.\r
     //\r
+    AsciiPrint ("\n Downloading NBP file...\n");\r
     TmpBufSize = (UINT64) (*BufferSize);\r
     Status = PxeBc->Mtftp (\r
                       PxeBc,\r
@@ -2913,6 +2930,7 @@ EfiPxeLoadFile (
   // Check download status\r
   //\r
   if (Status == EFI_SUCCESS) {\r
+    AsciiPrint ("\n  NBP file downloaded successfully.\n");\r
     //\r
     // The DHCP4 can have only one configured child instance so we need to stop\r
     // reset the DHCP4 child before we return. Otherwise the other programs which \r
index 077905671e17d9687ef326782e256955792d4e89..c1cabca8b96a2a7524d5f4c0d5d2d78ada1d0d28 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Support routines for PxeBc.\r
 \r
-Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -114,6 +114,26 @@ PxeBcConfigureUdpWriteInstance (
   return Status;\r
 }\r
 \r
+/**\r
+  This function is to display the IPv4 address.\r
+\r
+  @param[in]  Ip        The pointer to the IPv4 address.\r
+\r
+**/\r
+VOID\r
+PxeBcShowIp4Addr (\r
+  IN EFI_IPv4_ADDRESS   *Ip\r
+  )\r
+{\r
+  UINTN                 Index;\r
+\r
+  for (Index = 0; Index < 4; Index++) {\r
+    AsciiPrint ("%d", Ip->Addr[Index]);\r
+    if (Index < 3) {\r
+      AsciiPrint (".");\r
+    }\r
+  }\r
+}\r
 \r
 /**\r
   Convert number to ASCII value.\r
index 16ac05ec82ae363d235673932b4698a41ac1cd2f..59e9b3276e7f8c4c3f4fbc7be3259971dd90f32a 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
   Support routines for PxeBc.\r
-Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -67,6 +67,20 @@ PxeBcConfigureUdpWriteInstance (
   IN     UINT8          Ttl,\r
   IN     UINT8          ToS\r
   );\r
+\r
+\r
+/**\r
+  This function is to display the IPv4 address.\r
+\r
+  @param[in]  Ip        The pointer to the IPv4 address.\r
+\r
+**/\r
+VOID\r
+PxeBcShowIp4Addr (\r
+  IN EFI_IPv4_ADDRESS   *Ip\r
+  );\r
+  \r
+\r
 /**\r
   Convert number to ASCII value.\r
 \r