[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 35/47] hw/mips/mipssim: use qemu_create_nic_device()
From: |
David Woodhouse |
Subject: |
[PATCH v4 35/47] hw/mips/mipssim: use qemu_create_nic_device() |
Date: |
Fri, 26 Jan 2024 17:25:12 +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.43.0
- [PATCH v4 05/47] hw/i386/pc: use qemu_get_nic_info() and pci_init_nic_devices(), (continued)
- [PATCH v4 05/47] hw/i386/pc: use qemu_get_nic_info() and pci_init_nic_devices(), David Woodhouse, 2024/01/26
- [PATCH v4 21/47] hw/arm/allwinner: use qemu_configure_nic_device(), David Woodhouse, 2024/01/26
- [PATCH v4 04/47] hw/pci: add pci_init_nic_devices(), pci_init_nic_in_slot(), David Woodhouse, 2024/01/26
- [PATCH v4 25/47] hw/net/smc91c111: use qemu_configure_nic_device(), David Woodhouse, 2024/01/26
- [PATCH v4 38/47] hw/net/lasi_i82596: use qemu_create_nic_device(), David Woodhouse, 2024/01/26
- [PATCH v4 39/47] hw/openrisc/openrisc_sim: use qemu_create_nic_device(), David Woodhouse, 2024/01/26
- [PATCH v4 14/47] hw/mips/loongson3_virt: use pci_init_nic_devices(), David Woodhouse, 2024/01/26
- [PATCH v4 37/47] hw/net/lasi_i82596: Re-enable build, David Woodhouse, 2024/01/26
- [PATCH v4 35/47] hw/mips/mipssim: use qemu_create_nic_device(),
David Woodhouse <=
- [PATCH v4 46/47] net: remove qemu_show_nic_models(), qemu_find_nic_model(), David Woodhouse, 2024/01/26
- [PATCH v4 13/47] hw/mips/malta: use pci_init_nic_devices(), David Woodhouse, 2024/01/26
- [PATCH v4 30/47] hw/arm: use qemu_configure_nic_device(), David Woodhouse, 2024/01/26
- [PATCH v4 40/47] hw/riscv: use qemu_configure_nic_device(), David Woodhouse, 2024/01/26
- [PATCH v4 36/47] hw/mips/jazz: use qemu_find_nic_info(), David Woodhouse, 2024/01/26
- [PATCH v4 26/47] hw/net/lan9118: use qemu_configure_nic_device(), David Woodhouse, 2024/01/26
- [PATCH v4 17/47] hw/ppc: use pci_init_nic_devices(), David Woodhouse, 2024/01/26
- [PATCH v4 12/47] hw/mips/fuloong2e: use pci_init_nic_devices(), David Woodhouse, 2024/01/26
- [PATCH v4 20/47] hw/xtensa/virt: use pci_init_nic_devices(), David Woodhouse, 2024/01/26
- [PATCH v4 41/47] hw/s390x/s390-virtio-ccw: use qemu_create_nic_device(), David Woodhouse, 2024/01/26