Revision 4f1c942b hw/stellaris_enet.c
b/hw/stellaris_enet.c | ||
---|---|---|
78 | 78 |
} |
79 | 79 |
|
80 | 80 |
/* TODO: Implement MAC address filtering. */ |
81 |
static void stellaris_enet_receive(VLANClientState *vc, const uint8_t *buf, size_t size)
|
|
81 |
static ssize_t stellaris_enet_receive(VLANClientState *vc, const uint8_t *buf, size_t size)
|
|
82 | 82 |
{ |
83 | 83 |
stellaris_enet_state *s = vc->opaque; |
84 | 84 |
int n; |
... | ... | |
86 | 86 |
uint32_t crc; |
87 | 87 |
|
88 | 88 |
if ((s->rctl & SE_RCTL_RXEN) == 0) |
89 |
return; |
|
89 |
return -1;
|
|
90 | 90 |
if (s->np >= 31) { |
91 | 91 |
DPRINTF("Packet dropped\n"); |
92 |
return; |
|
92 |
return -1;
|
|
93 | 93 |
} |
94 | 94 |
|
95 | 95 |
DPRINTF("Received packet len=%d\n", size); |
... | ... | |
116 | 116 |
|
117 | 117 |
s->ris |= SE_INT_RX; |
118 | 118 |
stellaris_enet_update(s); |
119 |
|
|
120 |
return size; |
|
119 | 121 |
} |
120 | 122 |
|
121 | 123 |
static int stellaris_enet_can_receive(VLANClientState *vc) |
Also available in: Unified diff