diff options
author | John Baldwin <jhb@FreeBSD.org> | 2016-04-27 16:31:12 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2016-04-27 16:31:12 +0000 |
commit | 3d0338a09278a0cc38785321f102de9775c57ed3 (patch) | |
tree | 1dfb549dd2b02d536680e720de4a0da58313b464 /sys/dev/cardbus | |
parent | a907c6914c5879870b2597a63253cea0a5b7bdb8 (diff) | |
download | src-3d0338a09278a0cc38785321f102de9775c57ed3.tar.gz src-3d0338a09278a0cc38785321f102de9775c57ed3.zip |
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
Notes
Notes:
svn path=/head/; revision=298708
Diffstat (limited to 'sys/dev/cardbus')
-rw-r--r-- | sys/dev/cardbus/cardbus.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index a6037e15c1ea..765c1700dd28 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -346,6 +346,7 @@ static device_method_t cardbus_methods[] = { DEVMETHOD(bus_get_dma_tag, bus_generic_get_dma_tag), DEVMETHOD(bus_read_ivar, cardbus_read_ivar), DEVMETHOD(bus_driver_added, cardbus_driver_added), + DEVMETHOD(bus_rescan, kobj_error_method), /* Card Interface */ DEVMETHOD(card_attach_card, cardbus_attach_card), |