summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2006-07-24 17:25:11 +0000
committermiod <miod@openbsd.org>2006-07-24 17:25:11 +0000
commitff3ff058966118c1ba2108b9b356e458a1c2159f (patch)
treeb44e1be2856ebaeed466372fd38b9689b3e28c7e
parentUse 'cp -R' instead of 'cp -r' in the example of the -J option. (diff)
downloadwireguard-openbsd-ff3ff058966118c1ba2108b9b356e458a1c2159f.tar.xz
wireguard-openbsd-ff3ff058966118c1ba2108b9b356e458a1c2159f.zip
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).
-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
};