public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wu, Jiaxin" <jiaxin.wu@intel.com>
To: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>,
	"Carsey, Jaben" <jaben.carsey@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	"Ni, Ruiyu" <ruiyu.ni@intel.com>
Subject: Re: [PATCH v3] Ifconfig : Fixed False information about Media State.
Date: Mon, 9 Oct 2017 01:29:27 +0000	[thread overview]
Message-ID: <895558F6EA4E3B41AC93A00D163B72741633C189@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <DB5PR04MB099869F88D05F219FB39D4FE8E770@DB5PR04MB0998.eurprd04.prod.outlook.com>

I agree with Jaben. If NetLibDetectMedia return error status, we can output as below:

      ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_MEDIA_STATE), gShellNetwork1HiiHandle, L"Media state unknown");

Thanks,
Jiaxin

> -----Original Message-----
> From: Meenakshi Aggarwal [mailto:meenakshi.aggarwal@nxp.com]
> Sent: Sunday, October 8, 2017 4:49 PM
> To: Carsey, Jaben <jaben.carsey@intel.com>; edk2-devel@lists.01.org; Wu,
> Jiaxin <jiaxin.wu@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>
> 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 <meenakshi.aggarwal@nxp.com>; edk2-
> > devel@lists.01.org; Wu, Jiaxin <jiaxin.wu@intel.com>; Ni, Ruiyu
> > <ruiyu.ni@intel.com>
> > Subject: RE: [PATCH v3] Ifconfig : Fixed False information about Media
> State.
> >
> > Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> 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 <jiaxin.wu@intel.com>; Carsey,
> > > Jaben <jaben.carsey@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>
> > > Cc: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
> > > 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 <meenakshi.aggarwal@nxp.com>
> > > ---
> > >  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 == 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



  reply	other threads:[~2017-10-09  1:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-05  6:36 [PATCH] Ifconfig : Fixed False information about Media State Meenakshi Aggarwal
2017-10-05 15:01 ` Carsey, Jaben
2017-10-05 17:10   ` Meenakshi Aggarwal
2017-10-05 20:26     ` Carsey, Jaben
2017-10-06  4:21       ` Meenakshi Aggarwal
2017-10-06  4:40 ` [PATCH v2] " Meenakshi Aggarwal
2017-10-06  4:48   ` [PATCH v3] *** Ifconfig : Fixed False information about Media State *** Meenakshi Aggarwal
2017-10-06  4:48     ` [PATCH v3] Ifconfig : Fixed False information about Media State Meenakshi Aggarwal
2017-10-06 14:01       ` Carsey, Jaben
2017-10-08  8:49         ` Meenakshi Aggarwal
2017-10-09  1:29           ` Wu, Jiaxin [this message]
2017-10-09  2:09             ` Ni, Ruiyu
2017-10-09  3:21               ` Wu, Jiaxin
2017-10-10 14:07       ` [PATCH v4] " Meenakshi Aggarwal
2017-10-11  0:47         ` Wu, Jiaxin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=895558F6EA4E3B41AC93A00D163B72741633C189@SHSMSX103.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox