diff options
author | Jason Wang <jasowang@redhat.com> | 2013-01-30 19:12:23 +0800 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-02-01 11:03:00 -0600 |
commit | cc1f0f45425d0cca41ad421623f92bebc93a21a9 (patch) | |
tree | 8015fb30e1da7eab59fbbf236f790500a47cbea0 /hw/xilinx_ethlite.c | |
parent | b356f76de31e343121cdab3a01b39182edce9519 (diff) | |
download | qemu-cc1f0f45425d0cca41ad421623f92bebc93a21a9.zip qemu-cc1f0f45425d0cca41ad421623f92bebc93a21a9.tar.gz qemu-cc1f0f45425d0cca41ad421623f92bebc93a21a9.tar.bz2 |
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/xilinx_ethlite.c')
-rw-r--r-- | hw/xilinx_ethlite.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/xilinx_ethlite.c b/hw/xilinx_ethlite.c index bdd6ab2..21c6f8c 100644 --- a/hw/xilinx_ethlite.c +++ b/hw/xilinx_ethlite.c @@ -167,7 +167,7 @@ static const MemoryRegionOps eth_ops = { static int eth_can_rx(NetClientState *nc) { - struct xlx_ethlite *s = DO_UPCAST(NICState, nc, nc)->opaque; + struct xlx_ethlite *s = qemu_get_nic_opaque(nc); unsigned int rxbase = s->rxbuf * (0x800 / 4); return !(s->regs[rxbase + R_RX_CTRL0] & CTRL_S); @@ -175,7 +175,7 @@ static int eth_can_rx(NetClientState *nc) static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size) { - struct xlx_ethlite *s = DO_UPCAST(NICState, nc, nc)->opaque; + struct xlx_ethlite *s = qemu_get_nic_opaque(nc); unsigned int rxbase = s->rxbuf * (0x800 / 4); /* DA filter. */ @@ -201,7 +201,7 @@ static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size) static void eth_cleanup(NetClientState *nc) { - struct xlx_ethlite *s = DO_UPCAST(NICState, nc, nc)->opaque; + struct xlx_ethlite *s = qemu_get_nic_opaque(nc); s->nic = NULL; } |