diff options
author | Jason Wang <jasowang@redhat.com> | 2013-01-30 19:12:23 +0800 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-02-01 11:03:00 -0600 |
commit | cc1f0f45425d0cca41ad421623f92bebc93a21a9 (patch) | |
tree | 8015fb30e1da7eab59fbbf236f790500a47cbea0 /hw/milkymist-minimac2.c | |
parent | b356f76de31e343121cdab3a01b39182edce9519 (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/milkymist-minimac2.c')
-rw-r--r-- | hw/milkymist-minimac2.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/milkymist-minimac2.c b/hw/milkymist-minimac2.c index 2a8a4efa46..9992dcceaf 100644 --- a/hw/milkymist-minimac2.c +++ b/hw/milkymist-minimac2.c @@ -280,7 +280,7 @@ static void update_rx_interrupt(MilkymistMinimac2State *s) static ssize_t minimac2_rx(NetClientState *nc, const uint8_t *buf, size_t size) { - MilkymistMinimac2State *s = DO_UPCAST(NICState, nc, nc)->opaque; + MilkymistMinimac2State *s = qemu_get_nic_opaque(nc); uint32_t r_count; uint32_t r_state; @@ -410,7 +410,7 @@ static const MemoryRegionOps minimac2_ops = { static int minimac2_can_rx(NetClientState *nc) { - MilkymistMinimac2State *s = DO_UPCAST(NICState, nc, nc)->opaque; + MilkymistMinimac2State *s = qemu_get_nic_opaque(nc); if (s->regs[R_STATE0] == STATE_LOADED) { return 1; @@ -424,7 +424,7 @@ static int minimac2_can_rx(NetClientState *nc) static void minimac2_cleanup(NetClientState *nc) { - MilkymistMinimac2State *s = DO_UPCAST(NICState, nc, nc)->opaque; + MilkymistMinimac2State *s = qemu_get_nic_opaque(nc); s->nic = NULL; } |