[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 31/46] hw/net/etraxfs-eth: use qemu_configure_nic_device()
From: |
David Woodhouse |
Subject: |
[PATCH v3 31/46] hw/net/etraxfs-eth: use qemu_configure_nic_device() |
Date: |
Mon, 8 Jan 2024 20:27:00 +0000 |
From: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
hw/cris/axis_dev88.c | 9 ++++-----
hw/net/etraxfs_eth.c | 5 ++---
include/hw/cris/etraxfs.h | 2 +-
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/hw/cris/axis_dev88.c b/hw/cris/axis_dev88.c
index d82050d927..5556634921 100644
--- a/hw/cris/axis_dev88.c
+++ b/hw/cris/axis_dev88.c
@@ -308,15 +308,14 @@ void axisdev88_init(MachineState *machine)
/* Add the two ethernet blocks. */
dma_eth = g_malloc0(sizeof dma_eth[0] * 4); /* Allocate 4 channels. */
- etraxfs_eth_init(&nd_table[0], 0x30034000, 1, &dma_eth[0], &dma_eth[1]);
- if (nb_nics > 1) {
- etraxfs_eth_init(&nd_table[1], 0x30036000, 2, &dma_eth[2],
&dma_eth[3]);
- }
+ etraxfs_eth_init(0x30034000, 1, &dma_eth[0], &dma_eth[1]);
/* The DMA Connector block is missing, hardwire things for now. */
etraxfs_dmac_connect_client(etraxfs_dmac, 0, &dma_eth[0]);
etraxfs_dmac_connect_client(etraxfs_dmac, 1, &dma_eth[1]);
- if (nb_nics > 1) {
+
+ if (qemu_find_nic_info("etraxfs-eth", true, "fseth")) {
+ etraxfs_eth_init(0x30036000, 2, &dma_eth[2], &dma_eth[3]);
etraxfs_dmac_connect_client(etraxfs_dmac, 6, &dma_eth[2]);
etraxfs_dmac_connect_client(etraxfs_dmac, 7, &dma_eth[3]);
}
diff --git a/hw/net/etraxfs_eth.c b/hw/net/etraxfs_eth.c
index ba57a978d1..5faf20c782 100644
--- a/hw/net/etraxfs_eth.c
+++ b/hw/net/etraxfs_eth.c
@@ -647,15 +647,14 @@ static void etraxfs_eth_class_init(ObjectClass *klass,
void *data)
/* Instantiate an ETRAXFS Ethernet MAC. */
DeviceState *
-etraxfs_eth_init(NICInfo *nd, hwaddr base, int phyaddr,
+etraxfs_eth_init(hwaddr base, int phyaddr,
struct etraxfs_dma_client *dma_out,
struct etraxfs_dma_client *dma_in)
{
DeviceState *dev;
- qemu_check_nic_model(nd, "fseth");
dev = qdev_new("etraxfs-eth");
- qdev_set_nic_properties(dev, nd);
+ qemu_configure_nic_device(dev, true, "fseth");
qdev_prop_set_uint32(dev, "phyaddr", phyaddr);
/*
diff --git a/include/hw/cris/etraxfs.h b/include/hw/cris/etraxfs.h
index 467b529dc0..012c4e9974 100644
--- a/include/hw/cris/etraxfs.h
+++ b/include/hw/cris/etraxfs.h
@@ -31,7 +31,7 @@
#include "hw/sysbus.h"
#include "qapi/error.h"
-DeviceState *etraxfs_eth_init(NICInfo *nd, hwaddr base, int phyaddr,
+DeviceState *etraxfs_eth_init(hwaddr base, int phyaddr,
struct etraxfs_dma_client *dma_out,
struct etraxfs_dma_client *dma_in);
--
2.41.0
- Re: [PATCH v3 46/46] net: make nb_nics and nd_table[] static in net/net.c, (continued)
- [PATCH v3 44/46] hw/pci: remove pci_nic_init_nofail(), David Woodhouse, 2024/01/08
- [PATCH v3 26/46] hw/net/lan9118: use qemu_configure_nic_device(), David Woodhouse, 2024/01/08
- [PATCH v3 25/46] hw/net/smc91c111: use qemu_configure_nic_device(), David Woodhouse, 2024/01/08
- [PATCH v3 08/46] hw/arm/sbsa-ref: use pci_init_nic_devices(), David Woodhouse, 2024/01/08
- [PATCH v3 41/46] hw/sparc/sun4m: use qemu_find_nic_info(), David Woodhouse, 2024/01/08
- [PATCH v3 28/46] hw/arm/npcm7xx: use qemu_configure_nic_device, allow emc0/emc1 as aliases, David Woodhouse, 2024/01/08
- [PATCH v3 19/46] hw/sparc64/sun4u: use pci_init_nic_devices(), David Woodhouse, 2024/01/08
- [PATCH v3 06/46] hw/xen: use qemu_create_nic_bus_devices() to instantiate Xen NICs, David Woodhouse, 2024/01/08
- [PATCH v3 31/46] hw/net/etraxfs-eth: use qemu_configure_nic_device(),
David Woodhouse <=
- [PATCH v3 01/46] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info(), David Woodhouse, 2024/01/08
- Re: [PATCH v3 01/46] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info(), Thomas Huth, 2024/01/26
- Re: [PATCH v3 01/46] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info(), David Woodhouse, 2024/01/26
- Re: [PATCH v3 01/46] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info(), Thomas Huth, 2024/01/26
- Re: [PATCH v3 01/46] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info(), David Woodhouse, 2024/01/26
- Re: [PATCH v3 01/46] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info(), Thomas Huth, 2024/01/26
Re: [PATCH v3 01/46] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info(), Peter Maydell, 2024/01/26
- Re: [PATCH v3 01/46] net: add qemu_{configure,create}_nic_device(), qemu_find_nic_info(), David Woodhouse, 2024/01/26
- Re: [PATCH v3 01/46] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info(), Peter Maydell, 2024/01/26
- Re: [PATCH v3 01/46] net: add qemu_{configure,create}_nic_device(), qemu_find_nic_info(), David Woodhouse, 2024/01/26