net: add return value to packet receive handler

This allows us to handle queue full conditions rather than dropping
the packet on the floor.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
This commit is contained in:
Mark McLoughlin 2009-05-18 13:40:55 +01:00
parent e3f5ec2b5e
commit 4f1c942b7f
18 changed files with 126 additions and 95 deletions

View file

@ -353,7 +353,7 @@ static int mcf_fec_can_receive(VLANClientState *vc)
return s->rx_enabled;
}
static void mcf_fec_receive(VLANClientState *vc, const uint8_t *buf, size_t size)
static ssize_t mcf_fec_receive(VLANClientState *vc, const uint8_t *buf, size_t size)
{
mcf_fec_state *s = vc->opaque;
mcf_fec_bd bd;
@ -426,6 +426,7 @@ static void mcf_fec_receive(VLANClientState *vc, const uint8_t *buf, size_t size
s->rx_descriptor = addr;
mcf_fec_enable_rx(s);
mcf_fec_update(s);
return size;
}
static CPUReadMemoryFunc *mcf_fec_readfn[] = {