Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci check interrupt status of the PCI interface chip...
details: https://anonhg.NetBSD.org/src/rev/a2c8c918badf
branches: trunk
changeset: 525884:a2c8c918badf
user: drochner <drochner%NetBSD.org@localhost>
date: Fri Apr 19 10:55:46 2002 +0000
description:
check interrupt status of the PCI interface chip (if possible)
before calling the (slow) isic handler
being here, remove #ifdefs for FreeBSD and old version support
and add RCS ID tags
diffstat:
sys/dev/pci/isic_pci.c | 26 +---
sys/dev/pci/isic_pci.h | 6 +-
sys/dev/pci/isic_pci_elsa_qs1p.c | 244 +++++---------------------------------
3 files changed, 47 insertions(+), 229 deletions(-)
diffs (truncated from 471 to 300 lines):
diff -r 437930c2478f -r a2c8c918badf sys/dev/pci/isic_pci.c
--- a/sys/dev/pci/isic_pci.c Fri Apr 19 10:40:23 2002 +0000
+++ b/sys/dev/pci/isic_pci.c Fri Apr 19 10:55:46 2002 +0000
@@ -1,3 +1,5 @@
+/* $NetBSD: isic_pci.c,v 1.15 2002/04/19 10:55:46 drochner Exp $ */
+
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -35,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isic_pci.c,v 1.14 2002/04/14 12:24:27 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isic_pci.c,v 1.15 2002/04/19 10:55:46 drochner Exp $");
#include <sys/param.h>
#include <sys/errno.h>
@@ -45,6 +47,7 @@
#include <net/if.h>
#include <sys/systm.h>
#include <sys/malloc.h>
+#include <sys/callout.h>
#include <machine/cpu.h>
#include <machine/intr.h>
@@ -57,16 +60,7 @@
#include <dev/pci/pcivar.h>
#include <dev/pci/pcidevs.h>
-#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
-#include <sys/callout.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_ioctl.h>
-#else
#include <netisdn/i4b_ioctl.h>
-#endif
-
#include <netisdn/i4b_global.h>
#include <netisdn/i4b_debug.h>
#include <netisdn/i4b_trace.h>
@@ -161,10 +155,8 @@
printf(": %s\n", prod->name);
-#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
callout_init(&sc->sc_T3_callout);
callout_init(&sc->sc_T4_callout);
-#endif
/* card initilization and sc setup */
prod->attach(psc, pa);
@@ -219,7 +211,7 @@
break;
case 0x02:
- printf("%s: IPAC PSB2115 Version 2\n", sc->sc_dev.dv_xname);
+ printf("%s: IPAC PSB2115 Version 1.2\n", sc->sc_dev.dv_xname);
break;
default:
@@ -276,7 +268,7 @@
return;
}
intrstr = pci_intr_string(pc, ih);
- psc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, isicintr, sc);
+ psc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, isic_intr_qs1p, psc);
if (psc->sc_ih == NULL) {
printf("%s: couldn't establish interrupt",
sc->sc_dev.dv_xname);
@@ -318,11 +310,6 @@
sc->sc_obuf2 = NULL;
sc->sc_freeflag2 = 0;
-#if defined(__FreeBSD__) && __FreeBSD__ >=3
- callout_handle_init(&sc->sc_T3_callout);
- callout_handle_init(&sc->sc_T4_callout);
-#endif
-
/* init higher protocol layers */
isic_attach_bri(sc, cardname, &isic_std_driver);
}
@@ -364,4 +351,3 @@
splx(s);
return (error);
}
-
diff -r 437930c2478f -r a2c8c918badf sys/dev/pci/isic_pci.h
--- a/sys/dev/pci/isic_pci.h Fri Apr 19 10:40:23 2002 +0000
+++ b/sys/dev/pci/isic_pci.h Fri Apr 19 10:55:46 2002 +0000
@@ -1,3 +1,5 @@
+/* $NetBSD: isic_pci.h,v 1.5 2002/04/19 10:55:46 drochner Exp $ */
+
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -42,8 +44,10 @@
bus_addr_t sc_base;
bus_size_t sc_size;
pci_chipset_tag_t sc_pc;
+ int flags;
+#define PCIISIC_LCROK 0x01
};
extern void isic_attach_Eqs1pp __P((struct pci_isic_softc *psc, struct pci_attach_args *pa));
extern void isic_attach_fritzPci __P((struct pci_isic_softc *psc, struct pci_attach_args *pa));
-
+extern int isic_intr_qs1p(void *);
diff -r 437930c2478f -r a2c8c918badf sys/dev/pci/isic_pci_elsa_qs1p.c
--- a/sys/dev/pci/isic_pci_elsa_qs1p.c Fri Apr 19 10:40:23 2002 +0000
+++ b/sys/dev/pci/isic_pci_elsa_qs1p.c Fri Apr 19 10:55:46 2002 +0000
@@ -1,3 +1,5 @@
+/* $NetBSD: isic_pci_elsa_qs1p.c,v 1.9 2002/04/19 10:55:46 drochner Exp $ */
+
/*
* Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
*
@@ -27,14 +29,10 @@
* isic - I4B Siemens ISDN Chipset Driver for ELSA Quickstep 1000pro PCI
* =====================================================================
*
- * $Id: isic_pci_elsa_qs1p.c,v 1.8 2002/04/18 15:32:30 martin Exp $
- *
- * last edit-date: [Fri Jan 5 11:38:58 2001]
- *
*---------------------------------------------------------------------------*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isic_pci_elsa_qs1p.c,v 1.8 2002/04/18 15:32:30 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isic_pci_elsa_qs1p.c,v 1.9 2002/04/19 10:55:46 drochner Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -42,28 +40,10 @@
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <net/if.h>
-
-#if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
#include <sys/callout.h>
-#endif
-#ifdef __FreeBSD__
-#if __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
#include <machine/bus.h>
#include <sys/device.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
@@ -71,8 +51,6 @@
#include <netisdn/i4b_debug.h>
#include <netisdn/i4b_ioctl.h>
-#endif
-
#include <netisdn/i4b_global.h>
#include <netisdn/i4b_debug.h>
#include <netisdn/i4b_l2.h>
@@ -83,10 +61,7 @@
#include <dev/ic/isac.h>
#include <dev/ic/hscx.h>
#include <dev/ic/ipac.h>
-
-#ifndef __FreeBSD__
#include <dev/pci/isic_pci.h>
-#endif
/* masks for register encoded in base addr */
@@ -121,29 +96,6 @@
/*---------------------------------------------------------------------------*
* ELSA QuickStep 1000pro/PCI ISAC get fifo routine
*---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-eqs1pp_read_fifo(void *buf, const void *base, size_t len)
-{
- if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXB)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, IPAC_HSCXB_OFF);
- insb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW), (u_char *)buf, (u_int)len);
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXA)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, IPAC_HSCXA_OFF);
- insb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW), (u_char *)buf, (u_int)len);
- }
- else /* if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDISAC) */
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, IPAC_ISAC_OFF);
- insb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW), (u_char *)buf, (u_int)len);
- }
-}
-
-#else
static void
eqs1pp_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
@@ -166,34 +118,9 @@
}
}
-#endif
-
/*---------------------------------------------------------------------------*
* ELSA QuickStep 1000pro/PCI ISAC put fifo routine
*---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-eqs1pp_write_fifo(void *base, const void *buf, size_t len)
-{
- if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXB)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, IPAC_HSCXB_OFF);
- outsb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW), (u_char *)buf, (u_int)len);
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXA)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, IPAC_HSCXA_OFF);
- outsb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW), (u_char *)buf, (u_int)len);
- }
- else /* if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDISAC) */
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, IPAC_ISAC_OFF);
- outsb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW), (u_char *)buf, (u_int)len);
- }
-}
-
-#else
static void
eqs1pp_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
@@ -215,39 +142,10 @@
break;
}
}
-#endif
/*---------------------------------------------------------------------------*
* ELSA QuickStep 1000pro/PCI ISAC put register routine
*---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-eqs1pp_write_reg(u_char *base, u_int offset, u_int v)
-{
- if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXB)
- {
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, (u_char)(offset+IPAC_HSCXB_OFF));
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW, (u_char)v);
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXA)
- {
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, (u_char)(offset+IPAC_HSCXA_OFF));
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW, (u_char)v);
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDISAC)
- {
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, (u_char)(offset+IPAC_ISAC_OFF));
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW, (u_char)v);
- }
- else /* IPAC */
- {
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, (u_char)(offset+IPAC_IPAC_OFF));
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW, (u_char)v);
- }
-}
-
-#else
static void
eqs1pp_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
@@ -273,39 +171,10 @@
break;
}
}
-#endif
/*---------------------------------------------------------------------------*
* ELSA QuickStep 1000pro/PCI ISAC get register routine
*---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
Home |
Main Index |
Thread Index |
Old Index