summaryrefslogtreecommitdiffstats
path: root/sys/powerpc
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2016-04-27 16:31:12 +0000
committerjhb <jhb@FreeBSD.org>2016-04-27 16:31:12 +0000
commitc97e88d8d27379822b48e87c286771f02ec6230b (patch)
tree1dfb549dd2b02d536680e720de4a0da58313b464 /sys/powerpc
parente05c6840a1464552cb7462d76fbae2a9e3bc86d0 (diff)
downloadFreeBSD-src-c97e88d8d27379822b48e87c286771f02ec6230b.zip
FreeBSD-src-c97e88d8d27379822b48e87c286771f02ec6230b.tar.gz
Implement a PCI bus rescan method.
Rescanning a PCI bus uses the following steps: - Fetch the current set of child devices and save it in the 'devlist' array. - Allocate a parallel array 'unchanged' initalized with NULL pointers. - Scan the bus checking each slot (and each function on slots with a multifunction device). - If a valid function is found, look for a matching device in the 'devlist' array. If a device is found, save the pointer in the 'unchanged' array. If a device is not found, add a new device. - After the scan has finished, walk the 'devlist' array deleting any devices that do not have a matching pointer in the 'unchanged' array. - Finally, fetch an updated set of child devices and explicitly attach any devices that are not present in the 'unchanged' array. This builds on the previous changes to move subclass data management into pci_alloc_devinfo(), pci_child_added(), and bus_child_deleted(). Subclasses of the PCI bus use custom rescan logic explicitly override the rescan method to disable rescans. Differential Revision: https://reviews.freebsd.org/D6018
Diffstat (limited to 'sys/powerpc')
-rw-r--r--sys/powerpc/ofw/ofw_pcibus.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/powerpc/ofw/ofw_pcibus.c b/sys/powerpc/ofw/ofw_pcibus.c
index 01e2343..05aa06c 100644
--- a/sys/powerpc/ofw/ofw_pcibus.c
+++ b/sys/powerpc/ofw/ofw_pcibus.c
@@ -77,6 +77,7 @@ static device_method_t ofw_pcibus_methods[] = {
/* Bus interface */
DEVMETHOD(bus_child_deleted, ofw_pcibus_child_deleted),
DEVMETHOD(bus_child_pnpinfo_str, ofw_pcibus_child_pnpinfo_str_method),
+ DEVMETHOD(bus_rescan, kobj_error_method),
/* PCI interface */
DEVMETHOD(pci_alloc_devinfo, ofw_pcibus_alloc_devinfo),
OpenPOWER on IntegriCloud