aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2010-03-31 18:05:37 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-04-06 16:55:08 -0400
commit152d530d9edbb08424dc1b6561252597a7932c49 (patch)
tree2fd5f34a59e76a11bd683cf5dcd925ac09f90533 /drivers/net/wireless/ath
parent3069168c82d65f88e4ac76eda09baff02adfd743 (diff)
ath9k: remove ah->mask_reg, it's never used properly
ah->mask_reg was used to hold different data throughout the driver. ath9k_hw_init_interrupt_masks() used it to save the value written to AR_IMR. ath9k_hw_set_interrupts() used it to hold the interrupt mask as defined in enum ath9k_int. Those masks differ in many bits. Use ah->imask instead of ah->mask_reg in ath9k_hw_set_interrupts() and ath9k_hw_updatetxtriglevel(). That's what the code was meant to do. ah->imask is initialized in ath9k_start(), so we don't need to initialize it from ah->mask_reg. Once it's done, ah->mask_reg becomes write-only, so it's replaced with a local variable in ath9k_hw_init_interrupt_masks(). Signed-off-by: Pavel Roskin <proski@gnu.org> Reported-by: Julia Lawall <julia@diku.dk> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c15
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/mac.c2
3 files changed, 8 insertions, 10 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 77db932c3137..e716b600dec5 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1120,23 +1120,23 @@ static void ath9k_hw_init_chain_masks(struct ath_hw *ah)
1120static void ath9k_hw_init_interrupt_masks(struct ath_hw *ah, 1120static void ath9k_hw_init_interrupt_masks(struct ath_hw *ah,
1121 enum nl80211_iftype opmode) 1121 enum nl80211_iftype opmode)
1122{ 1122{
1123 ah->mask_reg = AR_IMR_TXERR | 1123 u32 imr_reg = AR_IMR_TXERR |
1124 AR_IMR_TXURN | 1124 AR_IMR_TXURN |
1125 AR_IMR_RXERR | 1125 AR_IMR_RXERR |
1126 AR_IMR_RXORN | 1126 AR_IMR_RXORN |
1127 AR_IMR_BCNMISC; 1127 AR_IMR_BCNMISC;
1128 1128
1129 if (ah->config.rx_intr_mitigation) 1129 if (ah->config.rx_intr_mitigation)
1130 ah->mask_reg |= AR_IMR_RXINTM | AR_IMR_RXMINTR; 1130 imr_reg |= AR_IMR_RXINTM | AR_IMR_RXMINTR;
1131 else 1131 else
1132 ah->mask_reg |= AR_IMR_RXOK; 1132 imr_reg |= AR_IMR_RXOK;
1133 1133
1134 ah->mask_reg |= AR_IMR_TXOK; 1134 imr_reg |= AR_IMR_TXOK;
1135 1135
1136 if (opmode == NL80211_IFTYPE_AP) 1136 if (opmode == NL80211_IFTYPE_AP)
1137 ah->mask_reg |= AR_IMR_MIB; 1137 imr_reg |= AR_IMR_MIB;
1138 1138
1139 REG_WRITE(ah, AR_IMR, ah->mask_reg); 1139 REG_WRITE(ah, AR_IMR, imr_reg);
1140 ah->imrs2_reg |= AR_IMR_S2_GTT; 1140 ah->imrs2_reg |= AR_IMR_S2_GTT;
1141 REG_WRITE(ah, AR_IMR_S2, ah->imrs2_reg); 1141 REG_WRITE(ah, AR_IMR_S2, ah->imrs2_reg);
1142 1142
@@ -2839,7 +2839,7 @@ EXPORT_SYMBOL(ath9k_hw_getisr);
2839 2839
2840enum ath9k_int ath9k_hw_set_interrupts(struct ath_hw *ah, enum ath9k_int ints) 2840enum ath9k_int ath9k_hw_set_interrupts(struct ath_hw *ah, enum ath9k_int ints)
2841{ 2841{
2842 u32 omask = ah->mask_reg; 2842 enum ath9k_int omask = ah->imask;
2843 u32 mask, mask2; 2843 u32 mask, mask2;
2844 struct ath9k_hw_capabilities *pCap = &ah->caps; 2844 struct ath9k_hw_capabilities *pCap = &ah->caps;
2845 struct ath_common *common = ath9k_hw_common(ah); 2845 struct ath_common *common = ath9k_hw_common(ah);
@@ -2911,7 +2911,6 @@ enum ath9k_int ath9k_hw_set_interrupts(struct ath_hw *ah, enum ath9k_int ints)
2911 AR_IMR_S2_TSFOOR | AR_IMR_S2_GTT | AR_IMR_S2_CST); 2911 AR_IMR_S2_TSFOOR | AR_IMR_S2_GTT | AR_IMR_S2_CST);
2912 ah->imrs2_reg |= mask2; 2912 ah->imrs2_reg |= mask2;
2913 REG_WRITE(ah, AR_IMR_S2, ah->imrs2_reg); 2913 REG_WRITE(ah, AR_IMR_S2, ah->imrs2_reg);
2914 ah->mask_reg = ints;
2915 2914
2916 if (!(pCap->hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) { 2915 if (!(pCap->hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) {
2917 if (ints & ATH9K_INT_TIM_TIMER) 2916 if (ints & ATH9K_INT_TIM_TIMER)
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 0ac7a80be082..97ebeba8a157 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -479,7 +479,6 @@ struct ath_hw {
479 479
480 int16_t curchan_rad_index; 480 int16_t curchan_rad_index;
481 enum ath9k_int imask; 481 enum ath9k_int imask;
482 u32 mask_reg;
483 u32 imrs2_reg; 482 u32 imrs2_reg;
484 u32 txok_interrupt_mask; 483 u32 txok_interrupt_mask;
485 u32 txerr_interrupt_mask; 484 u32 txerr_interrupt_mask;
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index e020b82a677e..4a2060e5a777 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -105,7 +105,7 @@ bool ath9k_hw_updatetxtriglevel(struct ath_hw *ah, bool bIncTrigLevel)
105 if (ah->tx_trig_level >= ah->config.max_txtrig_level) 105 if (ah->tx_trig_level >= ah->config.max_txtrig_level)
106 return false; 106 return false;
107 107
108 omask = ath9k_hw_set_interrupts(ah, ah->mask_reg & ~ATH9K_INT_GLOBAL); 108 omask = ath9k_hw_set_interrupts(ah, ah->imask & ~ATH9K_INT_GLOBAL);
109 109
110 txcfg = REG_READ(ah, AR_TXCFG); 110 txcfg = REG_READ(ah, AR_TXCFG);
111 curLevel = MS(txcfg, AR_FTRIG); 111 curLevel = MS(txcfg, AR_FTRIG);