Revision: 18547
          http://sourceforge.net/p/edk2/code/18547
Author:   hwu1225
Date:     2015-09-25 06:06:59 +0000 (Fri, 25 Sep 2015)
Log Message:
-----------
ShellPkg: Update tftp to build with current tip

(Sync patch r18543 from main trunk.)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <[email protected]>
Signed-off-by: Tapan  Shah <[email protected]>
Signed-off-by: Jiaxin Wu <[email protected]>
Reviewed-by: Qiu Shumin <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/18543

Modified Paths:
--------------
    branches/UDK2015/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c
    
branches/UDK2015/ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.h
    
branches/UDK2015/ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.uni

Modified: branches/UDK2015/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c
===================================================================
--- branches/UDK2015/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c    
2015-09-25 03:51:46 UTC (rev 18546)
+++ branches/UDK2015/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c    
2015-09-25 06:06:59 UTC (rev 18547)
@@ -2,6 +2,8 @@
   The implementation for the 'tftp' Shell command.
 
   Copyright (c) 2015, ARM Ltd. All rights reserved.<BR>
+  Copyright (c) 2015, Intel Corporation. All rights reserved. <BR>
+  (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
@@ -14,6 +16,8 @@
 
 #include "UefiShellTftpCommandLib.h"
 
+#define IP4_CONFIG2_INTERFACE_INFO_NAME_LENGTH 32
+
 /*
    Constant strings and definitions related to the message indicating the 
amount of
    progress in the dowloading of a TFTP file.
@@ -59,7 +63,8 @@
   @param[in]   NicNumber         The network physical device number.
   @param[out]  NicName           Address where to store the NIC name.
                                  The memory area has to be at least
-                                 IP4_NIC_NAME_LENGTH bytes wide.
+                                 IP4_CONFIG2_INTERFACE_INFO_NAME_LENGTH 
+                                 double byte wide.
 
   @return  EFI_SUCCESS  The name of the NIC was returned.
   @return  Others       The creation of the child for the Managed
@@ -258,7 +263,7 @@
   EFI_HANDLE              *Handles;
   UINTN                   HandleCount;
   UINTN                   NicNumber;
-  CHAR16                  NicName[IP4_NIC_NAME_LENGTH];
+  CHAR16                  NicName[IP4_CONFIG2_INTERFACE_INFO_NAME_LENGTH];
   EFI_HANDLE              ControllerHandle;
   EFI_HANDLE              Mtftp4ChildHandle;
   EFI_MTFTP4_PROTOCOL     *Mtftp4;
@@ -271,6 +276,7 @@
   NicFound            = FALSE;
   AsciiRemoteFilePath = NULL;
   Handles             = NULL;
+  FileSize            = 0;
 
   //
   // Initialize the Shell library (we must be in non-auto-init...)
@@ -571,7 +577,7 @@
     return FALSE;
   }
 
-  *Value = Val;
+  *Value = (UINT16)Val;
   return TRUE;
 }
 
@@ -582,7 +588,8 @@
   @param[in]   NicNumber         The network physical device number.
   @param[out]  NicName           Address where to store the NIC name.
                                  The memory area has to be at least
-                                 IP4_NIC_NAME_LENGTH bytes wide.
+                                 IP4_CONFIG2_INTERFACE_INFO_NAME_LENGTH 
+                                 double byte wide.
 
   @return  EFI_SUCCESS  The name of the NIC was returned.
   @return  Others       The creation of the child for the Managed
@@ -623,7 +630,7 @@
 
   UnicodeSPrint (
     NicName,
-    IP4_NIC_NAME_LENGTH,
+    IP4_CONFIG2_INTERFACE_INFO_NAME_LENGTH,
     SnpMode.IfType == NET_IFTYPE_ETHERNET ?
     L"eth%d" :
     L"unk%d" ,
@@ -942,7 +949,7 @@
 {
   DOWNLOAD_CONTEXT  *Context;
   CHAR16            Progress[TFTP_PROGRESS_MESSAGE_SIZE];
-  UINT64            NbOfKb;
+  UINTN             NbOfKb;
   UINTN             Index;
   UINTN             LastStep;
   UINTN             Step;
@@ -966,10 +973,9 @@
   NbOfKb = Context->DownloadedNbOfBytes / 1024;
 
   Progress[0] = L'\0';
-  LastStep  = (Context->LastReportedNbOfBytes * TFTP_PROGRESS_SLIDER_STEPS) /
-              Context->FileSize;
-  Step      = (Context->DownloadedNbOfBytes   * TFTP_PROGRESS_SLIDER_STEPS) /
-              Context->FileSize;
+  LastStep  = (Context->LastReportedNbOfBytes * TFTP_PROGRESS_SLIDER_STEPS) / 
Context->FileSize;
+  Step      = (Context->DownloadedNbOfBytes * TFTP_PROGRESS_SLIDER_STEPS) / 
Context->FileSize;
+
   if (Step <= LastStep) {
     return EFI_SUCCESS;
   }

Modified: 
branches/UDK2015/ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.h
===================================================================
--- 
branches/UDK2015/ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.h
 2015-09-25 03:51:46 UTC (rev 18546)
+++ 
branches/UDK2015/ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.h
 2015-09-25 06:06:59 UTC (rev 18547)
@@ -1,7 +1,7 @@
 /** @file
   header file for NULL named library for 'tftp' Shell command functions.
 
-  Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved. <BR>
+  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved. <BR>
   Copyright (c) 2015, ARM Ltd. All rights reserved.<BR>
 
   This program and the accompanying materials
@@ -21,7 +21,6 @@
 #include <ShellBase.h>
 
 #include <Guid/ShellLibHiiGuid.h>
-#include <Guid/NicIp4ConfigNvData.h>
 
 #include <Protocol/ServiceBinding.h>
 #include <Protocol/Mtftp4.h>
@@ -42,9 +41,9 @@
 extern EFI_HANDLE gShellTftpHiiHandle;
 
 typedef struct {
-  UINT64  FileSize;
-  UINT64  DownloadedNbOfBytes;
-  UINT64  LastReportedNbOfBytes;
+  UINTN  FileSize;
+  UINTN  DownloadedNbOfBytes;
+  UINTN  LastReportedNbOfBytes;
 } DOWNLOAD_CONTEXT;
 
 /**

Modified: 
branches/UDK2015/ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.uni
===================================================================
--- 
branches/UDK2015/ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.uni
       2015-09-25 03:51:46 UTC (rev 18546)
+++ 
branches/UDK2015/ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.uni
       2015-09-25 06:06:59 UTC (rev 18547)
@@ -2,7 +2,7 @@
  - @@ -26,7 +26,7 @@
  - @@ -34,7 +34,7 @@
  - @@ -124,34 +124,38 @@
  ------+ --- ---+  

------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to