diff options
author | Jason Wang <jasowang@redhat.com> | 2013-01-30 19:12:22 +0800 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-02-01 11:02:55 -0600 |
commit | b356f76de31e343121cdab3a01b39182edce9519 (patch) | |
tree | 917613c9d0047ba2b4b67a5a4e6146c62b2a62d7 /hw/pcnet.c | |
parent | 28a65891a0deb10b222890b9eb916ca32cb977bb (diff) | |
download | qemu-b356f76de31e343121cdab3a01b39182edce9519.tar.gz qemu-b356f76de31e343121cdab3a01b39182edce9519.tar.bz2 qemu-b356f76de31e343121cdab3a01b39182edce9519.zip |
net: introduce qemu_get_queue()
To support multiqueue, the patch introduce a helper qemu_get_queue()
which is used to get the NetClientState of a device. 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 | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/pcnet.c b/hw/pcnet.c index 30f100007a..2126e22ffa 100644 --- a/hw/pcnet.c +++ b/hw/pcnet.c @@ -1261,11 +1261,12 @@ static void pcnet_transmit(PCNetState *s) if (BCR_SWSTYLE(s) == 1) add_crc = !GET_FIELD(tmd.status, TMDS, NOFCS); s->looptest = add_crc ? PCNET_LOOPTEST_CRC : PCNET_LOOPTEST_NOCRC; - pcnet_receive(&s->nic->nc, s->buffer, s->xmit_pos); + pcnet_receive(qemu_get_queue(s->nic), s->buffer, s->xmit_pos); s->looptest = 0; } else if (s->nic) - qemu_send_packet(&s->nic->nc, s->buffer, s->xmit_pos); + qemu_send_packet(qemu_get_queue(s->nic), s->buffer, + s->xmit_pos); s->csr[0] &= ~0x0008; /* clear TDMD */ s->csr[4] |= 0x0004; /* set TXSTRT */ @@ -1730,7 +1731,7 @@ int pcnet_common_init(DeviceState *dev, PCNetState *s, NetClientInfo *info) qemu_macaddr_default_if_unset(&s->conf.macaddr); s->nic = qemu_new_nic(info, &s->conf, object_get_typename(OBJECT(dev)), dev->id, s); - qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a); + qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a); add_boot_device_path(s->conf.bootindex, dev, "/ethernet-phy@0"); |