EmbeddedPkg/Lan9118Dxe: rename TimeOut to Retries

The variable TimeOut is actually a retry, not a timeout, so I renamed
the variable accordingly.

This patch makes no functional change.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
This commit is contained in:
Ryan Harkin 2016-02-09 17:10:02 +00:00 committed by Ard Biesheuvel
parent c64aa7c409
commit bbff41c11f
1 changed files with 11 additions and 11 deletions

View File

@ -355,7 +355,7 @@ Lan9118Initialize (
IN EFI_SIMPLE_NETWORK_PROTOCOL *Snp IN EFI_SIMPLE_NETWORK_PROTOCOL *Snp
) )
{ {
UINTN Timeout; UINTN Retries;
UINT64 DefaultMacAddress; UINT64 DefaultMacAddress;
// Attempt to wake-up the device if it is in a lower power state // Attempt to wake-up the device if it is in a lower power state
@ -366,22 +366,22 @@ Lan9118Initialize (
} }
// Check that device is active // Check that device is active
Timeout = 20; Retries = 20;
while ((MmioRead32 (LAN9118_PMT_CTRL) & MPTCTRL_READY) == 0 && --Timeout) { while ((MmioRead32 (LAN9118_PMT_CTRL) & MPTCTRL_READY) == 0 && --Retries) {
gBS->Stall (LAN9118_STALL); gBS->Stall (LAN9118_STALL);
MemoryFence(); MemoryFence();
} }
if (!Timeout) { if (!Retries) {
return EFI_TIMEOUT; return EFI_TIMEOUT;
} }
// Check that EEPROM isn't active // Check that EEPROM isn't active
Timeout = 20; Retries = 20;
while ((MmioRead32 (LAN9118_E2P_CMD) & E2P_EPC_BUSY) && --Timeout){ while ((MmioRead32 (LAN9118_E2P_CMD) & E2P_EPC_BUSY) && --Retries){
gBS->Stall (LAN9118_STALL); gBS->Stall (LAN9118_STALL);
MemoryFence(); MemoryFence();
} }
if (!Timeout) { if (!Retries) {
return EFI_TIMEOUT; return EFI_TIMEOUT;
} }
@ -574,7 +574,7 @@ AutoNegotiate (
UINT32 PhyControl; UINT32 PhyControl;
UINT32 PhyStatus; UINT32 PhyStatus;
UINT32 Features; UINT32 Features;
UINT32 TimeOut; UINT32 Retries;
// First check that auto-negotiation is supported // First check that auto-negotiation is supported
PhyStatus = IndirectPHYRead32 (PHY_INDEX_BASIC_STATUS); PhyStatus = IndirectPHYRead32 (PHY_INDEX_BASIC_STATUS);
@ -586,12 +586,12 @@ AutoNegotiate (
// Check that link is up first // Check that link is up first
if ((PhyStatus & PHYSTS_LINK_STS) == 0) { if ((PhyStatus & PHYSTS_LINK_STS) == 0) {
// Wait until it is up or until Time Out // Wait until it is up or until Time Out
TimeOut = FixedPcdGet32 (PcdLan9118DefaultNegotiationTimeout) / LAN9118_STALL; Retries = FixedPcdGet32 (PcdLan9118DefaultNegotiationTimeout) / LAN9118_STALL;
while ((IndirectPHYRead32 (PHY_INDEX_BASIC_STATUS) & PHYSTS_LINK_STS) == 0) { while ((IndirectPHYRead32 (PHY_INDEX_BASIC_STATUS) & PHYSTS_LINK_STS) == 0) {
MemoryFence(); MemoryFence();
gBS->Stall (LAN9118_STALL); gBS->Stall (LAN9118_STALL);
TimeOut--; Retries--;
if (!TimeOut) { if (!Retries) {
DEBUG ((EFI_D_ERROR, "Link timeout in auto-negotiation.\n")); DEBUG ((EFI_D_ERROR, "Link timeout in auto-negotiation.\n"));
return EFI_TIMEOUT; return EFI_TIMEOUT;
} }