summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Leonard <d@cvs.openbsd.org>1999-08-19 06:15:39 +0000
committerDavid Leonard <d@cvs.openbsd.org>1999-08-19 06:15:39 +0000
commitca0c9fd128d28557a13cb3a0534026a70a05e4d4 (patch)
treeccb4332d68b14fe6a487bfa6e80080b1f99f50aa /sys
parent66c7ffe27c916d18da8f192f0ed47c28772ac2ac (diff)
extend debugging to 16-bit pio
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/rlnreg.h43
1 files changed, 38 insertions, 5 deletions
diff --git a/sys/dev/ic/rlnreg.h b/sys/dev/ic/rlnreg.h
index 0677837aa8c..6b2b0c4b7d8 100644
--- a/sys/dev/ic/rlnreg.h
+++ b/sys/dev/ic/rlnreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rlnreg.h,v 1.1 1999/07/30 13:43:36 d Exp $ */
+/* $OpenBSD: rlnreg.h,v 1.2 1999/08/19 06:15:38 d Exp $ */
/*
* David Leonard <d@openbsd.org>, 1999. Public Domain.
*
@@ -55,7 +55,10 @@
static void _rln_register_write_1 __P((struct rln_softc *, u_int8_t,
u_int8_t));
+static void _rln_register_write_2 __P((struct rln_softc *, u_int8_t,
+ u_int16_t));
static u_int8_t _rln_register_read_1 __P((struct rln_softc *, u_int8_t));
+static u_int16_t _rln_register_read_2 __P((struct rln_softc *, u_int8_t));
static int rln_status_rx_ready __P((struct rln_softc *));
/* Write to a register. */
@@ -73,6 +76,20 @@ _rln_register_write_1(sc, regoff, value)
_rln_regacc_delay();
}
+static inline void
+_rln_register_write_2(sc, regoff, value)
+ struct rln_softc *sc;
+ u_int8_t regoff;
+ u_int16_t value;
+{
+
+#ifdef RLNDEBUG_REG
+ printf(" %c<%04x", "DDS3CEI7"[regoff], value);
+#endif
+ bus_space_write_2((sc)->sc_iot, (sc)->sc_ioh, (regoff), (value));
+ _rln_regacc_delay();
+}
+
/* Read from a register. */
static inline u_int8_t
_rln_register_read_1(sc, regoff)
@@ -92,6 +109,24 @@ _rln_register_read_1(sc, regoff)
return (ret);
}
+
+static inline u_int16_t
+_rln_register_read_2(sc, regoff)
+ struct rln_softc *sc;
+ u_int8_t regoff;
+{
+ u_int16_t ret;
+
+ ret = bus_space_read_2((sc)->sc_iot, (sc)->sc_ioh, (regoff));
+#ifdef RLNDEBUG_REG
+ if (ret != (sc)->dbg_oreg[regoff]) {
+ printf(" %c>%04x", "DDS3CEI7"[regoff], ret);
+ (sc)->dbg_oreg[regoff] = ret;
+ }
+#endif
+ return (ret);
+}
+
/* 8-bit data register access. */
#define rln_data_write_1(sc, value) \
_rln_register_write_1(sc, RLN_REG_DATA, (value))
@@ -106,11 +141,9 @@ _rln_register_read_1(sc, regoff)
/* 16-bit data register access. */
#define rln_data_write_2(sc, value) \
- bus_space_write_2((sc)->sc_iot, (sc)->sc_ioh, \
- RLN_REG_DATA, (value))
+ _rln_register_write_2(sc, RLN_REG_DATA, (value))
#define rln_data_read_2(sc) \
- bus_space_read_2((sc)->sc_iot, (sc)->sc_ioh, \
- RLN_REG_DATA)
+ _rln_register_read_2(sc, RLN_REG_DATA)
#define rln_data_write_multi_2(sc, buf, len) \
bus_space_write_multi_2((sc)->sc_iot, (sc)->sc_ioh, \
RLN_REG_DATA, (buf), (len))