diff options
author | Peter Crosthwaite <peter.crosthwaite@xilinx.com> | 2013-01-26 12:36:22 -0800 |
---|---|---|
committer | Edgar E. Iglesias <edgar.iglesias@gmail.com> | 2013-01-27 00:48:39 +0100 |
commit | 808fb9f277abda16601e9db938d29aeaf2548585 (patch) | |
tree | 09017038787b883c4ec25e5e9b67cea67096530b /hw | |
parent | 13144781d4e9e6100b398213f9000576a3dc88f9 (diff) | |
download | qemu-808fb9f277abda16601e9db938d29aeaf2548585.zip |
xilinx_ethlite: fix eth_can_rx() for ping-pong
The eth_can_rx() function only checks the first buffers status ("ping"). The
controller should be able to receive into "pong" when ping-pong is enabled.
Checks the active buffer (either "ping" or "pong") when determining can_rx()
rather than just testing "ping".
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xilinx_ethlite.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/xilinx_ethlite.c b/hw/xilinx_ethlite.c index 2254851f0a..972b85e291 100644 --- a/hw/xilinx_ethlite.c +++ b/hw/xilinx_ethlite.c @@ -163,9 +163,9 @@ static const MemoryRegionOps eth_ops = { static int eth_can_rx(NetClientState *nc) { struct xlx_ethlite *s = DO_UPCAST(NICState, nc, nc)->opaque; - int r; - r = !(s->regs[R_RX_CTRL0] & CTRL_S); - return r; + unsigned int rxbase = s->rxbuf * (0x800 / 4); + + return !(s->regs[rxbase + R_RX_CTRL0] & CTRL_S); } static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size) |