/** * pcibios_release_device - release PCI device * @dev: PCI device * * The function is called before releasing the indicated PCI device.
*/ void pcibios_release_device(struct pci_dev *dev)
{ struct pci_controller *phb = pci_bus_to_host(dev->bus); struct pci_dn *pdn = pci_get_pdn(dev);
if (phb->controller_ops.release_device)
phb->controller_ops.release_device(dev);
/* free()ing the pci_dn has been deferred to us, do it now */ if (pdn && (pdn->flags & PCI_DN_FLAG_DEAD)) {
pci_dbg(dev, "freeing dead pdn\n");
kfree(pdn);
}
}
/** * pci_hp_remove_devices - remove all devices under this bus * @bus: the indicated PCI bus * * Remove all of the PCI devices under this bus both from the * linux pci device tree, and from the powerpc EEH address cache.
*/ void pci_hp_remove_devices(struct pci_bus *bus)
{ struct pci_dev *dev, *tmp; struct pci_bus *child_bus;
/* First go down child busses */
list_for_each_entry(child_bus, &bus->children, node)
pci_hp_remove_devices(child_bus);
if (!of_property_read_u32(start->child, "class-code", &class)) { /* Call of pci_scan_slot for non-bridge/EP case */ if (!((class >> 8) == PCI_CLASS_BRIDGE_PCI)) {
slotno = PCI_SLOT(PCI_DN(start->child)->devfn);
pci_scan_slot(bus, PCI_DEVFN(slotno, 0)); return;
}
}
/* Iterate all siblings */
for_each_child_of_node(start, dn) { class = 0;
if (!of_property_read_u32(start->child, "class-code", &class)) { /* Call of pci_scan_slot on each sibling-nodes/bridge-ports */ if ((class >> 8) == PCI_CLASS_BRIDGE_PCI) {
slotno = PCI_SLOT(PCI_DN(dn)->devfn);
pci_scan_slot(bus, PCI_DEVFN(slotno, 0));
}
}
}
}
/** * pci_hp_add_devices - adds new pci devices to bus * @bus: the indicated PCI bus * * This routine will find and fixup new pci devices under * the indicated bus. This routine presumes that there * might already be some devices under this bridge, so * it carefully tries to add only new devices. (And that * is how this routine differs from other, similar pcibios * routines.)
*/ void pci_hp_add_devices(struct pci_bus *bus)
{ int mode, max; struct pci_dev *dev; struct pci_controller *phb; struct device_node *dn = pci_bus_to_OF_node(bus);
if (!dn) return;
phb = pci_bus_to_host(bus);
mode = PCI_PROBE_NORMAL; if (phb->controller_ops.probe_mode)
mode = phb->controller_ops.probe_mode(bus);
if (mode == PCI_PROBE_DEVTREE) { /* use ofdt-based probe */
of_rescan_bus(dn, bus);
} elseif (mode == PCI_PROBE_NORMAL &&
dn->child && PCI_DN(dn->child)) { /* * Use legacy probe. In the partial hotplug case, we * probably have grandchildren devices unplugged. So * we don't check the return value from pci_scan_slot() in * order for fully rescan all the way down to pick them up. * They can have been removed during partial hotplug.
*/
traverse_siblings_and_scan_slot(dn, bus);
max = bus->busn_res.start; /* * Scan bridges that are already configured. We don't touch * them unless they are misconfigured (which will be done in * the second scan below).
*/
for_each_pci_bridge(dev, bus)
max = pci_scan_bridge(bus, dev, max, 0);
/* Scan bridges that need to be reconfigured */
for_each_pci_bridge(dev, bus)
max = pci_scan_bridge(bus, dev, max, 1);
}
pcibios_finish_adding_to_bus(bus);
}
EXPORT_SYMBOL_GPL(pci_hp_add_devices);
Messung V0.5
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.20Angebot
Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.