From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 BC3A121E1B74E for ; Sun, 8 Oct 2017 19:07:35 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Oct 2017 19:11:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,498,1500966000"; d="scan'208";a="160292880" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga005.fm.intel.com with ESMTP; 08 Oct 2017 19:11:01 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 8 Oct 2017 19:11:01 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 8 Oct 2017 19:11:00 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.159]) with mapi id 14.03.0319.002; Mon, 9 Oct 2017 10:09:25 +0800 From: "Ni, Ruiyu" To: "Wu, Jiaxin" , Meenakshi Aggarwal , "Carsey, Jaben" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH v3] Ifconfig : Fixed False information about Media State. Thread-Index: AQHTPl4Qnswl4h1Ni0+poxp2OgUP7aLWVHkAgALNTgCAARd4gIAAkSrA Date: Mon, 9 Oct 2017 02:09:24 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BA8A253@SHSMSX104.ccr.corp.intel.com> References: <1507264809-19123-1-git-send-email-meenakshi.aggarwal@nxp.com> <1507265294-19227-1-git-send-email-meenakshi.aggarwal@nxp.com> <1507265294-19227-2-git-send-email-meenakshi.aggarwal@nxp.com> <895558F6EA4E3B41AC93A00D163B72741633C189@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <895558F6EA4E3B41AC93A00D163B72741633C189@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v3] Ifconfig : Fixed False information about Media State. 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: , X-List-Received-Date: Mon, 09 Oct 2017 02:07:35 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Do you need to put all the hard-code string in UNI file for localization? Thanks/Ray > -----Original Message----- > From: Wu, Jiaxin > Sent: Monday, October 9, 2017 9:29 AM > To: Meenakshi Aggarwal ; Carsey, Jaben > ; edk2-devel@lists.01.org; Ni, Ruiyu > > Subject: RE: [PATCH v3] Ifconfig : Fixed False information about Media St= ate. >=20 > I agree with Jaben. If NetLibDetectMedia return error status, we can outp= ut as > below: >=20 > ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN > (STR_IFCONFIG_INFO_MEDIA_STATE), gShellNetwork1HiiHandle, L"Media state > unknown"); >=20 > Thanks, > Jiaxin >=20 > > -----Original Message----- > > From: Meenakshi Aggarwal [mailto:meenakshi.aggarwal@nxp.com] > > Sent: Sunday, October 8, 2017 4:49 PM > > To: Carsey, Jaben ; edk2-devel@lists.01.org; > > Wu, Jiaxin ; Ni, Ruiyu > > Subject: RE: [PATCH v3] Ifconfig : Fixed False information about Media = State. > > > > It is hard to say when can an API fail because its dependent on > > implementation. > > > > > > > -----Original Message----- > > > From: Carsey, Jaben [mailto:jaben.carsey@intel.com] > > > Sent: Friday, October 06, 2017 7:32 PM > > > To: Meenakshi Aggarwal ; edk2- > > > devel@lists.01.org; Wu, Jiaxin ; Ni, Ruiyu > > > > > > Subject: RE: [PATCH v3] Ifconfig : Fixed False information about > > > Media > > State. > > > > > > Reviewed-by: Jaben Carsey Do you know under > > > what conditions the API will fail? Is it worth saying something like > > > media > > stats > > > unknown when the function fails? > > > > > > Ray, > > > > > > What do you think? > > > > > > > > > > -----Original Message----- > > > > From: Meenakshi Aggarwal [mailto:meenakshi.aggarwal@nxp.com] > > > > Sent: Thursday, October 05, 2017 9:48 PM > > > > To: edk2-devel@lists.01.org; Wu, Jiaxin ; > > > > Carsey, Jaben ; Ni, Ruiyu > > > > > > > > Cc: Meenakshi Aggarwal > > > > Subject: [PATCH v3] Ifconfig : Fixed False information about Media = State. > > > > Importance: High > > > > > > > > Issue : We were setting MediaPresent as TRUE (default) and not > > > > checking return status of NetLibDetectMedia(). > > > > NetLibDetectMedia() sets MediaPresent FLAG in case of success only > > > > and dont change flag on error. > > > > So, Media State will display as 'Media Present', in case of error > > > > also. > > > > > > > > Fix : Check return value of NetLibDetectMedia() > > > > > > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > > > > > > > Signed-off-by: Meenakshi Aggarwal > > > > --- > > > > ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c | 11 > > > > +++++++-- > > > > -- > > > > 1 file changed, 7 insertions(+), 4 deletions(-) > > > > > > > > diff --git > > > > a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c > > > > b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c > > > > index 4db07b2..90ca724 100644 > > > > --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c > > > > +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c > > > > @@ -576,11 +576,14 @@ IfConfigShowInterfaceInfo ( > > > > // > > > > // Get Media State. > > > > // > > > > - NetLibDetectMedia (IfCb->NicHandle, &MediaPresent); > > > > - if (!MediaPresent) { > > > > - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN > > > > (STR_IFCONFIG_INFO_MEDIA_STATE), gShellNetwork1HiiHandle, > > L"Media > > > > disconnected"); > > > > + if (EFI_SUCCESS =3D=3D 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"); > > > > + } > > > > } else { > > > > - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN > > > > (STR_IFCONFIG_INFO_MEDIA_STATE), gShellNetwork1HiiHandle, > > L"Media > > > > present"); > > > > + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN > > > > (STR_IFCONFIG_INFO_MEDIA_STATE), gShellNetwork1HiiHandle, > > L"Media > > > > disconnected"); > > > > } > > > > > > > > // > > > > -- > > > > 2.7.4