summaryrefslogtreecommitdiff
path: root/hw/eepro100.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/eepro100.c
parentb356f76de31e343121cdab3a01b39182edce9519 (diff)
downloadqemu-cc1f0f45425d0cca41ad421623f92bebc93a21a9.tar.gz
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/eepro100.c')
-rw-r--r--hw/eepro100.c6
1 files changed, 3 insertions, 3 deletions
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;
}