diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/btcoex.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/btcoex.c | 63 |
1 files changed, 46 insertions, 17 deletions
diff --git a/drivers/net/wireless/ath/ath9k/btcoex.c b/drivers/net/wireless/ath/ath9k/btcoex.c index 419e9a3f2fed..9963b0bf9f72 100644 --- a/drivers/net/wireless/ath/ath9k/btcoex.c +++ b/drivers/net/wireless/ath/ath9k/btcoex.c | |||
@@ -49,6 +49,7 @@ static const u32 mci_wlan_weights[ATH_BTCOEX_STOMP_MAX] | |||
49 | { 0x01017d01, 0x3b3b3b01, 0x3b3b3b01, 0x3b3b3b3b }, /* STOMP_LOW */ | 49 | { 0x01017d01, 0x3b3b3b01, 0x3b3b3b01, 0x3b3b3b3b }, /* STOMP_LOW */ |
50 | { 0x01017d01, 0x01010101, 0x01010101, 0x01010101 }, /* STOMP_NONE */ | 50 | { 0x01017d01, 0x01010101, 0x01010101, 0x01010101 }, /* STOMP_NONE */ |
51 | { 0x01017d01, 0x013b0101, 0x3b3b0101, 0x3b3b013b }, /* STOMP_LOW_FTP */ | 51 | { 0x01017d01, 0x013b0101, 0x3b3b0101, 0x3b3b013b }, /* STOMP_LOW_FTP */ |
52 | { 0xffffff01, 0xffffffff, 0xffffff01, 0xffffffff }, /* STOMP_AUDIO */ | ||
52 | }; | 53 | }; |
53 | 54 | ||
54 | void ath9k_hw_init_btcoex_hw(struct ath_hw *ah, int qnum) | 55 | void ath9k_hw_init_btcoex_hw(struct ath_hw *ah, int qnum) |
@@ -195,7 +196,7 @@ void ath9k_hw_btcoex_init_mci(struct ath_hw *ah) | |||
195 | ah->btcoex_hw.mci.need_flush_btinfo = false; | 196 | ah->btcoex_hw.mci.need_flush_btinfo = false; |
196 | ah->btcoex_hw.mci.wlan_cal_seq = 0; | 197 | ah->btcoex_hw.mci.wlan_cal_seq = 0; |
197 | ah->btcoex_hw.mci.wlan_cal_done = 0; | 198 | ah->btcoex_hw.mci.wlan_cal_done = 0; |
198 | ah->btcoex_hw.mci.config = 0x2201; | 199 | ah->btcoex_hw.mci.config = (AR_SREV_9462(ah)) ? 0x2201 : 0xa4c1; |
199 | } | 200 | } |
200 | EXPORT_SYMBOL(ath9k_hw_btcoex_init_mci); | 201 | EXPORT_SYMBOL(ath9k_hw_btcoex_init_mci); |
201 | 202 | ||
@@ -218,27 +219,45 @@ void ath9k_hw_btcoex_set_weight(struct ath_hw *ah, | |||
218 | enum ath_stomp_type stomp_type) | 219 | enum ath_stomp_type stomp_type) |
219 | { | 220 | { |
220 | struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; | 221 | struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; |
222 | struct ath9k_hw_mci *mci_hw = &ah->btcoex_hw.mci; | ||
223 | u8 txprio_shift[] = { 24, 16, 16, 0 }; /* tx priority weight */ | ||
224 | bool concur_tx = (mci_hw->concur_tx && btcoex_hw->tx_prio[stomp_type]); | ||
225 | const u32 *weight = ar9003_wlan_weights[stomp_type]; | ||
226 | int i; | ||
221 | 227 | ||
222 | if (AR_SREV_9300_20_OR_LATER(ah)) { | 228 | if (!AR_SREV_9300_20_OR_LATER(ah)) { |
223 | const u32 *weight = ar9003_wlan_weights[stomp_type]; | ||
224 | int i; | ||
225 | |||
226 | if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) { | ||
227 | if ((stomp_type == ATH_BTCOEX_STOMP_LOW) && | ||
228 | btcoex_hw->mci.stomp_ftp) | ||
229 | stomp_type = ATH_BTCOEX_STOMP_LOW_FTP; | ||
230 | weight = mci_wlan_weights[stomp_type]; | ||
231 | } | ||
232 | |||
233 | for (i = 0; i < AR9300_NUM_WLAN_WEIGHTS; i++) { | ||
234 | btcoex_hw->bt_weight[i] = AR9300_BT_WGHT; | ||
235 | btcoex_hw->wlan_weight[i] = weight[i]; | ||
236 | } | ||
237 | } else { | ||
238 | btcoex_hw->bt_coex_weights = | 229 | btcoex_hw->bt_coex_weights = |
239 | SM(bt_weight, AR_BTCOEX_BT_WGHT) | | 230 | SM(bt_weight, AR_BTCOEX_BT_WGHT) | |
240 | SM(wlan_weight, AR_BTCOEX_WL_WGHT); | 231 | SM(wlan_weight, AR_BTCOEX_WL_WGHT); |
232 | return; | ||
233 | } | ||
234 | |||
235 | if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) { | ||
236 | enum ath_stomp_type stype = | ||
237 | ((stomp_type == ATH_BTCOEX_STOMP_LOW) && | ||
238 | btcoex_hw->mci.stomp_ftp) ? | ||
239 | ATH_BTCOEX_STOMP_LOW_FTP : stomp_type; | ||
240 | weight = mci_wlan_weights[stype]; | ||
241 | } | 241 | } |
242 | |||
243 | for (i = 0; i < AR9300_NUM_WLAN_WEIGHTS; i++) { | ||
244 | btcoex_hw->bt_weight[i] = AR9300_BT_WGHT; | ||
245 | btcoex_hw->wlan_weight[i] = weight[i]; | ||
246 | if (concur_tx && i) { | ||
247 | btcoex_hw->wlan_weight[i] &= | ||
248 | ~(0xff << txprio_shift[i-1]); | ||
249 | btcoex_hw->wlan_weight[i] |= | ||
250 | (btcoex_hw->tx_prio[stomp_type] << | ||
251 | txprio_shift[i-1]); | ||
252 | } | ||
253 | } | ||
254 | /* Last WLAN weight has to be adjusted wrt tx priority */ | ||
255 | if (concur_tx) { | ||
256 | btcoex_hw->wlan_weight[i-1] &= ~(0xff << txprio_shift[i-1]); | ||
257 | btcoex_hw->wlan_weight[i-1] |= (btcoex_hw->tx_prio[stomp_type] | ||
258 | << txprio_shift[i-1]); | ||
259 | } | ||
260 | |||
242 | } | 261 | } |
243 | EXPORT_SYMBOL(ath9k_hw_btcoex_set_weight); | 262 | EXPORT_SYMBOL(ath9k_hw_btcoex_set_weight); |
244 | 263 | ||
@@ -385,3 +404,13 @@ void ath9k_hw_btcoex_bt_stomp(struct ath_hw *ah, | |||
385 | } | 404 | } |
386 | } | 405 | } |
387 | EXPORT_SYMBOL(ath9k_hw_btcoex_bt_stomp); | 406 | EXPORT_SYMBOL(ath9k_hw_btcoex_bt_stomp); |
407 | |||
408 | void ath9k_hw_btcoex_set_concur_txprio(struct ath_hw *ah, u8 *stomp_txprio) | ||
409 | { | ||
410 | struct ath_btcoex_hw *btcoex = &ah->btcoex_hw; | ||
411 | int i; | ||
412 | |||
413 | for (i = 0; i < ATH_BTCOEX_STOMP_MAX; i++) | ||
414 | btcoex->tx_prio[i] = stomp_txprio[i]; | ||
415 | } | ||
416 | EXPORT_SYMBOL(ath9k_hw_btcoex_set_concur_txprio); | ||