[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 35/46] hw/mips/mipssim: use qemu_create_nic_device()
From: |
David Woodhouse |
Subject: |
[PATCH v3 35/46] hw/mips/mipssim: use qemu_create_nic_device() |
Date: |
Mon, 8 Jan 2024 20:27:04 +0000 |
From: David Woodhouse <dwmw@amazon.co.uk>
The MIPS SIM platform instantiates its NIC only if a corresponding
configuration exists for it. Use qemu_create_nic_device() function for
that.
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
hw/mips/mipssim.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/hw/mips/mipssim.c b/hw/mips/mipssim.c
index 01e323904d..16af31648e 100644
--- a/hw/mips/mipssim.c
+++ b/hw/mips/mipssim.c
@@ -118,13 +118,15 @@ static void main_cpu_reset(void *opaque)
}
}
-static void mipsnet_init(int base, qemu_irq irq, NICInfo *nd)
+static void mipsnet_init(int base, qemu_irq irq)
{
DeviceState *dev;
SysBusDevice *s;
- dev = qdev_new("mipsnet");
- qdev_set_nic_properties(dev, nd);
+ dev = qemu_create_nic_device("mipsnet", true, NULL);
+ if (!dev) {
+ return;
+ }
s = SYS_BUS_DEVICE(dev);
sysbus_realize_and_unref(s, &error_fatal);
@@ -225,9 +227,8 @@ mips_mipssim_init(MachineState *machine)
sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0));
}
- if (nd_table[0].used)
- /* MIPSnet uses the MIPS CPU INT0, which is interrupt 2. */
- mipsnet_init(0x4200, env->irq[2], &nd_table[0]);
+ /* MIPSnet uses the MIPS CPU INT0, which is interrupt 2. */
+ mipsnet_init(0x4200, env->irq[2]);
}
static void mips_mipssim_machine_init(MachineClass *mc)
--
2.41.0
- [PATCH v3 36/46] hw/mips/jazz: use qemu_find_nic_info(), (continued)
- [PATCH v3 36/46] hw/mips/jazz: use qemu_find_nic_info(), David Woodhouse, 2024/01/08
- [PATCH v3 39/46] hw/riscv: use qemu_configure_nic_device(), David Woodhouse, 2024/01/08
- [PATCH v3 29/46] hw/arm/stellaris: use qemu_find_nic_info(), David Woodhouse, 2024/01/08
- [PATCH v3 30/46] hw/arm: use qemu_configure_nic_device(), David Woodhouse, 2024/01/08
- [PATCH v3 21/46] hw/arm/allwinner: use qemu_configure_nic_device(), David Woodhouse, 2024/01/08
- [PATCH v3 38/46] hw/openrisc/openrisc_sim: use qemu_create_nic_device(), David Woodhouse, 2024/01/08
- [PATCH v3 18/46] hw/sh4/r2d: use pci_init_nic_devices(), David Woodhouse, 2024/01/08
- [PATCH v3 10/46] hw/hppa: use pci_init_nic_devices(), David Woodhouse, 2024/01/08
- [PATCH v3 42/46] hw/xtensa/xtfpga: use qemu_create_nic_device(), David Woodhouse, 2024/01/08
- [PATCH v3 35/46] hw/mips/mipssim: use qemu_create_nic_device(),
David Woodhouse <=
- [PATCH v3 20/46] hw/xtensa/virt: use pci_init_nic_devices(), David Woodhouse, 2024/01/08
- [PATCH v3 13/46] hw/mips/malta: use pci_init_nic_devices(), David Woodhouse, 2024/01/08
- [PATCH v3 03/46] net: add qemu_create_nic_bus_devices(), David Woodhouse, 2024/01/08
- [PATCH v3 12/46] hw/mips/fuloong2e: use pci_init_nic_devices(), David Woodhouse, 2024/01/08
- [PATCH v3 24/46] hw/arm/fsl: use qemu_configure_nic_device(), David Woodhouse, 2024/01/08
- [PATCH v3 45/46] net: remove qemu_show_nic_models(), qemu_find_nic_model(), David Woodhouse, 2024/01/08