summaryrefslogtreecommitdiff
path: root/sys/arch/sparc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-07-05 06:50:22 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-07-05 06:50:22 +0000
commitac09caf2bff1ed3a50b7e8f0a9c4d846c8a1d84b (patch)
tree2365bc9241c36d8955c56c2f7c98f9a650001c9a /sys/arch/sparc
parent3196160ab52d4aa81321633a07f7690e85354f07 (diff)
start at irq framework
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r--sys/arch/sparc/dev/be.c69
-rw-r--r--sys/arch/sparc/dev/bevar.h5
2 files changed, 60 insertions, 14 deletions
diff --git a/sys/arch/sparc/dev/be.c b/sys/arch/sparc/dev/be.c
index 0dc5b3aeb08..a4090cbc31e 100644
--- a/sys/arch/sparc/dev/be.c
+++ b/sys/arch/sparc/dev/be.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: be.c,v 1.2 1998/07/04 20:20:57 deraadt Exp $ */
+/* $OpenBSD: be.c,v 1.3 1998/07/05 06:50:20 deraadt Exp $ */
/*
* Copyright (c) 1998 Theo de Raadt. All rights reserved.
@@ -62,6 +62,7 @@
#include <sparc/dev/dmavar.h>
#include <sparc/dev/qecvar.h>
+#include <sparc/dev/qecreg.h>
#include <sparc/dev/bereg.h>
#include <sparc/dev/bevar.h>
@@ -72,9 +73,14 @@ void beinit __P((struct besoftc *));
void bestart __P((struct ifnet *));
void bestop __P((struct besoftc *));
void bewatchdog __P((struct ifnet *));
-int beintr __P((void *));
int beioctl __P((struct ifnet *, u_long, caddr_t));
+int beintr __P((void *));
+int betint __P((struct besoftc *));
+int berint __P((struct besoftc *));
+int beqint __P((struct besoftc *));
+int beeint __P((struct besoftc *));
+
struct cfdriver be_cd = {
NULL, "be", DV_IFNET
};
@@ -123,6 +129,7 @@ beattach(parent, self, aux)
sc->sc_cr = mapiodev(ca->ca_ra.ra_reg, 0, sizeof(struct be_cregs));
sc->sc_br = mapiodev(&ca->ca_ra.ra_reg[1], 0, sizeof(struct be_bregs));
sc->sc_tr = mapiodev(&ca->ca_ra.ra_reg[2], 0, sizeof(struct be_tregs));
+ sc->sc_qr = qec->sc_regs;
bestop(sc);
sc->sc_mem = qec->sc_buffer;
@@ -246,17 +253,53 @@ int
beintr(v)
void *v;
{
-#if 0
+ int r = 0;
struct besoftc *sc = (struct besoftc *)v;
u_int32_t why;
- why = be_read32(&greg->stat);
+#if 1
+ why = sc->sc_qr->stat;
- if (why & GREG_STAT_TXALL)
- be_tint(sc);
+ if (why & QEC_STAT_TX)
+ r |= betint(sc);
+ if (why & QEC_STAT_RX)
+ r |= berint(sc);
+ if (why & QEC_STAT_BM)
+ r |= beqint(sc);
+ if (why & QEC_STAT_ER)
+ r |= beeint(sc);
+ if (r)
+ printf("%s: intr: why=%08x\n", sc->sc_dev.dv_xname, why);
- printf("%s: intr: why=%08x\n", sc->sc_dev.dv_xname, why);
#endif
+ return (r);
+}
+
+int
+betint(sc)
+ struct besoftc *sc;
+{
+ return (0);
+}
+
+int
+berint(sc)
+ struct besoftc *sc;
+{
+ return (0);
+}
+
+int
+beqint(sc)
+ struct besoftc *sc;
+{
+ return (0);
+}
+
+int
+beeint(sc)
+ struct besoftc *sc;
+{
return (0);
}
@@ -372,13 +415,15 @@ void
beinit(sc)
struct besoftc *sc;
{
-#if 0
- u_int32_t c;
- struct be_bregs *br = sc->sc_bregs;
- struct be_cregs *cr = sc->sc_cregs;
- struct be_tregs *tr = sc->sc_tregs;
bestop(sc);
+#if 0
+ sc->sc_qr->msize = sc->sc_memsize;
+ sc->sc_qr->rsize = sc->sc_memsize / 2;
+ sc->sc_qr->tsize = sc->sc_memsize / 2;
+ sc->sc_qr->psize = 2048;
+ /*sc->sc_qr->ctrl = QEC_CTRL_BMODE | QEC_CTRL_B32;*/
+
be_meminit(sc);
be_write32(&treg->int_mask, 0xffff);
diff --git a/sys/arch/sparc/dev/bevar.h b/sys/arch/sparc/dev/bevar.h
index 3b7b07180a1..4673bec4927 100644
--- a/sys/arch/sparc/dev/bevar.h
+++ b/sys/arch/sparc/dev/bevar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bevar.h,v 1.2 1998/07/04 20:20:58 deraadt Exp $ */
+/* $OpenBSD: bevar.h,v 1.3 1998/07/05 06:50:21 deraadt Exp $ */
/*
* Copyright (c) 1998 Theo de Raadt. All rights reserved.
@@ -29,15 +29,16 @@
struct besoftc {
struct device sc_dev;
struct sbusdev sc_sd; /* sbus device */
+ struct arpcom sc_arpcom;
struct intrhand sc_ih; /* interrupt vectoring */
struct dma_softc *sc_dma; /* pointer to my dma */
u_long sc_laddr; /* DMA address */
+ struct qecregs *sc_qr; /* QEC registers */
struct be_bregs *sc_br; /* registers */
struct be_cregs *sc_cr; /* registers */
struct be_tregs *sc_tr; /* registers */
- struct arpcom sc_arpcom;
void *sc_mem;
int sc_memsize;
long sc_addr;