diff options
author | jhb <jhb@FreeBSD.org> | 2009-06-09 14:26:23 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2009-06-09 14:26:23 +0000 |
commit | 77373ed4681d2d7d7a25a619e896c065e12976c6 (patch) | |
tree | 10671dffb6ce198477de5fc2d00a79d3d795b1a4 /share | |
parent | 7e92c698d93e930bd9f98da57fa435a205f23986 (diff) | |
download | FreeBSD-src-77373ed4681d2d7d7a25a619e896c065e12976c6.zip FreeBSD-src-77373ed4681d2d7d7a25a619e896c065e12976c6.tar.gz |
Add support for multiple passes of the device tree during the boot-time
probe. The current device order is unchanged. This commit just adds the
infrastructure and ABI changes so that it is easier to merge later changes
into 8.x.
- Driver attachments now have an associated pass level. Attachments are
not allowed to probe or attach to drivers until the system-wide pass level
is >= the attachment's pass level. By default driver attachments use the
"last" pass level (BUS_PASS_DEFAULT). Driver's that wish to probe during
an earlier pass use EARLY_DRIVER_MODULE() instead of DRIVER_MODULE() which
accepts the pass level as an additional parameter.
- A new method BUS_NEW_PASS has been added to the bus interface. This
method is invoked when the system-wide pass level is changed to kick off
a rescan of the device tree so that drivers that have just been made
"eligible" can probe and attach.
- The bus_generic_new_pass() function provides a default implementation of
BUS_NEW_PASS(). It first allows drivers that were just made eligible for
this pass to identify new child devices. Then it propogates the rescan to
child devices that already have an attached driver by invoking their
BUS_NEW_PASS() method. It also reprobes devices without a driver.
- BUS_PROBE_NOMATCH() is only invoked for devices that do not have
an attached driver after being scanned during the final pass.
- The bus_set_pass() function is used during boot to raise the pass level.
Currently it is only called once during root_bus_configure() to raise
the pass level to BUS_PASS_DEFAULT. This has the effect of probing all
devices in a single pass identical to previous behavior.
Reviewed by: imp
Approved by: re (kib)
Diffstat (limited to 'share')
-rw-r--r-- | share/man/man9/BUS_NEW_PASS.9 | 56 | ||||
-rw-r--r-- | share/man/man9/Makefile | 3 | ||||
-rw-r--r-- | share/man/man9/bus_generic_new_pass.9 | 57 | ||||
-rw-r--r-- | share/man/man9/bus_set_pass.9 | 54 |
4 files changed, 170 insertions, 0 deletions
diff --git a/share/man/man9/BUS_NEW_PASS.9 b/share/man/man9/BUS_NEW_PASS.9 new file mode 100644 index 0000000..5b31c6d --- /dev/null +++ b/share/man/man9/BUS_NEW_PASS.9 @@ -0,0 +1,56 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2009 Advanced Computing Technologies LLC +.\" Written by: John H. Baldwin <jhb@FreeBSD.org> +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 8, 2009 +.Dt BUS_NEW_PASS 9 +.Os +.Sh NAME +.Nm BUS_NEW_PASS +.Nd "notify a bus that the pass level has been changed" +.Sh SYNOPSIS +.In sys/param.h +.In sys/bus.h +.Ft void +.Fn BUS_NEW_PASS "device_t dev" +.Sh DESCRIPTION +The +.Fn BUS_NEW_PASS +method is called on each bus device to rescan the device tree when the pass +level has been changed. +This method is responsible for invoking +.Xr BUS_NEW_PASS 9 +on child bus devices to propogate the rescan to child devices. +It is also responsible for reprobing any unattached child devices and +allowing drivers for the current pass to identify new children. +A default implementation is provided by +.Xr bus_generic_new_pass 9 . +.Sh SEE ALSO +.Xr bus_generic_new_pass 9 , +.Xr bus_set_pass 9 , +.Xr device 9 diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 3e5b949..b1faffa 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -28,12 +28,15 @@ MAN= accept_filter.9 \ bus_dma.9 \ bus_generic_attach.9 \ bus_generic_detach.9 \ + bus_generic_new_pass.9 \ bus_generic_print_child.9 \ bus_generic_read_ivar.9 \ bus_generic_shutdown.9 \ + BUS_NEW_PASS.9 \ BUS_PRINT_CHILD.9 \ BUS_READ_IVAR.9 \ bus_release_resource.9 \ + bus_set_pass.9 \ bus_set_resource.9 \ BUS_SETUP_INTR.9 \ bus_space.9 \ diff --git a/share/man/man9/bus_generic_new_pass.9 b/share/man/man9/bus_generic_new_pass.9 new file mode 100644 index 0000000..51bb4b2 --- /dev/null +++ b/share/man/man9/bus_generic_new_pass.9 @@ -0,0 +1,57 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2009 Advanced Computing Technologies LLC +.\" Written by: John H. Baldwin <jhb@FreeBSD.org> +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 8, 2009 +.Dt bus_generic_new_pass 9 +.Os +.Sh NAME +.Nm bus_generic_new_pass +.Nd "generic implementation of BUS_NEW_PASS for bus devices" +.Sh SYNOPSIS +.In sys/param.h +.In sys/bus.h +.Ft void +.Fn bus_generic_new_pass "device_t dev" +.Sh DESCRIPTION +This function provides an implementation of the +.Xr BUS_NEW_PASS 9 +method which can be used by bus drivers. +It first invokes the +.Xr DEVICE_IDENTIFY 9 +method for any drivers whose pass level is equal to the new pass level. +Then, for each attached child device it calls +.Xr BUS_NEW_PASS 9 +to rescan child busses, +and for each unattached child device it calls +.Xr device_probe_and_attach 9 . +.Sh SEE ALSO +.Xr BUS_NEW_PASS 9 , +.Xr bus_set_pass 9 , +.Xr device 9 , +.Xr DEVICE_IDENTIFY 9 diff --git a/share/man/man9/bus_set_pass.9 b/share/man/man9/bus_set_pass.9 new file mode 100644 index 0000000..1c882f4 --- /dev/null +++ b/share/man/man9/bus_set_pass.9 @@ -0,0 +1,54 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2009 Advanced Computing Technologies LLC +.\" Written by: John H. Baldwin <jhb@FreeBSD.org> +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 8, 2009 +.Dt bus_set_pass 9 +.Os +.Sh NAME +.Nm bus_set_pass +.Nd "raise the bus pass level" +.Sh SYNOPSIS +.In sys/param.h +.In sys/bus.h +.Ft void +.Fn bus_set_pass "int pass" +.Sh DESCRIPTION +The +.Nm +function is called during boot to raise the bus pass level to +.Fa pass . +The function will rescan the device tree for each pass level between the +current pass level and the new level that has at least one associated +driver. +The device tree rescans are implemented by invoking the +.Xr BUS_NEW_PASS 9 +method on the root bus device. +.Sh SEE ALSO +.Xr BUS_NEW_PASS 9 , +.Xr device 9 |