[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 15/47] hw/ppc/prep: use pci_init_nic_devices()
From: |
David Woodhouse |
Subject: |
[PATCH v4 15/47] hw/ppc/prep: use pci_init_nic_devices() |
Date: |
Fri, 26 Jan 2024 17:24:52 +0000 |
From: David Woodhouse <dwmw@amazon.co.uk>
Previously, the first PCI NIC would be placed in PCI slot 3 and the rest
would be dynamically assigned. Even if the user overrode the default NIC
type and made it something other than PCNet.
Now, the first PCNet NIC (that is, anything not explicitly specified
to be anything different) will go to slot 3 even if it isn't the first
NIC specified on the command line. And anything else will be dynamically
assigned.
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Thomas Huth <thuth@redhat.com>
---
hw/ppc/prep.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 137276bcb9..1a6cd05c61 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -241,7 +241,6 @@ static void ibm_40p_init(MachineState *machine)
ISADevice *isa_dev;
ISABus *isa_bus;
void *fw_cfg;
- int i;
uint32_t kernel_base = 0, initrd_base = 0;
long kernel_size = 0, initrd_size = 0;
char boot_device;
@@ -336,10 +335,9 @@ static void ibm_40p_init(MachineState *machine)
/* XXX: s3-trio at PCI_DEVFN(2, 0) */
pci_vga_init(pci_bus);
- for (i = 0; i < nb_nics; i++) {
- pci_nic_init_nofail(&nd_table[i], pci_bus, mc->default_nic,
- i == 0 ? "3" : NULL);
- }
+ /* First PCNET device at PCI_DEVFN(3, 0) */
+ pci_init_nic_in_slot(pci_bus, mc->default_nic, NULL, "3");
+ pci_init_nic_devices(pci_bus, mc->default_nic);
}
/* Prepare firmware configuration for OpenBIOS */
--
2.43.0
- [PATCH v4 07/47] hw/alpha/dp264: use pci_init_nic_devices(), (continued)
- [PATCH v4 07/47] hw/alpha/dp264: use pci_init_nic_devices(), David Woodhouse, 2024/01/26
- [PATCH v4 10/47] hw/hppa: use pci_init_nic_devices(), David Woodhouse, 2024/01/26
- [PATCH v4 16/47] hw/ppc/spapr: use qemu_get_nic_info() and pci_init_nic_devices(), David Woodhouse, 2024/01/26
- [PATCH v4 22/47] hw/arm/aspeed: use qemu_configure_nic_device(), David Woodhouse, 2024/01/26
- [PATCH v4 29/47] hw/arm/stellaris: use qemu_find_nic_info(), David Woodhouse, 2024/01/26
- [PATCH v4 45/47] hw/pci: remove pci_nic_init_nofail(), David Woodhouse, 2024/01/26
- [PATCH v4 08/47] hw/arm/sbsa-ref: use pci_init_nic_devices(), David Woodhouse, 2024/01/26
- [PATCH v4 15/47] hw/ppc/prep: use pci_init_nic_devices(),
David Woodhouse <=
- [PATCH v4 43/47] hw/xtensa/xtfpga: use qemu_create_nic_device(), David Woodhouse, 2024/01/26
- [PATCH v4 42/47] hw/sparc/sun4m: use qemu_find_nic_info(), David Woodhouse, 2024/01/26
- [PATCH v4 09/47] hw/arm/virt: use pci_init_nic_devices(), David Woodhouse, 2024/01/26
- [PATCH v4 01/47] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info(), David Woodhouse, 2024/01/26
- [PATCH v4 23/47] hw/arm/exynos4: use qemu_create_nic_device(), David Woodhouse, 2024/01/26
- [PATCH v4 06/47] hw/xen: use qemu_create_nic_bus_devices() to instantiate Xen NICs, David Woodhouse, 2024/01/26
- [PATCH v4 32/47] hw/m68k/mcf5208: use qemu_create_nic_device(), David Woodhouse, 2024/01/26
- [PATCH v4 28/47] hw/arm/npcm7xx: use qemu_configure_nic_device, allow emc0/emc1 as aliases, David Woodhouse, 2024/01/26
- [PATCH v4 27/47] hw/arm/highbank: use qemu_create_nic_device(), David Woodhouse, 2024/01/26
- [PATCH v4 11/47] hw/loongarch: use pci_init_nic_devices(), David Woodhouse, 2024/01/26