summaryrefslogtreecommitdiff
path: root/sys/arch/vax
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-07-24 17:25:12 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-07-24 17:25:12 +0000
commit854fe71d5e689db870dcdc92e572165edc5ee6ee (patch)
tree957e7318a46f3466205292a19a4597c914e469cf /sys/arch/vax
parentc1f9f52900cac8d98ca1664c2129eb9589c4a3b0 (diff)
Recent change to the way mainbus children attach requires sbi_match to be
split between mainbus and abus attachments. Untested (and this is not part of the supported hardware at the moment), but at least this will allow sbi to attach to abus (this was broken, even before the mainbus attachment changes).
Diffstat (limited to 'sys/arch/vax')
-rw-r--r--sys/arch/vax/vax/sbi.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/sys/arch/vax/vax/sbi.c b/sys/arch/vax/vax/sbi.c
index c3cf5953945..937b4c5100d 100644
--- a/sys/arch/vax/vax/sbi.c
+++ b/sys/arch/vax/vax/sbi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sbi.c,v 1.11 2006/07/20 19:08:15 miod Exp $ */
+/* $OpenBSD: sbi.c,v 1.12 2006/07/24 17:25:11 miod Exp $ */
/* $NetBSD: sbi.c,v 1.20 1999/08/07 10:36:50 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -44,9 +44,14 @@
#include <machine/nexus.h>
static int sbi_print(void *, const char *);
-static int sbi_match(struct device *, struct cfdata *, void *);
+static int sbi_match_abus(struct device *, struct cfdata *, void *);
+static int sbi_match_mainbus(struct device *, struct cfdata *, void *);
static void sbi_attach(struct device *, struct device *, void *);
+struct cfdriver sbi_cd = {
+ NULL, "sbi", DV_DULL
+};
+
int
sbi_print(aux, name)
void *aux;
@@ -70,7 +75,7 @@ sbi_print(aux, name)
}
int
-sbi_match(parent, cf, aux)
+sbi_match_mainbus(parent, cf, aux)
struct device *parent;
struct cfdata *cf;
void *aux;
@@ -82,6 +87,20 @@ sbi_match(parent, cf, aux)
return 0;
}
+int
+sbi_match_abus(parent, cf, aux)
+ struct device *parent;
+ struct cfdata *cf;
+ void *aux;
+{
+ struct bp_conf *bp = aux;
+
+ if (strcmp(bp->type, sbi_cd.cd_name) == 0)
+ return 1;
+
+ return 0;
+}
+
void
sbi_attach(parent, self, aux)
struct device *parent, *self;
@@ -114,9 +133,9 @@ sbi_attach(parent, self, aux)
}
struct cfattach sbi_mainbus_ca = {
- sizeof(struct device), sbi_match, sbi_attach
+ sizeof(struct device), sbi_match_mainbus, sbi_attach
};
struct cfattach sbi_abus_ca = {
- sizeof(struct device), sbi_match, sbi_attach
+ sizeof(struct device), sbi_match_abus, sbi_attach
};