summaryrefslogtreecommitdiff
path: root/ShellPkg
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2015-08-31 06:03:10 +0000
committerhwu1225 <hwu1225@Edk2>2015-08-31 06:03:10 +0000
commit24542d59049bdc7684835a4b820e21638433adaa (patch)
tree89df83ca8544494260362d2b68fe76c0d0c5b22b /ShellPkg
parentf0e92f2f4f04e831bfcecabd8bdce3161f0b988b (diff)
downloadedk2-platforms-24542d59049bdc7684835a4b820e21638433adaa.tar.xz
ShellPkg: Get media status in ifconfig command
v2: * Update to use NetLibDetectMedia() directly. This patch is used to get media status in ifconfig command. (Sync patch r18363 from main trunk.) Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18364 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c25
-rw-r--r--ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.unibin20910 -> 21094 bytes
2 files changed, 19 insertions, 6 deletions
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
index 273f1a85dd..e16d46a8ec 100644
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
+++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
@@ -596,11 +596,14 @@ IfConfigShowInterfaceInfo (
IN LIST_ENTRY *IfList
)
{
- LIST_ENTRY *Entry;
- LIST_ENTRY *Next;
- IFCONFIG_INTERFACE_CB *IfCb;
- EFI_IPv4_ADDRESS Gateway;
- UINT32 Index;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
+ IFCONFIG_INTERFACE_CB *IfCb;
+ BOOLEAN MediaPresent;
+ EFI_IPv4_ADDRESS Gateway;
+ UINT32 Index;
+
+ MediaPresent = TRUE;
if (IsListEmpty (IfList)) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INVALID_INTERFACE), gShellNetwork1HiiHandle);
@@ -617,7 +620,17 @@ IfConfigShowInterfaceInfo (
//
// Print interface name.
//
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_IF_NAME), gShellNetwork1HiiHandle, IfCb->IfInfo->Name);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_IF_NAME), gShellNetwork1HiiHandle, IfCb->IfInfo->Name);
+
+ //
+ // Get Media State.
+ //
+ NetLibDetectMedia (IfCb->NicHandle, &MediaPresent);
+ if (!MediaPresent) {
+ 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");
+ }
//
// Print interface config policy.
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni
index 7cc7b7d672..4325959182 100644
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni
+++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni
Binary files differ