mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
net: introduce qemu_get_nic()
To support multiqueue, this patch introduces a helper qemu_get_nic() to get NICState from a NetClientState. 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
b356f76de3
commit
cc1f0f4542
28 changed files with 92 additions and 78 deletions
|
@ -280,7 +280,7 @@ static void update_rx_interrupt(MilkymistMinimac2State *s)
|
|||
|
||||
static ssize_t minimac2_rx(NetClientState *nc, const uint8_t *buf, size_t size)
|
||||
{
|
||||
MilkymistMinimac2State *s = DO_UPCAST(NICState, nc, nc)->opaque;
|
||||
MilkymistMinimac2State *s = qemu_get_nic_opaque(nc);
|
||||
|
||||
uint32_t r_count;
|
||||
uint32_t r_state;
|
||||
|
@ -410,7 +410,7 @@ static const MemoryRegionOps minimac2_ops = {
|
|||
|
||||
static int minimac2_can_rx(NetClientState *nc)
|
||||
{
|
||||
MilkymistMinimac2State *s = DO_UPCAST(NICState, nc, nc)->opaque;
|
||||
MilkymistMinimac2State *s = qemu_get_nic_opaque(nc);
|
||||
|
||||
if (s->regs[R_STATE0] == STATE_LOADED) {
|
||||
return 1;
|
||||
|
@ -424,7 +424,7 @@ static int minimac2_can_rx(NetClientState *nc)
|
|||
|
||||
static void minimac2_cleanup(NetClientState *nc)
|
||||
{
|
||||
MilkymistMinimac2State *s = DO_UPCAST(NICState, nc, nc)->opaque;
|
||||
MilkymistMinimac2State *s = qemu_get_nic_opaque(nc);
|
||||
|
||||
s->nic = NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue