diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2009-06-10 18:05:55 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-06-10 18:08:35 -0500 |
commit | f8e76fbf5190575c0f927fe3c5b0ec6934c6c3fc (patch) | |
tree | c67bf81b0bfa6b897f4fb7a236962a85819e15f7 /hw/mcf_fec.c | |
parent | b319820d4099ec6b98c9c260e06d519fc41d544c (diff) | |
parent | 4ffb17f5c3244e405198ae285ffbb20a62e0d4b3 (diff) |
Merge branch 'net-queue'
* net-queue: (28 commits)
virtio-net: Increase filter and control limits
virtio-net: Add new RX filter controls
virtio-net: MAC filter optimization
virtio-net: Fix MAC filter overflow handling
virtio-net: reorganize receive_filter()
virtio-net: Use a byte to store RX mode flags
virtio-net: Add version_id 7 placeholder for vnet header support
virtio-net: implement rx packet queueing
net: make use of async packet sending API in tap client
net: add qemu_send_packet_async()
net: split out packet queueing and flushing into separate functions
net: return status from qemu_deliver_packet()
net: add return value to packet receive handler
net: pass VLANClientState* as first arg to receive handlers
net: re-name vc->fd_read() to vc->receive()
net: add fd_readv() handler to qemu_new_vlan_client() args
net: only read from tapfd when we can send
net: vlan clients with no fd_can_read() can always receive
net: move the tap buffer into TAPState
net: factor tap_read_packet() out of tap_send()
...
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/mcf_fec.c')
-rw-r--r-- | hw/mcf_fec.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/hw/mcf_fec.c b/hw/mcf_fec.c index 6c0acc5789..179ec19e07 100644 --- a/hw/mcf_fec.c +++ b/hw/mcf_fec.c @@ -347,15 +347,15 @@ static void mcf_fec_write(void *opaque, target_phys_addr_t addr, uint32_t value) mcf_fec_update(s); } -static int mcf_fec_can_receive(void *opaque) +static int mcf_fec_can_receive(VLANClientState *vc) { - mcf_fec_state *s = (mcf_fec_state *)opaque; + mcf_fec_state *s = vc->opaque; return s->rx_enabled; } -static void mcf_fec_receive(void *opaque, const uint8_t *buf, int size) +static ssize_t mcf_fec_receive(VLANClientState *vc, const uint8_t *buf, size_t size) { - mcf_fec_state *s = (mcf_fec_state *)opaque; + mcf_fec_state *s = vc->opaque; mcf_fec_bd bd; uint32_t flags = 0; uint32_t addr; @@ -426,6 +426,7 @@ static void mcf_fec_receive(void *opaque, const uint8_t *buf, int size) s->rx_descriptor = addr; mcf_fec_enable_rx(s); mcf_fec_update(s); + return size; } static CPUReadMemoryFunc *mcf_fec_readfn[] = { @@ -462,7 +463,7 @@ void mcf_fec_init(NICInfo *nd, target_phys_addr_t base, qemu_irq *irq) cpu_register_physical_memory(base, 0x400, s->mmio_index); s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, - mcf_fec_receive, mcf_fec_can_receive, + mcf_fec_can_receive, mcf_fec_receive, NULL, mcf_fec_cleanup, s); memcpy(s->macaddr, nd->macaddr, 6); qemu_format_nic_info_str(s->vc, s->macaddr); |