summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authormhitch <mhitch@NetBSD.org>2000-03-04 05:43:51 +0000
committermhitch <mhitch@NetBSD.org>2000-03-04 05:43:51 +0000
commit3b06f6f887b50d759b6aeefd3d3c00218bc29dda (patch)
tree8f2d8bd2babfb6597edd0c3b31bd3477f8d85490 /sys/dev
parent8bf4d36694b6faf4df5c6d4f3578d3f5038d4385 (diff)
Fix boot device detection. Device probes are not done when adapters are
configured, but after all adapters have been configured. When multiple adapters are present, only the last configured adapter could be matched to the boot device slot. The adapter attach routines now check if that adapter slot matches the boot device slot and saves the softc pointer for that controller. Then when the disks are configured, dk_establish() matches the appropriate controller.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/tc/asc_ioasic.c10
-rw-r--r--sys/dev/tc/asc_tc.c10
2 files changed, 18 insertions, 2 deletions
diff --git a/sys/dev/tc/asc_ioasic.c b/sys/dev/tc/asc_ioasic.c
index d837643ec8c..f80c217a0a1 100644
--- a/sys/dev/tc/asc_ioasic.c
+++ b/sys/dev/tc/asc_ioasic.c
@@ -1,4 +1,4 @@
-/* $NetBSD: asc_ioasic.c,v 1.19 2000/02/03 05:16:30 nisimura Exp $ */
+/* $NetBSD: asc_ioasic.c,v 1.20 2000/03/04 05:43:51 mhitch Exp $ */
/*
* Copyright 1996 The Board of Trustees of The Leland Stanford
@@ -77,6 +77,14 @@ asc_ioasic_attach(parent, self, aux)
{
asc_softc_t asc = (asc_softc_t)self;
struct ioasicdev_attach_args *d = aux;
+/* XXX Hook for dk_establish() to determine boot device */
+ extern int booted_slot;
+ extern struct device *booted_controller;
+
+ /* Is this the controller we booted from? */
+ if (booted_slot == 3)
+ booted_controller = self;
+/* XXX */
asc->sc_bst = ((struct ioasic_softc *)parent)->sc_bst;
asc->sc_bsh = ((struct ioasic_softc *)parent)->sc_bsh;
diff --git a/sys/dev/tc/asc_tc.c b/sys/dev/tc/asc_tc.c
index 764d00fbe01..7a8f78c0faa 100644
--- a/sys/dev/tc/asc_tc.c
+++ b/sys/dev/tc/asc_tc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: asc_tc.c,v 1.12 2000/02/11 01:32:42 thorpej Exp $ */
+/* $NetBSD: asc_tc.c,v 1.13 2000/03/04 05:43:51 mhitch Exp $ */
/*
* Copyright 1996 The Board of Trustees of The Leland Stanford
@@ -81,6 +81,14 @@ asc_tc_attach(parent, self, aux)
u_char *buff;
int i, speed;
int unit;
+/* XXX Hook for dk_establish() to determine boot device */
+ extern int booted_slot;
+ extern struct device *booted_controller;
+
+ /* Is this the controller we booted from? */
+ if (booted_slot == t->ta_slot)
+ booted_controller = self;
+/* XXX */
unit = asc->sc_dev.dv_unit;