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/eepro100.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'hw/eepro100.c') diff --git a/hw/eepro100.c b/hw/eepro100.c index 5b77bdc47c..f9856ae8c6 100644 --- a/hw/eepro100.c +++ b/hw/eepro100.c @@ -1619,7 +1619,7 @@ static const MemoryRegionOps eepro100_ops = { static int nic_can_receive(NetClientState *nc) { - EEPRO100State *s = DO_UPCAST(NICState, nc, nc)->opaque; + EEPRO100State *s = qemu_get_nic_opaque(nc); TRACE(RXTX, logout("%p\n", s)); return get_ru_state(s) == ru_ready; #if 0 @@ -1633,7 +1633,7 @@ static ssize_t nic_receive(NetClientState *nc, const uint8_t * buf, size_t size) * - Magic packets should set bit 30 in power management driver register. * - Interesting packets should set bit 29 in power management driver register. */ - EEPRO100State *s = DO_UPCAST(NICState, nc, nc)->opaque; + EEPRO100State *s = qemu_get_nic_opaque(nc); uint16_t rfd_status = 0xa000; #if defined(CONFIG_PAD_RECEIVED_FRAMES) uint8_t min_buf[60]; @@ -1835,7 +1835,7 @@ static const VMStateDescription vmstate_eepro100 = { static void nic_cleanup(NetClientState *nc) { - EEPRO100State *s = DO_UPCAST(NICState, nc, nc)->opaque; + EEPRO100State *s = qemu_get_nic_opaque(nc); s->nic = NULL; } -- cgit v1.2.3-55-g7522