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/pcnet.c | |
parent | b356f76de31e343121cdab3a01b39182edce9519 (diff) |
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/pcnet.c')
-rw-r--r-- | hw/pcnet.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/pcnet.c b/hw/pcnet.c index 2126e22ffa..e0de1e3458 100644 --- a/hw/pcnet.c +++ b/hw/pcnet.c @@ -1006,7 +1006,7 @@ static int pcnet_tdte_poll(PCNetState *s) int pcnet_can_receive(NetClientState *nc) { - PCNetState *s = DO_UPCAST(NICState, nc, nc)->opaque; + PCNetState *s = qemu_get_nic_opaque(nc); if (CSR_STOP(s) || CSR_SPND(s)) return 0; @@ -1017,7 +1017,7 @@ int pcnet_can_receive(NetClientState *nc) ssize_t pcnet_receive(NetClientState *nc, const uint8_t *buf, size_t size_) { - PCNetState *s = DO_UPCAST(NICState, nc, nc)->opaque; + PCNetState *s = qemu_get_nic_opaque(nc); int is_padr = 0, is_bcast = 0, is_ladr = 0; uint8_t buf1[60]; int remaining; @@ -1199,7 +1199,7 @@ ssize_t pcnet_receive(NetClientState *nc, const uint8_t *buf, size_t size_) void pcnet_set_link_status(NetClientState *nc) { - PCNetState *d = DO_UPCAST(NICState, nc, nc)->opaque; + PCNetState *d = qemu_get_nic_opaque(nc); d->lnkst = nc->link_down ? 0 : 0x40; } |