summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev/qec.c
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>1998-11-11 00:26:02 +0000
committerJason Wright <jason@cvs.openbsd.org>1998-11-11 00:26:02 +0000
commit777b7ad5376b715f1c9f137f1b1cf6d7345dc634 (patch)
tree3594b8e48c738c3130b511593e51a5a1b8700405 /sys/arch/sparc/dev/qec.c
parentdad9cda7d59a7eebcce55a30abe7e270a54af10e (diff)
Detect cards that require dma that are in non-dma slots and don't allow
them to be attach'd.
Diffstat (limited to 'sys/arch/sparc/dev/qec.c')
-rw-r--r--sys/arch/sparc/dev/qec.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/sys/arch/sparc/dev/qec.c b/sys/arch/sparc/dev/qec.c
index f0a3abec994..f0573775853 100644
--- a/sys/arch/sparc/dev/qec.c
+++ b/sys/arch/sparc/dev/qec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qec.c,v 1.8 1998/11/02 05:50:59 jason Exp $ */
+/* $OpenBSD: qec.c,v 1.9 1998/11/11 00:26:00 jason Exp $ */
/*
* Copyright (c) 1998 Theo de Raadt and Jason L. Wright.
@@ -48,12 +48,13 @@
#include <sparc/dev/qecvar.h>
int qecprint __P((void *, const char *));
+int qecmatch __P((struct device *, void *, void *));
void qecattach __P((struct device *, struct device *, void *));
void qec_fix_range __P((struct qec_softc *, struct sbus_softc *));
void qec_translate __P((struct qec_softc *, struct confargs *));
struct cfattach qec_ca = {
- sizeof(struct qec_softc), matchbyname, qecattach
+ sizeof(struct qec_softc), qecmatch, qecattach
};
struct cfdriver qec_cd = {
@@ -74,6 +75,27 @@ qecprint(aux, name)
}
/*
+ * match a QEC device in a slot capable of DMA
+ */
+int
+qecmatch(parent, vcf, aux)
+ struct device *parent;
+ void *vcf, *aux;
+{
+ struct cfdata *cf = vcf;
+ struct confargs *ca = aux;
+ struct romaux *ra = &ca->ca_ra;
+
+ if (strcmp(cf->cf_driver->cd_name, ra->ra_name))
+ return (0);
+
+ if (!sbus_testdma((struct sbus_softc *)parent, ca))
+ return (0);
+
+ return (1);
+}
+
+/*
* Attach all the sub-devices we can find
*/
void