aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ath
diff options
context:
space:
mode:
authorSam Leffler <sam@FreeBSD.org>2008-08-18 01:20:39 +0000
committerSam Leffler <sam@FreeBSD.org>2008-08-18 01:20:39 +0000
commit61556d9b61632a48c252bf30687fc508b81415ea (patch)
tree58ccbab45472c16fb2e057ebfe0e71c751be6a49 /sys/dev/ath
parente5d2ef086a935cf0448c65c3f135350458965249 (diff)
Notes
Diffstat (limited to 'sys/dev/ath')
-rw-r--r--sys/dev/ath/ah_osdep.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/ath/ah_osdep.h b/sys/dev/ath/ah_osdep.h
index a82bd020cfb5..062d149e5f98 100644
--- a/sys/dev/ath/ah_osdep.h
+++ b/sys/dev/ath/ah_osdep.h
@@ -87,8 +87,11 @@ extern u_int32_t ath_hal_reg_read(struct ath_hal *ah, u_int reg);
#define AH_BIG_ENDIAN 4321
#if _BYTE_ORDER == _BIG_ENDIAN
+#define OS_REG_UNSWAPPED(_reg) \
+ (((_reg) >= 0x4000 && (_reg) < 0x5000) || \
+ ((_reg) >= 0x7000 && (_reg) < 0x8000))
#define OS_REG_WRITE(_ah, _reg, _val) do { \
- if ( (_reg) >= 0x4000 && (_reg) < 0x5000) \
+ if (OS_REG_UNSWAPPED(_reg)) \
bus_space_write_4((bus_space_tag_t)(_ah)->ah_st, \
(bus_space_handle_t)(_ah)->ah_sh, (_reg), (_val)); \
else \
@@ -96,12 +99,13 @@ extern u_int32_t ath_hal_reg_read(struct ath_hal *ah, u_int reg);
(bus_space_handle_t)(_ah)->ah_sh, (_reg), (_val)); \
} while (0)
#define OS_REG_READ(_ah, _reg) \
- (((_reg) >= 0x4000 && (_reg) < 0x5000) ? \
+ (OS_REG_UNSWAPPED(_reg) ? \
bus_space_read_4((bus_space_tag_t)(_ah)->ah_st, \
(bus_space_handle_t)(_ah)->ah_sh, (_reg)) : \
bus_space_read_stream_4((bus_space_tag_t)(_ah)->ah_st, \
(bus_space_handle_t)(_ah)->ah_sh, (_reg)))
#else /* _BYTE_ORDER == _LITTLE_ENDIAN */
+#define OS_REG_UNSWAPPED(_reg) (0)
#define OS_REG_WRITE(_ah, _reg, _val) \
bus_space_write_4((bus_space_tag_t)(_ah)->ah_st, \
(bus_space_handle_t)(_ah)->ah_sh, (_reg), (_val))