Add domain support to PCI bus allocation

When the system has more than a single PCI domain, the bus numbers
are not unique, thus they cannot be used for "pci" device numbering.
Change bus numbers to -1 (i.e. to-be-determined automatically)
wherever the code did not care about domains.

Reviewed by:   jhb
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3406
This commit is contained in:
zbb 2015-09-16 23:34:51 +00:00
parent 76309d54d2
commit 95f13176f5
19 changed files with 19 additions and 19 deletions

View File

@ -266,7 +266,7 @@ versatile_pci_attach(device_t dev)
versatile_pci_conf_write_4((slot << 11) + PCIR_COMMAND, val);
}
device_add_child(dev, "pci", 0);
device_add_child(dev, "pci", -1);
return (bus_generic_attach(dev));
}

View File

@ -117,7 +117,7 @@ i80321_pci_attach(device_t dev)
if (rman_init(&sc->sc_irq_rman) != 0 ||
rman_manage_region(&sc->sc_irq_rman, 26, 32) != 0)
panic("i80321_pci_probe: failed to set up IRQ rman");
device_add_child(dev, "pci",busno);
device_add_child(dev, "pci", -1);
return (bus_generic_attach(dev));
}

View File

@ -209,7 +209,7 @@ i81342_pci_attach(device_t dev)
}
bus_space_write_4(sc->sc_st, sc->sc_atu_sh, ATU_ISR,
bus_space_read_4(sc->sc_st, sc->sc_atu_sh, ATU_ISR) & ATUX_ISR_ERRMSK);
device_add_child(dev, "pci", busno);
device_add_child(dev, "pci", -1);
return (bus_generic_attach(dev));
}

View File

@ -150,7 +150,7 @@ acpi_pcib_attach(device_t dev, ACPI_BUFFER *prt, int busno)
/*
* Attach the PCI bus proper.
*/
if (device_add_child(dev, "pci", busno) == NULL) {
if (device_add_child(dev, "pci", -1) == NULL) {
device_printf(device_get_parent(dev), "couldn't attach pci bus\n");
return_VALUE(ENXIO);
}

View File

@ -1082,7 +1082,7 @@ pcib_attach(device_t dev)
pcib_attach_common(dev);
sc = device_get_softc(dev);
if (sc->bus.sec != 0) {
child = device_add_child(dev, "pci", sc->bus.sec);
child = device_add_child(dev, "pci", -1);
if (child != NULL)
return(bus_generic_attach(dev));
}

View File

@ -559,7 +559,7 @@ xpcib_attach(device_t dev)
DPRINTF("xpcib attach (bus=%d)\n", sc->bus);
device_add_child(dev, "pci", sc->bus);
device_add_child(dev, "pci", -1);
return bus_generic_attach(dev);
}

View File

@ -181,7 +181,7 @@ admpci_attach(device_t dev)
panic("bus_space_map failed");
}
device_add_child(dev, "pci", busno);
device_add_child(dev, "pci", -1);
return (bus_generic_attach(dev));
}

View File

@ -462,7 +462,7 @@ ar71xx_pci_attach(device_t dev)
ar71xx_pci_slot_fixup(dev, 0, 18, 0);
#endif /* AR71XX_ATH_EEPROM */
device_add_child(dev, "pci", busno);
device_add_child(dev, "pci", -1);
return (bus_generic_attach(dev));
}

View File

@ -429,7 +429,7 @@ ar724x_pci_attach(device_t dev)
| PCIM_CMD_SERRESPEN | PCIM_CMD_BACKTOBACK
| PCIM_CMD_PERRESPEN | PCIM_CMD_MWRICEN, 2);
device_add_child(dev, "pci", busno);
device_add_child(dev, "pci", -1);
return (bus_generic_attach(dev));
}

View File

@ -362,7 +362,7 @@ qca955x_pci_attach(device_t dev)
| PCIM_CMD_SERRESPEN | PCIM_CMD_BACKTOBACK
| PCIM_CMD_PERRESPEN | PCIM_CMD_MWRICEN, 2);
device_add_child(dev, "pci", busno);
device_add_child(dev, "pci", -1);
return (bus_generic_attach(dev));
}

View File

@ -205,7 +205,7 @@ octopci_attach(device_t dev)
subbus = octopci_init_bus(dev, sc->sc_bus);
octopci_write_config(dev, sc->sc_bus, 0, 0, PCIR_SUBBUS_1, subbus, 1);
device_add_child(dev, "pci", device_get_unit(dev));
device_add_child(dev, "pci", -1);
return (bus_generic_attach(dev));
}

View File

@ -275,7 +275,7 @@ idtpci_attach(device_t dev)
PCI_IRQ_END) != 0)
panic("idtpci_attach: failed to set up IRQ rman");
device_add_child(dev, "pci", busno);
device_add_child(dev, "pci", -1);
return (bus_generic_attach(dev));
}

View File

@ -415,7 +415,7 @@ gt_pci_attach(device_t dev)
}
/* Initialize memory and i/o rmans. */
device_add_child(dev, "pci", busno);
device_add_child(dev, "pci", -1);
return (bus_generic_attach(dev));
}

View File

@ -314,7 +314,7 @@ xlp_pcib_attach(device_t dev)
for (link = 0; link < 4; link++)
xlp_pcib_hardware_swap_enable(node, link);
device_add_child(dev, "pci", 0);
device_add_child(dev, "pci", -1);
bus_generic_attach(dev);
return (0);
}

View File

@ -306,7 +306,7 @@ xlr_pcib_attach(device_t dev)
0xff, 0x7fffffff, 0, NULL, NULL, &sc->sc_pci_dmat) != 0)
panic("%s: bus_dma_tag_create failed", __func__);
}
device_add_child(dev, "pci", 0);
device_add_child(dev, "pci", -1);
bus_generic_attach(dev);
return (0);
}

View File

@ -240,7 +240,7 @@ ofw_pci_attach(device_t dev)
return (error);
}
device_add_child(dev, "pci", device_get_unit(dev));
device_add_child(dev, "pci", -1);
return (bus_generic_attach(dev));
}

View File

@ -524,7 +524,7 @@ legacy_pcib_attach(device_t dev)
device_probe_and_attach(pir);
}
#endif
device_add_child(dev, "pci", bus);
device_add_child(dev, "pci", -1);
return bus_generic_attach(dev);
}

View File

@ -218,7 +218,7 @@ static int
qpi_pcib_attach(device_t dev)
{
device_add_child(dev, "pci", pcib_get_bus(dev));
device_add_child(dev, "pci", -1);
return (bus_generic_attach(dev));
}

View File

@ -69,7 +69,7 @@ mptable_hostb_attach(device_t dev)
#ifdef NEW_PCIB
mptable_pci_host_res_init(dev);
#endif
device_add_child(dev, "pci", pcib_get_bus(dev));
device_add_child(dev, "pci", -1);
return (bus_generic_attach(dev));
}