Commit dadc54b8 authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: rtl8723au: Move rtl8723a_dual_antenna_detection() to rtl8723a_bt-coexist.c

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dddeff3f
......@@ -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;
}
}
......@@ -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 */
......@@ -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);
......
......@@ -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
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment