summaryrefslogtreecommitdiffstats
path: root/hw/lan9118.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/lan9118.c
parentb356f76de31e343121cdab3a01b39182edce9519 (diff)
downloadhqemu-cc1f0f45425d0cca41ad421623f92bebc93a21a9.zip
hqemu-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/lan9118.c')
-rw-r--r--hw/lan9118.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/lan9118.c b/hw/lan9118.c
index 262f389..0e844e5 100644
--- a/hw/lan9118.c
+++ b/hw/lan9118.c
@@ -386,7 +386,7 @@ static void phy_update_link(lan9118_state *s)
static void lan9118_set_link(NetClientState *nc)
{
- phy_update_link(DO_UPCAST(NICState, nc, nc)->opaque);
+ phy_update_link(qemu_get_nic_opaque(nc));
}
static void phy_reset(lan9118_state *s)
@@ -512,7 +512,7 @@ static int lan9118_filter(lan9118_state *s, const uint8_t *addr)
static ssize_t lan9118_receive(NetClientState *nc, const uint8_t *buf,
size_t size)
{
- lan9118_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
+ lan9118_state *s = qemu_get_nic_opaque(nc);
int fifo_len;
int offset;
int src_pos;
@@ -1306,7 +1306,7 @@ static const MemoryRegionOps lan9118_16bit_mem_ops = {
static void lan9118_cleanup(NetClientState *nc)
{
- lan9118_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
+ lan9118_state *s = qemu_get_nic_opaque(nc);
s->nic = NULL;
}
OpenPOWER on IntegriCloud