aboutsummaryrefslogtreecommitdiff
path: root/hw/dp8393x.c
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2009-05-18 13:33:03 +0100
committerMark McLoughlin <markmc@redhat.com>2009-06-09 11:38:49 +0100
commite3f5ec2b5e92706e3b807059f79b1fb5d936e567 (patch)
treee49989391834350755b1138d07ac3e464a5dbd6c /hw/dp8393x.c
parentcda9046ba7dbba45f3016e5d60caffa2d72960fa (diff)
downloadqemu-e3f5ec2b5e92706e3b807059f79b1fb5d936e567.zip
qemu-e3f5ec2b5e92706e3b807059f79b1fb5d936e567.tar.gz
qemu-e3f5ec2b5e92706e3b807059f79b1fb5d936e567.tar.bz2
net: pass VLANClientState* as first arg to receive handlers
Give static type checking a chance to catch errors. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Diffstat (limited to 'hw/dp8393x.c')
-rw-r--r--hw/dp8393x.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/dp8393x.c b/hw/dp8393x.c
index 1b48d96..de39983 100644
--- a/hw/dp8393x.c
+++ b/hw/dp8393x.c
@@ -407,9 +407,9 @@ static void do_transmit_packets(dp8393xState *s)
if (s->regs[SONIC_RCR] & (SONIC_RCR_LB1 | SONIC_RCR_LB0)) {
/* Loopback */
s->regs[SONIC_TCR] |= SONIC_TCR_CRSL;
- if (s->vc->fd_can_read(s)) {
+ if (s->vc->can_receive(s->vc)) {
s->loopback_packet = 1;
- s->vc->receive(s, s->tx_buffer, tx_len);
+ s->vc->receive(s->vc, s->tx_buffer, tx_len);
}
} else {
/* Transmit packet */
@@ -676,9 +676,9 @@ static CPUWriteMemoryFunc *dp8393x_write[3] = {
dp8393x_writel,
};
-static int nic_can_receive(void *opaque)
+static int nic_can_receive(VLANClientState *vc)
{
- dp8393xState *s = opaque;
+ dp8393xState *s = vc->opaque;
if (!(s->regs[SONIC_CR] & SONIC_CR_RXEN))
return 0;
@@ -725,10 +725,10 @@ static int receive_filter(dp8393xState *s, const uint8_t * buf, int size)
return -1;
}
-static void nic_receive(void *opaque, const uint8_t * buf, size_t size)
+static void nic_receive(VLANClientState *vc, const uint8_t * buf, size_t size)
{
uint16_t data[10];
- dp8393xState *s = opaque;
+ dp8393xState *s = vc->opaque;
int packet_type;
uint32_t available, address;
int width, rx_len = size;