From nobody Fri Nov 1 16:22:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1513245232338474.51434052332286; Thu, 14 Dec 2017 01:53:52 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 22B6B2034B9FD; Thu, 14 Dec 2017 01:49:10 -0800 (PST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 77F62221E06B0 for ; Thu, 14 Dec 2017 01:49:09 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Dec 2017 01:53:50 -0800 Received: from fanwang2-hp.ccr.corp.intel.com ([10.239.9.33]) by orsmga002.jf.intel.com with ESMTP; 14 Dec 2017 01:53:49 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Permerror (SPF Permanent Error: More than 10 MX records returned) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=fan.wang@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,400,1508828400"; d="scan'208";a="18149675" From: fanwang2 To: edk2-devel@lists.01.org Date: Thu, 14 Dec 2017 17:53:10 +0800 Message-Id: <1513245190-8172-4-git-send-email-fan.wang@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1513245190-8172-1-git-send-email-fan.wang@intel.com> References: <1513245190-8172-1-git-send-email-fan.wang@intel.com> Subject: [edk2] [Patch 3/3 V2] ShellPkg: Update Api from NetLibDetectMedia to NetLibDetectMediaWaitTimeout. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ye Ting , Wang Fan , Fu Siyuan , Wu Jiaxin MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Wang Fan V2: *Define time period in a macro instead of hard code. Cc: Ye Ting Cc: Fu Siyuan Cc: Wu Jiaxin Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan --- ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c | 8 ++++---- ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c | 8 ++++---- ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c b/She= llPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c index 082ab72..ab6ab8b 100644 --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c @@ -548,15 +548,15 @@ IfConfigShowInterfaceInfo ( ) { LIST_ENTRY *Entry; LIST_ENTRY *Next; IFCONFIG_INTERFACE_CB *IfCb; - BOOLEAN MediaPresent; + EFI_STATUS MediaStatus; EFI_IPv4_ADDRESS Gateway; UINT32 Index; =20 - MediaPresent =3D TRUE; + MediaStatus =3D EFI_SUCCESS; =20 if (IsListEmpty (IfList)) { ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INVALID_INTE= RFACE), gShellNetwork1HiiHandle); } =20 @@ -574,12 +574,12 @@ IfConfigShowInterfaceInfo ( ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_IF_NAME= ), gShellNetwork1HiiHandle, IfCb->IfInfo->Name);=20 =20 // // Get Media State. // - if (EFI_SUCCESS =3D=3D NetLibDetectMedia (IfCb->NicHandle, &MediaPrese= nt)) { - if (!MediaPresent) { + if (EFI_SUCCESS =3D=3D NetLibDetectMediaWaitTimeout (IfCb->NicHandle, = 0, &MediaStatus)) { + if (MediaStatus !=3D EFI_SUCCESS) { ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_MED= IA_STATE), gShellNetwork1HiiHandle, L"Media disconnected"); } else { ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_MED= IA_STATE), gShellNetwork1HiiHandle, L"Media present"); } } else { diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c b/ShellPk= g/Library/UefiShellNetwork1CommandsLib/Ping.c index 10d291c..bec9535 100644 --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c @@ -964,11 +964,11 @@ PingCreateIpInstance ( EFI_STATUS Status; UINTN HandleIndex; UINTN HandleNum; EFI_HANDLE *HandleBuffer; BOOLEAN UnspecifiedSrc; - BOOLEAN MediaPresent; + EFI_STATUS MediaStatus; EFI_SERVICE_BINDING_PROTOCOL *EfiSb; VOID *IpXCfg; EFI_IP6_CONFIG_DATA Ip6Config; EFI_IP4_CONFIG_DATA Ip4Config; VOID *IpXInterfaceInfo; @@ -976,11 +976,11 @@ PingCreateIpInstance ( EFI_IPv6_ADDRESS *Addr; UINTN AddrIndex; =20 HandleBuffer =3D NULL; UnspecifiedSrc =3D FALSE; - MediaPresent =3D TRUE; + MediaStatus =3D EFI_SUCCESS; EfiSb =3D NULL; IpXInterfaceInfo =3D NULL; IfInfoSize =3D 0; =20 // @@ -1033,12 +1033,12 @@ PingCreateIpInstance ( =20 if (UnspecifiedSrc) { // // Check media. // - NetLibDetectMedia (HandleBuffer[HandleIndex], &MediaPresent); - if (!MediaPresent) { + NetLibDetectMediaWaitTimeout (HandleBuffer[HandleIndex], 0, &MediaSt= atus); + if (MediaStatus !=3D EFI_SUCCESS) { // // Skip this one. // continue; } diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c b/ShellP= kg/Library/UefiShellNetwork2CommandsLib/Ping6.c index b784696..fa27c82 100644 --- a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c +++ b/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c @@ -753,22 +753,22 @@ Ping6CreateIpInstance ( EFI_STATUS Status; UINTN HandleIndex; 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; EFI_IP6_CONFIG_INTERFACE_INFO *IfInfo; UINTN IfInfoSize; EFI_IPv6_ADDRESS *Addr; UINTN AddrIndex; =20 HandleBuffer =3D NULL; UnspecifiedSrc =3D FALSE; - MediaPresent =3D TRUE; + MediaStatus =3D EFI_SUCCESS Ip6Sb =3D NULL; IfInfo =3D NULL; IfInfoSize =3D 0; =20 // @@ -812,12 +812,12 @@ Ping6CreateIpInstance ( =20 if (UnspecifiedSrc) { // // Check media. // - NetLibDetectMedia (HandleBuffer[HandleIndex], &MediaPresent); - if (!MediaPresent) { + NetLibDetectMediaWaitTimeout (HandleBuffer[HandleIndex], 0, &MediaSt= atus); + if (MediaStatus !=3D EFI_SUCCESS) { // // Skip this one. // continue; } --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel