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/opencores_eth.c | |
parent | 28a65891a0deb10b222890b9eb916ca32cb977bb (diff) | |
download | hqemu-b356f76de31e343121cdab3a01b39182edce9519.zip hqemu-b356f76de31e343121cdab3a01b39182edce9519.tar.gz |
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/opencores_eth.c')
-rw-r--r-- | hw/opencores_eth.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/opencores_eth.c b/hw/opencores_eth.c index 746a959..2496d4e 100644 --- a/hw/opencores_eth.c +++ b/hw/opencores_eth.c @@ -339,7 +339,7 @@ static void open_eth_reset(void *opaque) s->rx_desc = 0x40; mii_reset(&s->mii); - open_eth_set_link_status(&s->nic->nc); + open_eth_set_link_status(qemu_get_queue(s->nic)); } static int open_eth_can_receive(NetClientState *nc) @@ -499,7 +499,7 @@ static void open_eth_start_xmit(OpenEthState *s, desc *tx) if (tx_len > len) { memset(buf + len, 0, tx_len - len); } - qemu_send_packet(&s->nic->nc, buf, tx_len); + qemu_send_packet(qemu_get_queue(s->nic), buf, tx_len); if (tx->len_flags & TXD_WR) { s->tx_desc = 0; @@ -606,7 +606,7 @@ static void open_eth_mii_command_host_write(OpenEthState *s, uint32_t val) } else { s->regs[MIIRX_DATA] = 0xffff; } - SET_REGFIELD(s, MIISTATUS, LINKFAIL, s->nic->nc.link_down); + SET_REGFIELD(s, MIISTATUS, LINKFAIL, qemu_get_queue(s->nic)->link_down); } } |