summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorcgd <cgd@NetBSD.org>1995-04-17 12:06:30 +0000
committercgd <cgd@NetBSD.org>1995-04-17 12:06:30 +0000
commit8a640328edd60eb5a19fc29a8847efd3baeb4fa8 (patch)
tree8f8ab3df0b9f5b324f7c9ac9288e1c3123eb36a5 /sys/dev/pci
parent78ec8e770169b76edc642d16e220a93f577713f9 (diff)
clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done, but it's getting better...
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/ncr.c22
-rw-r--r--sys/dev/pci/pcivar.h12
2 files changed, 20 insertions, 14 deletions
diff --git a/sys/dev/pci/ncr.c b/sys/dev/pci/ncr.c
index fa2ddfb5527..ed3f85a00ef 100644
--- a/sys/dev/pci/ncr.c
+++ b/sys/dev/pci/ncr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ncr.c,v 1.13 1995/03/28 20:00:53 jtc Exp $ */
+/* $NetBSD: ncr.c,v 1.14 1995/04/17 12:09:43 cgd Exp $ */
/**************************************************************************
**
@@ -907,7 +907,7 @@ struct ccb {
struct ncb {
#ifdef __NetBSD__
struct device sc_dev;
- struct intrhand sc_ih;
+ void *sc_ih;
#else /* !__NetBSD__ */
int unit;
#endif /* __NetBSD__ */
@@ -1157,7 +1157,7 @@ ccb_p ncr_get_ccb (ncb_p np, u_long flags, u_long t,u_long l);
U_INT32 ncr_info (int unit);
#endif /* !__NetBSD__ */
void ncr_init (ncb_p np, char * msg, u_long code);
-int ncr_intr (ncb_p np);
+int ncr_intr (void *);
void ncr_int_ma (ncb_p np);
void ncr_int_sir (ncb_p np);
void ncr_int_sto (ncb_p np);
@@ -1204,7 +1204,7 @@ void ncr_attach (pcici_t tag, int unit);
static char ident[] =
- "\n$Id: ncr.c,v 1.13 1995/03/28 20:00:53 jtc Exp $\n";
+ "\n$Id: ncr.c,v 1.14 1995/04/17 12:09:43 cgd Exp $\n";
u_long ncr_version = NCR_VERSION
+ (u_long) sizeof (struct ncb)
@@ -3280,11 +3280,8 @@ void ncr_attach (pcici_t config_id, int unit)
};
#ifdef __NetBSD__
- np->sc_ih.ih_fun = ncr_intr;
- np->sc_ih.ih_arg = np;
- np->sc_ih.ih_level = IPL_BIO;
-
- if (pci_map_int(pa->pa_tag, &np->sc_ih))
+ np->sc_ih = pci_map_int(pa->pa_tag, PCI_IPL_BIO, ncr_intr, np);
+ if (np->sc_ih == NULL)
return;
#else /* !__NetBSD__ */
/*
@@ -3314,7 +3311,7 @@ void ncr_attach (pcici_t config_id, int unit)
ncr_name (np));
DELAY (1000000);
#endif
- printf ("%s scanning for targets 0..%d ($Revision: 1.13 $)\n",
+ printf ("%s scanning for targets 0..%d ($Revision: 1.14 $)\n",
ncr_name (np), MAX_TARGET-1);
/*
@@ -3366,9 +3363,10 @@ void ncr_attach (pcici_t config_id, int unit)
*/
int
-ncr_intr(np)
- ncb_p np;
+ncr_intr(arg)
+ void *arg;
{
+ ncb_p np = arg;
int n = 0;
if (DEBUG_FLAGS & DEBUG_TINY) printf ("[");
diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h
index d3c843ae2cd..f128fc12e40 100644
--- a/sys/dev/pci/pcivar.h
+++ b/sys/dev/pci/pcivar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: pcivar.h,v 1.4 1995/01/27 05:44:33 cgd Exp $ */
+/* $NetBSD: pcivar.h,v 1.5 1995/04/17 12:09:47 cgd Exp $ */
/*
* Copyright (c) 1994 Charles Hannum. All rights reserved.
@@ -45,6 +45,14 @@ ERROR: COMPILING FOR UNSUPPORTED MACHINE, OR MORE THAN ONE.
#include <i386/pci/pci_machdep.h>
#endif
+/* PCI interrupt levels; system interrupt levels for PCI bus use */
+typedef enum {
+ PCI_IPL_NONE, /* block only the interrupt's IRQ*/
+ PCI_IPL_BIO, /* block I/O interrupts */
+ PCI_IPL_NET, /* network */
+ PCI_IPL_TTY, /* terminal */
+ PCI_IPL_CLOCK, /* clock */
+} pci_intrlevel;
struct pci_attach_args {
int pa_bus;
@@ -57,4 +65,4 @@ pcitag_t pci_make_tag __P((int, int, int));
pcireg_t pci_conf_read __P((pcitag_t, int));
void pci_conf_write __P((pcitag_t, int, pcireg_t));
int pci_map_mem __P((pcitag_t, int, vm_offset_t *, vm_offset_t *));
-int pci_map_int __P((pcitag_t, struct intrhand *));
+void *pci_map_int __P((pcitag_t, pci_intrlevel, int (*)(void *), void *));