aboutsummaryrefslogtreecommitdiff
path: root/hw/ne2000.c
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2013-01-30 19:12:22 +0800
committerAnthony Liguori <aliguori@us.ibm.com>2013-02-01 11:02:55 -0600
commitb356f76de31e343121cdab3a01b39182edce9519 (patch)
tree917613c9d0047ba2b4b67a5a4e6146c62b2a62d7 /hw/ne2000.c
parent28a65891a0deb10b222890b9eb916ca32cb977bb (diff)
downloadqemu-b356f76de31e343121cdab3a01b39182edce9519.zip
qemu-b356f76de31e343121cdab3a01b39182edce9519.tar.gz
qemu-b356f76de31e343121cdab3a01b39182edce9519.tar.bz2
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/ne2000.c')
-rw-r--r--hw/ne2000.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/ne2000.c b/hw/ne2000.c
index 872115c..03c4209 100644
--- a/hw/ne2000.c
+++ b/hw/ne2000.c
@@ -300,7 +300,8 @@ static void ne2000_ioport_write(void *opaque, uint32_t addr, uint32_t val)
index -= NE2000_PMEM_SIZE;
/* fail safe: check range on the transmitted length */
if (index + s->tcnt <= NE2000_PMEM_END) {
- qemu_send_packet(&s->nic->nc, s->mem + index, s->tcnt);
+ qemu_send_packet(qemu_get_queue(s->nic), s->mem + index,
+ s->tcnt);
}
/* signal end of transfer */
s->tsr = ENTSR_PTX;
@@ -737,7 +738,7 @@ static int pci_ne2000_init(PCIDevice *pci_dev)
s->nic = qemu_new_nic(&net_ne2000_info, &s->c,
object_get_typename(OBJECT(pci_dev)), pci_dev->qdev.id, s);
- qemu_format_nic_info_str(&s->nic->nc, s->c.macaddr.a);
+ qemu_format_nic_info_str(qemu_get_queue(s->nic), s->c.macaddr.a);
add_boot_device_path(s->c.bootindex, &pci_dev->qdev, "/ethernet-phy@0");
@@ -750,7 +751,7 @@ static void pci_ne2000_exit(PCIDevice *pci_dev)
NE2000State *s = &d->ne2000;
memory_region_destroy(&s->io);
- qemu_del_net_client(&s->nic->nc);
+ qemu_del_net_client(qemu_get_queue(s->nic));
}
static Property ne2000_properties[] = {