From: David Woodhouse <dwmw2@infradead.org>
To: qemu-devel@nongnu.org
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
"Beniamino Galvani" <b.galvani@gmail.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Strahinja Jankovic" <strahinja.p.jankovic@gmail.com>,
"Niek Linnenbank" <nieklinnenbank@gmail.com>,
"Cédric Le Goater" <clg@kaod.org>,
"Andrew Jeffery" <andrew@codeconstruct.com.au>,
"Joel Stanley" <joel@jms.id.au>,
"Igor Mitsyanko" <i.mitsyanko@gmail.com>,
"Jean-Christophe Dubois" <jcd@tribudubois.net>,
"Andrey Smirnov" <andrew.smirnov@gmail.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Rob Herring" <robh@kernel.org>,
"Subbaraya Sundeep" <sundeep.lkml@gmail.com>,
"Jan Kiszka" <jan.kiszka@web.de>,
"Tyrone Ting" <kfting@nuvoton.com>,
"Hao Wu" <wuhaotsh@google.com>,
"Radoslaw Biernacki" <rad@semihalf.com>,
"Leif Lindholm" <quic_llindhol@quicinc.com>,
"Marcin Juszkiewicz" <marcin.juszkiewicz@linaro.org>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
"Alistair Francis" <alistair@alistair23.me>,
"Helge Deller" <deller@gmx.de>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Song Gao" <gaosong@loongson.cn>,
"Thomas Huth" <huth@tuxfamily.org>,
"Laurent Vivier" <laurent@vivier.eu>,
"Huacai Chen" <chenhuacai@kernel.org>,
"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
"Hervé Poussineau" <hpoussin@reactos.org>,
"Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
"Aurelien Jarno" <aurelien@aurel32.net>,
"Jason Wang" <jasowang@redhat.com>, "Jia Liu" <proljc@gmail.com>,
"Stafford Horne" <shorne@gmail.com>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Daniel Henrique Barboza" <danielhb413@gmail.com>,
"David Gibson" <david@gibson.dropbear.id.au>,
"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
"Bin Meng" <bin.meng@windriver.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Weiwei Li" <liweiwei@iscas.ac.cn>,
"Liu Zhiwei" <zhiwei_liu@linux.alibaba.com>,
"David Hildenbrand" <david@redhat.com>,
"Ilya Leoshkevich" <iii@linux.ibm.com>,
"Halil Pasic" <pasic@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>,
"Eric Farman" <farman@linux.ibm.com>,
"Yoshinori Sato" <ysato@users.sourceforge.jp>,
"Magnus Damm" <magnus.damm@gmail.com>,
"Artyom Tarasenko" <atar4qemu@gmail.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Anthony Perard" <anthony.perard@citrix.com>,
"Paul Durrant" <paul@xen.org>,
"Max Filippov" <jcmvbkbc@gmail.com>,
qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org,
qemu-s390x@nongnu.org, xen-devel@lists.xenproject.org
Subject: [PATCH for-8.3 v2 30/46] hw/arm: use qemu_configure_nic_device()
Date: Mon, 6 Nov 2023 19:49:35 +0000 [thread overview]
Message-ID: <20231106195352.301038-31-dwmw2@infradead.org> (raw)
In-Reply-To: <20231106195352.301038-1-dwmw2@infradead.org>
From: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
hw/arm/mps2-tz.c | 8 ++------
hw/arm/msf2-soc.c | 6 +-----
hw/arm/musicpal.c | 3 +--
hw/arm/xilinx_zynq.c | 11 ++++-------
hw/arm/xlnx-versal.c | 7 +------
hw/arm/xlnx-zynqmp.c | 8 +-------
6 files changed, 10 insertions(+), 33 deletions(-)
diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c
index eae3639da2..6808143a07 100644
--- a/hw/arm/mps2-tz.c
+++ b/hw/arm/mps2-tz.c
@@ -499,14 +499,12 @@ static MemoryRegion *make_eth_dev(MPS2TZMachineState *mms, void *opaque,
const PPCExtraData *extradata)
{
SysBusDevice *s;
- NICInfo *nd = &nd_table[0];
/* In hardware this is a LAN9220; the LAN9118 is software compatible
* except that it doesn't support the checksum-offload feature.
*/
- qemu_check_nic_model(nd, "lan9118");
mms->lan9118 = qdev_new(TYPE_LAN9118);
- qdev_set_nic_properties(mms->lan9118, nd);
+ qemu_configure_nic_device(mms->lan9118, true, NULL);
s = SYS_BUS_DEVICE(mms->lan9118);
sysbus_realize_and_unref(s, &error_fatal);
@@ -524,7 +522,6 @@ static MemoryRegion *make_eth_usb(MPS2TZMachineState *mms, void *opaque,
* irqs[] is the ethernet IRQ.
*/
SysBusDevice *s;
- NICInfo *nd = &nd_table[0];
memory_region_init(&mms->eth_usb_container, OBJECT(mms),
"mps2-tz-eth-usb-container", 0x200000);
@@ -533,9 +530,8 @@ static MemoryRegion *make_eth_usb(MPS2TZMachineState *mms, void *opaque,
* In hardware this is a LAN9220; the LAN9118 is software compatible
* except that it doesn't support the checksum-offload feature.
*/
- qemu_check_nic_model(nd, "lan9118");
mms->lan9118 = qdev_new(TYPE_LAN9118);
- qdev_set_nic_properties(mms->lan9118, nd);
+ qemu_configure_nic_device(mms->lan9118, true, NULL);
s = SYS_BUS_DEVICE(mms->lan9118);
sysbus_realize_and_unref(s, &error_fatal);
diff --git a/hw/arm/msf2-soc.c b/hw/arm/msf2-soc.c
index b5fe9f364d..35bf1d64e1 100644
--- a/hw/arm/msf2-soc.c
+++ b/hw/arm/msf2-soc.c
@@ -197,12 +197,8 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
g_free(bus_name);
}
- /* FIXME use qdev NIC properties instead of nd_table[] */
- if (nd_table[0].used) {
- qemu_check_nic_model(&nd_table[0], TYPE_MSS_EMAC);
- qdev_set_nic_properties(DEVICE(&s->emac), &nd_table[0]);
- }
dev = DEVICE(&s->emac);
+ qemu_configure_nic_device(dev, true, NULL);
object_property_set_link(OBJECT(&s->emac), "ahb-bus",
OBJECT(get_system_memory()), &error_abort);
if (!sysbus_realize(SYS_BUS_DEVICE(&s->emac), errp)) {
diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
index 9703bfb97f..a60139ce53 100644
--- a/hw/arm/musicpal.c
+++ b/hw/arm/musicpal.c
@@ -1286,9 +1286,8 @@ static void musicpal_init(MachineState *machine)
}
sysbus_create_simple(TYPE_MV88W8618_FLASHCFG, MP_FLASHCFG_BASE, NULL);
- qemu_check_nic_model(&nd_table[0], "mv88w8618");
dev = qdev_new(TYPE_MV88W8618_ETH);
- qdev_set_nic_properties(dev, &nd_table[0]);
+ qemu_configure_nic_device(dev, true, "mv88w8618");
object_property_set_link(OBJECT(dev), "dma-memory",
OBJECT(get_system_memory()), &error_fatal);
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c
index dbb9793aa1..73a6472b91 100644
--- a/hw/arm/xilinx_zynq.c
+++ b/hw/arm/xilinx_zynq.c
@@ -108,16 +108,13 @@ static void zynq_write_board_setup(ARMCPU *cpu,
static struct arm_boot_info zynq_binfo = {};
-static void gem_init(NICInfo *nd, uint32_t base, qemu_irq irq)
+static void gem_init(uint32_t base, qemu_irq irq)
{
DeviceState *dev;
SysBusDevice *s;
dev = qdev_new(TYPE_CADENCE_GEM);
- if (nd->used) {
- qemu_check_nic_model(nd, TYPE_CADENCE_GEM);
- qdev_set_nic_properties(dev, nd);
- }
+ qemu_configure_nic_device(dev, true, NULL);
object_property_set_int(OBJECT(dev), "phy-addr", 7, &error_abort);
s = SYS_BUS_DEVICE(dev);
sysbus_realize_and_unref(s, &error_fatal);
@@ -279,8 +276,8 @@ static void zynq_init(MachineState *machine)
sysbus_create_varargs("cadence_ttc", 0xF8002000,
pic[69-IRQ_OFFSET], pic[70-IRQ_OFFSET], pic[71-IRQ_OFFSET], NULL);
- gem_init(&nd_table[0], 0xE000B000, pic[54-IRQ_OFFSET]);
- gem_init(&nd_table[1], 0xE000C000, pic[77-IRQ_OFFSET]);
+ gem_init(0xE000B000, pic[54 - IRQ_OFFSET]);
+ gem_init(0xE000C000, pic[77 - IRQ_OFFSET]);
for (n = 0; n < 2; n++) {
int hci_irq = n ? 79 : 56;
diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c
index 4f74a64a0d..c9561995ae 100644
--- a/hw/arm/xlnx-versal.c
+++ b/hw/arm/xlnx-versal.c
@@ -249,18 +249,13 @@ static void versal_create_gems(Versal *s, qemu_irq *pic)
static const int irqs[] = { VERSAL_GEM0_IRQ_0, VERSAL_GEM1_IRQ_0};
static const uint64_t addrs[] = { MM_GEM0, MM_GEM1 };
char *name = g_strdup_printf("gem%d", i);
- NICInfo *nd = &nd_table[i];
DeviceState *dev;
MemoryRegion *mr;
object_initialize_child(OBJECT(s), name, &s->lpd.iou.gem[i],
TYPE_CADENCE_GEM);
dev = DEVICE(&s->lpd.iou.gem[i]);
- /* FIXME use qdev NIC properties instead of nd_table[] */
- if (nd->used) {
- qemu_check_nic_model(nd, "cadence_gem");
- qdev_set_nic_properties(dev, nd);
- }
+ qemu_configure_nic_device(dev, true, NULL);
object_property_set_int(OBJECT(dev), "phy-addr", 23, &error_abort);
object_property_set_int(OBJECT(dev), "num-priority-queues", 2,
&error_abort);
diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
index 5905a33015..4f1714e4a1 100644
--- a/hw/arm/xlnx-zynqmp.c
+++ b/hw/arm/xlnx-zynqmp.c
@@ -616,13 +616,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
}
for (i = 0; i < XLNX_ZYNQMP_NUM_GEMS; i++) {
- NICInfo *nd = &nd_table[i];
-
- /* FIXME use qdev NIC properties instead of nd_table[] */
- if (nd->used) {
- qemu_check_nic_model(nd, TYPE_CADENCE_GEM);
- qdev_set_nic_properties(DEVICE(&s->gem[i]), nd);
- }
+ qemu_configure_nic_device(DEVICE(&s->gem[i]), true, NULL);
object_property_set_int(OBJECT(&s->gem[i]), "revision", GEM_REVISION,
&error_abort);
object_property_set_int(OBJECT(&s->gem[i]), "phy-addr", 23,
--
2.41.0
next prev parent reply other threads:[~2023-11-06 19:58 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-06 19:49 [PATCH for-8.3 v2 00/46] Rework matching of network devices to -nic options David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 01/46] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 02/46] net: report list of available models according to platform David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 03/46] net: add qemu_create_nic_bus_devices() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 04/46] hw/pci: add pci_init_nic_devices(), pci_init_nic_in_slot() David Woodhouse
2023-11-10 7:31 ` Philippe Mathieu-Daudé
2023-11-10 9:21 ` David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 05/46] hw/i386/pc: use qemu_get_nic_info() and pci_init_nic_devices() David Woodhouse
2023-11-10 7:40 ` Philippe Mathieu-Daudé
2023-11-10 9:27 ` David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 06/46] hw/xen: use qemu_create_nic_bus_devices() to instantiate Xen NICs David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 07/46] hw/alpha/dp264: use pci_init_nic_devices() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 08/46] hw/arm/sbsa-ref: " David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 09/46] hw/arm/virt: " David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 10/46] hw/hppa: " David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 11/46] hw/loongarch: " David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 12/46] hw/mips/fuloong2e: " David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 13/46] hw/mips/malta: " David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 14/46] hw/mips/loongson3_virt: " David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 15/46] hw/ppc/prep: " David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 16/46] hw/ppc/spapr: use qemu_get_nic_info() and pci_init_nic_devices() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 17/46] hw/ppc: use pci_init_nic_devices() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 18/46] hw/sh4/r2d: " David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 19/46] hw/sparc64/sun4u: " David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 20/46] hw/xtensa/virt: " David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 21/46] hw/arm/allwinner: use qemu_configure_nic_device() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 22/46] hw/arm/aspeed: " David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 23/46] hw/arm/exynos4: use qemu_create_nic_device() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 24/46] hw/arm/fsl: use qemu_configure_nic_device() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 25/46] hw/net/smc91c111: " David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 26/46] hw/net/lan9118: " David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 27/46] hw/arm/highbank: use qemu_create_nic_device() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 28/46] hw/arm/npcm7xx: use qemu_configure_nic_device, allow emc0/emc1 as aliases David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 29/46] hw/arm/stellaris: use qemu_find_nic_info() David Woodhouse
2023-11-06 19:49 ` David Woodhouse [this message]
2023-11-06 19:49 ` [PATCH for-8.3 v2 31/46] hw/net/etraxfs-eth: use qemu_configure_nic_device() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 32/46] hw/m68k/mcf5208: use qemu_create_nic_device() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 33/46] hw/m68k/q800: use qemu_find_nic_info() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 34/46] hw/microblaze: use qemu_configure_nic_device() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 35/46] hw/mips/mipssim: use qemu_create_nic_device() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 36/46] hw/mips/jazz: use qemu_find_nic_info() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 37/46] hw/net/lasi_i82596: use qemu_configure_nic_device() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 38/46] hw/openrisc/openrisc_sim: use qemu_create_nic_device() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 39/46] hw/riscv: use qemu_configure_nic_device() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 40/46] hw/s390x/s390-virtio-ccw: use qemu_create_nic_device() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 41/46] hw/sparc/sun4m: use qemu_find_nic_info() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 42/46] hw/xtensa/xtfpga: use qemu_create_nic_device() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 43/46] net: remove qemu_check_nic_model() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 44/46] hw/pci: remove pci_nic_init_nofail() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 45/46] net: remove qemu_show_nic_models(), qemu_find_nic_model() David Woodhouse
2023-11-06 19:49 ` [PATCH for-8.3 v2 46/46] net: make nb_nics and nd_table[] static in net/net.c David Woodhouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231106195352.301038-31-dwmw2@infradead.org \
--to=dwmw2@infradead.org \
--cc=aleksandar.rikalo@syrmia.com \
--cc=alistair@alistair23.me \
--cc=andrew.smirnov@gmail.com \
--cc=andrew@codeconstruct.com.au \
--cc=anthony.perard@citrix.com \
--cc=atar4qemu@gmail.com \
--cc=aurelien@aurel32.net \
--cc=b.galvani@gmail.com \
--cc=bin.meng@windriver.com \
--cc=borntraeger@linux.ibm.com \
--cc=chenhuacai@kernel.org \
--cc=clg@kaod.org \
--cc=danielhb413@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=david@redhat.com \
--cc=deller@gmx.de \
--cc=edgar.iglesias@gmail.com \
--cc=eduardo@habkost.net \
--cc=farman@linux.ibm.com \
--cc=gaosong@loongson.cn \
--cc=harshpb@linux.ibm.com \
--cc=hpoussin@reactos.org \
--cc=huth@tuxfamily.org \
--cc=i.mitsyanko@gmail.com \
--cc=iii@linux.ibm.com \
--cc=jan.kiszka@web.de \
--cc=jasowang@redhat.com \
--cc=jcd@tribudubois.net \
--cc=jcmvbkbc@gmail.com \
--cc=jiaxun.yang@flygoat.com \
--cc=joel@jms.id.au \
--cc=kfting@nuvoton.com \
--cc=laurent@vivier.eu \
--cc=liweiwei@iscas.ac.cn \
--cc=magnus.damm@gmail.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=marcin.juszkiewicz@linaro.org \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=mst@redhat.com \
--cc=nieklinnenbank@gmail.com \
--cc=npiggin@gmail.com \
--cc=palmer@dabbelt.com \
--cc=pasic@linux.ibm.com \
--cc=paul@xen.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=proljc@gmail.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=quic_llindhol@quicinc.com \
--cc=rad@semihalf.com \
--cc=richard.henderson@linaro.org \
--cc=robh@kernel.org \
--cc=shorne@gmail.com \
--cc=sstabellini@kernel.org \
--cc=strahinja.p.jankovic@gmail.com \
--cc=sundeep.lkml@gmail.com \
--cc=wuhaotsh@google.com \
--cc=xen-devel@lists.xenproject.org \
--cc=ysato@users.sourceforge.jp \
--cc=zhiwei_liu@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).