From nobody Tue May 7 19:32:44 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 1513230614664180.66780718784355; Wed, 13 Dec 2017 21:50:14 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id F0EC3221E069A; Wed, 13 Dec 2017 21:45:32 -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 32050221E0694 for ; Wed, 13 Dec 2017 21:45:32 -0800 (PST) Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Dec 2017 21:50:12 -0800 Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.123]) by fmsmga008.fm.intel.com with ESMTP; 13 Dec 2017 21:50:10 -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=jiaxin.wu@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,399,1508828400"; d="scan'208";a="2403454" From: Jiaxin Wu To: edk2-devel@lists.01.org Date: Thu, 14 Dec 2017 13:50:05 +0800 Message-Id: <1513230607-1832-2-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1513230607-1832-1-git-send-email-jiaxin.wu@intel.com> References: <1513230607-1832-1-git-send-email-jiaxin.wu@intel.com> Subject: [edk2] [Patch 1/3] NetworkPkg/UefiPxeBcDxe: Fix Pxe.Dhcp() return status code. 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 , 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" According UEFI Spec, if valid PXE offer is not received, Pxe.Dhcp() should return EFI_NO_RESPONSE, but currently, EFI_TIMEOUT is returned from Pxe.Dhcp(). This patch is to fix the above issue. Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin Reviewed-by: Fu Siyuan --- NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c | 2 +- NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c b/NetworkPkg/UefiPxeBcDxe/= PxeBcBoot.c index fc50a82..0bb1d66 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c @@ -1240,11 +1240,11 @@ ON_EXIT: } else if (Status =3D=3D EFI_OUT_OF_RESOURCES) { AsciiPrint ("\n PXE-E09: Could not allocate I/O buffers.\n"); } else if (Status =3D=3D EFI_NO_MEDIA) { AsciiPrint ("\n PXE-E12: Could not detect network connection.\n"); } else if (Status =3D=3D EFI_NO_RESPONSE) { - AsciiPrint ("\n PXE-E16: No offer received.\n"); + AsciiPrint ("\n PXE-E16: No valid offer received.\n"); } else if (Status =3D=3D EFI_TIMEOUT) { AsciiPrint ("\n PXE-E18: Server response timeout.\n"); } else if (Status =3D=3D EFI_ABORTED) { AsciiPrint ("\n PXE-E21: Remote boot cancelled.\n"); } else if (Status =3D=3D EFI_ICMP_ERROR) { diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c b/NetworkPkg/UefiPxeBcDxe= /PxeBcDhcp4.c index 97829e9..101c658 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c @@ -1705,10 +1705,15 @@ PxeBcDhcp4Dora ( Status =3D Dhcp4->Start (Dhcp4, NULL); if (EFI_ERROR (Status) && Status !=3D EFI_ALREADY_STARTED) { if (Status =3D=3D EFI_ICMP_ERROR) { PxeMode->IcmpErrorReceived =3D TRUE; } + + if (Status =3D=3D EFI_TIMEOUT && Private->OfferNum > 0) { + Status =3D EFI_NO_RESPONSE; + } + =20 goto ON_EXIT; } =20 // // Get the acquired IPv4 address and store them. --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Tue May 7 19:32:44 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 1513230617762191.91540187204862; Wed, 13 Dec 2017 21:50:17 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 39473221E069C; Wed, 13 Dec 2017 21:45:36 -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 16E3E221E069C for ; Wed, 13 Dec 2017 21:45:33 -0800 (PST) Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Dec 2017 21:50:13 -0800 Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.123]) by fmsmga008.fm.intel.com with ESMTP; 13 Dec 2017 21:50:12 -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=jiaxin.wu@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,399,1508828400"; d="scan'208";a="2403461" From: Jiaxin Wu To: edk2-devel@lists.01.org Date: Thu, 14 Dec 2017 13:50:06 +0800 Message-Id: <1513230607-1832-3-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1513230607-1832-1-git-send-email-jiaxin.wu@intel.com> References: <1513230607-1832-1-git-send-email-jiaxin.wu@intel.com> Subject: [edk2] [Patch 2/3] NetworkPkg/UefiPxeBcDxe: Correct the handle for PXE Base Code Callback Protocol. 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 , 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" According UEFI Spec: The PXE Base Code Callback Protocol must be on the same handle as the PXE Base Code Protocol. But current implementation doesn't follow that. This patch is fix that issu= e. Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin Reviewed-by: Fu Siyuan --- NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c | 6 +++--- NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c b/NetworkPkg/UefiPxeBcDxe/= PxeBcBoot.c index 0bb1d66..1f8895f 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c @@ -992,11 +992,11 @@ PxeBcInstallCallback ( // // Check whether PxeBaseCodeCallbackProtocol already installed. // PxeBc =3D &Private->PxeBc; Status =3D gBS->HandleProtocol ( - Private->Controller, + Private->Mode.UsingIpv6 ? Private->Ip6Nic->Controller : = Private->Ip4Nic->Controller, &gEfiPxeBaseCodeCallbackProtocolGuid, (VOID **) &Private->PxeBcCallback ); if (Status =3D=3D EFI_UNSUPPORTED) { =20 @@ -1008,11 +1008,11 @@ PxeBcInstallCallback ( =20 // // Install a default callback if user didn't offer one. // Status =3D gBS->InstallProtocolInterface ( - &Private->Controller, + Private->Mode.UsingIpv6 ? &Private->Ip6Nic->Controller= : &Private->Ip4Nic->Controller, &gEfiPxeBaseCodeCallbackProtocolGuid, EFI_NATIVE_INTERFACE, &Private->LoadFileCallback ); =20 @@ -1052,11 +1052,11 @@ PxeBcUninstallCallback ( NewMakeCallback =3D FALSE; =20 PxeBc->SetParameters (PxeBc, NULL, NULL, NULL, NULL, &NewMakeCallback); =20 gBS->UninstallProtocolInterface ( - Private->Controller, + Private->Mode.UsingIpv6 ? Private->Ip6Nic->Controller : Private-= >Ip4Nic->Controller, &gEfiPxeBaseCodeCallbackProtocolGuid, &Private->LoadFileCallback ); } } diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c b/NetworkPkg/UefiPxeBcDxe/= PxeBcImpl.c index ab9e494..1fc26c5 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c @@ -1923,11 +1923,11 @@ EfiPxeBcSetParameters ( if (*NewMakeCallback) { // // Update the previous PxeBcCallback protocol. // Status =3D gBS->HandleProtocol ( - Private->Controller, + Mode->UsingIpv6 ? Private->Ip6Nic->Controller : Priv= ate->Ip4Nic->Controller, &gEfiPxeBaseCodeCallbackProtocolGuid, (VOID **) &Private->PxeBcCallback ); =20 if (EFI_ERROR (Status) || (Private->PxeBcCallback->Callback =3D=3D N= ULL)) { --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Tue May 7 19:32:44 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 1513230619526948.7612411588743; Wed, 13 Dec 2017 21:50:19 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 73D09221E06A0; Wed, 13 Dec 2017 21:45:36 -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 62B62221E0694 for ; Wed, 13 Dec 2017 21:45:34 -0800 (PST) Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Dec 2017 21:50:15 -0800 Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.123]) by fmsmga008.fm.intel.com with ESMTP; 13 Dec 2017 21:50:13 -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=jiaxin.wu@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,399,1508828400"; d="scan'208";a="2403468" From: Jiaxin Wu To: edk2-devel@lists.01.org Date: Thu, 14 Dec 2017 13:50:07 +0800 Message-Id: <1513230607-1832-4-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1513230607-1832-1-git-send-email-jiaxin.wu@intel.com> References: <1513230607-1832-1-git-send-email-jiaxin.wu@intel.com> Subject: [edk2] [Patch 3/3] NetworkPkg/UefiPxeBcDxe: Allow the NULL configuration for NewStationIP/NewSubnetMask 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 , 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" According the UEFI Spec for PxeBc.SetStationIP(): If NewStationIP is NULL, then the current IP address will not be modified. ... If NewSubnetMask is NULL, then the current subnet mask will not be modified. Currently, EfiPxeBcSetStationIP() doesn't comply with UEFI Spec. This patch= is to fix the issue. Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin Reviewed-by: Fu Siyuan --- NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c | 24 ++++++++++++++---------- NetworkPkg/UefiPxeBcDxe/PxeBcSupport.h | 4 ++-- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c b/NetworkPkg/UefiPxeBcD= xe/PxeBcSupport.c index 538cb59..52f1e92 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c @@ -28,26 +28,26 @@ =20 **/ EFI_STATUS PxeBcFlushStationIp ( PXEBC_PRIVATE_DATA *Private, - EFI_IP_ADDRESS *StationIp, + EFI_IP_ADDRESS *StationIp, OPTIONAL EFI_IP_ADDRESS *SubnetMask OPTIONAL ) { EFI_PXE_BASE_CODE_MODE *Mode; EFI_STATUS Status; =20 - ASSERT (StationIp !=3D NULL); - Mode =3D Private->PxeBc.Mode; Status =3D EFI_SUCCESS; =20 if (Mode->UsingIpv6) { =20 - CopyMem (&Private->Udp6CfgData.StationAddress, StationIp, sizeof (EFI_= IPv6_ADDRESS)); - CopyMem (&Private->Ip6CfgData.StationAddress, StationIp, sizeof (EFI_I= Pv6_ADDRESS)); + if (StationIp !=3D NULL) { + CopyMem (&Private->Udp6CfgData.StationAddress, StationIp, sizeof (EF= I_IPv6_ADDRESS)); + CopyMem (&Private->Ip6CfgData.StationAddress, StationIp, sizeof (EFI= _IPv6_ADDRESS)); + } =20 // // Reconfigure the Ip6 instance to capture background ICMP6 packets wi= th new station Ip address. // Private->Ip6->Cancel (Private->Ip6, &Private->Icmp6Token); @@ -58,15 +58,19 @@ PxeBcFlushStationIp ( goto ON_EXIT; } =20 Status =3D Private->Ip6->Receive (Private->Ip6, &Private->Icmp6Token); } else { - ASSERT (SubnetMask !=3D NULL); - CopyMem (&Private->Udp4CfgData.StationAddress, StationIp, sizeof (EFI_= IPv4_ADDRESS)); - CopyMem (&Private->Udp4CfgData.SubnetMask, SubnetMask, sizeof (EFI_IPv= 4_ADDRESS)); - CopyMem (&Private->Ip4CfgData.StationAddress, StationIp, sizeof (EFI_I= Pv4_ADDRESS)); - CopyMem (&Private->Ip4CfgData.SubnetMask, SubnetMask, sizeof (EFI_IPv4= _ADDRESS)); + if (StationIp !=3D NULL) { + CopyMem (&Private->Udp4CfgData.StationAddress, StationIp, sizeof (EF= I_IPv4_ADDRESS)); + CopyMem (&Private->Ip4CfgData.StationAddress, StationIp, sizeof (EFI= _IPv4_ADDRESS)); + } + =20 + if (SubnetMask !=3D NULL) { + CopyMem (&Private->Udp4CfgData.SubnetMask, SubnetMask, sizeof (EFI_I= Pv4_ADDRESS)); + CopyMem (&Private->Ip4CfgData.SubnetMask, SubnetMask, sizeof (EFI_IP= v4_ADDRESS)); + } =20 // // Reconfigure the Ip4 instance to capture background ICMP packets wit= h new station Ip address. // Private->Ip4->Cancel (Private->Ip4, &Private->IcmpToken); diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.h b/NetworkPkg/UefiPxeBcD= xe/PxeBcSupport.h index b8519ae..17bee5c 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.h +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.h @@ -1,9 +1,9 @@ /** @file Support functions declaration for UefiPxeBc Driver. =20 - Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
=20 This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at http://opensource.org/licenses/bsd-license.php. @@ -38,11 +38,11 @@ =20 **/ EFI_STATUS PxeBcFlushStationIp ( PXEBC_PRIVATE_DATA *Private, - EFI_IP_ADDRESS *StationIp, + EFI_IP_ADDRESS *StationIp, OPTIONAL EFI_IP_ADDRESS *SubnetMask OPTIONAL ); =20 =20 /** --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel