From owner-svn-src-head@freebsd.org Wed Jun 1 03:49:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B18AB582B5; Wed, 1 Jun 2016 03:49:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F359101E; Wed, 1 Jun 2016 03:49:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u513nM4F045022; Wed, 1 Jun 2016 03:49:22 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u513nM1I045021; Wed, 1 Jun 2016 03:49:22 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606010349.u513nM1I045021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 1 Jun 2016 03:49:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301097 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jun 2016 03:49:23 -0000 Author: adrian Date: Wed Jun 1 03:49:22 2016 New Revision: 301097 URL: https://svnweb.freebsd.org/changeset/base/301097 Log: [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 Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c Wed Jun 1 03:36:31 2016 (r301096) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c Wed Jun 1 03:49:22 2016 (r301097) @@ -472,9 +472,11 @@ void ar9300_mci_mute_bt(struct ath_hal * * 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_u 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(st 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(st } 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 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);