From: Jes Sorensen Date: Sun, 25 May 2014 20:43:24 +0000 (+0200) Subject: staging: rtl8723au: Convert BT_IsBtDisabled() into rtl8723a_BT_enabled() X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=bf2a7b99516d716fb06fbdd03e5d477b8c8a5cd1;p=deliverable%2Flinux.git staging: rtl8723au: Convert BT_IsBtDisabled() into rtl8723a_BT_enabled() Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/hal/hal_com.c b/drivers/staging/rtl8723au/hal/hal_com.c index dc4dfe9626c9..09e888aaef71 100644 --- a/drivers/staging/rtl8723au/hal/hal_com.c +++ b/drivers/staging/rtl8723au/hal/hal_com.c @@ -455,15 +455,12 @@ void rtl8723a_set_ampdu_factor(struct rtw_adapter *padapter, u8 FactorToSet) u8 index = 0; pRegToSet = RegToSet_Normal; /* 0xb972a841; */ -#ifdef CONFIG_8723AU_BT_COEXIST - if ((BT_IsBtDisabled(padapter) == false) && - rtl8723a_BT_using_antenna_1(padapter)) { + + if (rtl8723a_BT_enabled(padapter) && + rtl8723a_BT_using_antenna_1(padapter)) MaxAggNum = 0x8; - } else -#endif /* CONFIG_8723AU_BT_COEXIST */ - { + else MaxAggNum = 0xF; - } if (FactorToSet <= 3) { FactorToSet = (1 << (FactorToSet + 2)); diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c index 4c4f0bf12605..b28dc1ae9047 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c @@ -5519,7 +5519,7 @@ _btdm_1AntSetPSTDMA(struct rtw_adapter *padapter, u8 bPSEn, u8 smartps, if (!bTDMAOn) { btdm_1AntPsTdma(padapter, false, tdmaType); } 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_CONNECT_IDLE) || (tdmaType == 29)) @@ -6064,7 +6064,7 @@ static void btdm_1AntBtCoexistHandler(struct rtw_adapter *padapter) pBtCoex8723 = &pHalData->bt_coexist.halCoex8723; pBtdm8723 = &pBtCoex8723->btdm1Ant; padapter->pwrctrlpriv.btcoex_rfon = false; - if (BT_IsBtDisabled(padapter)) { + if (!rtl8723a_BT_enabled(padapter)) { RTPRINT(FBT, BT_TRACE, ("[BTCoex], BT is disabled\n")); if (BTDM_IsWifiConnectionExist(padapter)) { @@ -6243,7 +6243,7 @@ static void BTDM_1AntWifiAssociateNotify(struct rtw_adapter *padapter, u8 type) if (type) { rtl8723a_CheckAntenna_Selection(padapter); - if (BT_IsBtDisabled(padapter)) + if (!rtl8723a_BT_enabled(padapter)) btdm_1AntSetPSTDMA(padapter, false, 0, false, 9); else { struct bt_coexist_8723a *pBtCoex; @@ -6275,7 +6275,7 @@ static void BTDM_1AntWifiAssociateNotify(struct rtw_adapter *padapter, u8 type) } } } else { - if (BT_IsBtDisabled(padapter)) { + if (!rtl8723a_BT_enabled(padapter)) { if (!BTDM_IsWifiConnectionExist(padapter)) { btdm_1AntPsTdma(padapter, false, 0); btdm_1AntTSFSwitch(padapter, false); @@ -6360,7 +6360,7 @@ static void BTDM_1AntWifiScanNotify(struct rtw_adapter *padapter, u8 scanType) if (scanType) { rtl8723a_CheckAntenna_Selection(padapter); - if (BT_IsBtDisabled(padapter)) { + if (!rtl8723a_BT_enabled(padapter)) { btdm_1AntSetPSTDMA(padapter, false, 0, false, 9); } else if (BTDM_IsWifiConnectionExist(padapter) == false) { BTDM_1AntWifiAssociateNotify(padapter, true); @@ -9306,7 +9306,7 @@ void BTDM_QueryBtInformation(struct rtw_adapter *padapter) pHalData = GET_HAL_DATA(padapter); pBtCoex = &pHalData->bt_coexist.halCoex8723; - if (BT_IsBtDisabled(padapter)) { + if (!rtl8723a_BT_enabled(padapter)) { pBtCoex->c2hBtInfo = BT_INFO_STATE_DISABLED; pBtCoex->bC2hBtInfoReqSent = false; return; @@ -9851,7 +9851,7 @@ static void BTDM_BTCoexist8723A(struct rtw_adapter *padapter) } if (pBtCoex->bC2hBtInfoReqSent) { - if (BT_IsBtDisabled(padapter)) { + if (!rtl8723a_BT_enabled(padapter)) { pBtCoex->c2hBtInfo = BT_INFO_STATE_DISABLED; } else { if (pBtCoex->c2hBtInfo == BT_INFO_STATE_DISABLED) @@ -9859,7 +9859,7 @@ static void BTDM_BTCoexist8723A(struct rtw_adapter *padapter) } btdm_BTCoexist8723AHandler(padapter); - } else if (BT_IsBtDisabled(padapter) == true) { + } else if (!rtl8723a_BT_enabled(padapter)) { pBtCoex->c2hBtInfo = BT_INFO_STATE_DISABLED; btdm_BTCoexist8723AHandler(padapter); } @@ -11236,14 +11236,14 @@ u8 BTDM_IsActionPANA2DP(struct rtw_adapter *padapter) 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); if (pHalData->bt_coexist.bCurBtDisabled) - return true; - else return false; + else + return true; } /* ===== End of sync from SD7 driver HAL/BTCoexist/HalBtCoexist.c ===== */ diff --git a/drivers/staging/rtl8723au/include/rtl8723a_bt-coexist.h b/drivers/staging/rtl8723au/include/rtl8723a_bt-coexist.h index bb6790713b7e..d8a324484b55 100644 --- a/drivers/staging/rtl8723au/include/rtl8723a_bt-coexist.h +++ b/drivers/staging/rtl8723au/include/rtl8723a_bt-coexist.h @@ -1601,8 +1601,6 @@ u8 BTDM_IsActionPAN(struct rtw_adapter * padapter); u8 BTDM_IsActionHIDA2DP(struct rtw_adapter * padapter); u8 BTDM_IsActionHIDPAN(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_BtTxRxCounterL(struct rtw_adapter * padapter); diff --git a/drivers/staging/rtl8723au/include/rtl8723a_bt_intf.h b/drivers/staging/rtl8723au/include/rtl8723a_bt_intf.h index 66a3f1843545..653af15d5ec3 100644 --- a/drivers/staging/rtl8723au/include/rtl8723a_bt_intf.h +++ b/drivers/staging/rtl8723au/include/rtl8723a_bt_intf.h @@ -20,11 +20,16 @@ #ifdef CONFIG_8723AU_BT_COEXIST bool rtl8723a_BT_using_antenna_1(struct rtw_adapter *padapter); +bool rtl8723a_BT_enabled(struct rtw_adapter *padapter); #else static inline bool rtl8723a_BT_using_antenna_1(struct rtw_adapter *padapter) { return false; } +static inline bool rtl8723a_BT_enabled(struct rtw_adapter *padapter) +{ + return false; +} #endif #endif