summaryrefslogtreecommitdiffstats
path: root/hw/smc91c111.c
diff options
context:
space:
mode:
authorJason Wang2013-01-30 12:12:23 +0100
committerAnthony Liguori2013-02-01 18:03:00 +0100
commitcc1f0f45425d0cca41ad421623f92bebc93a21a9 (patch)
tree8015fb30e1da7eab59fbbf236f790500a47cbea0 /hw/smc91c111.c
parentnet: introduce qemu_get_queue() (diff)
downloadqemu-cc1f0f45425d0cca41ad421623f92bebc93a21a9.tar.gz
qemu-cc1f0f45425d0cca41ad421623f92bebc93a21a9.tar.xz
qemu-cc1f0f45425d0cca41ad421623f92bebc93a21a9.zip
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/smc91c111.c')
-rw-r--r--hw/smc91c111.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/smc91c111.c b/hw/smc91c111.c
index cf79c69b7e..67fd074d85 100644
--- a/hw/smc91c111.c
+++ b/hw/smc91c111.c
@@ -631,7 +631,7 @@ static uint32_t smc91c111_readl(void *opaque, hwaddr offset)
static int smc91c111_can_receive(NetClientState *nc)
{
- smc91c111_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
+ smc91c111_state *s = qemu_get_nic_opaque(nc);
if ((s->rcr & RCR_RXEN) == 0 || (s->rcr & RCR_SOFT_RST))
return 1;
@@ -642,7 +642,7 @@ static int smc91c111_can_receive(NetClientState *nc)
static ssize_t smc91c111_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
- smc91c111_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
+ smc91c111_state *s = qemu_get_nic_opaque(nc);
int status;
int packetsize;
uint32_t crc;
@@ -731,7 +731,7 @@ static const MemoryRegionOps smc91c111_mem_ops = {
static void smc91c111_cleanup(NetClientState *nc)
{
- smc91c111_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
+ smc91c111_state *s = qemu_get_nic_opaque(nc);
s->nic = NULL;
}