Discussion:
[edk2] [PATCH] ArmPlatformPkg/Bds: Use HandleProtocol to get SNP instance
Heyi Guo
2015-07-16 08:35:17 UTC
Permalink
LocateProtocol only gets the 1st SNP instance and this will be wrong
in a system with multiple SNP instances installed. Use HandleProtocol
instead.

Cc: Olivier Martin <***@arm.com>
Cc: Leif Lindholm <***@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <***@linaro.org>
---
ArmPlatformPkg/Bds/BootOptionSupport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ArmPlatformPkg/Bds/BootOptionSupport.c b/ArmPlatformPkg/Bds/BootOptionSupport.c
index f50f13f..27faf00 100644
--- a/ArmPlatformPkg/Bds/BootOptionSupport.c
+++ b/ArmPlatformPkg/Bds/BootOptionSupport.c
@@ -667,7 +667,7 @@ BdsLoadOptionPxeList (
// Allocate BDS Supported Device structure
SupportedDevice = (BDS_SUPPORTED_DEVICE*)AllocatePool(sizeof(BDS_SUPPORTED_DEVICE));

- Status = gBS->LocateProtocol (&gEfiSimpleNetworkProtocolGuid, NULL, (VOID **)&SimpleNet);
+ Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiSimpleNetworkProtocolGuid, (VOID **)&SimpleNet);
if (!EFI_ERROR(Status)) {
Mac = &SimpleNet->Mode->CurrentAddress;
UnicodeSPrint (DeviceDescription,BOOT_DEVICE_DESCRIPTION_MAX,L"MAC Address: %02x:%02x:%02x:%02x:%02x:%02x", Mac->Addr[0], Mac->Addr[1], Mac->Addr[2], Mac->Addr[3], Mac->Addr[4], Mac->Addr[5]);
--
2.1.4
Olivier Martin
2015-07-16 09:40:46 UTC
Permalink
-----Original Message-----
Sent: 16 July 2015 09:35
Cc: Heyi Guo; Olivier Martin; Leif Lindholm
Subject: [edk2] [PATCH] ArmPlatformPkg/Bds: Use HandleProtocol to get
SNP instance
LocateProtocol only gets the 1st SNP instance and this will be wrong in a
system with multiple SNP instances installed. Use HandleProtocol instead.
Contributed-under: TianoCore Contribution Agreement 1.0
---
ArmPlatformPkg/Bds/BootOptionSupport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ArmPlatformPkg/Bds/BootOptionSupport.c
b/ArmPlatformPkg/Bds/BootOptionSupport.c
index f50f13f..27faf00 100644
--- a/ArmPlatformPkg/Bds/BootOptionSupport.c
+++ b/ArmPlatformPkg/Bds/BootOptionSupport.c
@@ -667,7 +667,7 @@ BdsLoadOptionPxeList (
// Allocate BDS Supported Device structure
SupportedDevice =
(BDS_SUPPORTED_DEVICE*)AllocatePool(sizeof(BDS_SUPPORTED_DEVICE));
- Status = gBS->LocateProtocol (&gEfiSimpleNetworkProtocolGuid, NULL,
(VOID **)&SimpleNet);
+ Status = gBS->HandleProtocol (HandleBuffer[Index],
+ &gEfiSimpleNetworkProtocolGuid, (VOID **)&SimpleNet);
if (!EFI_ERROR(Status)) {
Mac = &SimpleNet->Mode->CurrentAddress;
UnicodeSPrint
%02x:%02x:%02x:%02x:%02x:%02x", Mac->Addr[0], Mac->Addr[1], Mac-
Post by Heyi Guo
Addr[2], Mac->Addr[3], Mac->Addr[4], Mac->Addr[5]);
--
2.1.4
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782
Loading...