diff options
author | fanwang2 <fan.wang@intel.com> | 2017-12-18 09:21:22 +0800 |
---|---|---|
committer | Fu Siyuan <siyuan.fu@intel.com> | 2017-12-18 16:38:24 +0800 |
commit | 0f1e07ee63731059b5edbddf4e16cc30045c9920 (patch) | |
tree | c2d425823df5c91e14d6da2b08266c2cdcc1e60c | |
parent | 152f2d5e4546b43f5e842d8538c90055c36dcd19 (diff) | |
download | edk2-0f1e07ee63731059b5edbddf4e16cc30045c9920.tar.gz edk2-0f1e07ee63731059b5edbddf4e16cc30045c9920.tar.bz2 edk2-0f1e07ee63731059b5edbddf4e16cc30045c9920.zip |
ShellPkg: Update Api from NetLibDetectMedia to NetLibDetectMediaWaitTimeout.
Since new Api NetLibDetectMediaWaitTimeout was involved to support connecting
state handling, and it is forward compatible. So apply this Api in ShellPkg.
V2:
*Define time period in a macro instead of hard code.
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wang Fan <fan.wang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Signed-off-by: fanwang2 <fan.wang@intel.com>
-rw-r--r-- | ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c | 8 | ||||
-rw-r--r-- | ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c | 8 | ||||
-rw-r--r-- | ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c | 8 |
3 files changed, 12 insertions, 12 deletions
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c index 082ab72fed..ab6ab8b57e 100644 --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c @@ -550,11 +550,11 @@ IfConfigShowInterfaceInfo ( LIST_ENTRY *Entry;
LIST_ENTRY *Next;
IFCONFIG_INTERFACE_CB *IfCb;
- BOOLEAN MediaPresent;
+ EFI_STATUS MediaStatus;
EFI_IPv4_ADDRESS Gateway;
UINT32 Index;
- MediaPresent = TRUE;
+ MediaStatus = EFI_SUCCESS;
if (IsListEmpty (IfList)) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INVALID_INTERFACE), gShellNetwork1HiiHandle);
@@ -576,8 +576,8 @@ IfConfigShowInterfaceInfo ( //
// Get Media State.
//
- if (EFI_SUCCESS == NetLibDetectMedia (IfCb->NicHandle, &MediaPresent)) {
- if (!MediaPresent) {
+ if (EFI_SUCCESS == NetLibDetectMediaWaitTimeout (IfCb->NicHandle, 0, &MediaStatus)) {
+ if (MediaStatus != EFI_SUCCESS) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_MEDIA_STATE), gShellNetwork1HiiHandle, L"Media disconnected");
} else {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_MEDIA_STATE), gShellNetwork1HiiHandle, L"Media present");
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c index 10d291c314..bec9535a8b 100644 --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c @@ -966,7 +966,7 @@ PingCreateIpInstance ( UINTN HandleNum;
EFI_HANDLE *HandleBuffer;
BOOLEAN UnspecifiedSrc;
- BOOLEAN MediaPresent;
+ EFI_STATUS MediaStatus;
EFI_SERVICE_BINDING_PROTOCOL *EfiSb;
VOID *IpXCfg;
EFI_IP6_CONFIG_DATA Ip6Config;
@@ -978,7 +978,7 @@ PingCreateIpInstance ( HandleBuffer = NULL;
UnspecifiedSrc = FALSE;
- MediaPresent = TRUE;
+ MediaStatus = EFI_SUCCESS;
EfiSb = NULL;
IpXInterfaceInfo = NULL;
IfInfoSize = 0;
@@ -1035,8 +1035,8 @@ PingCreateIpInstance ( //
// Check media.
//
- NetLibDetectMedia (HandleBuffer[HandleIndex], &MediaPresent);
- if (!MediaPresent) {
+ NetLibDetectMediaWaitTimeout (HandleBuffer[HandleIndex], 0, &MediaStatus);
+ if (MediaStatus != EFI_SUCCESS) {
//
// Skip this one.
//
diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c b/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c index b78469621e..fa27c823e5 100644 --- a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c +++ b/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c @@ -755,7 +755,7 @@ Ping6CreateIpInstance ( UINTN HandleNum;
EFI_HANDLE *HandleBuffer;
BOOLEAN UnspecifiedSrc;
- BOOLEAN MediaPresent;
+ EFI_STATUS MediaStatus;
EFI_SERVICE_BINDING_PROTOCOL *Ip6Sb;
EFI_IP6_CONFIG_PROTOCOL *Ip6Cfg;
EFI_IP6_CONFIG_DATA Ip6Config;
@@ -766,7 +766,7 @@ Ping6CreateIpInstance ( HandleBuffer = NULL;
UnspecifiedSrc = FALSE;
- MediaPresent = TRUE;
+ MediaStatus = EFI_SUCCESS
Ip6Sb = NULL;
IfInfo = NULL;
IfInfoSize = 0;
@@ -814,8 +814,8 @@ Ping6CreateIpInstance ( //
// Check media.
//
- NetLibDetectMedia (HandleBuffer[HandleIndex], &MediaPresent);
- if (!MediaPresent) {
+ NetLibDetectMediaWaitTimeout (HandleBuffer[HandleIndex], 0, &MediaStatus);
+ if (MediaStatus != EFI_SUCCESS) {
//
// Skip this one.
//
|