mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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>
This commit is contained in:
parent
28a65891a0
commit
b356f76de3
28 changed files with 140 additions and 115 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue