aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c21
-rw-r--r--drivers/net/wireless/ath/ath9k/pci.c4
2 files changed, 15 insertions, 10 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
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index a1001ffdd389..b2a45ce62698 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -65,7 +65,7 @@ static bool ath_pci_eeprom_read(struct ath_common *common, u32 off, u16 *data)
65{ 65{
66 struct ath_hw *ah = (struct ath_hw *) common->ah; 66 struct ath_hw *ah = (struct ath_hw *) common->ah;
67 67
68 (void)REG_READ(ah, AR5416_EEPROM_OFFSET + (off << AR5416_EEPROM_S)); 68 common->ops->read(ah, AR5416_EEPROM_OFFSET + (off << AR5416_EEPROM_S));
69 69
70 if (!ath9k_hw_wait(ah, 70 if (!ath9k_hw_wait(ah,
71 AR_EEPROM_STATUS_DATA, 71 AR_EEPROM_STATUS_DATA,
@@ -75,7 +75,7 @@ static bool ath_pci_eeprom_read(struct ath_common *common, u32 off, u16 *data)
75 return false; 75 return false;
76 } 76 }
77 77
78 *data = MS(REG_READ(ah, AR_EEPROM_STATUS_DATA), 78 *data = MS(common->ops->read(ah, AR_EEPROM_STATUS_DATA),
79 AR_EEPROM_STATUS_DATA_VAL); 79 AR_EEPROM_STATUS_DATA_VAL);
80 80
81 return true; 81 return true;