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

staging: rtl8723au: Convert BT_IsBtDisabled() into rtl8723a_BT_enabled()

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3a159d9a
...@@ -455,15 +455,12 @@ void rtl8723a_set_ampdu_factor(struct rtw_adapter *padapter, u8 FactorToSet) ...@@ -455,15 +455,12 @@ void rtl8723a_set_ampdu_factor(struct rtw_adapter *padapter, u8 FactorToSet)
u8 index = 0; u8 index = 0;
pRegToSet = RegToSet_Normal; /* 0xb972a841; */ pRegToSet = RegToSet_Normal; /* 0xb972a841; */
#ifdef CONFIG_8723AU_BT_COEXIST
if ((BT_IsBtDisabled(padapter) == false) && if (rtl8723a_BT_enabled(padapter) &&
rtl8723a_BT_using_antenna_1(padapter)) { rtl8723a_BT_using_antenna_1(padapter))
MaxAggNum = 0x8; MaxAggNum = 0x8;
} else else
#endif /* CONFIG_8723AU_BT_COEXIST */
{
MaxAggNum = 0xF; MaxAggNum = 0xF;
}
if (FactorToSet <= 3) { if (FactorToSet <= 3) {
FactorToSet = (1 << (FactorToSet + 2)); FactorToSet = (1 << (FactorToSet + 2));
......
...@@ -5519,7 +5519,7 @@ _btdm_1AntSetPSTDMA(struct rtw_adapter *padapter, u8 bPSEn, u8 smartps, ...@@ -5519,7 +5519,7 @@ _btdm_1AntSetPSTDMA(struct rtw_adapter *padapter, u8 bPSEn, u8 smartps,
if (!bTDMAOn) { if (!bTDMAOn) {
btdm_1AntPsTdma(padapter, false, tdmaType); btdm_1AntPsTdma(padapter, false, tdmaType);
} else { } else {
if ((BT_IsBtDisabled(padapter)) || if (!rtl8723a_BT_enabled(padapter) ||
(pHalData->bt_coexist.halCoex8723.c2hBtInfo == BT_INFO_STATE_NO_CONNECTION) || (pHalData->bt_coexist.halCoex8723.c2hBtInfo == BT_INFO_STATE_NO_CONNECTION) ||
(pHalData->bt_coexist.halCoex8723.c2hBtInfo == BT_INFO_STATE_CONNECT_IDLE) || (pHalData->bt_coexist.halCoex8723.c2hBtInfo == BT_INFO_STATE_CONNECT_IDLE) ||
(tdmaType == 29)) (tdmaType == 29))
...@@ -6064,7 +6064,7 @@ static void btdm_1AntBtCoexistHandler(struct rtw_adapter *padapter) ...@@ -6064,7 +6064,7 @@ static void btdm_1AntBtCoexistHandler(struct rtw_adapter *padapter)
pBtCoex8723 = &pHalData->bt_coexist.halCoex8723; pBtCoex8723 = &pHalData->bt_coexist.halCoex8723;
pBtdm8723 = &pBtCoex8723->btdm1Ant; pBtdm8723 = &pBtCoex8723->btdm1Ant;
padapter->pwrctrlpriv.btcoex_rfon = false; padapter->pwrctrlpriv.btcoex_rfon = false;
if (BT_IsBtDisabled(padapter)) { if (!rtl8723a_BT_enabled(padapter)) {
RTPRINT(FBT, BT_TRACE, ("[BTCoex], BT is disabled\n")); RTPRINT(FBT, BT_TRACE, ("[BTCoex], BT is disabled\n"));
if (BTDM_IsWifiConnectionExist(padapter)) { if (BTDM_IsWifiConnectionExist(padapter)) {
...@@ -6243,7 +6243,7 @@ static void BTDM_1AntWifiAssociateNotify(struct rtw_adapter *padapter, u8 type) ...@@ -6243,7 +6243,7 @@ static void BTDM_1AntWifiAssociateNotify(struct rtw_adapter *padapter, u8 type)
if (type) { if (type) {
rtl8723a_CheckAntenna_Selection(padapter); rtl8723a_CheckAntenna_Selection(padapter);
if (BT_IsBtDisabled(padapter)) if (!rtl8723a_BT_enabled(padapter))
btdm_1AntSetPSTDMA(padapter, false, 0, false, 9); btdm_1AntSetPSTDMA(padapter, false, 0, false, 9);
else { else {
struct bt_coexist_8723a *pBtCoex; struct bt_coexist_8723a *pBtCoex;
...@@ -6275,7 +6275,7 @@ static void BTDM_1AntWifiAssociateNotify(struct rtw_adapter *padapter, u8 type) ...@@ -6275,7 +6275,7 @@ static void BTDM_1AntWifiAssociateNotify(struct rtw_adapter *padapter, u8 type)
} }
} }
} else { } else {
if (BT_IsBtDisabled(padapter)) { if (!rtl8723a_BT_enabled(padapter)) {
if (!BTDM_IsWifiConnectionExist(padapter)) { if (!BTDM_IsWifiConnectionExist(padapter)) {
btdm_1AntPsTdma(padapter, false, 0); btdm_1AntPsTdma(padapter, false, 0);
btdm_1AntTSFSwitch(padapter, false); btdm_1AntTSFSwitch(padapter, false);
...@@ -6360,7 +6360,7 @@ static void BTDM_1AntWifiScanNotify(struct rtw_adapter *padapter, u8 scanType) ...@@ -6360,7 +6360,7 @@ static void BTDM_1AntWifiScanNotify(struct rtw_adapter *padapter, u8 scanType)
if (scanType) { if (scanType) {
rtl8723a_CheckAntenna_Selection(padapter); rtl8723a_CheckAntenna_Selection(padapter);
if (BT_IsBtDisabled(padapter)) { if (!rtl8723a_BT_enabled(padapter)) {
btdm_1AntSetPSTDMA(padapter, false, 0, false, 9); btdm_1AntSetPSTDMA(padapter, false, 0, false, 9);
} else if (BTDM_IsWifiConnectionExist(padapter) == false) { } else if (BTDM_IsWifiConnectionExist(padapter) == false) {
BTDM_1AntWifiAssociateNotify(padapter, true); BTDM_1AntWifiAssociateNotify(padapter, true);
...@@ -9306,7 +9306,7 @@ void BTDM_QueryBtInformation(struct rtw_adapter *padapter) ...@@ -9306,7 +9306,7 @@ void BTDM_QueryBtInformation(struct rtw_adapter *padapter)
pHalData = GET_HAL_DATA(padapter); pHalData = GET_HAL_DATA(padapter);
pBtCoex = &pHalData->bt_coexist.halCoex8723; pBtCoex = &pHalData->bt_coexist.halCoex8723;
if (BT_IsBtDisabled(padapter)) { if (!rtl8723a_BT_enabled(padapter)) {
pBtCoex->c2hBtInfo = BT_INFO_STATE_DISABLED; pBtCoex->c2hBtInfo = BT_INFO_STATE_DISABLED;
pBtCoex->bC2hBtInfoReqSent = false; pBtCoex->bC2hBtInfoReqSent = false;
return; return;
...@@ -9851,7 +9851,7 @@ static void BTDM_BTCoexist8723A(struct rtw_adapter *padapter) ...@@ -9851,7 +9851,7 @@ static void BTDM_BTCoexist8723A(struct rtw_adapter *padapter)
} }
if (pBtCoex->bC2hBtInfoReqSent) { if (pBtCoex->bC2hBtInfoReqSent) {
if (BT_IsBtDisabled(padapter)) { if (!rtl8723a_BT_enabled(padapter)) {
pBtCoex->c2hBtInfo = BT_INFO_STATE_DISABLED; pBtCoex->c2hBtInfo = BT_INFO_STATE_DISABLED;
} else { } else {
if (pBtCoex->c2hBtInfo == BT_INFO_STATE_DISABLED) if (pBtCoex->c2hBtInfo == BT_INFO_STATE_DISABLED)
...@@ -9859,7 +9859,7 @@ static void BTDM_BTCoexist8723A(struct rtw_adapter *padapter) ...@@ -9859,7 +9859,7 @@ static void BTDM_BTCoexist8723A(struct rtw_adapter *padapter)
} }
btdm_BTCoexist8723AHandler(padapter); btdm_BTCoexist8723AHandler(padapter);
} else if (BT_IsBtDisabled(padapter) == true) { } else if (!rtl8723a_BT_enabled(padapter)) {
pBtCoex->c2hBtInfo = BT_INFO_STATE_DISABLED; pBtCoex->c2hBtInfo = BT_INFO_STATE_DISABLED;
btdm_BTCoexist8723AHandler(padapter); btdm_BTCoexist8723AHandler(padapter);
} }
...@@ -11236,14 +11236,14 @@ u8 BTDM_IsActionPANA2DP(struct rtw_adapter *padapter) ...@@ -11236,14 +11236,14 @@ u8 BTDM_IsActionPANA2DP(struct rtw_adapter *padapter)
return bRet; return bRet;
} }
u8 BTDM_IsBtDisabled(struct rtw_adapter *padapter) bool rtl8723a_BT_enabled(struct rtw_adapter *padapter)
{ {
struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter); struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
if (pHalData->bt_coexist.bCurBtDisabled) if (pHalData->bt_coexist.bCurBtDisabled)
return true;
else
return false; return false;
else
return true;
} }
/* ===== End of sync from SD7 driver HAL/BTCoexist/HalBtCoexist.c ===== */ /* ===== End of sync from SD7 driver HAL/BTCoexist/HalBtCoexist.c ===== */
......
...@@ -1601,8 +1601,6 @@ u8 BTDM_IsActionPAN(struct rtw_adapter * padapter); ...@@ -1601,8 +1601,6 @@ u8 BTDM_IsActionPAN(struct rtw_adapter * padapter);
u8 BTDM_IsActionHIDA2DP(struct rtw_adapter * padapter); u8 BTDM_IsActionHIDA2DP(struct rtw_adapter * padapter);
u8 BTDM_IsActionHIDPAN(struct rtw_adapter * padapter); u8 BTDM_IsActionHIDPAN(struct rtw_adapter * padapter);
u8 BTDM_IsActionPANA2DP(struct rtw_adapter * padapter); u8 BTDM_IsActionPANA2DP(struct rtw_adapter * padapter);
u8 BTDM_IsBtDisabled(struct rtw_adapter * padapter);
#define BT_IsBtDisabled BTDM_IsBtDisabled
u32 BTDM_BtTxRxCounterH(struct rtw_adapter * padapter); u32 BTDM_BtTxRxCounterH(struct rtw_adapter * padapter);
u32 BTDM_BtTxRxCounterL(struct rtw_adapter * padapter); u32 BTDM_BtTxRxCounterL(struct rtw_adapter * padapter);
......
...@@ -20,11 +20,16 @@ ...@@ -20,11 +20,16 @@
#ifdef CONFIG_8723AU_BT_COEXIST #ifdef CONFIG_8723AU_BT_COEXIST
bool rtl8723a_BT_using_antenna_1(struct rtw_adapter *padapter); bool rtl8723a_BT_using_antenna_1(struct rtw_adapter *padapter);
bool rtl8723a_BT_enabled(struct rtw_adapter *padapter);
#else #else
static inline bool rtl8723a_BT_using_antenna_1(struct rtw_adapter *padapter) static inline bool rtl8723a_BT_using_antenna_1(struct rtw_adapter *padapter)
{ {
return false; return false;
} }
static inline bool rtl8723a_BT_enabled(struct rtw_adapter *padapter)
{
return false;
}
#endif #endif
#endif #endif
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