Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Do bus-specific interrupt handling (i.e. ahc_pci_...



details:   https://anonhg.NetBSD.org/src/rev/e1f4b58ce374
branches:  trunk
changeset: 483702:e1f4b58ce374
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Thu Mar 16 10:33:45 2000 +0000

description:
Do bus-specific interrupt handling (i.e. ahc_pci_intr) via a bus_intr
field in the softc, instead of relying on NPCI > 0. This would
prevent things from compiling if PCI buses were in the config file,
but ahc was attached only to something else than the PCI bus.

diffstat:

 sys/dev/ic/aic7xxx.c    |  17 ++++-------------
 sys/dev/ic/aic7xxxvar.h |   3 ++-
 2 files changed, 6 insertions(+), 14 deletions(-)

diffs (71 lines):

diff -r 437ffd090a91 -r e1f4b58ce374 sys/dev/ic/aic7xxx.c
--- a/sys/dev/ic/aic7xxx.c      Thu Mar 16 08:42:40 2000 +0000
+++ b/sys/dev/ic/aic7xxx.c      Thu Mar 16 10:33:45 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic7xxx.c,v 1.42 2000/03/15 02:08:28 fvdl Exp $        */
+/*     $NetBSD: aic7xxx.c,v 1.43 2000/03/16 10:33:45 fvdl Exp $        */
 
 /*
  * Generic driver for the aic7xxx based adaptec SCSI controllers
@@ -88,8 +88,6 @@
 
 #include "opt_ddb.h"
 
-#include "pci.h"
-
 #include <sys/param.h>
 #include <sys/kernel.h>
 #include <sys/systm.h>
@@ -198,10 +196,6 @@
 static int     ahc_debug = AHC_DEBUG;
 #endif
 
-#if NPCI > 0
-extern void ahc_pci_intr(struct ahc_softc *);
-#endif
-
 static int     ahcinitscbdata(struct ahc_softc *);
 static void    ahcfiniscbdata(struct ahc_softc *);
 
@@ -1499,10 +1493,9 @@
         * Any interrupts to process?
         */
        if ((intstat & INT_PEND) == 0) {
-#if NPCI > 0
-               if ((ahc_inb(ahc, ERROR) & PCIERRSTAT) != 0) {
-#ifdef AHC_PCI_DEBUG
-                       printf("%s: PCI intr: CCHADDR %x HADDR %x SEQADDR %x\n",
+               if (ahc->bus_intr && ahc->bus_intr(ahc)) {
+#ifdef AHC_DEBUG
+                       printf("%s: bus intr: CCHADDR %x HADDR %x SEQADDR %x\n",
                            ahc_name(ahc),
                            ahc_inb(ahc, CCHADDR) |
                            (ahc_inb(ahc, CCHADDR+1) << 8)
@@ -1514,10 +1507,8 @@
                            ahc_inb(ahc, SEQADDR0) |
                            (ahc_inb(ahc, SEQADDR1) << 8));
 #endif
-                       ahc_pci_intr(ahc);
                        return 1;
                }
-#endif
                return 0;
        }
 
diff -r 437ffd090a91 -r e1f4b58ce374 sys/dev/ic/aic7xxxvar.h
--- a/sys/dev/ic/aic7xxxvar.h   Thu Mar 16 08:42:40 2000 +0000
+++ b/sys/dev/ic/aic7xxxvar.h   Thu Mar 16 10:33:45 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic7xxxvar.h,v 1.21 2000/03/15 02:08:30 fvdl Exp $     */
+/*     $NetBSD: aic7xxxvar.h,v 1.22 2000/03/16 10:33:45 fvdl Exp $     */
 
 /*
  * Interface to the generic driver for the aic7xxx based adaptec
@@ -635,6 +635,7 @@
        u_int16_t                user_tagenable;/* Tagged Queuing allowed */
 
        void                    *bus_data;
+       int                     (*bus_intr)(struct ahc_softc *);
 };
 
 struct full_ahc_softc {



Home | Main Index | Thread Index | Old Index