diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-10-04 13:43:15 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-10-19 15:53:06 -0400 |
commit | 037fd9b6473393c35a31f0c43e26eb7e874e901d (patch) | |
tree | 36952e61f40c5ab8975c1e2df522aae477a3b168 /drivers | |
parent | ed9f0ed3b977f480a35ea3d3e9d966d89724185e (diff) |
ath_hw: Use common REG_WRITE parameter order
All defines for REG_WRITE in Atheros wireless drivers use the order "ah",
"register" and "value". hw.c is the only file using the order "ah", "value" and
"register".
drivers/net/wireless/ath/ath9k/hw.h:#define REG_WRITE(_ah, _reg, _val) \
drivers/net/wireless/ath/key.c:#define REG_WRITE(_ah, _reg, _val) (common->ops->write)(_ah, _val, _reg)
This inconsistent definition can easily lead to implementation errors. The
modification doesn't change the behavior of the driver or the generated code.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/hw.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/wireless/ath/hw.c b/drivers/net/wireless/ath/hw.c index 19befb331073..39e8a590d7fc 100644 --- a/drivers/net/wireless/ath/hw.c +++ b/drivers/net/wireless/ath/hw.c | |||
@@ -20,8 +20,8 @@ | |||
20 | #include "ath.h" | 20 | #include "ath.h" |
21 | #include "reg.h" | 21 | #include "reg.h" |
22 | 22 | ||
23 | #define REG_READ (common->ops->read) | 23 | #define REG_READ (common->ops->read) |
24 | #define REG_WRITE (common->ops->write) | 24 | #define REG_WRITE(_ah, _reg, _val) (common->ops->write)(_ah, _val, _reg) |
25 | 25 | ||
26 | /** | 26 | /** |
27 | * ath_hw_set_bssid_mask - filter out bssids we listen | 27 | * ath_hw_set_bssid_mask - filter out bssids we listen |
@@ -119,8 +119,8 @@ void ath_hw_setbssidmask(struct ath_common *common) | |||
119 | { | 119 | { |
120 | void *ah = common->ah; | 120 | void *ah = common->ah; |
121 | 121 | ||
122 | REG_WRITE(ah, get_unaligned_le32(common->bssidmask), AR_BSSMSKL); | 122 | REG_WRITE(ah, AR_BSSMSKL, get_unaligned_le32(common->bssidmask)); |
123 | REG_WRITE(ah, get_unaligned_le16(common->bssidmask + 4), AR_BSSMSKU); | 123 | REG_WRITE(ah, AR_BSSMSKU, get_unaligned_le16(common->bssidmask + 4)); |
124 | } | 124 | } |
125 | EXPORT_SYMBOL(ath_hw_setbssidmask); | 125 | EXPORT_SYMBOL(ath_hw_setbssidmask); |
126 | 126 | ||
@@ -139,7 +139,7 @@ void ath_hw_cycle_counters_update(struct ath_common *common) | |||
139 | void *ah = common->ah; | 139 | void *ah = common->ah; |
140 | 140 | ||
141 | /* freeze */ | 141 | /* freeze */ |
142 | REG_WRITE(ah, AR_MIBC_FMC, AR_MIBC); | 142 | REG_WRITE(ah, AR_MIBC, AR_MIBC_FMC); |
143 | 143 | ||
144 | /* read */ | 144 | /* read */ |
145 | cycles = REG_READ(ah, AR_CCCNT); | 145 | cycles = REG_READ(ah, AR_CCCNT); |
@@ -148,13 +148,13 @@ void ath_hw_cycle_counters_update(struct ath_common *common) | |||
148 | tx = REG_READ(ah, AR_TFCNT); | 148 | tx = REG_READ(ah, AR_TFCNT); |
149 | 149 | ||
150 | /* clear */ | 150 | /* clear */ |
151 | REG_WRITE(ah, 0, AR_CCCNT); | 151 | REG_WRITE(ah, AR_CCCNT, 0); |
152 | REG_WRITE(ah, 0, AR_RFCNT); | 152 | REG_WRITE(ah, AR_RFCNT, 0); |
153 | REG_WRITE(ah, 0, AR_RCCNT); | 153 | REG_WRITE(ah, AR_RCCNT, 0); |
154 | REG_WRITE(ah, 0, AR_TFCNT); | 154 | REG_WRITE(ah, AR_TFCNT, 0); |
155 | 155 | ||
156 | /* unfreeze */ | 156 | /* unfreeze */ |
157 | REG_WRITE(ah, 0, AR_MIBC); | 157 | REG_WRITE(ah, AR_MIBC, 0); |
158 | 158 | ||
159 | /* update all cycle counters here */ | 159 | /* update all cycle counters here */ |
160 | common->cc_ani.cycles += cycles; | 160 | common->cc_ani.cycles += cycles; |