Revision e3f5ec2b hw/mipsnet.c
b/hw/mipsnet.c | ||
---|---|---|
66 | 66 |
return 0; |
67 | 67 |
} |
68 | 68 |
|
69 |
static int mipsnet_can_receive(void *opaque)
|
|
69 |
static int mipsnet_can_receive(VLANClientState *vc)
|
|
70 | 70 |
{ |
71 |
MIPSnetState *s = opaque; |
|
71 |
MIPSnetState *s = vc->opaque;
|
|
72 | 72 |
|
73 | 73 |
if (s->busy) |
74 | 74 |
return 0; |
75 | 75 |
return !mipsnet_buffer_full(s); |
76 | 76 |
} |
77 | 77 |
|
78 |
static void mipsnet_receive(void *opaque, const uint8_t *buf, size_t size)
|
|
78 |
static void mipsnet_receive(VLANClientState *vc, const uint8_t *buf, size_t size)
|
|
79 | 79 |
{ |
80 |
MIPSnetState *s = opaque; |
|
80 |
MIPSnetState *s = vc->opaque;
|
|
81 | 81 |
|
82 | 82 |
#ifdef DEBUG_MIPSNET_RECEIVE |
83 | 83 |
printf("mipsnet: receiving len=%d\n", size); |
84 | 84 |
#endif |
85 |
if (!mipsnet_can_receive(opaque))
|
|
85 |
if (!mipsnet_can_receive(vc))
|
|
86 | 86 |
return; |
87 | 87 |
|
88 | 88 |
s->busy = 1; |
Also available in: Unified diff