summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2007-04-11 20:31:39 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2007-04-11 20:31:39 +0000
commitcb3a7040897423f6db6fc92e8045b735a671607c (patch)
treea9300f8f8e8adab89b38d0c03ffb10009835aec3 /sys
parent48bc1683a6199c3b4b3431568e7eca711372225a (diff)
Cleanup makros even more. Remove unused ones and reduce the amount of
insane nesting. This driver is slowly getting to a sane level of makro usage. OK mglocker@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/acxvar.h39
1 files changed, 12 insertions, 27 deletions
diff --git a/sys/dev/ic/acxvar.h b/sys/dev/ic/acxvar.h
index d7d94232f4c..7d422528494 100644
--- a/sys/dev/ic/acxvar.h
+++ b/sys/dev/ic/acxvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: acxvar.h,v 1.16 2007/03/29 12:59:29 claudio Exp $ */
+/* $OpenBSD: acxvar.h,v 1.17 2007/04/11 20:31:38 claudio Exp $ */
/*
* Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
@@ -95,38 +95,23 @@ extern int acxdebug;
#define CSR_CLRB_2(sc, reg, b) \
CSR_WRITE_2((sc), (reg), CSR_READ_2((sc), (reg)) & (~(b)))
-#define DESC_READ_1(sc, off) \
- bus_space_read_1((sc)->sc_mem2_bt, (sc)->sc_mem2_bh, (off))
-#define DESC_READ_4(sc, off) \
- bus_space_read_4((sc)->sc_mem2_bt, (sc)->sc_mem2_bh, (off))
-
-#define DESC_WRITE_1(sc, off, val) \
- bus_space_write_1((sc)->sc_mem2_bt, (sc)->sc_mem2_bh, (off), (val))
-#define DESC_WRITE_2(sc, off, val) \
- bus_space_write_2((sc)->sc_mem2_bt, (sc)->sc_mem2_bh, (off), (val))
-#define DESC_WRITE_4(sc, off, val) \
- bus_space_write_4((sc)->sc_mem2_bt, (sc)->sc_mem2_bh, (off), (val))
#define DESC_WRITE_REGION_1(sc, off, d, dlen) \
bus_space_write_region_1((sc)->sc_mem2_bt, (sc)->sc_mem2_bh, \
(off), (const uint8_t *)(d), (dlen))
-#define FW_TXDESC_SETFIELD(sc, mb, field, val, sz) \
- DESC_WRITE_##sz((sc), (mb)->tb_fwdesc_ofs + \
- offsetof(struct acx_fw_txdesc, field), (val))
-
-#define FW_TXDESC_GETFIELD(sc, mb, field, sz) \
- DESC_READ_##sz((sc), (mb)->tb_fwdesc_ofs + \
- offsetof(struct acx_fw_txdesc, field))
-
-#define FW_TXDESC_SETFIELD_1(sc, mb, field, val) \
- FW_TXDESC_SETFIELD(sc, mb, field, val, 1)
-#define FW_TXDESC_SETFIELD_2(sc, mb, field, val) \
- FW_TXDESC_SETFIELD(sc, mb, field, val, 2)
+#define FW_TXDESC_SETFIELD_1(sc, mb, field, val) \
+ bus_space_write_1((sc)->sc_mem2_bt, (sc)->sc_mem2_bh, \
+ (mb)->tb_fwdesc_ofs + offsetof(struct acx_fw_txdesc, field), (val))
+#define FW_TXDESC_SETFIELD_2(sc, mb, field, val) \
+ bus_space_write_2((sc)->sc_mem2_bt, (sc)->sc_mem2_bh, \
+ (mb)->tb_fwdesc_ofs + offsetof(struct acx_fw_txdesc, field), (val))
#define FW_TXDESC_SETFIELD_4(sc, mb, field, val) \
- FW_TXDESC_SETFIELD(sc, mb, field, val, 4)
+ bus_space_write_4((sc)->sc_mem2_bt, (sc)->sc_mem2_bh, \
+ (mb)->tb_fwdesc_ofs + offsetof(struct acx_fw_txdesc, field), (val))
-#define FW_TXDESC_GETFIELD_1(sc, mb, field) \
- FW_TXDESC_GETFIELD(sc, mb, field, 1)
+#define FW_TXDESC_GETFIELD_1(sc, mb, field) \
+ bus_space_read_1((sc)->sc_mem2_bt, (sc)->sc_mem2_bh, \
+ (mb)->tb_fwdesc_ofs + offsetof(struct acx_fw_txdesc, field))
/*
* Firmware TX descriptor