aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/xilinx_ethlite.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/hw/xilinx_ethlite.c b/hw/xilinx_ethlite.c
index 780e9c05a6..77cd6fb05e 100644
--- a/hw/xilinx_ethlite.c
+++ b/hw/xilinx_ethlite.c
@@ -160,28 +160,28 @@ static CPUWriteMemoryFunc *eth_write[] = {
NULL, NULL, &eth_writel,
};
-static int eth_can_rx(void *opaque)
+static int eth_can_rx(VLANClientState *vc)
{
- struct xlx_ethlite *s = opaque;
+ struct xlx_ethlite *s = vc->opaque;
int r;
r = !(s->regs[R_RX_CTRL0] & CTRL_S);
qemu_log("%s %d\n", __func__, r);
return r;
}
-static void eth_rx(void *opaque, const uint8_t *buf, int size)
+static ssize_t eth_rx(VLANClientState *vc, const uint8_t *buf, size_t size)
{
- struct xlx_ethlite *s = opaque;
+ struct xlx_ethlite *s = vc->opaque;
unsigned int rxbase = s->rxbuf * (0x800 / 4);
int i;
/* DA filter. */
if (!(buf[0] & 0x80) && memcmp(&s->macaddr[0], buf, 6))
- return;
+ return size;
if (s->regs[rxbase + R_RX_CTRL0] & CTRL_S) {
D(qemu_log("ethlite lost packet %x\n", s->regs[R_RX_CTRL0]));
- return;
+ return -1;
}
D(qemu_log("%s %d rxbase=%x\n", __func__, size, rxbase));
@@ -199,7 +199,7 @@ static void eth_rx(void *opaque, const uint8_t *buf, int size)
/* If c_rx_pingpong was set flip buffers. */
s->rxbuf ^= s->c_rx_pingpong;
- return;
+ return size;
}
static void eth_cleanup(VLANClientState *vc)
@@ -223,7 +223,7 @@ static void xilinx_ethlite_init(SysBusDevice *dev)
qdev_get_macaddr(&dev->qdev, s->macaddr);
s->vc = qdev_get_vlan_client(&dev->qdev,
- eth_rx, eth_can_rx, eth_cleanup, s);
+ eth_can_rx, eth_rx, NULL, eth_cleanup, s);
}
static void xilinx_ethlite_register(void)