From nobody Wed Dec 25 05:03:52 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 151211753889962.14556591996745; Fri, 1 Dec 2017 00:38:58 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 96F2F221660DD; Fri, 1 Dec 2017 00:34:31 -0800 (PST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 85251220F3C5A for ; Fri, 1 Dec 2017 00:34:30 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Dec 2017 00:38:56 -0800 Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.162]) by fmsmga005.fm.intel.com with ESMTP; 01 Dec 2017 00:38: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: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,344,1508828400"; d="scan'208";a="182334453" From: Jiaxin Wu To: edk2-devel@lists.01.org Date: Fri, 1 Dec 2017 16:38:45 +0800 Message-Id: <1512117526-11308-2-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1512117526-11308-1-git-send-email-jiaxin.wu@intel.com> References: <1512117526-11308-1-git-send-email-jiaxin.wu@intel.com> Subject: [edk2] [Patch 1/2] MdeModulePkg/Dhcp4Dxe: Check Media status before starting DHCP process. 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 , Karunakar P , 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" Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Karunakar P Signed-off-by: Wu Jiaxin --- MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c b/MdeModul= ePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c index 1db4c66..8780414 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c @@ -1,9 +1,9 @@ /** @file This file implement the EFI_DHCP4_PROTOCOL interface. =20 -Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD = License which accompanies this distribution. The full text of the license may be = found at http://opensource.org/licenses/bsd-license.php =20 @@ -778,10 +778,11 @@ EfiDhcp4Start ( IN EFI_EVENT CompletionEvent OPTIONAL ) { DHCP_PROTOCOL *Instance; DHCP_SERVICE *DhcpSb; + BOOLEAN MediaPresent; EFI_STATUS Status; EFI_TPL OldTpl; =20 // // First validate the parameters @@ -807,10 +808,20 @@ EfiDhcp4Start ( if ((DhcpSb->DhcpState !=3D Dhcp4Init) && (DhcpSb->DhcpState !=3D Dhcp4I= nitReboot)) { Status =3D EFI_ALREADY_STARTED; goto ON_ERROR; } =20 + // + // Check Media Satus. + // + MediaPresent =3D TRUE; + NetLibDetectMedia (DhcpSb->Controller, &MediaPresent); + if (!MediaPresent) { + Status =3D EFI_NO_MEDIA; + goto ON_ERROR; + } + DhcpSb->IoStatus =3D EFI_ALREADY_STARTED; =20 if (EFI_ERROR (Status =3D DhcpInitRequest (DhcpSb))) { goto ON_ERROR; } --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel