From e3f5ec2b5e92706e3b807059f79b1fb5d936e567 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Mon, 18 May 2009 13:33:03 +0100 Subject: net: pass VLANClientState* as first arg to receive handlers Give static type checking a chance to catch errors. Signed-off-by: Mark McLoughlin --- hw/pcnet.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'hw/pcnet.c') diff --git a/hw/pcnet.c b/hw/pcnet.c index 4defc43..a8297df 100644 --- a/hw/pcnet.c +++ b/hw/pcnet.c @@ -1062,9 +1062,9 @@ static int pcnet_tdte_poll(PCNetState *s) return !!(CSR_CXST(s) & 0x8000); } -static int pcnet_can_receive(void *opaque) +static int pcnet_can_receive(VLANClientState *vc) { - PCNetState *s = opaque; + PCNetState *s = vc->opaque; if (CSR_STOP(s) || CSR_SPND(s)) return 0; @@ -1076,9 +1076,9 @@ static int pcnet_can_receive(void *opaque) #define MIN_BUF_SIZE 60 -static void pcnet_receive(void *opaque, const uint8_t *buf, size_t size) +static void pcnet_receive(VLANClientState *vc, const uint8_t *buf, size_t size) { - PCNetState *s = opaque; + PCNetState *s = vc->opaque; int is_padr = 0, is_bcast = 0, is_ladr = 0; uint8_t buf1[60]; int remaining; @@ -1302,7 +1302,7 @@ static void pcnet_transmit(PCNetState *s) if (BCR_SWSTYLE(s) == 1) add_crc = !GET_FIELD(tmd.status, TMDS, NOFCS); s->looptest = add_crc ? PCNET_LOOPTEST_CRC : PCNET_LOOPTEST_NOCRC; - pcnet_receive(s, s->buffer, s->xmit_pos); + pcnet_receive(s->vc, s->buffer, s->xmit_pos); s->looptest = 0; } else if (s->vc) -- cgit v1.1