Skip to content

Commit

Permalink
xilinx_ethlite: fix eth_can_rx() for ping-pong
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
pete128 authored and edgarigl committed Jan 26, 2013
1 parent 1314478 commit 808fb9f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hw/xilinx_ethlite.c
Expand Up @@ -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)
Expand Down

0 comments on commit 808fb9f

Please sign in to comment.