summaryrefslogtreecommitdiffstats
path: root/sys/dev/dpt
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>1999-08-01 22:57:09 +0000
committermdodd <mdodd@FreeBSD.org>1999-08-01 22:57:09 +0000
commitc790088cf6511de19be83cd5a1ca24ad896d2be1 (patch)
tree62ea067550649b36861238bc9f0b86abd784376b /sys/dev/dpt
parent6a572156072aa10677fe402b5b7995b0754131d6 (diff)
downloadFreeBSD-src-c790088cf6511de19be83cd5a1ca24ad896d2be1.zip
FreeBSD-src-c790088cf6511de19be83cd5a1ca24ad896d2be1.tar.gz
Move the specification of EDGE/LEVEL triggered interrupts to
eisa_add_intr() which now takes an additional arguement (one of EISA_TRIGGER_LEVEL or EISA_TRIGGER_EDGE). The flag RR_SHAREABLE has no effect when passed to bus_alloc_resource(dev, SYS_RES_IRQ, ...) in an EISA device context as the eisa_alloc_resource() call (bus_alloc_resource method) now deals with this flag directly, depending on the device ivars. This change does nothing more than move all the 'shared = inb(foo + iobsse)' nonesense to the device probe methods rather than the device attach. Also, print out 'edge' or 'level' in the IRQ announcement message. Reviewed by: dfr
Diffstat (limited to 'sys/dev/dpt')
-rw-r--r--sys/dev/dpt/dpt_eisa.c21
-rw-r--r--sys/dev/dpt/dpt_eisa.h5
2 files changed, 14 insertions, 12 deletions
diff --git a/sys/dev/dpt/dpt_eisa.c b/sys/dev/dpt/dpt_eisa.c
index e38ea66..0c376f4 100644
--- a/sys/dev/dpt/dpt_eisa.c
+++ b/sys/dev/dpt/dpt_eisa.c
@@ -33,7 +33,7 @@
*/
/*
- * $Id: dpt_eisa.c,v 1.5 1999/04/18 15:50:33 peter Exp $
+ * $Id: dpt_eisa.c,v 1.6 1999/05/08 21:59:19 dfr Exp $
*/
#include "eisa.h"
@@ -78,6 +78,7 @@ dpt_eisa_probe(device_t dev)
u_int32_t io_base;
u_int intdef;
u_int irq;
+ int shared;
desc = dpt_eisa_match(eisa_get_id(dev));
if (!desc)
@@ -88,10 +89,14 @@ dpt_eisa_probe(device_t dev)
+ DPT_EISA_SLOT_OFFSET;
eisa_add_iospace(dev, io_base, DPT_EISA_IOSIZE, RESVADDR_NONE);
+
+ outb((DPT_EISA_CFENABLE + io_base), 0xf8);
- intdef = inb(DPT_EISA_INTDEF + io_base);
+ intdef = inb(DPT_EISA_INTDEF + io_base);
irq = intdef & DPT_EISA_INT_NUM_MASK;
+ shared = (intdef & DPT_EISA_INT_LEVEL)
+ ? EISA_TRIGGER_LEVEL : EISA_TRIGGER_EDGE;
switch (irq) {
case DPT_EISA_INT_NUM_11:
irq = 11;
@@ -103,15 +108,15 @@ dpt_eisa_probe(device_t dev)
irq = 14;
break;
default:
- printf("dpt at slot %d: illegal irq setting %d\n",
+ device_printf(dev, "dpt at slot %d: illegal irq setting %d\n",
eisa_get_slot(dev), irq);
irq = 0;
break;
}
if (irq == 0)
- return ENXIO;
+ return (ENXIO);
- eisa_add_intr(dev, irq);
+ eisa_add_intr(dev, irq, shared);
return 0;
}
@@ -123,7 +128,6 @@ dpt_eisa_attach(device_t dev)
struct resource *io = 0;
struct resource *irq = 0;
int unit = device_get_unit(dev);
- int shared;
int s;
int rid;
void *ih;
@@ -136,9 +140,6 @@ dpt_eisa_attach(device_t dev)
return ENOMEM;
}
- shared = (inb(DPT_EISA_INTDEF + rman_get_start(io))
- & DPT_EISA_INT_LEVEL) ? RF_SHAREABLE : 0;
-
dpt = dpt_alloc(unit, rman_get_bustag(io),
rman_get_bushandle(io) + DPT_EISA_EATA_REG_OFFSET);
if (dpt == NULL)
@@ -160,7 +161,7 @@ dpt_eisa_attach(device_t dev)
rid = 0;
irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid,
- 0, ~0, 1, shared | RF_ACTIVE);
+ 0, ~0, 1, RF_ACTIVE);
if (!irq) {
device_printf(dev, "No irq?!\n");
goto bad;
diff --git a/sys/dev/dpt/dpt_eisa.h b/sys/dev/dpt/dpt_eisa.h
index e76087b..0731911 100644
--- a/sys/dev/dpt/dpt_eisa.h
+++ b/sys/dev/dpt/dpt_eisa.h
@@ -32,12 +32,14 @@
*/
/*
- * $Id: dpt_eisa.h,v 1.1 1998/03/11 00:30:14 julian Exp $
+ * $Id: dpt_eisa.h,v 1.2 1998/09/15 08:33:35 gibbs Exp $
*/
#define DPT_EISA_SLOT_OFFSET 0xc00
#define DPT_EISA_IOSIZE 0x100
+#define DPT_EISA_CFENABLE 0x8f
+
#define DPT_EISA_INTDEF 0x90
#define DPT_EISA_INT_LEVEL 0x04
#define DPT_EISA_INT_NUM_MASK 0x38
@@ -62,4 +64,3 @@
#define DPT_EISA_DPTBC01 0x1214BC01
#define DPT_EISA_NEC8200 0x12148200
#define DPT_EISA_ATT2408 0x12142408
-
OpenPOWER on IntegriCloud