aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/debug.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-09-23 23:06:59 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-07 16:39:41 -0400
commit475a6e4d3907d6af412d081a9eab3b1e8a24afd1 (patch)
tree4e1101f67a5cfd85e8575beafafb487b504baa45 /drivers/net/wireless/ath/ath9k/debug.c
parentbdcf8ff3dd7e89ee4b3f303b6f7e5e04876f9d76 (diff)
ath9k: use common read/write ops on pci and debug code
PCI and debug code will not be shared between ath9k and ath9k_htc, so make that code use the common read/write ops. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/debug.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 5dfc0e97d96d..352914cae6d8 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -18,6 +18,11 @@
18 18
19#include "ath9k.h" 19#include "ath9k.h"
20 20
21#define REG_WRITE_D(_ah, _reg, _val) \
22 ath9k_hw_common(_ah)->ops->write((_ah), (_val), (_reg))
23#define REG_READ_D(_ah, _reg) \
24 ath9k_hw_common(_ah)->ops->read((_ah), (_reg))
25
21static unsigned int ath9k_debug = ATH_DBG_DEFAULT; 26static unsigned int ath9k_debug = ATH_DBG_DEFAULT;
22module_param_named(debug, ath9k_debug, uint, 0); 27module_param_named(debug, ath9k_debug, uint, 0);
23 28
@@ -82,7 +87,7 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf,
82 87
83 ath9k_ps_wakeup(sc); 88 ath9k_ps_wakeup(sc);
84 89
85 REG_WRITE(ah, AR_MACMISC, 90 REG_WRITE_D(ah, AR_MACMISC,
86 ((AR_MACMISC_DMA_OBS_LINE_8 << AR_MACMISC_DMA_OBS_S) | 91 ((AR_MACMISC_DMA_OBS_LINE_8 << AR_MACMISC_DMA_OBS_S) |
87 (AR_MACMISC_MISC_OBS_BUS_1 << 92 (AR_MACMISC_MISC_OBS_BUS_1 <<
88 AR_MACMISC_MISC_OBS_BUS_MSB_S))); 93 AR_MACMISC_MISC_OBS_BUS_MSB_S)));
@@ -94,7 +99,7 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf,
94 if (i % 4 == 0) 99 if (i % 4 == 0)
95 len += snprintf(buf + len, sizeof(buf) - len, "\n"); 100 len += snprintf(buf + len, sizeof(buf) - len, "\n");
96 101
97 val[i] = REG_READ(ah, AR_DMADBG_0 + (i * sizeof(u32))); 102 val[i] = REG_READ_D(ah, AR_DMADBG_0 + (i * sizeof(u32)));
98 len += snprintf(buf + len, sizeof(buf) - len, "%d: %08x ", 103 len += snprintf(buf + len, sizeof(buf) - len, "%d: %08x ",
99 i, val[i]); 104 i, val[i]);
100 } 105 }
@@ -144,9 +149,9 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf,
144 (val[6] & 0x0001e000) >> 13, (val[6] & 0x001e0000) >> 17); 149 (val[6] & 0x0001e000) >> 13, (val[6] & 0x001e0000) >> 17);
145 150
146 len += snprintf(buf + len, sizeof(buf) - len, "pcu observe: 0x%x \n", 151 len += snprintf(buf + len, sizeof(buf) - len, "pcu observe: 0x%x \n",
147 REG_READ(ah, AR_OBS_BUS_1)); 152 REG_READ_D(ah, AR_OBS_BUS_1));
148 len += snprintf(buf + len, sizeof(buf) - len, 153 len += snprintf(buf + len, sizeof(buf) - len,
149 "AR_CR: 0x%x \n", REG_READ(ah, AR_CR)); 154 "AR_CR: 0x%x \n", REG_READ_D(ah, AR_CR));
150 155
151 ath9k_ps_restore(sc); 156 ath9k_ps_restore(sc);
152 157
@@ -363,12 +368,12 @@ static ssize_t read_file_wiphy(struct file *file, char __user *user_buf,
363 aphy->chan_idx, aphy->chan_is_ht); 368 aphy->chan_idx, aphy->chan_is_ht);
364 } 369 }
365 370
366 put_unaligned_le32(REG_READ(sc->sc_ah, AR_STA_ID0), addr); 371 put_unaligned_le32(REG_READ_D(sc->sc_ah, AR_STA_ID0), addr);
367 put_unaligned_le16(REG_READ(sc->sc_ah, AR_STA_ID1) & 0xffff, addr + 4); 372 put_unaligned_le16(REG_READ_D(sc->sc_ah, AR_STA_ID1) & 0xffff, addr + 4);
368 len += snprintf(buf + len, sizeof(buf) - len, 373 len += snprintf(buf + len, sizeof(buf) - len,
369 "addr: %pM\n", addr); 374 "addr: %pM\n", addr);
370 put_unaligned_le32(REG_READ(sc->sc_ah, AR_BSSMSKL), addr); 375 put_unaligned_le32(REG_READ_D(sc->sc_ah, AR_BSSMSKL), addr);
371 put_unaligned_le16(REG_READ(sc->sc_ah, AR_BSSMSKU) & 0xffff, addr + 4); 376 put_unaligned_le16(REG_READ_D(sc->sc_ah, AR_BSSMSKU) & 0xffff, addr + 4);
372 len += snprintf(buf + len, sizeof(buf) - len, 377 len += snprintf(buf + len, sizeof(buf) - len,
373 "addrmask: %pM\n", addr); 378 "addrmask: %pM\n", addr);
374 379