From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> --- .../staging/rtl8723au/hal/rtl8723a_bt-coexist.c | 46 ++++++++++++++++++++ drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 49 ---------------------- drivers/staging/rtl8723au/hal/usb_halinit.c | 4 +- .../staging/rtl8723au/include/rtl8723a_bt_intf.h | 2 + drivers/staging/rtl8723au/include/rtl8723a_hal.h | 4 -- 5 files changed, 49 insertions(+), 56 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c index 4d94b4b..48c16f4 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c @@ -11341,3 +11341,49 @@ void HALBT_SetRtsCtsNoLenLimit(struct rtw_adapter *padapter) } /* ===== End of sync from SD7 driver HAL/HalBT.c ===== */ + +void rtl8723a_dual_antenna_detection(struct rtw_adapter *padapter) +{ + struct hal_data_8723a *pHalData; + struct dm_odm_t *pDM_Odm; + struct sw_ant_sw *pDM_SWAT_Table; + u8 i; + + pHalData = GET_HAL_DATA(padapter); + pDM_Odm = &pHalData->odmpriv; + pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; + + /* */ + /* <Roger_Notes> RTL8723A Single and Dual antenna dynamic detection + mechanism when RF power state is on. */ + /* We should take power tracking, IQK, LCK, RCK RF read/write + operation into consideration. */ + /* 2011.12.15. */ + /* */ + if (!pHalData->bAntennaDetected) { + u8 btAntNum = BT_GetPGAntNum(padapter); + + /* Set default antenna B status */ + if (btAntNum == Ant_x2) + pDM_SWAT_Table->ANTB_ON = true; + else if (btAntNum == Ant_x1) + pDM_SWAT_Table->ANTB_ON = false; + else + pDM_SWAT_Table->ANTB_ON = true; + + if (pHalData->CustomerID != RT_CID_TOSHIBA) { + for (i = 0; i < MAX_ANTENNA_DETECTION_CNT; i++) { + if (ODM_SingleDualAntennaDetection + (&pHalData->odmpriv, ANTTESTALL) == true) + break; + } + + /* Set default antenna number for BT coexistence */ + if (btAntNum == Ant_x2) + BT_SetBtCoexCurrAntNum(padapter, + pDM_SWAT_Table-> + ANTB_ON ? 2 : 1); + } + pHalData->bAntennaDetected = true; + } +} diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c index 20c93e4..970b585 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c @@ -2575,52 +2575,3 @@ void hw_var_set_mlme_join(struct rtw_adapter *padapter, u8 type) } #endif } - -#ifdef CONFIG_8723AU_BT_COEXIST - -void rtl8723a_SingleDualAntennaDetection(struct rtw_adapter *padapter) -{ - struct hal_data_8723a *pHalData; - struct dm_odm_t *pDM_Odm; - struct sw_ant_sw *pDM_SWAT_Table; - u8 i; - - pHalData = GET_HAL_DATA(padapter); - pDM_Odm = &pHalData->odmpriv; - pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; - - /* */ - /* <Roger_Notes> RTL8723A Single and Dual antenna dynamic detection - mechanism when RF power state is on. */ - /* We should take power tracking, IQK, LCK, RCK RF read/write - operation into consideration. */ - /* 2011.12.15. */ - /* */ - if (!pHalData->bAntennaDetected) { - u8 btAntNum = BT_GetPGAntNum(padapter); - - /* Set default antenna B status */ - if (btAntNum == Ant_x2) - pDM_SWAT_Table->ANTB_ON = true; - else if (btAntNum == Ant_x1) - pDM_SWAT_Table->ANTB_ON = false; - else - pDM_SWAT_Table->ANTB_ON = true; - - if (pHalData->CustomerID != RT_CID_TOSHIBA) { - for (i = 0; i < MAX_ANTENNA_DETECTION_CNT; i++) { - if (ODM_SingleDualAntennaDetection - (&pHalData->odmpriv, ANTTESTALL) == true) - break; - } - - /* Set default antenna number for BT coexistence */ - if (btAntNum == Ant_x2) - BT_SetBtCoexCurrAntNum(padapter, - pDM_SWAT_Table-> - ANTB_ON ? 2 : 1); - } - pHalData->bAntennaDetected = true; - } -} -#endif /* CONFIG_8723AU_BT_COEXIST */ diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c b/drivers/staging/rtl8723au/hal/usb_halinit.c index d30ba1b..cbd5a8c 100644 --- a/drivers/staging/rtl8723au/hal/usb_halinit.c +++ b/drivers/staging/rtl8723au/hal/usb_halinit.c @@ -831,9 +831,7 @@ static int rtl8723au_hal_init(struct rtw_adapter *Adapter) HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_LCK); rtl8723a_phy_lc_calibrate(Adapter); -#ifdef CONFIG_8723AU_BT_COEXIST - rtl8723a_SingleDualAntennaDetection(Adapter); -#endif + rtl8723a_dual_antenna_detection(Adapter); } HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC21); diff --git a/drivers/staging/rtl8723au/include/rtl8723a_bt_intf.h b/drivers/staging/rtl8723au/include/rtl8723a_bt_intf.h index 5de42b0..7cf4de6 100644 --- a/drivers/staging/rtl8723au/include/rtl8723a_bt_intf.h +++ b/drivers/staging/rtl8723au/include/rtl8723a_bt_intf.h @@ -31,6 +31,7 @@ void rtl8723a_BT_specialpacket_notify(struct rtw_adapter *padapter); void rtl8723a_BT_lps_leave(struct rtw_adapter *padapter); void rtl8723a_BT_disable_coexist(struct rtw_adapter *padapter); bool rtl8723a_BT_disable_EDCA_turbo(struct rtw_adapter *padapter); +void rtl8723a_dual_antenna_detection(struct rtw_adapter *padapter); #else static inline bool rtl8723a_BT_using_antenna_1(struct rtw_adapter *padapter) { @@ -54,6 +55,7 @@ static inline bool rtl8723a_BT_disable_EDCA_turbo(struct rtw_adapter *padapter) { return false; } +#define rtl8723a_dual_antenna_detection(padapter) do {} while(0) #endif #endif diff --git a/drivers/staging/rtl8723au/include/rtl8723a_hal.h b/drivers/staging/rtl8723au/include/rtl8723a_hal.h index 33ad2b7..344b708 100644 --- a/drivers/staging/rtl8723au/include/rtl8723a_hal.h +++ b/drivers/staging/rtl8723au/include/rtl8723a_hal.h @@ -529,10 +529,6 @@ void Hal_EfuseParseThermalMeter_8723A(struct rtw_adapter *padapter, u8 *hwinfo, void Hal_InitChannelPlan23a(struct rtw_adapter *padapter); -#ifdef CONFIG_8723AU_BT_COEXIST -void rtl8723a_SingleDualAntennaDetection(struct rtw_adapter *padapter); -#endif - /* register */ void SetBcnCtrlReg23a(struct rtw_adapter *padapter, u8 SetBits, u8 ClearBits); void rtl8723a_InitBeaconParameters(struct rtw_adapter *padapter); -- 1.9.3 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel