summaryrefslogtreecommitdiffstats
path: root/hw/cadence_gem.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/cadence_gem.c
parent28a65891a0deb10b222890b9eb916ca32cb977bb (diff)
downloadhqemu-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/cadence_gem.c')
-rw-r--r--hw/cadence_gem.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/cadence_gem.c b/hw/cadence_gem.c
index b77423d..b8071a4 100644
--- a/hw/cadence_gem.c
+++ b/hw/cadence_gem.c
@@ -389,10 +389,10 @@ static void gem_init_register_masks(GemState *s)
*/
static void phy_update_link(GemState *s)
{
- DB_PRINT("down %d\n", s->nic->nc.link_down);
+ DB_PRINT("down %d\n", qemu_get_queue(s->nic)->link_down);
/* Autonegotiation status mirrors link status. */
- if (s->nic->nc.link_down) {
+ if (qemu_get_queue(s->nic)->link_down) {
s->phy_regs[PHY_REG_STATUS] &= ~(PHY_REG_STATUS_ANEGCMPL |
PHY_REG_STATUS_LINK);
s->phy_regs[PHY_REG_INT_ST] |= PHY_REG_INT_ST_LINKC;
@@ -908,9 +908,10 @@ static void gem_transmit(GemState *s)
/* Send the packet somewhere */
if (s->phy_loop) {
- gem_receive(&s->nic->nc, tx_packet, total_bytes);
+ gem_receive(qemu_get_queue(s->nic), tx_packet, total_bytes);
} else {
- qemu_send_packet(&s->nic->nc, tx_packet, total_bytes);
+ qemu_send_packet(qemu_get_queue(s->nic), tx_packet,
+ total_bytes);
}
/* Prepare for next packet */
OpenPOWER on IntegriCloud