Take advantage of the apm/npx code and let them identify themselves rather

than having explicit hooks here.
Treat the eisa/isa attach a little differently so that we defer the
decision about to attach eisa/isa to the motherboard directly only if
the PCI probe (if it exists) fails to turn up a PCI->EISA/ISA bridge.
This restores the original device geometry where ISA and/or EISA attach
to their bridge rather than bypassing and going to the root.
This commit is contained in:
Peter Wemm 1999-08-22 19:56:55 +00:00
parent f3b63bd388
commit ca29e71c56
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=50183
4 changed files with 136 additions and 92 deletions

View File

@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: nexus.c,v 1.12 1999/07/16 01:00:24 msmith Exp $
* $Id: nexus.c,v 1.13 1999/07/29 01:02:52 mdodd Exp $
*/
/*
@ -132,7 +132,6 @@ DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0);
static int
nexus_probe(device_t dev)
{
device_t child;
device_quiet(dev); /* suppress attach message for neatness */
@ -187,29 +186,41 @@ nexus_probe(device_t dev)
|| rman_manage_region(&mem_rman, 0, ~0))
panic("nexus_probe mem_rman");
child = device_add_child(dev, "npx", 0, 0);
if (child == 0)
panic("nexus_probe npx");
return bus_generic_probe(dev);
}
child = device_add_child(dev, "apm", 0, 0);
if (child == 0)
panic("nexus_probe apm");
bus_generic_probe(dev);
#if 0
child = device_add_child(dev, "pcib", 0, 0);
if (child == 0)
panic("nexus_probe pcib");
#endif
static int
nexus_attach(device_t dev)
{
device_t child;
int rv;
/*
* First, deal with the children we know about already
*/
rv = bus_generic_attach(dev);
if (rv)
return rv;
/*
* And if we didn't see EISA or ISA on a pci bridge, create some
* connection points now so they show up "on motherboard".
*/
if (!devclass_get_device(devclass_find("eisa"), 0)) {
child = device_add_child(dev, "eisa", 0, 0);
if (child == 0)
panic("nexus_probe eisa");
if (child == NULL)
panic("nexus_attach eisa");
rv = device_probe_and_attach(child);
if (rv)
return rv;
}
if (!devclass_get_device(devclass_find("isa"), 0)) {
child = device_add_child(dev, "isa", 0, 0);
if (child == 0)
panic("nexus_probe isa");
if (child == NULL)
panic("nexus_attach isa");
rv = device_probe_and_attach(child);
if (rv)
return rv;
}
return 0;
}

View File

@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: nexus.c,v 1.12 1999/07/16 01:00:24 msmith Exp $
* $Id: nexus.c,v 1.13 1999/07/29 01:02:52 mdodd Exp $
*/
/*
@ -132,7 +132,6 @@ DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0);
static int
nexus_probe(device_t dev)
{
device_t child;
device_quiet(dev); /* suppress attach message for neatness */
@ -187,29 +186,41 @@ nexus_probe(device_t dev)
|| rman_manage_region(&mem_rman, 0, ~0))
panic("nexus_probe mem_rman");
child = device_add_child(dev, "npx", 0, 0);
if (child == 0)
panic("nexus_probe npx");
return bus_generic_probe(dev);
}
child = device_add_child(dev, "apm", 0, 0);
if (child == 0)
panic("nexus_probe apm");
bus_generic_probe(dev);
#if 0
child = device_add_child(dev, "pcib", 0, 0);
if (child == 0)
panic("nexus_probe pcib");
#endif
static int
nexus_attach(device_t dev)
{
device_t child;
int rv;
/*
* First, deal with the children we know about already
*/
rv = bus_generic_attach(dev);
if (rv)
return rv;
/*
* And if we didn't see EISA or ISA on a pci bridge, create some
* connection points now so they show up "on motherboard".
*/
if (!devclass_get_device(devclass_find("eisa"), 0)) {
child = device_add_child(dev, "eisa", 0, 0);
if (child == 0)
panic("nexus_probe eisa");
if (child == NULL)
panic("nexus_attach eisa");
rv = device_probe_and_attach(child);
if (rv)
return rv;
}
if (!devclass_get_device(devclass_find("isa"), 0)) {
child = device_add_child(dev, "isa", 0, 0);
if (child == 0)
panic("nexus_probe isa");
if (child == NULL)
panic("nexus_attach isa");
rv = device_probe_and_attach(child);
if (rv)
return rv;
}
return 0;
}

View File

@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: nexus.c,v 1.12 1999/07/16 01:00:24 msmith Exp $
* $Id: nexus.c,v 1.13 1999/07/29 01:02:52 mdodd Exp $
*/
/*
@ -132,7 +132,6 @@ DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0);
static int
nexus_probe(device_t dev)
{
device_t child;
device_quiet(dev); /* suppress attach message for neatness */
@ -187,29 +186,41 @@ nexus_probe(device_t dev)
|| rman_manage_region(&mem_rman, 0, ~0))
panic("nexus_probe mem_rman");
child = device_add_child(dev, "npx", 0, 0);
if (child == 0)
panic("nexus_probe npx");
return bus_generic_probe(dev);
}
child = device_add_child(dev, "apm", 0, 0);
if (child == 0)
panic("nexus_probe apm");
bus_generic_probe(dev);
#if 0
child = device_add_child(dev, "pcib", 0, 0);
if (child == 0)
panic("nexus_probe pcib");
#endif
static int
nexus_attach(device_t dev)
{
device_t child;
int rv;
/*
* First, deal with the children we know about already
*/
rv = bus_generic_attach(dev);
if (rv)
return rv;
/*
* And if we didn't see EISA or ISA on a pci bridge, create some
* connection points now so they show up "on motherboard".
*/
if (!devclass_get_device(devclass_find("eisa"), 0)) {
child = device_add_child(dev, "eisa", 0, 0);
if (child == 0)
panic("nexus_probe eisa");
if (child == NULL)
panic("nexus_attach eisa");
rv = device_probe_and_attach(child);
if (rv)
return rv;
}
if (!devclass_get_device(devclass_find("isa"), 0)) {
child = device_add_child(dev, "isa", 0, 0);
if (child == 0)
panic("nexus_probe isa");
if (child == NULL)
panic("nexus_attach isa");
rv = device_probe_and_attach(child);
if (rv)
return rv;
}
return 0;
}

View File

@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: nexus.c,v 1.12 1999/07/16 01:00:24 msmith Exp $
* $Id: nexus.c,v 1.13 1999/07/29 01:02:52 mdodd Exp $
*/
/*
@ -132,7 +132,6 @@ DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0);
static int
nexus_probe(device_t dev)
{
device_t child;
device_quiet(dev); /* suppress attach message for neatness */
@ -187,29 +186,41 @@ nexus_probe(device_t dev)
|| rman_manage_region(&mem_rman, 0, ~0))
panic("nexus_probe mem_rman");
child = device_add_child(dev, "npx", 0, 0);
if (child == 0)
panic("nexus_probe npx");
return bus_generic_probe(dev);
}
child = device_add_child(dev, "apm", 0, 0);
if (child == 0)
panic("nexus_probe apm");
bus_generic_probe(dev);
#if 0
child = device_add_child(dev, "pcib", 0, 0);
if (child == 0)
panic("nexus_probe pcib");
#endif
static int
nexus_attach(device_t dev)
{
device_t child;
int rv;
/*
* First, deal with the children we know about already
*/
rv = bus_generic_attach(dev);
if (rv)
return rv;
/*
* And if we didn't see EISA or ISA on a pci bridge, create some
* connection points now so they show up "on motherboard".
*/
if (!devclass_get_device(devclass_find("eisa"), 0)) {
child = device_add_child(dev, "eisa", 0, 0);
if (child == 0)
panic("nexus_probe eisa");
if (child == NULL)
panic("nexus_attach eisa");
rv = device_probe_and_attach(child);
if (rv)
return rv;
}
if (!devclass_get_device(devclass_find("isa"), 0)) {
child = device_add_child(dev, "isa", 0, 0);
if (child == 0)
panic("nexus_probe isa");
if (child == NULL)
panic("nexus_attach isa");
rv = device_probe_and_attach(child);
if (rv)
return rv;
}
return 0;
}