diff options
author | Mark McLoughlin | 2009-05-18 14:40:55 +0200 |
---|---|---|
committer | Mark McLoughlin | 2009-06-09 12:38:49 +0200 |
commit | 4f1c942b7fb29864ad86cb3af9076da38f38f74e (patch) | |
tree | 2f51a121e715476c3986c0ae0b4513be555d8ee8 /hw/musicpal.c | |
parent | net: pass VLANClientState* as first arg to receive handlers (diff) | |
download | qemu-4f1c942b7fb29864ad86cb3af9076da38f38f74e.tar.gz qemu-4f1c942b7fb29864ad86cb3af9076da38f38f74e.tar.xz qemu-4f1c942b7fb29864ad86cb3af9076da38f38f74e.zip |
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>
Diffstat (limited to 'hw/musicpal.c')
-rw-r--r-- | hw/musicpal.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/musicpal.c b/hw/musicpal.c index 844edb8f37..8c70a2bec8 100644 --- a/hw/musicpal.c +++ b/hw/musicpal.c @@ -562,7 +562,7 @@ static int eth_can_receive(VLANClientState *vc) return 1; } -static void eth_receive(VLANClientState *vc, const uint8_t *buf, size_t size) +static ssize_t eth_receive(VLANClientState *vc, const uint8_t *buf, size_t size) { mv88w8618_eth_state *s = vc->opaque; uint32_t desc_addr; @@ -586,11 +586,12 @@ static void eth_receive(VLANClientState *vc, const uint8_t *buf, size_t size) if (s->icr & s->imr) qemu_irq_raise(s->irq); eth_rx_desc_put(desc_addr, &desc); - return; + return size; } desc_addr = desc.next; } while (desc_addr != s->rx_queue[i]); } + return size; } static void eth_tx_desc_put(uint32_t addr, mv88w8618_tx_desc *desc) |