summaryrefslogtreecommitdiffstats
path: root/sys/contrib
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2016-06-01 03:49:22 +0000
committeradrian <adrian@FreeBSD.org>2016-06-01 03:49:22 +0000
commit8835742d9d9b4e8020a0c0af009cbab93aa8b2ee (patch)
treea09e87fdd28df9994aebe8f4fed25d6215892e9d /sys/contrib
parent6ad082eea9462c0af28b049104317582e3171b25 (diff)
downloadFreeBSD-src-8835742d9d9b4e8020a0c0af009cbab93aa8b2ee.zip
FreeBSD-src-8835742d9d9b4e8020a0c0af009cbab93aa8b2ee.tar.gz
[ath_hal] implement shared PA handling checks, based on ath9k.
These are apparently conditional on there being a shared PA/LNA, which at least on AR9462/QCA9535 devices I have isn't a thing. I'm .. not yet sure which devices it /is/ a thing, so I'll come back to that. Tested: * QCA9565 STA + bluetooth Obtained from: Linux ath9k
Diffstat (limited to 'sys/contrib')
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c
index e3d9334..502746e 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c
@@ -472,9 +472,11 @@ void ar9300_mci_mute_bt(struct ath_hal *ah)
* 1. reset not after resuming from full sleep
* 2. before reset MCI RX, to quiet BT and avoid MCI RX misalignment
*/
- HALDEBUG(ah, HAL_DEBUG_BT_COEX, "(MCI) Send LNA take\n");
- ar9300_mci_send_lna_take(ah, AH_TRUE);
- OS_DELAY(5);
+ if (MCI_ANT_ARCH_PA_LNA_SHARED(ah->ah_config.ath_hal_mci_config)) {
+ HALDEBUG(ah, HAL_DEBUG_BT_COEX, "(MCI) Send LNA take\n");
+ ar9300_mci_send_lna_take(ah, AH_TRUE);
+ OS_DELAY(5);
+ }
HALDEBUG(ah, HAL_DEBUG_BT_COEX, "(MCI) Send sys sleeping\n");
ar9300_mci_send_sys_sleeping(ah, AH_TRUE);
}
@@ -498,7 +500,7 @@ static void ar9300_mci_observation_set_up(struct ath_hal *ah)
HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: called; config=0x%08x\n",
__func__, ah->ah_config.ath_hal_mci_config);
- if (ah->ah_config.ath_hal_mci_config &
+ if (ah->ah_config.ath_hal_mci_config &
ATH_MCI_CONFIG_MCI_OBS_MCI)
{
HALDEBUG(ah, HAL_DEBUG_BT_COEX, "%s: CONFIG_MCI_OBS_MCI\n", __func__);
@@ -846,7 +848,9 @@ static void ar9300_mci_prep_interface(struct ath_hal *ah)
AR_MCI_INTERRUPT_RX_MSG_CONT_RST);
OS_REG_WRITE(ah, AR_MCI_INTERRUPT_RAW, AR_MCI_INTERRUPT_BT_PRI);
- if (AR_SREV_JUPITER_10(ah) || ahp->ah_mci_coex_is_2g) {
+ if (AR_SREV_JUPITER_10(ah) ||
+ (ahp->ah_mci_coex_is_2g &&
+ MCI_ANT_ARCH_PA_LNA_SHARED(ah->ah_config.ath_hal_mci_config))) {
/* Send LNA_TRANS */
HALDEBUG(ah, HAL_DEBUG_BT_COEX, "(MCI) %s: Send LNA_TRANS to BT\n",
__func__);
@@ -856,8 +860,8 @@ static void ar9300_mci_prep_interface(struct ath_hal *ah)
}
if (AR_SREV_JUPITER_10(ah) ||
- (ahp->ah_mci_coex_is_2g && !ahp->ah_mci_coex_2g5g_update))
- {
+ (ahp->ah_mci_coex_is_2g && !ahp->ah_mci_coex_2g5g_update &&
+ MCI_ANT_ARCH_PA_LNA_SHARED(ah->ah_config.ath_hal_mci_config))) {
if (ar9300_mci_wait_for_interrupt(ah, AR_MCI_INTERRUPT_RX_MSG_RAW,
AR_MCI_INTERRUPT_RX_MSG_LNA_INFO, mci_timeout)) {
HALDEBUG(ah, HAL_DEBUG_BT_COEX,
@@ -1153,7 +1157,11 @@ void ar9300_mci_reset(struct ath_hal *ah, HAL_BOOL en_int, HAL_BOOL is_2g,
OS_REG_WRITE(ah, AR_MCI_MSG_ATTRIBUTES_TABLE,
(SM(0xe801, AR_MCI_MSG_ATTRIBUTES_TABLE_INVALID_HDR) |
SM(0x0000, AR_MCI_MSG_ATTRIBUTES_TABLE_CHECKSUM)));
- OS_REG_CLR_BIT(ah, AR_MCI_TX_CTRL, AR_MCI_TX_CTRL_DISABLE_LNA_UPDATE);
+ if (MCI_ANT_ARCH_PA_LNA_SHARED(ah->ah_config.ath_hal_mci_config)) {
+ OS_REG_CLR_BIT(ah, AR_MCI_TX_CTRL, AR_MCI_TX_CTRL_DISABLE_LNA_UPDATE);
+ } else {
+ OS_REG_SET_BIT(ah, AR_MCI_TX_CTRL, AR_MCI_TX_CTRL_DISABLE_LNA_UPDATE);
+ }
if (AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah)) {
ar9300_mci_observation_set_up(ah);
OpenPOWER on IntegriCloud