summaryrefslogtreecommitdiff
path: root/sys/arch/vax/if
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-07-07 23:10:47 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-07-07 23:10:47 +0000
commit82eede488a736053ee53d7963df114bb8c4f8e80 (patch)
tree34094ffb91e7cfe3131630966dc0a4deaf9bdd9a /sys/arch/vax/if
parentf6adcfa1e8fa253c177874131f7bd165bcbe0fd1 (diff)
new-style interrupt counters. based on initial work by hugh. ok miod
Diffstat (limited to 'sys/arch/vax/if')
-rw-r--r--sys/arch/vax/if/if_de.c6
-rw-r--r--sys/arch/vax/if/if_le.c18
-rw-r--r--sys/arch/vax/if/if_qe.c13
-rw-r--r--sys/arch/vax/if/sgec.c8
-rw-r--r--sys/arch/vax/if/sgecvar.h4
5 files changed, 27 insertions, 22 deletions
diff --git a/sys/arch/vax/if/if_de.c b/sys/arch/vax/if/if_de.c
index 09ef89e4cde..a6dbe086e1c 100644
--- a/sys/arch/vax/if/if_de.c
+++ b/sys/arch/vax/if/if_de.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_de.c,v 1.13 2003/06/02 23:27:57 millert Exp $ */
+/* $OpenBSD: if_de.c,v 1.14 2004/07/07 23:10:45 deraadt Exp $ */
/* $NetBSD: if_de.c,v 1.27 1997/04/19 15:02:29 ragge Exp $ */
/*
@@ -215,8 +215,8 @@ deattach(parent, self, aux)
ubarelse((void *)ds->ds_dev.dv_parent, &ds->ds_ubaddr);
bcopy((caddr_t)&ds->ds_pcbb.pcbb2, myaddr, sizeof (myaddr));
- printf("%s: hardware address %s\n", ds->ds_dev.dv_xname,
- ether_sprintf(myaddr));
+ printf("%s: address %s\n", ds->ds_dev.dv_xname,
+ ether_sprintf(myaddr));
ifp->if_ioctl = deioctl;
ifp->if_start = destart;
ds->ds_deuba.iff_flags = UBA_CANTWAIT;
diff --git a/sys/arch/vax/if/if_le.c b/sys/arch/vax/if/if_le.c
index 847b9bad707..e7182e5c5e2 100644
--- a/sys/arch/vax/if/if_le.c
+++ b/sys/arch/vax/if/if_le.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_le.c,v 1.11 2003/06/02 23:27:57 millert Exp $ */
+/* $OpenBSD: if_le.c,v 1.12 2004/07/07 23:10:45 deraadt Exp $ */
/* $NetBSD: if_le.c,v 1.14 1999/08/14 18:40:23 ragge Exp $ */
/*-
@@ -103,7 +103,8 @@
struct le_softc {
struct am7990_softc sc_am7990; /* Must be first */
- struct evcnt sc_intrcnt;
+ struct evcount sc_intrcnt;
+ int sc_vec;
volatile u_short *sc_rap;
volatile u_short *sc_rdp;
};
@@ -163,7 +164,7 @@ le_ibus_attach(parent, self, aux)
{
struct le_softc *sc = (void *)self;
int *lance_addr;
- int i, vec, br;
+ int i, br;
sc->sc_rdp = (short *)vax_map_physmem(0x20084400, 1);
sc->sc_rap = sc->sc_rdp + 2;
@@ -177,14 +178,15 @@ le_ibus_attach(parent, self, aux)
DELAY(100);
*sc->sc_rdp = LE_C0_INIT|LE_C0_INEA;
DELAY(100000);
- i = scb_vecref(&vec, &br);
- if (i == 0 || vec == 0)
+ i = scb_vecref(&sc->sc_vec, &br);
+ if (i == 0 || sc->sc_vec == 0)
return;
- scb_vecalloc(vec, (void *)am7990_intr, sc,
+ scb_vecalloc(sc->sc_vec, (void *)am7990_intr, sc,
SCB_ISTACK, &sc->sc_intrcnt);
- evcnt_attach(self, "intr", &sc->sc_intrcnt);
+ evcount_attach(&sc->sc_intrcnt, self->dv_xname,
+ (void *)&sc->sc_vec, &evcount_intr);
- printf(": vec %o ipl %x\n%s", vec, br, self->dv_xname);
+ printf(": vec %d ipl %x\n%s", sc->sc_vec, br, self->dv_xname);
/*
* MD functions.
*/
diff --git a/sys/arch/vax/if/if_qe.c b/sys/arch/vax/if/if_qe.c
index d418ecaa776..2d43a41c411 100644
--- a/sys/arch/vax/if/if_qe.c
+++ b/sys/arch/vax/if/if_qe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_qe.c,v 1.17 2003/05/11 19:41:12 deraadt Exp $ */
+/* $OpenBSD: if_qe.c,v 1.18 2004/07/07 23:10:45 deraadt Exp $ */
/* $NetBSD: if_qe.c,v 1.51 2002/06/08 12:28:37 ragge Exp $ */
/*
* Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved.
@@ -77,7 +77,8 @@ struct qe_cdata {
struct qe_softc {
struct device sc_dev; /* Configuration common part */
- struct evcnt sc_intrcnt; /* Interrupt counting */
+ struct evcount sc_intrcnt; /* Interrupt counting */
+ int sc_cvec;
struct arpcom sc_ac; /* Ethernet common part */
#define sc_if sc_ac.ac_if /* network-visible interface */
bus_space_tag_t sc_iot;
@@ -305,15 +306,17 @@ qeattach(struct device *parent, struct device *self, void *aux)
sc->sc_ac.ac_enaddr[i] = QE_RCSR(i * 2) & 0xff;
QE_WCSR(QE_CSR_VECTOR, sc->sc_intvec | 1);
- printf("\n%s: %s, hardware address %s\n", sc->sc_dev.dv_xname,
- QE_RCSR(QE_CSR_VECTOR) & 1 ? "delqa":"deqna",
+ printf(": %s, address %s\n",
+ QE_RCSR(QE_CSR_VECTOR) & 1 ? "delqa" : "deqna",
ether_sprintf(sc->sc_ac.ac_enaddr));
QE_WCSR(QE_CSR_VECTOR, QE_RCSR(QE_CSR_VECTOR) & ~1); /* ??? */
uba_intr_establish(ua->ua_icookie, ua->ua_cvec, qeintr,
sc, &sc->sc_intrcnt);
- evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt);
+ sc->sc_cvec = ua->ua_cvec;
+ evcount_attach(&sc->sc_intrcnt, sc->sc_dev.dv_xname,
+ (void *)&sc->sc_cvec, &evcount_intr);
strlcpy(ifp->if_xname, sc->sc_dev.dv_xname, sizeof ifp->if_xname);
ifp->if_softc = sc;
diff --git a/sys/arch/vax/if/sgec.c b/sys/arch/vax/if/sgec.c
index 292bcd12f02..7d4c1d7ec97 100644
--- a/sys/arch/vax/if/sgec.c
+++ b/sys/arch/vax/if/sgec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sgec.c,v 1.6 2003/05/11 19:41:12 deraadt Exp $ */
+/* $OpenBSD: sgec.c,v 1.7 2004/07/07 23:10:45 deraadt Exp $ */
/* $NetBSD: sgec.c,v 1.5 2000/06/04 02:14:14 matt Exp $ */
/*
* Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved.
@@ -175,7 +175,8 @@ sgec_attach(sc)
/* For vmstat -i
*/
- evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt);
+ evcount_attach(&sc->sc_intrcnt, sc->sc_dev.dv_xname,
+ (void *)&sc->sc_intvec, &evcount_intr);
/*
* Create ring loops of the buffer chains.
@@ -209,8 +210,7 @@ sgec_attach(sc)
if_attach(ifp);
ether_ifattach(ifp);
- printf("\n%s: hardware address %s\n", sc->sc_dev.dv_xname,
- ether_sprintf(sc->sc_ac.ac_enaddr));
+ printf(": address %s\n", ether_sprintf(sc->sc_ac.ac_enaddr));
return;
/*
diff --git a/sys/arch/vax/if/sgecvar.h b/sys/arch/vax/if/sgecvar.h
index a7bb0afc389..268d2310102 100644
--- a/sys/arch/vax/if/sgecvar.h
+++ b/sys/arch/vax/if/sgecvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sgecvar.h,v 1.3 2002/03/14 01:26:48 millert Exp $ */
+/* $OpenBSD: sgecvar.h,v 1.4 2004/07/07 23:10:45 deraadt Exp $ */
/* $NetBSD: sgecvar.h,v 1.2 2000/06/04 02:14:14 matt Exp $ */
/*
* Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved.
@@ -44,7 +44,7 @@ struct ze_cdata {
struct ze_softc {
struct device sc_dev; /* Configuration common part */
- struct evcnt sc_intrcnt; /* Interrupt counters */
+ struct evcount sc_intrcnt; /* Interrupt counters */
struct arpcom sc_ac; /* Ethernet common part */
#define sc_if sc_ac.ac_if /* network-visible interface */
bus_space_tag_t sc_iot;