aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/btcoex.c
diff options
context:
space:
mode:
authorVivek Natarajan <vnatarajan@atheros.com>2011-04-26 01:09:53 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-28 14:50:01 -0400
commita6ef530f2b0bc7e871e8c2f2b2a0905eed57fead (patch)
tree605ec1e98b4ef9aea90dfcfea695a02f2886e85e /drivers/net/wireless/ath/ath9k/btcoex.c
parent978f78bf71372a48785ac9407ebc10170f14f56c (diff)
ath9k_hw: Add support for btcoexistence in AR9300.
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/btcoex.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/btcoex.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath9k/btcoex.c b/drivers/net/wireless/ath/ath9k/btcoex.c
index 71e9e4841fa2..23f15a7ca7f1 100644
--- a/drivers/net/wireless/ath/ath9k/btcoex.c
+++ b/drivers/net/wireless/ath/ath9k/btcoex.c
@@ -51,6 +51,10 @@ void ath9k_hw_init_btcoex_hw(struct ath_hw *ah, int qnum)
51 .bt_hold_rx_clear = true, 51 .bt_hold_rx_clear = true,
52 }; 52 };
53 u32 i; 53 u32 i;
54 bool rxclear_polarity = ath_bt_config.bt_rxclear_polarity;
55
56 if (AR_SREV_9300_20_OR_LATER(ah))
57 rxclear_polarity = !ath_bt_config.bt_rxclear_polarity;
54 58
55 btcoex_hw->bt_coex_mode = 59 btcoex_hw->bt_coex_mode =
56 (btcoex_hw->bt_coex_mode & AR_BT_QCU_THRESH) | 60 (btcoex_hw->bt_coex_mode & AR_BT_QCU_THRESH) |
@@ -59,7 +63,7 @@ void ath9k_hw_init_btcoex_hw(struct ath_hw *ah, int qnum)
59 SM(ath_bt_config.bt_txframe_extend, AR_BT_TX_FRAME_EXTEND) | 63 SM(ath_bt_config.bt_txframe_extend, AR_BT_TX_FRAME_EXTEND) |
60 SM(ath_bt_config.bt_mode, AR_BT_MODE) | 64 SM(ath_bt_config.bt_mode, AR_BT_MODE) |
61 SM(ath_bt_config.bt_quiet_collision, AR_BT_QUIET) | 65 SM(ath_bt_config.bt_quiet_collision, AR_BT_QUIET) |
62 SM(ath_bt_config.bt_rxclear_polarity, AR_BT_RX_CLEAR_POLARITY) | 66 SM(rxclear_polarity, AR_BT_RX_CLEAR_POLARITY) |
63 SM(ath_bt_config.bt_priority_time, AR_BT_PRIORITY_TIME) | 67 SM(ath_bt_config.bt_priority_time, AR_BT_PRIORITY_TIME) |
64 SM(ath_bt_config.bt_first_slot_time, AR_BT_FIRST_SLOT_TIME) | 68 SM(ath_bt_config.bt_first_slot_time, AR_BT_FIRST_SLOT_TIME) |
65 SM(qnum, AR_BT_QCU_THRESH); 69 SM(qnum, AR_BT_QCU_THRESH);
@@ -142,6 +146,7 @@ void ath9k_hw_btcoex_set_weight(struct ath_hw *ah,
142} 146}
143EXPORT_SYMBOL(ath9k_hw_btcoex_set_weight); 147EXPORT_SYMBOL(ath9k_hw_btcoex_set_weight);
144 148
149
145static void ath9k_hw_btcoex_enable_3wire(struct ath_hw *ah) 150static void ath9k_hw_btcoex_enable_3wire(struct ath_hw *ah)
146{ 151{
147 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; 152 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;
@@ -152,9 +157,22 @@ static void ath9k_hw_btcoex_enable_3wire(struct ath_hw *ah)
152 * enable coex 3-wire 157 * enable coex 3-wire
153 */ 158 */
154 REG_WRITE(ah, AR_BT_COEX_MODE, btcoex_hw->bt_coex_mode); 159 REG_WRITE(ah, AR_BT_COEX_MODE, btcoex_hw->bt_coex_mode);
155 REG_WRITE(ah, AR_BT_COEX_WEIGHT, btcoex_hw->bt_coex_weights);
156 REG_WRITE(ah, AR_BT_COEX_MODE2, btcoex_hw->bt_coex_mode2); 160 REG_WRITE(ah, AR_BT_COEX_MODE2, btcoex_hw->bt_coex_mode2);
157 161
162
163 if (AR_SREV_9300_20_OR_LATER(ah)) {
164 REG_WRITE(ah, AR_BT_COEX_WL_WEIGHTS0, ah->bt_coex_wlan_weight[0]);
165 REG_WRITE(ah, AR_BT_COEX_WL_WEIGHTS1, ah->bt_coex_wlan_weight[1]);
166 REG_WRITE(ah, AR_BT_COEX_BT_WEIGHTS0, ah->bt_coex_bt_weight[0]);
167 REG_WRITE(ah, AR_BT_COEX_BT_WEIGHTS1, ah->bt_coex_bt_weight[1]);
168 REG_WRITE(ah, AR_BT_COEX_BT_WEIGHTS2, ah->bt_coex_bt_weight[2]);
169 REG_WRITE(ah, AR_BT_COEX_BT_WEIGHTS3, ah->bt_coex_bt_weight[3]);
170
171 } else
172 REG_WRITE(ah, AR_BT_COEX_WEIGHT, btcoex_hw->bt_coex_weights);
173
174
175
158 if (AR_SREV_9271(ah)) { 176 if (AR_SREV_9271(ah)) {
159 val = REG_READ(ah, 0x50040); 177 val = REG_READ(ah, 0x50040);
160 val &= 0xFFFFFEFF; 178 val &= 0xFFFFFEFF;
@@ -202,8 +220,18 @@ void ath9k_hw_btcoex_disable(struct ath_hw *ah)
202 220
203 if (btcoex_hw->scheme == ATH_BTCOEX_CFG_3WIRE) { 221 if (btcoex_hw->scheme == ATH_BTCOEX_CFG_3WIRE) {
204 REG_WRITE(ah, AR_BT_COEX_MODE, AR_BT_QUIET | AR_BT_MODE); 222 REG_WRITE(ah, AR_BT_COEX_MODE, AR_BT_QUIET | AR_BT_MODE);
205 REG_WRITE(ah, AR_BT_COEX_WEIGHT, 0);
206 REG_WRITE(ah, AR_BT_COEX_MODE2, 0); 223 REG_WRITE(ah, AR_BT_COEX_MODE2, 0);
224
225 if (AR_SREV_9300_20_OR_LATER(ah)) {
226 REG_WRITE(ah, AR_BT_COEX_WL_WEIGHTS0, 0);
227 REG_WRITE(ah, AR_BT_COEX_WL_WEIGHTS1, 0);
228 REG_WRITE(ah, AR_BT_COEX_BT_WEIGHTS0, 0);
229 REG_WRITE(ah, AR_BT_COEX_BT_WEIGHTS1, 0);
230 REG_WRITE(ah, AR_BT_COEX_BT_WEIGHTS2, 0);
231 REG_WRITE(ah, AR_BT_COEX_BT_WEIGHTS3, 0);
232 } else
233 REG_WRITE(ah, AR_BT_COEX_WEIGHT, 0);
234
207 } 235 }
208 236
209 ah->btcoex_hw.enabled = false; 237 ah->btcoex_hw.enabled = false;