Set the MAC addresses in the SNP function in the entry point, rather than the initialization function. This allows the driver to be bound to before being initialized. Without this change there is the unhandled requirement that the LAN9118 driver be initialized before the ip4 driver binds to it.
Signed-off-by: Roy Franz roy.franz@linaro.org Contributed-under: TianoCore Contribution Agreement 1.0 --- ArmPlatformPkg/Drivers/LAN9118Dxe/LAN9118Dxe.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/ArmPlatformPkg/Drivers/LAN9118Dxe/LAN9118Dxe.c b/ArmPlatformPkg/Drivers/LAN9118Dxe/LAN9118Dxe.c index b05fac2..ab9fa38 100644 --- a/ArmPlatformPkg/Drivers/LAN9118Dxe/LAN9118Dxe.c +++ b/ArmPlatformPkg/Drivers/LAN9118Dxe/LAN9118Dxe.c @@ -1381,11 +1381,6 @@ DEBUG((EFI_D_ERROR, "Here: %a, line: %d\n", __func__, __LINE__)); gRxDataSize = RxBufferSize; }
- // Set the current MAC Address - Snp->Mode->CurrentAddress = GetCurrentMacAddress (); - - // Set the permanent MAC Address - Snp->Mode->PermanentAddress = Snp->Mode->CurrentAddress;
// Do auto-negotiation if supported Status = AutoNegotiate (Snp); @@ -2572,9 +2567,11 @@ DEBUG((EFI_D_ERROR, "Here: %a, line: %d, snpMode: %p\n", __func__, __LINE__, Snp
// Set broadcast address SetMem (&SnpMode->BroadcastAddress, sizeof (EFI_MAC_ADDRESS), 0xFF); + SnpMode->PermanentAddress = GetCurrentMacAddress (); + SnpMode->CurrentAddress = SnpMode->PermanentAddress;
// Assign fields for device path - Lan9118Path->Lan9118.MacAddress = GetCurrentMacAddress (); + Lan9118Path->Lan9118.MacAddress = SnpMode->PermanentAddress; Lan9118Path->Lan9118.IfType = Snp->Mode->IfType;
// Initialise the protocol