diff options
author | adrian <adrian@FreeBSD.org> | 2013-06-07 05:17:58 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2013-06-07 05:17:58 +0000 |
commit | fd875f85f0b44b5f5c5c0f795084292d70b50876 (patch) | |
tree | 8484d0ddd4720ea807514b773d2ffb4b953d49e6 | |
parent | 93e98d543063f23d3559151174982ac08a538229 (diff) | |
download | FreeBSD-src-fd875f85f0b44b5f5c5c0f795084292d70b50876.zip FreeBSD-src-fd875f85f0b44b5f5c5c0f795084292d70b50876.tar.gz |
Add bluetooth fixes to the AR5416/AR92xx HAL:
* Call the bluetooth setup function during the reset path, so the bluetooth
settings are actually initialised.
* Call the AR9285 diversity functions during bluetooth setup; so the AR9285
diversity and antenna configuration registers are correctly programmed
* Misc debugging info.
Tested:
* AR9285+AR3011 bluetooth combo; this code itself doesn't enable bluetooth
coexistence but it's part of what I'm currently using.
-rw-r--r-- | sys/dev/ath/ath_hal/ah.h | 2 | ||||
-rw-r--r-- | sys/dev/ath/ath_hal/ar5416/ar5416_attach.c | 2 | ||||
-rw-r--r-- | sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c | 5 | ||||
-rw-r--r-- | sys/dev/ath/ath_hal/ar5416/ar5416_reset.c | 6 | ||||
-rw-r--r-- | sys/dev/ath/ath_hal/ar9002/ar9285_attach.c | 6 | ||||
-rw-r--r-- | sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c | 6 |
6 files changed, 22 insertions, 5 deletions
diff --git a/sys/dev/ath/ath_hal/ah.h b/sys/dev/ath/ath_hal/ah.h index f4798a0..bd26dba 100644 --- a/sys/dev/ath/ath_hal/ah.h +++ b/sys/dev/ath/ath_hal/ah.h @@ -1581,7 +1581,7 @@ struct ath_hal { uint32_t); void __ahdecl(*ah_btCoexSetBmissThresh)(struct ath_hal *, uint32_t); - void __ahdecl(*ah_btcoexSetParameter)(struct ath_hal *, + void __ahdecl(*ah_btCoexSetParameter)(struct ath_hal *, uint32_t, uint32_t); void __ahdecl(*ah_btCoexDisable)(struct ath_hal *); int __ahdecl(*ah_btCoexEnable)(struct ath_hal *); diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c b/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c index fd00ea7..99bab06 100644 --- a/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c +++ b/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c @@ -207,7 +207,7 @@ ar5416InitState(struct ath_hal_5416 *ahp5416, uint16_t devid, HAL_SOFTC sc, ah->ah_btCoexSetQcuThresh = ar5416BTCoexSetQcuThresh; ah->ah_btCoexSetWeights = ar5416BTCoexSetWeights; ah->ah_btCoexSetBmissThresh = ar5416BTCoexSetupBmissThresh; - ah->ah_btcoexSetParameter = ar5416BTCoexSetParameter; + ah->ah_btCoexSetParameter = ar5416BTCoexSetParameter; ah->ah_btCoexDisable = ar5416BTCoexDisable; ah->ah_btCoexEnable = ar5416BTCoexEnable; AH5416(ah)->ah_btCoexSetDiversity = ar5416BTCoexAntennaDiversity; diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c b/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c index 6d18faf..c73b0ee 100644 --- a/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c +++ b/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c @@ -328,6 +328,11 @@ ar5416InitBTCoex(struct ath_hal *ah) { struct ath_hal_5416 *ahp = AH5416(ah); + HALDEBUG(ah, HAL_DEBUG_BT_COEX, + "%s: called; configType=%d\n", + __func__, + ahp->ah_btCoexConfigType); + if (ahp->ah_btCoexConfigType == HAL_BT_COEX_CFG_3WIRE) { OS_REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, (AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB | diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c b/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c index bc45ea4..eb31f08 100644 --- a/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c +++ b/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c @@ -289,6 +289,12 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMODE opmode, ar5416StartTsf2(ah); #endif + /* + * Enable Bluetooth Coexistence if it's enabled. + */ + if (AH5416(ah)->ah_btCoexConfigType != HAL_BT_COEX_CFG_NONE) + ar5416InitBTCoex(ah); + /* Restore previous antenna */ OS_REG_WRITE(ah, AR_DEF_ANTENNA, saveDefAntenna); diff --git a/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c b/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c index ce31174..423f9de 100644 --- a/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c +++ b/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c @@ -172,14 +172,14 @@ ar9285Attach(uint16_t devid, HAL_SOFTC sc, /* override with 9285 specific state */ AH5416(ah)->ah_initPLL = ar9280InitPLL; - AH5416(ah)->ah_btCoexSetDiversity = ar5416BTCoexAntennaDiversity; + AH5416(ah)->ah_btCoexSetDiversity = ar9285BTCoexAntennaDiversity; ah->ah_setAntennaSwitch = ar9285SetAntennaSwitch; ah->ah_configPCIE = ar9285ConfigPCIE; ah->ah_disablePCIE = ar9285DisablePCIE; ah->ah_setTxPower = ar9285SetTransmitPower; ah->ah_setBoardValues = ar9285SetBoardValues; - ah->ah_btcoexSetParameter = ar9285BTCoexSetParameter; + ah->ah_btCoexSetParameter = ar9285BTCoexSetParameter; AH5416(ah)->ah_cal.iqCalData.calData = &ar9280_iq_cal; AH5416(ah)->ah_cal.adcGainCalData.calData = &ar9280_adc_gain_cal; @@ -543,7 +543,7 @@ ar9285FillCapabilityInfo(struct ath_hal *ah) pCap->halRtsAggrLimit = 64*1024; /* 802.11n max */ pCap->halExtChanDfsSupport = AH_TRUE; pCap->halUseCombinedRadarRssi = AH_TRUE; -#if 0 +#if 1 /* XXX bluetooth */ pCap->halBtCoexSupport = AH_TRUE; #endif diff --git a/sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c b/sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c index 9ad7620..4d79a4f 100644 --- a/sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c +++ b/sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c @@ -47,6 +47,12 @@ ar9285BTCoexAntennaDiversity(struct ath_hal *ah) u_int32_t regVal; u_int8_t ant_div_control1, ant_div_control2; + HALDEBUG(ah, HAL_DEBUG_BT_COEX, + "%s: btCoexFlag: ALLOW=%d, ENABLE=%d\n", + __func__, + !! (ahp->ah_btCoexFlag & HAL_BT_COEX_FLAG_ANT_DIV_ALLOW), + !! (ahp->ah_btCoexFlag & HAL_BT_COEX_FLAG_ANT_DIV_ENABLE)); + if ((ahp->ah_btCoexFlag & HAL_BT_COEX_FLAG_ANT_DIV_ALLOW) || (AH5212(ah)->ah_diversity != HAL_ANT_VARIABLE)) { if ((ahp->ah_btCoexFlag & HAL_BT_COEX_FLAG_ANT_DIV_ENABLE) && |