summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/realtek.c
diff options
context:
space:
mode:
authorMichael Brown2013-04-30 14:36:04 +0200
committerMichael Brown2013-04-30 14:42:12 +0200
commit592755eccf51c87ca727c2044eee7ffc3266e290 (patch)
treee3be3ae927c223dc0d734ee0c4bb7c2217cc9db2 /src/drivers/net/realtek.c
parent[pxe] Convert external PXE API errors into iPXE platform-generated errors (diff)
downloadipxe-592755eccf51c87ca727c2044eee7ffc3266e290.tar.gz
ipxe-592755eccf51c87ca727c2044eee7ffc3266e290.tar.xz
ipxe-592755eccf51c87ca727c2044eee7ffc3266e290.zip
[realtek] Allow reaction time between writing RTL_CAPR and reading RTL_CR
Some older RTL8139 chips seem to not immediately update the RTL_CR.BUFE bit in response to a write to RTL_CAPR. This results in iPXE seeing a spurious zero-length received packet, and thereafter being out of sync with the hardware's RX ring offset. Fix by inserting an extra PCI read cycle after writing to RTL_CAPR, to give the chip time to react before we next read RTL_CR. Reported-by: Gelip <mrgelip@gmail.com> Tested-by: Gelip <mrgelip@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/net/realtek.c')
-rw-r--r--src/drivers/net/realtek.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/drivers/net/realtek.c b/src/drivers/net/realtek.c
index d7c4d29d..70c0ac1c 100644
--- a/src/drivers/net/realtek.c
+++ b/src/drivers/net/realtek.c
@@ -861,6 +861,9 @@ static void realtek_legacy_poll_rx ( struct net_device *netdev ) {
rtl->rx_offset = ( ( rtl->rx_offset + 3 ) & ~3 );
rtl->rx_offset = ( rtl->rx_offset % RTL_RXBUF_LEN );
writew ( ( rtl->rx_offset - 16 ), rtl->regs + RTL_CAPR );
+
+ /* Give chip time to react before rechecking RTL_CR */
+ readw ( rtl->regs + RTL_CAPR );
}
}