aboutsummaryrefslogtreecommitdiff
path: root/hw/lan9118.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/lan9118.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/lan9118.c')
-rw-r--r--hw/lan9118.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/lan9118.c b/hw/lan9118.c
index 6596979..262f389 100644
--- a/hw/lan9118.c
+++ b/hw/lan9118.c
@@ -341,7 +341,7 @@ static void lan9118_update(lan9118_state *s)
static void lan9118_mac_changed(lan9118_state *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);
}
static void lan9118_reload_eeprom(lan9118_state *s)
@@ -373,7 +373,7 @@ static void phy_update_irq(lan9118_state *s)
static void phy_update_link(lan9118_state *s)
{
/* Autonegotiation status mirrors link status. */
- if (s->nic->nc.link_down) {
+ if (qemu_get_queue(s->nic)->link_down) {
s->phy_status &= ~0x0024;
s->phy_int |= PHY_INT_DOWN;
} else {
@@ -657,9 +657,9 @@ static void do_tx_packet(lan9118_state *s)
/* FIXME: Honor TX disable, and allow queueing of packets. */
if (s->phy_control & 0x4000) {
/* This assumes the receive routine doesn't touch the VLANClient. */
- lan9118_receive(&s->nic->nc, s->txp->data, s->txp->len);
+ lan9118_receive(qemu_get_queue(s->nic), s->txp->data, s->txp->len);
} else {
- qemu_send_packet(&s->nic->nc, s->txp->data, s->txp->len);
+ qemu_send_packet(qemu_get_queue(s->nic), s->txp->data, s->txp->len);
}
s->txp->fifo_used = 0;
@@ -1335,7 +1335,7 @@ static int lan9118_init1(SysBusDevice *dev)
s->nic = qemu_new_nic(&net_lan9118_info, &s->conf,
object_get_typename(OBJECT(dev)), dev->qdev.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);
s->eeprom[0] = 0xa5;
for (i = 0; i < 6; i++) {
s->eeprom[i + 1] = s->conf.macaddr.a[i];