From df12c1f543b228daae7a2fbcfd3bb12a6faab38a Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Thu, 11 Jun 2009 11:42:26 +0200 Subject: Fix xilinx_ethlite breakage by 4f1c942b7f Namely the new xilinx_ethlite used by mircoblaze. Signed-off-by: Jan Kiszka --- hw/xilinx_ethlite.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'hw/xilinx_ethlite.c') diff --git a/hw/xilinx_ethlite.c b/hw/xilinx_ethlite.c index 780e9c0..77cd6fb 100644 --- a/hw/xilinx_ethlite.c +++ b/hw/xilinx_ethlite.c @@ -160,28 +160,28 @@ static CPUWriteMemoryFunc *eth_write[] = { NULL, NULL, ð_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) -- cgit v1.1