aboutsummaryrefslogtreecommitdiff
path: root/hw/mcf_fec.c
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2013-01-30 19:12:23 +0800
committerAnthony Liguori <aliguori@us.ibm.com>2013-02-01 11:03:00 -0600
commitcc1f0f45425d0cca41ad421623f92bebc93a21a9 (patch)
tree8015fb30e1da7eab59fbbf236f790500a47cbea0 /hw/mcf_fec.c
parentb356f76de31e343121cdab3a01b39182edce9519 (diff)
net: introduce qemu_get_nic()
To support multiqueue, this patch introduces a helper qemu_get_nic() to get NICState from a NetClientState. The following patches would refactor this helper to support multiqueue. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/mcf_fec.c')
-rw-r--r--hw/mcf_fec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/mcf_fec.c b/hw/mcf_fec.c
index 8a90bf81ae..909e32b3e0 100644
--- a/hw/mcf_fec.c
+++ b/hw/mcf_fec.c
@@ -353,13 +353,13 @@ static void mcf_fec_write(void *opaque, hwaddr addr,
static int mcf_fec_can_receive(NetClientState *nc)
{
- mcf_fec_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
+ mcf_fec_state *s = qemu_get_nic_opaque(nc);
return s->rx_enabled;
}
static ssize_t mcf_fec_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
- mcf_fec_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
+ mcf_fec_state *s = qemu_get_nic_opaque(nc);
mcf_fec_bd bd;
uint32_t flags = 0;
uint32_t addr;
@@ -441,7 +441,7 @@ static const MemoryRegionOps mcf_fec_ops = {
static void mcf_fec_cleanup(NetClientState *nc)
{
- mcf_fec_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
+ mcf_fec_state *s = qemu_get_nic_opaque(nc);
memory_region_del_subregion(s->sysmem, &s->iomem);
memory_region_destroy(&s->iomem);