]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
hw/ppc/prep: use pci_init_nic_devices()
authorDavid Woodhouse <dwmw@amazon.co.uk>
Sat, 21 Oct 2023 20:38:05 +0000 (21:38 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Sun, 22 Oct 2023 13:29:55 +0000 (14:29 +0100)
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 commnd line. And anything else will be dynamically
assigned.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
hw/ppc/prep.c

index 137276bcb92b350529a1e388710f0b5159cdf3ab..1a08e74945550a1b4869230ba4ba7fc3974b037f 100644 (file)
@@ -336,10 +336,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 */