summaryrefslogtreecommitdiff
path: root/sys/arch/vax/qbus/ubavar.h
diff options
context:
space:
mode:
authorHugh Graham <hugh@cvs.openbsd.org>2001-08-25 13:33:38 +0000
committerHugh Graham <hugh@cvs.openbsd.org>2001-08-25 13:33:38 +0000
commit2f9f539a801e8c00430eacc3a70495465ca02e4e (patch)
treea8c95a4e7bd59da4baa2c4974425216c11ff94b4 /sys/arch/vax/qbus/ubavar.h
parent1195029145310bb1c26d5da6e89f13372126bc9b (diff)
Bring in some useful stuff from NetBSD. Mostly work by Matt Thomas,
and concerned with intvec counting. Also some ANSIfication.
Diffstat (limited to 'sys/arch/vax/qbus/ubavar.h')
-rw-r--r--sys/arch/vax/qbus/ubavar.h35
1 files changed, 20 insertions, 15 deletions
diff --git a/sys/arch/vax/qbus/ubavar.h b/sys/arch/vax/qbus/ubavar.h
index 942b8eb7af7..90a086a003d 100644
--- a/sys/arch/vax/qbus/ubavar.h
+++ b/sys/arch/vax/qbus/ubavar.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: ubavar.h,v 1.1 2000/04/27 03:14:49 bjc Exp $ */
-/* $NetBSD: ubavar.h,v 1.26 2000/01/24 02:40:30 matt Exp $ */
+/* $OpenBSD: ubavar.h,v 1.2 2001/08/25 13:33:37 hugh Exp $ */
+/* $NetBSD: ubavar.h,v 1.29 2000/06/04 06:17:04 matt Exp $ */
/*
* Copyright (c) 1982, 1986 Regents of the University of California.
@@ -70,10 +70,9 @@
*/
struct uba_softc {
struct device uh_dev; /* Device struct, autoconfig */
+ struct evcnt uh_intrcnt; /* interrupt counting */
SIMPLEQ_HEAD(, uba_unit) uh_resq; /* resource wait chain */
- void (**uh_reset) __P((int));/* UBA reset function array */
- int *uh_resarg; /* array of ubareset args */
- int uh_resno; /* Number of devices to reset */
+ SIMPLEQ_HEAD(, uba_reset) uh_resetq; /* ubareset queue */
int uh_lastiv; /* last free interrupt vector */
int (*uh_errchk) __P((struct uba_softc *));
void (*uh_beforescan) __P((struct uba_softc *));
@@ -103,6 +102,16 @@ struct uba_unit {
};
/*
+ * Reset structure. All devices that needs to be reinitialized
+ * after an ubareset registers with this struct.
+ */
+struct uba_reset {
+ SIMPLEQ_ENTRY(uba_reset) ur_resetq;
+ void (*ur_reset)(struct device *);
+ struct device *ur_dev;
+};
+
+/*
* uba_attach_args is used during autoconfiguration. It is sent
* from ubascan() to each (possible) device.
*/
@@ -111,8 +120,6 @@ struct uba_attach_args {
bus_addr_t ua_ioh; /* I/O regs addr */
bus_dma_tag_t ua_dmat;
void *ua_icookie; /* Cookie for interrupt establish */
- /* UBA reset routine, filled in by probe */
- void (*ua_reset) __P((int));
int ua_iaddr; /* Full CSR address of device */
int ua_br; /* IPL this dev interrupted on */
int ua_cvec; /* Vector for this device */
@@ -135,14 +142,12 @@ struct uba_attach_args {
#define ubdevreg(addr) ((addr) & 017777)
#ifdef _KERNEL
-#define b_forw b_hash.le_next /* Nice to have when handling uba queues */
-
-void uba_intr_establish __P((void *, int, void (*)(void *), void *));
-void uba_attach __P((struct uba_softc *, unsigned long));
-void uba_enqueue __P((struct uba_unit *));
-void uba_done __P((struct uba_softc *));
-void ubareset __P((int));
-
+void uba_intr_establish(void *, int, void (*)(void *), void *, struct evcnt *);
+void uba_reset_establish(void (*)(struct device *), struct device *);
+void uba_attach(struct uba_softc *, unsigned long);
+void uba_enqueue(struct uba_unit *);
+void uba_done(struct uba_softc *);
+void ubareset(struct uba_softc *);
#endif /* _KERNEL */
#endif /* _QBUS_UBAVAR_H */