From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Permerror (SPF Permanent Error: More than 10 MX records returned) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=siyuan.fu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 C778F221EA0B2 for ; Thu, 7 Dec 2017 16:55:24 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Dec 2017 16:59:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,375,1508828400"; d="scan'208";a="185118849" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga006.fm.intel.com with ESMTP; 07 Dec 2017 16:59:57 -0800 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 7 Dec 2017 16:59:57 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 7 Dec 2017 16:59:57 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.159]) with mapi id 14.03.0319.002; Fri, 8 Dec 2017 08:59:56 +0800 From: "Fu, Siyuan" To: "Wang, Fan" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Wang, Fan" , "Wu, Jiaxin" Thread-Topic: [edk2] [Patch] MdeModulePkg/NetLib: Fix an error when AIP doesn't support network media state detection Thread-Index: AQHTb0DvUDPJnSf/C0W2MaqM/SN8EKM4oSxw Date: Fri, 8 Dec 2017 00:59:55 +0000 Message-ID: References: <1512640263-7280-1-git-send-email-fan.wang@intel.com> In-Reply-To: <1512640263-7280-1-git-send-email-fan.wang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzlhM2VmNjctYmQ0Mi00YTRlLWJmNjQtZGQyZGUxOGZjODhlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJNNUZFYnAxQWZVZE13NHVDQnZNaXc4bzNLRjBzek01MWRrOHUxVHdrODF6MHE5U3Q2RDRoTW1XN2F4NTBtYlE5In0= dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] MdeModulePkg/NetLib: Fix an error when AIP doesn't support network media state detection 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: Fri, 08 Dec 2017 00:55:25 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Fu Siyuan > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > fanwang2 > Sent: Thursday, December 7, 2017 5:51 PM > To: edk2-devel@lists.01.org > Cc: Ye, Ting ; Wang, Fan ; Fu, > Siyuan ; Wu, Jiaxin > Subject: [edk2] [Patch] MdeModulePkg/NetLib: Fix an error when AIP doesn'= t > support network media state detection >=20 > AIP may not support detecting network media state, in this case, > should call NetLibDetectMedia to get media state. This patch is to > fix this issue. >=20 > Cc: Fu Siyuan > Cc: Ye Ting > Cc: Jiaxin Wu > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Wang Fan > --- > MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) >=20 > diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c > b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c > index 1bfa33d..d75cca2 100644 > --- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c > +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c > @@ -2603,10 +2603,28 @@ NetLibDetectMediaWaitTimeout ( > } else { >=20 > if (MediaInfo !=3D NULL) { > FreePool (MediaInfo); > } > + > + if (Status =3D=3D EFI_UNSUPPORTED) { > + > + // > + // If gEfiAdapterInfoMediaStateGuid is not supported, call > NetLibDetectMedia to get media state! > + // > + MediaPresent =3D TRUE; > + Status =3D NetLibDetectMedia (ServiceHandle, &MediaPresent); > + if (!EFI_ERROR (Status)) { > + if (MediaPresent =3D=3D TRUE) { > + *MediaState =3D EFI_SUCCESS; > + } else { > + *MediaState =3D EFI_NO_MEDIA; > + } > + } > + return Status; > + } > + > return Status; > } >=20 > // > // Loop to check media state > -- > 1.9.5.msysgit.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel