}
/* TODO: Implement MAC address filtering. */
-static void stellaris_enet_receive(VLANClientState *vc, const uint8_t *buf, size_t size)
+static ssize_t stellaris_enet_receive(VLANClientState *vc, const uint8_t *buf, size_t size)
{
stellaris_enet_state *s = vc->opaque;
int n;
uint32_t crc;
if ((s->rctl & SE_RCTL_RXEN) == 0)
- return;
+ return -1;
if (s->np >= 31) {
DPRINTF("Packet dropped\n");
- return;
+ return -1;
}
DPRINTF("Received packet len=%d\n", size);
s->ris |= SE_INT_RX;
stellaris_enet_update(s);
+
+ return size;
}
static int stellaris_enet_can_receive(VLANClientState *vc)