The implementation for Ping shell command.\r
\r
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
\r
/**\r
- Get and caculate the frequency in tick/ms.\r
- The result is saved in the globle variable mFrequency\r
+ Get and calculate the frequency in ticks/ms.\r
+ The result is saved in the global variable mFrequency\r
\r
- @retval EFI_SUCCESS Caculated the frequency successfully.\r
- @retval Others Failed to caculate the frequency.\r
+ @retval EFI_SUCCESS Calculated the frequency successfully.\r
+ @retval Others Failed to calculate the frequency.\r
\r
**/\r
EFI_STATUS\r
\r
//\r
// The timer period is in femtosecond (1 femtosecond is 1e-15 second).\r
- // So 1e+12 is divided by timer period to produce the freq in tick/ms.\r
+ // So 1e+12 is divided by timer period to produce the freq in ticks/ms.\r
//\r
mFrequency = DivU64x64Remainder (1000000000000ULL, TimerPeriod, NULL);\r
\r
}\r
\r
/**\r
- Caculate a duration in ms.\r
+ Calculate a duration in ms.\r
\r
@param[in] Begin The start point of time.\r
@param[in] End The end point of time.\r
//\r
Status = gBS->HandleProtocol (\r
HandleBuffer[HandleIndex],\r
- Private->IpChoice == PING_IP_CHOICE_IP6?&gEfiIp6ConfigProtocolGuid:&gEfiIp4ConfigProtocolGuid,\r
+ Private->IpChoice == PING_IP_CHOICE_IP6?&gEfiIp6ConfigProtocolGuid:&gEfiIp4Config2ProtocolGuid,\r
(VOID **) &IpXCfg\r
);\r
\r
NULL\r
);\r
} else {\r
- Status = ((EFI_IP4_CONFIG_PROTOCOL*)IpXCfg)->GetData (\r
+ Status = ((EFI_IP4_CONFIG2_PROTOCOL*)IpXCfg)->GetData (\r
IpXCfg,\r
+ Ip4Config2DataTypeInterfaceInfo,\r
&IfInfoSize,\r
NULL\r
);\r
IpXInterfaceInfo\r
);\r
} else {\r
- Status = ((EFI_IP4_CONFIG_PROTOCOL*)IpXCfg)->GetData (\r
+ Status = ((EFI_IP4_CONFIG2_PROTOCOL*)IpXCfg)->GetData (\r
IpXCfg,\r
+ Ip4Config2DataTypeInterfaceInfo,\r
&IfInfoSize,\r
IpXInterfaceInfo\r
);\r
//\r
// IP4 address check\r
//\r
- if (EFI_IP4_EQUAL (&Private->SrcAddress, &((EFI_IP4_IPCONFIG_DATA*)IpXInterfaceInfo)->StationAddress)) {\r
+ if (EFI_IP4_EQUAL (&Private->SrcAddress, &((EFI_IP4_CONFIG2_INTERFACE_INFO*)IpXInterfaceInfo)->StationAddress)) {\r
//\r
// Match a certain interface address.\r
//\r
//\r
// Configure the ip4 instance for icmp4 packet exchange.\r
//\r
-// PING_IP4_COPY_ADDRESS (&Ip4Config.StationAddress, &Private->SrcAddress);\r
-// Ip4Config.SubnetMask.Addr[0] = 0xFF;\r
-// Ip4Config.SubnetMask.Addr[1] = 0xFF;\r
-// Ip4Config.SubnetMask.Addr[2] = 0xFF;\r
-// Ip4Config.SubnetMask.Addr[3] = 0x00;\r
Ip4Config.DefaultProtocol = 1;\r
Ip4Config.AcceptAnyProtocol = FALSE;\r
Ip4Config.AcceptBroadcast = FALSE;\r
\r
@param[in] ImageHandle Handle to the Image (NULL if Internal).\r
@param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
+\r
+ @retval SHELL_SUCCESS The ping processed successfullly.\r
+ @retval others The ping processed unsuccessfully.\r
+ \r
**/\r
SHELL_STATUS\r
EFIAPI\r