From ab25d374b20b0f2d95e582f809da498a19d541a5 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Tue, 18 May 1999 21:03:30 +0000 Subject: [PATCH] Don't detect an EISA bus unless we see a "card" there somewhere. An EISA motherboard will have a card for the "motherboard" on slot 0. eisa0: on motherboard mainboard0: at slot 0 on eisa0 This should stop the probe "detecting" an EISA bus everywhere that has a 'controller eisa0' line regardless of whether it's really there. --- sys/dev/eisa/eisaconf.c | 12 ++++++++++-- sys/i386/eisa/eisaconf.c | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/sys/dev/eisa/eisaconf.c b/sys/dev/eisa/eisaconf.c index d6142e06418..464ebcfe4cb 100644 --- a/sys/dev/eisa/eisaconf.c +++ b/sys/dev/eisa/eisaconf.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: eisaconf.c,v 1.42 1999/05/06 22:17:26 peter Exp $ + * $Id: eisaconf.c,v 1.43 1999/05/08 21:59:20 dfr Exp $ */ #include "opt_eisa.h" @@ -149,6 +149,7 @@ eisa_probe(device_t dev) struct eisa_device *e_dev; int eisaBase = 0xc80; eisa_id_t eisa_id; + int devices_found = 0; device_set_desc(dev, "EISA bus"); @@ -162,6 +163,8 @@ eisa_probe(device_t dev) if (eisa_id & 0x80000000) continue; /* no EISA card in slot */ + devices_found++; + /* Prepare an eisa_device_node for this slot */ e_dev = (struct eisa_device *)malloc(sizeof(*e_dev), M_DEVBUF, M_NOWAIT); @@ -183,7 +186,12 @@ eisa_probe(device_t dev) device_add_child(dev, NULL, -1, e_dev); } - return 0; + /* + * EISA busses themselves are not easily detectable, the easiest way + * to tell if there is an eisa bus is if we found something - there + * should be a motherboard "card" there somewhere. + */ + return devices_found ? 0 : ENXIO; } static void diff --git a/sys/i386/eisa/eisaconf.c b/sys/i386/eisa/eisaconf.c index d6142e06418..464ebcfe4cb 100644 --- a/sys/i386/eisa/eisaconf.c +++ b/sys/i386/eisa/eisaconf.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: eisaconf.c,v 1.42 1999/05/06 22:17:26 peter Exp $ + * $Id: eisaconf.c,v 1.43 1999/05/08 21:59:20 dfr Exp $ */ #include "opt_eisa.h" @@ -149,6 +149,7 @@ eisa_probe(device_t dev) struct eisa_device *e_dev; int eisaBase = 0xc80; eisa_id_t eisa_id; + int devices_found = 0; device_set_desc(dev, "EISA bus"); @@ -162,6 +163,8 @@ eisa_probe(device_t dev) if (eisa_id & 0x80000000) continue; /* no EISA card in slot */ + devices_found++; + /* Prepare an eisa_device_node for this slot */ e_dev = (struct eisa_device *)malloc(sizeof(*e_dev), M_DEVBUF, M_NOWAIT); @@ -183,7 +186,12 @@ eisa_probe(device_t dev) device_add_child(dev, NULL, -1, e_dev); } - return 0; + /* + * EISA busses themselves are not easily detectable, the easiest way + * to tell if there is an eisa bus is if we found something - there + * should be a motherboard "card" there somewhere. + */ + return devices_found ? 0 : ENXIO; } static void