MmioWrite32 (LAN9118_PMT_CTRL, PmConf);\r
gBS->Stall (LAN9118_STALL);\r
\r
+ // Reactivate the LEDs\r
+ Status = ConfigureHardware (HW_CONF_USE_LEDS, Snp);\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
+\r
// Check that a buffer size was specified in SnpInitialize\r
if (gTxBuffer != 0) {\r
HwConf = MmioRead32 (LAN9118_HW_CFG); // Read the HW register\r
if (Interrupts & INSTS_TXE) {\r
DEBUG ((EFI_D_ERROR, "LAN9118: Transmitter error. Restarting..."));\r
\r
- // Initiate a software reset\r
+ // Software reset, the TXE interrupt is cleared by the reset.\r
Status = SoftReset (0, Snp);\r
if (EFI_ERROR (Status)) {\r
DEBUG ((EFI_D_ERROR, "\n\tSoft Reset Failed: Hardware Error\n"));\r
return EFI_DEVICE_ERROR;\r
}\r
\r
- // Acknowledge the TXE\r
- MmioWrite32 (LAN9118_INT_STS, INSTS_TXE);\r
- gBS->Stall (LAN9118_STALL);\r
+ // Reactivate the LEDs\r
+ Status = ConfigureHardware (HW_CONF_USE_LEDS, Snp);\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
\r
- // Restart the transmitter\r
+ //\r
+ // Restart the transmitter and if necessary the receiver.\r
+ // Do not ask for FIFO reset as it has already been done\r
+ // by SoftReset().\r
+ //\r
StartTx (START_TX_MAC | START_TX_CFG, Snp);\r
+ if (Snp->Mode->ReceiveFilterSetting != 0) {\r
+ StartRx (0, Snp);\r
+ }\r
}\r
\r
// Update the media status\r
if (MmioRead32 (LAN9118_INT_STS) & INSTS_RXE) {\r
DEBUG ((EFI_D_WARN, "Warning: Receiver Error. Restarting...\n"));\r
\r
- // Initiate a software reset\r
+ // Software reset, the RXE interrupt is cleared by the reset.\r
Status = SoftReset (0, Snp);\r
if (EFI_ERROR (Status)) {\r
DEBUG ((EFI_D_ERROR, "Error: Soft Reset Failed: Hardware Error.\n"));\r
return EFI_DEVICE_ERROR;\r
}\r
\r
- // Acknowledge the RXE\r
- MmioWrite32 (LAN9118_INT_STS, INSTS_RXE);\r
- gBS->Stall (LAN9118_STALL);\r
+ // Reactivate the LEDs\r
+ Status = ConfigureHardware (HW_CONF_USE_LEDS, Snp);\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
\r
- // Restart the rx (and do not clear FIFO)\r
+ //\r
+ // Restart the receiver and the transmitter without reseting the FIFOs\r
+ // as it has been done by SoftReset().\r
+ //\r
StartRx (0, Snp);\r
+ StartTx (START_TX_MAC | START_TX_CFG, Snp);\r
\r
// Say that command could not be sent\r
return EFI_DEVICE_ERROR;\r