From cc1f0f45425d0cca41ad421623f92bebc93a21a9 Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Wed, 30 Jan 2013 19:12:23 +0800 Subject: 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 Signed-off-by: Anthony Liguori --- hw/ne2000.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'hw/ne2000.c') diff --git a/hw/ne2000.c b/hw/ne2000.c index 03c420998b..c989190c0e 100644 --- a/hw/ne2000.c +++ b/hw/ne2000.c @@ -167,7 +167,7 @@ static int ne2000_buffer_full(NE2000State *s) int ne2000_can_receive(NetClientState *nc) { - NE2000State *s = DO_UPCAST(NICState, nc, nc)->opaque; + NE2000State *s = qemu_get_nic_opaque(nc); if (s->cmd & E8390_STOP) return 1; @@ -178,7 +178,7 @@ int ne2000_can_receive(NetClientState *nc) ssize_t ne2000_receive(NetClientState *nc, const uint8_t *buf, size_t size_) { - NE2000State *s = DO_UPCAST(NICState, nc, nc)->opaque; + NE2000State *s = qemu_get_nic_opaque(nc); int size = size_; uint8_t *p; unsigned int total_len, next, avail, len, index, mcast_idx; @@ -706,7 +706,7 @@ void ne2000_setup_io(NE2000State *s, unsigned size) static void ne2000_cleanup(NetClientState *nc) { - NE2000State *s = DO_UPCAST(NICState, nc, nc)->opaque; + NE2000State *s = qemu_get_nic_opaque(nc); s->nic = NULL; } -- cgit 1.4.1