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.88; helo=mga01.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org 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) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False 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 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,399,1508828400"; d="scan'208";a="2403461" 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 From: Jiaxin Wu To: edk2-devel@lists.01.org Cc: Ye Ting , Fu Siyuan , Wu Jiaxin 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: [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: , X-List-Received-Date: Thu, 14 Dec 2017 05:45:33 -0000 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 issue. Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin --- 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 = &Private->PxeBc; Status = gBS->HandleProtocol ( - Private->Controller, + Private->Mode.UsingIpv6 ? Private->Ip6Nic->Controller : Private->Ip4Nic->Controller, &gEfiPxeBaseCodeCallbackProtocolGuid, (VOID **) &Private->PxeBcCallback ); if (Status == EFI_UNSUPPORTED) { @@ -1008,11 +1008,11 @@ PxeBcInstallCallback ( // // Install a default callback if user didn't offer one. // Status = gBS->InstallProtocolInterface ( - &Private->Controller, + Private->Mode.UsingIpv6 ? &Private->Ip6Nic->Controller : &Private->Ip4Nic->Controller, &gEfiPxeBaseCodeCallbackProtocolGuid, EFI_NATIVE_INTERFACE, &Private->LoadFileCallback ); @@ -1052,11 +1052,11 @@ PxeBcUninstallCallback ( NewMakeCallback = FALSE; PxeBc->SetParameters (PxeBc, NULL, NULL, NULL, NULL, &NewMakeCallback); 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 = gBS->HandleProtocol ( - Private->Controller, + Mode->UsingIpv6 ? Private->Ip6Nic->Controller : Private->Ip4Nic->Controller, &gEfiPxeBaseCodeCallbackProtocolGuid, (VOID **) &Private->PxeBcCallback ); if (EFI_ERROR (Status) || (Private->PxeBcCallback->Callback == NULL)) { -- 1.9.5.msysgit.1