From: Jes Sorensen Date: Sun, 25 May 2014 20:43:38 +0000 (+0200) Subject: staging: rtl8723au: Move rtl8723a_dual_antenna_detection() to rtl8723a_bt-coexist.c X-Git-Tag: next-20140530~19^2~198 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=dadc54b8eb2aa54ae62968de07fd943986468378;p=karo-tx-linux.git staging: rtl8723au: Move rtl8723a_dual_antenna_detection() to rtl8723a_bt-coexist.c Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c index 4d94b4b99d60..48c16f4b2355 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; + + /* */ + /* 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 20c93e471adc..970b5858aad0 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; - - /* */ - /* 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 d30ba1b022ed..cbd5a8ce45c1 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 5de42b0f97ad..7cf4de62c987 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 33ad2b7ee69e..344b7085f877 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);