/** @file\r
The implementation for Ping6 application.\r
\r
- Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2016 - 2018, 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
EFI_EVENT Timer;\r
\r
UINT32 TimerPeriod;\r
- UINT32 RttTimerTick; \r
+ UINT32 RttTimerTick;\r
EFI_EVENT RttTimer;\r
\r
EFI_STATUS Status;\r
if (Private->TimerPeriod == 0) {\r
return EFI_ABORTED;\r
}\r
- \r
+\r
Private->RttTimerTick = 0;\r
Status = gBS->CreateEvent (\r
EVT_TIMER | EVT_NOTIFY_SIGNAL,\r
\r
/**\r
Read the current time.\r
- \r
+\r
@param[in] Private The pointer to PING6_PRIVATE_DATA.\r
\r
@retval the current tick value.\r
Status = Private->Ip6->Receive (Private->Ip6, RxToken);\r
\r
if (EFI_ERROR (Status)) {\r
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_IP6_RECEIVE), gShellNetwork2HiiHandle, Status);\r
Private->Status = EFI_ABORTED;\r
}\r
} else {\r
\r
Private->RxToken.Status = EFI_NOT_READY;\r
\r
- return Private->Ip6->Receive (Private->Ip6, &Private->RxToken);\r
+ Status = Private->Ip6->Receive (Private->Ip6, &Private->RxToken);\r
+ if (EFI_ERROR (Status)) {\r
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_IP6_RECEIVE), gShellNetwork2HiiHandle, Status);\r
+ }\r
+ return Status;\r
}\r
\r
/**\r
UINTN HandleNum;\r
EFI_HANDLE *HandleBuffer;\r
BOOLEAN UnspecifiedSrc;\r
- BOOLEAN MediaPresent;\r
+ EFI_STATUS MediaStatus;\r
EFI_SERVICE_BINDING_PROTOCOL *Ip6Sb;\r
EFI_IP6_CONFIG_PROTOCOL *Ip6Cfg;\r
EFI_IP6_CONFIG_DATA Ip6Config;\r
\r
HandleBuffer = NULL;\r
UnspecifiedSrc = FALSE;\r
- MediaPresent = TRUE;\r
+ MediaStatus = EFI_SUCCESS;\r
Ip6Sb = NULL;\r
IfInfo = NULL;\r
IfInfoSize = 0;\r
\r
if (NetIp6IsUnspecifiedAddr (&Private->SrcAddress)) {\r
//\r
- // SrcAddress is unspecified. So, both connected and configured interface will be automatic selected. \r
+ // SrcAddress is unspecified. So, both connected and configured interface will be automatic selected.\r
//\r
UnspecifiedSrc = TRUE;\r
}\r
- \r
+\r
//\r
// Source address is required when pinging a link-local address.\r
//\r
Status = EFI_INVALID_PARAMETER;\r
goto ON_ERROR;\r
}\r
- \r
+\r
//\r
// For each ip6 protocol, check interface addresses list.\r
//\r
//\r
// Check media.\r
//\r
- NetLibDetectMedia (HandleBuffer[HandleIndex], &MediaPresent);\r
- if (!MediaPresent) {\r
+ NetLibDetectMediaWaitTimeout (HandleBuffer[HandleIndex], 0, &MediaStatus);\r
+ if (MediaStatus != EFI_SUCCESS) {\r
//\r
// Skip this one.\r
//\r
// Match a certain interface address.\r
//\r
break;\r
- } \r
+ }\r
}\r
\r
if (AddrIndex < IfInfo->AddressInfoCount) {\r