]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/Ebl/Network.c
MdeModulePkg Variable: Update GetNextVariableName to follow UEFI 2.7
[mirror_edk2.git] / EmbeddedPkg / Ebl / Network.c
index c566dda49ad7e62551f20bb07cdfdbb88aeae015..f2562e60b0db7997b09f6a2a8e46eaf070e0f13d 100644 (file)
@@ -1,9 +1,10 @@
 /** @file\r
   EBL commands for Network Devices\r
 \r
-  Copyright (c) 2008-2009, Apple Inc. All rights reserved.\r
+  Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
+  (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
 \r
-  All rights reserved. This program and the accompanying materials\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
   http://opensource.org/licenses/bsd-license.php\r
@@ -21,18 +22,19 @@ ParseIp (
   OUT EFI_IP_ADDRESS  *Address\r
   )\r
 {\r
-  Address->v4.Addr[0] = AsciiStrDecimalToUintn(String);\r
+  Address->v4.Addr[0] = (UINT8)AsciiStrDecimalToUintn (String);\r
   String = AsciiStrStr(String, ".") + 1;\r
-  Address->v4.Addr[1] = AsciiStrDecimalToUintn(String);\r
+  Address->v4.Addr[1] = (UINT8)AsciiStrDecimalToUintn (String);\r
   String = AsciiStrStr(String, ".") + 1;\r
-  Address->v4.Addr[2] = AsciiStrDecimalToUintn(String);\r
+  Address->v4.Addr[2] = (UINT8)AsciiStrDecimalToUintn (String);\r
   String = AsciiStrStr(String, ".") + 1;\r
-  Address->v4.Addr[3] = AsciiStrDecimalToUintn(String);\r
-  \r
+  Address->v4.Addr[3] = (UINT8)AsciiStrDecimalToUintn (String);\r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
 EFI_STATUS\r
+EFIAPI\r
 EblIpCmd (\r
   IN UINTN  Argc,\r
   IN CHAR8  **Argv\r
@@ -41,28 +43,28 @@ EblIpCmd (
   EFI_STATUS        Status = EFI_INVALID_PARAMETER;\r
   EFI_MAC_ADDRESS   Mac;\r
   EFI_IP_ADDRESS    Ip;\r
-  \r
-  if (Argc == 1) {  \r
+\r
+  if (Argc == 1) {\r
     // Get current IP/MAC\r
-  \r
+\r
     // Get current MAC address\r
     Status = EblGetCurrentMacAddress (&Mac);\r
     if (EFI_ERROR (Status)) {\r
       goto Exit;\r
     }\r
-    \r
+\r
     AsciiPrint ("MAC Address:  %02x:%02x:%02x:%02x:%02x:%02x\n", Mac.Addr[0],  Mac.Addr[1],  Mac.Addr[2],  Mac.Addr[3],  Mac.Addr[4],  Mac.Addr[5]);\r
-    \r
+\r
     // Get current IP address\r
     Status = EblGetCurrentIpAddress (&Ip);\r
     if (EFI_ERROR(Status)) {\r
       AsciiPrint("IP Address is not configured.\n");\r
       Status = EFI_SUCCESS;\r
       goto Exit;\r
-    }    \r
+    }\r
+\r
+    AsciiPrint("IP Address:   %d.%d.%d.%d\n", Ip.v4.Addr[0], Ip.v4.Addr[1],Ip.v4.Addr[2], Ip.v4.Addr[3]);\r
 \r
-       AsciiPrint("IP Address:   %d.%d.%d.%d\n", Ip.v4.Addr[0], Ip.v4.Addr[1],Ip.v4.Addr[2], Ip.v4.Addr[3]);\r
-    \r
   } else if ((Argv[1][0] == 'r') && (Argc == 2)) {\r
     // Get new address via dhcp\r
     Status = EblPerformDHCP (TRUE);\r
@@ -72,10 +74,10 @@ EblIpCmd (
     if (EFI_ERROR (Status)) {\r
       goto Exit;\r
     }\r
-    \r
+\r
     Status = EblSetStationIp (&Ip, NULL);\r
   }\r
-  \r
+\r
 Exit:\r
   return Status;\r
 }\r