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>
This commit is contained in:
@ -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");
|
||||
|
Reference in New Issue
Block a user