aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@web.de>2009-06-11 11:42:26 +0200
committerPaul Brook <paul@codesourcery.com>2009-06-11 12:33:19 +0100
commitdf12c1f543b228daae7a2fbcfd3bb12a6faab38a (patch)
treece0c3aacda9f7fc8315dee493511f51d794c28b2 /hw
parent068daedd7dffcd065d3f238a6c04bb2cf51a9cd2 (diff)
Fix xilinx_ethlite breakage by 4f1c942b7f
Namely the new xilinx_ethlite used by mircoblaze. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Diffstat (limited to 'hw')
-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)