mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
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>
This commit is contained in:
parent
cda9046ba7
commit
e3f5ec2b5e
19 changed files with 90 additions and 90 deletions
10
hw/mipsnet.c
10
hw/mipsnet.c
|
@ -66,23 +66,23 @@ static int mipsnet_buffer_full(MIPSnetState *s)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int mipsnet_can_receive(void *opaque)
|
||||
static int mipsnet_can_receive(VLANClientState *vc)
|
||||
{
|
||||
MIPSnetState *s = opaque;
|
||||
MIPSnetState *s = vc->opaque;
|
||||
|
||||
if (s->busy)
|
||||
return 0;
|
||||
return !mipsnet_buffer_full(s);
|
||||
}
|
||||
|
||||
static void mipsnet_receive(void *opaque, const uint8_t *buf, size_t size)
|
||||
static void mipsnet_receive(VLANClientState *vc, const uint8_t *buf, size_t size)
|
||||
{
|
||||
MIPSnetState *s = opaque;
|
||||
MIPSnetState *s = vc->opaque;
|
||||
|
||||
#ifdef DEBUG_MIPSNET_RECEIVE
|
||||
printf("mipsnet: receiving len=%d\n", size);
|
||||
#endif
|
||||
if (!mipsnet_can_receive(opaque))
|
||||
if (!mipsnet_can_receive(vc))
|
||||
return;
|
||||
|
||||
s->busy = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue