Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ath9k: stomp audio profiles on weak signal strength

On lower WLAN signal strength, WLAN downlink traffic might suffer
from retransmissions. At the mean time, playing SCO/A2DP profiles
is affecting WLAN stability. In such scenario, by stomping SCO/A2DP
BT traffic completely for a BTCOEX period, gives WLAN traffic an
oppertunity to recover PHY rate. It also improves WLAN stability at
lower RSSI without sacificing BT traffic.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Rajkumar Manoharan and committed by
John W. Linville
2884561a b88083bf

+25 -1
+1
drivers/net/wireless/ath/ath9k/ath9k.h
··· 488 488 int rssi_count; 489 489 struct ath_gen_timer *no_stomp_timer; /* Timer for no BT stomping */ 490 490 struct ath_mci_profile mci; 491 + u8 stomp_audio; 491 492 }; 492 493 493 494 #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
+1
drivers/net/wireless/ath/ath9k/btcoex.c
··· 49 49 { 0x01017d01, 0x3b3b3b01, 0x3b3b3b01, 0x3b3b3b3b }, /* STOMP_LOW */ 50 50 { 0x01017d01, 0x01010101, 0x01010101, 0x01010101 }, /* STOMP_NONE */ 51 51 { 0x01017d01, 0x013b0101, 0x3b3b0101, 0x3b3b013b }, /* STOMP_LOW_FTP */ 52 + { 0xffffff01, 0xffffffff, 0xffffff01, 0xffffffff }, /* STOMP_AUDIO */ 52 53 }; 53 54 54 55 void ath9k_hw_init_btcoex_hw(struct ath_hw *ah, int qnum)
+1
drivers/net/wireless/ath/ath9k/btcoex.h
··· 50 50 ATH_BTCOEX_STOMP_LOW, 51 51 ATH_BTCOEX_STOMP_NONE, 52 52 ATH_BTCOEX_STOMP_LOW_FTP, 53 + ATH_BTCOEX_STOMP_AUDIO, 53 54 ATH_BTCOEX_STOMP_MAX 54 55 }; 55 56
+4 -1
drivers/net/wireless/ath/ath9k/gpio.c
··· 247 247 stomp_type = ATH_BTCOEX_STOMP_ALL; 248 248 timer_period = btcoex->btscan_no_stomp; 249 249 } 250 + } else if (btcoex->stomp_audio >= 5) { 251 + stomp_type = ATH_BTCOEX_STOMP_AUDIO; 252 + btcoex->stomp_audio = 0; 250 253 } 251 254 252 255 ath9k_hw_btcoex_bt_stomp(ah, stomp_type); ··· 298 295 (!(ah->caps.hw_caps & ATH9K_HW_CAP_MCI) && 299 296 test_bit(BT_OP_SCAN, &btcoex->op_flags))) 300 297 ath9k_hw_btcoex_bt_stomp(ah, ATH_BTCOEX_STOMP_NONE); 301 - else if (btcoex->bt_stomp_type == ATH_BTCOEX_STOMP_ALL) 298 + else if (btcoex->bt_stomp_type == ATH_BTCOEX_STOMP_ALL) 302 299 ath9k_hw_btcoex_bt_stomp(ah, ATH_BTCOEX_STOMP_LOW); 303 300 304 301 ath9k_hw_btcoex_enable(ah);
+18
drivers/net/wireless/ath/ath9k/mci.c
··· 729 729 ath9k_hw_set_txpowerlimit(ah, sc->config.txpowlimit, false); 730 730 } 731 731 732 + static void ath9k_mci_stomp_audio(struct ath_softc *sc) 733 + { 734 + struct ath_hw *ah = sc->sc_ah; 735 + struct ath_btcoex *btcoex = &sc->btcoex; 736 + struct ath_mci_profile *mci = &btcoex->mci; 737 + 738 + if (!mci->num_sco && !mci->num_a2dp) 739 + return; 740 + 741 + if (ah->stats.avgbrssi > 25) { 742 + btcoex->stomp_audio = 0; 743 + return; 744 + } 745 + 746 + btcoex->stomp_audio++; 747 + } 732 748 void ath9k_mci_update_rssi(struct ath_softc *sc) 733 749 { 734 750 struct ath_hw *ah = sc->sc_ah; 735 751 struct ath_btcoex *btcoex = &sc->btcoex; 736 752 struct ath9k_hw_mci *mci_hw = &sc->sc_ah->btcoex_hw.mci; 753 + 754 + ath9k_mci_stomp_audio(sc); 737 755 738 756 if (!(mci_hw->config & ATH_MCI_CONFIG_CONCUR_TX)) 739 757 return;