diff options
Diffstat (limited to 'drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c')
-rw-r--r-- | drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c | 224 |
1 files changed, 112 insertions, 112 deletions
diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c index 2779dba92bab..4b570ec75e67 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c +++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c @@ -15,10 +15,10 @@ do { \ } while (0) /* Global variables, these are static variables */ -static COEX_DM_8723B_2ANT GLCoexDm8723b2Ant; -static PCOEX_DM_8723B_2ANT pCoexDm = &GLCoexDm8723b2Ant; -static COEX_STA_8723B_2ANT GLCoexSta8723b2Ant; -static PCOEX_STA_8723B_2ANT pCoexSta = &GLCoexSta8723b2Ant; +static struct coex_dm_8723b_2ant GLCoexDm8723b2Ant; +static struct coex_dm_8723b_2ant *pCoexDm = &GLCoexDm8723b2Ant; +static struct coex_sta_8723b_2ant GLCoexSta8723b2Ant; +static struct coex_sta_8723b_2ant *pCoexSta = &GLCoexSta8723b2Ant; static const char *const GLBtInfoSrc8723b2Ant[] = { "BT Info[wifi fw]", @@ -44,7 +44,7 @@ static u8 halbtc8723b2ant_BtRssiState( (pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) || (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW) ) { - if (btRssi >= (rssiThresh+BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT)) { + if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT)) { btRssiState = BTC_RSSI_STATE_HIGH; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to High\n")); } else { @@ -70,7 +70,7 @@ static u8 halbtc8723b2ant_BtRssiState( (pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) || (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW) ) { - if (btRssi >= (rssiThresh+BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT)) { + if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT)) { btRssiState = BTC_RSSI_STATE_MEDIUM; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to Medium\n")); } else { @@ -81,7 +81,7 @@ static u8 halbtc8723b2ant_BtRssiState( (pCoexSta->preBtRssiState == BTC_RSSI_STATE_MEDIUM) || (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_MEDIUM) ) { - if (btRssi >= (rssiThresh1+BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT)) { + if (btRssi >= (rssiThresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT)) { btRssiState = BTC_RSSI_STATE_HIGH; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to High\n")); } else if (btRssi < rssiThresh) { @@ -108,7 +108,7 @@ static u8 halbtc8723b2ant_BtRssiState( } static u8 halbtc8723b2ant_WifiRssiState( - PBTC_COEXIST pBtCoexist, + struct btc_coexist *pBtCoexist, u8 index, u8 levelNum, u8 rssiThresh, @@ -125,7 +125,7 @@ static u8 halbtc8723b2ant_WifiRssiState( (pCoexSta->preWifiRssiState[index] == BTC_RSSI_STATE_LOW) || (pCoexSta->preWifiRssiState[index] == BTC_RSSI_STATE_STAY_LOW) ) { - if (wifiRssi >= (rssiThresh+BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT)) { + if (wifiRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT)) { wifiRssiState = BTC_RSSI_STATE_HIGH; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to High\n")); } else { @@ -151,7 +151,7 @@ static u8 halbtc8723b2ant_WifiRssiState( (pCoexSta->preWifiRssiState[index] == BTC_RSSI_STATE_LOW) || (pCoexSta->preWifiRssiState[index] == BTC_RSSI_STATE_STAY_LOW) ) { - if (wifiRssi >= (rssiThresh+BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT)) { + if (wifiRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT)) { wifiRssiState = BTC_RSSI_STATE_MEDIUM; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Medium\n")); } else { @@ -162,7 +162,7 @@ static u8 halbtc8723b2ant_WifiRssiState( (pCoexSta->preWifiRssiState[index] == BTC_RSSI_STATE_MEDIUM) || (pCoexSta->preWifiRssiState[index] == BTC_RSSI_STATE_STAY_MEDIUM) ) { - if (wifiRssi >= (rssiThresh1+BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT)) { + if (wifiRssi >= (rssiThresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT)) { wifiRssiState = BTC_RSSI_STATE_HIGH; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to High\n")); } else if (wifiRssi < rssiThresh) { @@ -189,7 +189,7 @@ static u8 halbtc8723b2ant_WifiRssiState( } static void halbtc8723b2ant_LimitedRx( - PBTC_COEXIST pBtCoexist, + struct btc_coexist *pBtCoexist, bool bForceExec, bool bRejApAggPkt, bool bBtCtrlAggBufSize, @@ -212,7 +212,7 @@ static void halbtc8723b2ant_LimitedRx( pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_AGGREGATE_CTRL, NULL); } -static void halbtc8723b2ant_MonitorBtCtr(PBTC_COEXIST pBtCoexist) +static void halbtc8723b2ant_MonitorBtCtr(struct btc_coexist *pBtCoexist) { u32 regHPTxRx, regLPTxRx, u4Tmp; u32 regHPTx = 0, regHPRx = 0, regLPTx = 0, regLPRx = 0; @@ -222,11 +222,11 @@ static void halbtc8723b2ant_MonitorBtCtr(PBTC_COEXIST pBtCoexist) u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, regHPTxRx); regHPTx = u4Tmp & bMaskLWord; - regHPRx = (u4Tmp & bMaskHWord)>>16; + regHPRx = (u4Tmp & bMaskHWord) >> 16; u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, regLPTxRx); regLPTx = u4Tmp & bMaskLWord; - regLPRx = (u4Tmp & bMaskHWord)>>16; + regLPRx = (u4Tmp & bMaskHWord) >> 16; pCoexSta->highPriorityTx = regHPTx; pCoexSta->highPriorityRx = regHPRx; @@ -262,7 +262,7 @@ static void halbtc8723b2ant_MonitorBtCtr(PBTC_COEXIST pBtCoexist) pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); } -static void halbtc8723b2ant_QueryBtInfo(PBTC_COEXIST pBtCoexist) +static void halbtc8723b2ant_QueryBtInfo(struct btc_coexist *pBtCoexist) { u8 H2C_Parameter[1] = {0}; @@ -279,7 +279,7 @@ static void halbtc8723b2ant_QueryBtInfo(PBTC_COEXIST pBtCoexist) pBtCoexist->fBtcFillH2c(pBtCoexist, 0x61, 1, H2C_Parameter); } -static bool halbtc8723b2ant_IsWifiStatusChanged(PBTC_COEXIST pBtCoexist) +static bool halbtc8723b2ant_IsWifiStatusChanged(struct btc_coexist *pBtCoexist) { static bool bPreWifiBusy, bPreUnder4way, bPreBtHsOn; bool bWifiBusy = false, bUnder4way = false, bBtHsOn = false; @@ -310,9 +310,9 @@ static bool halbtc8723b2ant_IsWifiStatusChanged(PBTC_COEXIST pBtCoexist) return false; } -static void halbtc8723b2ant_UpdateBtLinkInfo(PBTC_COEXIST pBtCoexist) +static void halbtc8723b2ant_UpdateBtLinkInfo(struct btc_coexist *pBtCoexist) { - PBTC_BT_LINK_INFO pBtLinkInfo = &pBtCoexist->btLinkInfo; + struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; bool bBtHsOn = false; pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); @@ -374,9 +374,9 @@ static void halbtc8723b2ant_UpdateBtLinkInfo(PBTC_COEXIST pBtCoexist) pBtLinkInfo->bHidOnly = false; } -static u8 halbtc8723b2ant_ActionAlgorithm(PBTC_COEXIST pBtCoexist) +static u8 halbtc8723b2ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) { - PBTC_BT_LINK_INFO pBtLinkInfo = &pBtCoexist->btLinkInfo; + struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; bool bBtHsOn = false; u8 algorithm = BT_8723B_2ANT_COEX_ALGO_UNDEFINED; u8 numOfDiffProfile = 0; @@ -549,7 +549,7 @@ static u8 halbtc8723b2ant_ActionAlgorithm(PBTC_COEXIST pBtCoexist) } static void halbtc8723b2ant_SetFwDacSwingLevel( - PBTC_COEXIST pBtCoexist, u8 dacSwingLvl + struct btc_coexist *pBtCoexist, u8 dacSwingLvl ) { u8 H2C_Parameter[1] = {0}; @@ -573,7 +573,7 @@ static void halbtc8723b2ant_SetFwDacSwingLevel( } static void halbtc8723b2ant_SetFwDecBtPwr( - PBTC_COEXIST pBtCoexist, u8 decBtPwrLvl + struct btc_coexist *pBtCoexist, u8 decBtPwrLvl ) { u8 H2C_Parameter[1] = {0}; @@ -594,7 +594,7 @@ static void halbtc8723b2ant_SetFwDecBtPwr( } static void halbtc8723b2ant_DecBtPwr( - PBTC_COEXIST pBtCoexist, bool bForceExec, u8 decBtPwrLvl + struct btc_coexist *pBtCoexist, bool bForceExec, u8 decBtPwrLvl ) { BTC_PRINT( @@ -628,7 +628,7 @@ static void halbtc8723b2ant_DecBtPwr( } static void halbtc8723b2ant_FwDacSwingLvl( - PBTC_COEXIST pBtCoexist, bool bForceExec, u8 fwDacSwingLvl + struct btc_coexist *pBtCoexist, bool bForceExec, u8 fwDacSwingLvl ) { BTC_PRINT( @@ -663,7 +663,7 @@ static void halbtc8723b2ant_FwDacSwingLvl( } static void halbtc8723b2ant_SetSwRfRxLpfCorner( - PBTC_COEXIST pBtCoexist, + struct btc_coexist *pBtCoexist, bool bRxRfShrinkOn ) { @@ -686,7 +686,7 @@ static void halbtc8723b2ant_SetSwRfRxLpfCorner( } static void halbtc8723b2ant_RfShrink( - PBTC_COEXIST pBtCoexist, bool bForceExec, bool bRxRfShrinkOn + struct btc_coexist *pBtCoexist, bool bForceExec, bool bRxRfShrinkOn ) { BTC_PRINT( @@ -720,7 +720,7 @@ static void halbtc8723b2ant_RfShrink( } static void halbtc8723b2ant_SetSwPenaltyTxRateAdaptive( - PBTC_COEXIST pBtCoexist, bool bLowPenaltyRa + struct btc_coexist *pBtCoexist, bool bLowPenaltyRa ) { u8 H2C_Parameter[6] = {0}; @@ -748,7 +748,7 @@ static void halbtc8723b2ant_SetSwPenaltyTxRateAdaptive( } static void halbtc8723b2ant_LowPenaltyRa( - PBTC_COEXIST pBtCoexist, bool bForceExec, bool bLowPenaltyRa + struct btc_coexist *pBtCoexist, bool bForceExec, bool bLowPenaltyRa ) { /* return; */ @@ -782,7 +782,7 @@ static void halbtc8723b2ant_LowPenaltyRa( pCoexDm->bPreLowPenaltyRa = pCoexDm->bCurLowPenaltyRa; } -static void halbtc8723b2ant_SetDacSwingReg(PBTC_COEXIST pBtCoexist, u32 level) +static void halbtc8723b2ant_SetDacSwingReg(struct btc_coexist *pBtCoexist, u32 level) { u8 val = (u8)level; @@ -795,7 +795,7 @@ static void halbtc8723b2ant_SetDacSwingReg(PBTC_COEXIST pBtCoexist, u32 level) } static void halbtc8723b2ant_SetSwFullTimeDacSwing( - PBTC_COEXIST pBtCoexist, bool bSwDacSwingOn, u32 swDacSwingLvl + struct btc_coexist *pBtCoexist, bool bSwDacSwingOn, u32 swDacSwingLvl ) { if (bSwDacSwingOn) @@ -806,7 +806,7 @@ static void halbtc8723b2ant_SetSwFullTimeDacSwing( static void halbtc8723b2ant_DacSwing( - PBTC_COEXIST pBtCoexist, + struct btc_coexist *pBtCoexist, bool bForceExec, bool bDacSwingOn, u32 dacSwingLvl @@ -850,7 +850,7 @@ static void halbtc8723b2ant_DacSwing( } static void halbtc8723b2ant_SetAgcTable( - PBTC_COEXIST pBtCoexist, bool bAgcTableEn + struct btc_coexist *pBtCoexist, bool bAgcTableEn ) { u8 rssiAdjustVal = 0; @@ -910,7 +910,7 @@ static void halbtc8723b2ant_SetAgcTable( } static void halbtc8723b2ant_AgcTable( - PBTC_COEXIST pBtCoexist, bool bForceExec, bool bAgcTableEn + struct btc_coexist *pBtCoexist, bool bForceExec, bool bAgcTableEn ) { BTC_PRINT( @@ -944,7 +944,7 @@ static void halbtc8723b2ant_AgcTable( } static void halbtc8723b2ant_SetCoexTable( - PBTC_COEXIST pBtCoexist, + struct btc_coexist *pBtCoexist, u32 val0x6c0, u32 val0x6c4, u32 val0x6c8, @@ -981,7 +981,7 @@ static void halbtc8723b2ant_SetCoexTable( } static void halbtc8723b2ant_CoexTable( - PBTC_COEXIST pBtCoexist, + struct btc_coexist *pBtCoexist, bool bForceExec, u32 val0x6c0, u32 val0x6c4, @@ -1047,7 +1047,7 @@ static void halbtc8723b2ant_CoexTable( } static void halbtc8723b2ant_CoexTableWithType( - PBTC_COEXIST pBtCoexist, bool bForceExec, u8 type + struct btc_coexist *pBtCoexist, bool bForceExec, u8 type ) { switch (type) { @@ -1096,7 +1096,7 @@ static void halbtc8723b2ant_CoexTableWithType( } static void halbtc8723b2ant_SetFwIgnoreWlanAct( - PBTC_COEXIST pBtCoexist, bool bEnable + struct btc_coexist *pBtCoexist, bool bEnable ) { u8 H2C_Parameter[1] = {0}; @@ -1117,7 +1117,7 @@ static void halbtc8723b2ant_SetFwIgnoreWlanAct( } static void halbtc8723b2ant_IgnoreWlanAct( - PBTC_COEXIST pBtCoexist, bool bForceExec, bool bEnable + struct btc_coexist *pBtCoexist, bool bForceExec, bool bEnable ) { BTC_PRINT( @@ -1145,7 +1145,7 @@ static void halbtc8723b2ant_IgnoreWlanAct( } static void halbtc8723b2ant_SetFwPstdma( - PBTC_COEXIST pBtCoexist, + struct btc_coexist *pBtCoexist, u8 byte1, u8 byte2, u8 byte3, @@ -1173,9 +1173,9 @@ static void halbtc8723b2ant_SetFwPstdma( ( "[BTCoex], FW write 0x60(5bytes) = 0x%x%08x\n", H2C_Parameter[0], - H2C_Parameter[1]<<24| - H2C_Parameter[2]<<16| - H2C_Parameter[3]<<8| + H2C_Parameter[1] << 24 | + H2C_Parameter[2] << 16 | + H2C_Parameter[3] << 8 | H2C_Parameter[4] ) ); @@ -1184,7 +1184,7 @@ static void halbtc8723b2ant_SetFwPstdma( } static void halbtc8723b2ant_SwMechanism1( - PBTC_COEXIST pBtCoexist, + struct btc_coexist *pBtCoexist, bool bShrinkRxLPF, bool bLowPenaltyRA, bool bLimitedDIG, @@ -1196,7 +1196,7 @@ static void halbtc8723b2ant_SwMechanism1( } static void halbtc8723b2ant_SwMechanism2( - PBTC_COEXIST pBtCoexist, + struct btc_coexist *pBtCoexist, bool bAGCTableShift, bool bADCBackOff, bool bSWDACSwing, @@ -1208,10 +1208,10 @@ static void halbtc8723b2ant_SwMechanism2( } static void halbtc8723b2ant_SetAntPath( - PBTC_COEXIST pBtCoexist, u8 antPosType, bool bInitHwCfg, bool bWifiOff + struct btc_coexist *pBtCoexist, u8 antPosType, bool bInitHwCfg, bool bWifiOff ) { - PBTC_BOARD_INFO pBoardInfo = &pBtCoexist->boardInfo; + struct btc_board_info *pBoardInfo = &pBtCoexist->boardInfo; u32 fwVer = 0, u4Tmp = 0; bool bPgExtSwitch = false; bool bUseExtSwitch = false; @@ -1302,7 +1302,7 @@ static void halbtc8723b2ant_SetAntPath( } static void halbtc8723b2ant_PsTdma( - PBTC_COEXIST pBtCoexist, bool bForceExec, bool bTurnOn, u8 type + struct btc_coexist *pBtCoexist, bool bForceExec, bool bTurnOn, u8 type ) { BTC_PRINT( @@ -1434,7 +1434,7 @@ static void halbtc8723b2ant_PsTdma( pCoexDm->prePsTdma = pCoexDm->curPsTdma; } -static void halbtc8723b2ant_CoexAllOff(PBTC_COEXIST pBtCoexist) +static void halbtc8723b2ant_CoexAllOff(struct btc_coexist *pBtCoexist) { /* fw all off */ halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 1); @@ -1450,7 +1450,7 @@ static void halbtc8723b2ant_CoexAllOff(PBTC_COEXIST pBtCoexist) halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); } -static void halbtc8723b2ant_InitCoexDm(PBTC_COEXIST pBtCoexist) +static void halbtc8723b2ant_InitCoexDm(struct btc_coexist *pBtCoexist) { /* force to reset coex mechanism */ @@ -1462,7 +1462,7 @@ static void halbtc8723b2ant_InitCoexDm(PBTC_COEXIST pBtCoexist) halbtc8723b2ant_SwMechanism2(pBtCoexist, false, false, false, 0x18); } -static void halbtc8723b2ant_ActionBtInquiry(PBTC_COEXIST pBtCoexist) +static void halbtc8723b2ant_ActionBtInquiry(struct btc_coexist *pBtCoexist) { bool bWifiConnected = false; bool bLowPwrDisable = true; @@ -1490,7 +1490,7 @@ static void halbtc8723b2ant_ActionBtInquiry(PBTC_COEXIST pBtCoexist) halbtc8723b2ant_SetAntPath(pBtCoexist, BTC_ANT_WIFI_AT_AUX, false, false); } -static bool halbtc8723b2ant_IsCommonAction(PBTC_COEXIST pBtCoexist) +static bool halbtc8723b2ant_IsCommonAction(struct btc_coexist *pBtCoexist) { u8 btRssiState = BTC_RSSI_STATE_HIGH; bool bCommon = false, bWifiConnected = false, bWifiBusy = false; @@ -1591,7 +1591,7 @@ static bool halbtc8723b2ant_IsCommonAction(PBTC_COEXIST pBtCoexist) } static void halbtc8723b2ant_TdmaDurationAdjust( - PBTC_COEXIST pBtCoexist, bool bScoHid, bool bTxPause, u8 maxInterval + struct btc_coexist *pBtCoexist, bool bScoHid, bool bTxPause, u8 maxInterval ) { static s32 up, dn, m, n, WaitCount; @@ -1691,7 +1691,7 @@ static void halbtc8723b2ant_TdmaDurationAdjust( if (m >= 20) /* m 最大值 = 20 ' 最大120秒 recheck是否調整 WiFi duration. */ m = 20; - n = 3*m; + n = 3 * m; up = 0; dn = 0; WaitCount = 0; @@ -1707,7 +1707,7 @@ static void halbtc8723b2ant_TdmaDurationAdjust( if (m >= 20) /* m 最大值 = 20 ' 最大120秒 recheck是否調整 WiFi duration. */ m = 20; - n = 3*m; + n = 3 * m; up = 0; dn = 0; WaitCount = 0; @@ -2041,7 +2041,7 @@ static void halbtc8723b2ant_TdmaDurationAdjust( } /* SCO only or SCO+PAN(HS) */ -static void halbtc8723b2ant_ActionSco(PBTC_COEXIST pBtCoexist) +static void halbtc8723b2ant_ActionSco(struct btc_coexist *pBtCoexist) { u8 wifiRssiState, btRssiState; u32 wifiBw; @@ -2096,7 +2096,7 @@ static void halbtc8723b2ant_ActionSco(PBTC_COEXIST pBtCoexist) } -static void halbtc8723b2ant_ActionHid(PBTC_COEXIST pBtCoexist) +static void halbtc8723b2ant_ActionHid(struct btc_coexist *pBtCoexist) { u8 wifiRssiState, btRssiState; u32 wifiBw; @@ -2157,7 +2157,7 @@ static void halbtc8723b2ant_ActionHid(PBTC_COEXIST pBtCoexist) } /* A2DP only / PAN(EDR) only/ A2DP+PAN(HS) */ -static void halbtc8723b2ant_ActionA2dp(PBTC_COEXIST pBtCoexist) +static void halbtc8723b2ant_ActionA2dp(struct btc_coexist *pBtCoexist) { u8 wifiRssiState, wifiRssiState1, btRssiState; u32 wifiBw; @@ -2238,7 +2238,7 @@ static void halbtc8723b2ant_ActionA2dp(PBTC_COEXIST pBtCoexist) } } -static void halbtc8723b2ant_ActionA2dpPanHs(PBTC_COEXIST pBtCoexist) +static void halbtc8723b2ant_ActionA2dpPanHs(struct btc_coexist *pBtCoexist) { u8 wifiRssiState, btRssiState; u32 wifiBw; @@ -2288,7 +2288,7 @@ static void halbtc8723b2ant_ActionA2dpPanHs(PBTC_COEXIST pBtCoexist) } } -static void halbtc8723b2ant_ActionPanEdr(PBTC_COEXIST pBtCoexist) +static void halbtc8723b2ant_ActionPanEdr(struct btc_coexist *pBtCoexist) { u8 wifiRssiState, btRssiState; u32 wifiBw; @@ -2346,7 +2346,7 @@ static void halbtc8723b2ant_ActionPanEdr(PBTC_COEXIST pBtCoexist) /* PAN(HS) only */ -static void halbtc8723b2ant_ActionPanHs(PBTC_COEXIST pBtCoexist) +static void halbtc8723b2ant_ActionPanHs(struct btc_coexist *pBtCoexist) { u8 wifiRssiState, btRssiState; u32 wifiBw; @@ -2396,7 +2396,7 @@ static void halbtc8723b2ant_ActionPanHs(PBTC_COEXIST pBtCoexist) } /* PAN(EDR)+A2DP */ -static void halbtc8723b2ant_ActionPanEdrA2dp(PBTC_COEXIST pBtCoexist) +static void halbtc8723b2ant_ActionPanEdrA2dp(struct btc_coexist *pBtCoexist) { u8 wifiRssiState, btRssiState; u32 wifiBw; @@ -2457,7 +2457,7 @@ static void halbtc8723b2ant_ActionPanEdrA2dp(PBTC_COEXIST pBtCoexist) } } -static void halbtc8723b2ant_ActionPanEdrHid(PBTC_COEXIST pBtCoexist) +static void halbtc8723b2ant_ActionPanEdrHid(struct btc_coexist *pBtCoexist) { u8 wifiRssiState, btRssiState; u32 wifiBw; @@ -2521,7 +2521,7 @@ static void halbtc8723b2ant_ActionPanEdrHid(PBTC_COEXIST pBtCoexist) } /* HID+A2DP+PAN(EDR) */ -static void halbtc8723b2ant_ActionHidA2dpPanEdr(PBTC_COEXIST pBtCoexist) +static void halbtc8723b2ant_ActionHidA2dpPanEdr(struct btc_coexist *pBtCoexist) { u8 wifiRssiState, btRssiState; u32 wifiBw; @@ -2581,7 +2581,7 @@ static void halbtc8723b2ant_ActionHidA2dpPanEdr(PBTC_COEXIST pBtCoexist) } } -static void halbtc8723b2ant_ActionHidA2dp(PBTC_COEXIST pBtCoexist) +static void halbtc8723b2ant_ActionHidA2dp(struct btc_coexist *pBtCoexist) { u8 wifiRssiState, btRssiState; u32 wifiBw; @@ -2656,7 +2656,7 @@ static void halbtc8723b2ant_ActionHidA2dp(PBTC_COEXIST pBtCoexist) } } -static void halbtc8723b2ant_RunCoexistMechanism(PBTC_COEXIST pBtCoexist) +static void halbtc8723b2ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist) { u8 algorithm = 0; @@ -2755,7 +2755,7 @@ static void halbtc8723b2ant_RunCoexistMechanism(PBTC_COEXIST pBtCoexist) } } -static void halbtc8723b2ant_WifiOffHwCfg(PBTC_COEXIST pBtCoexist) +static void halbtc8723b2ant_WifiOffHwCfg(struct btc_coexist *pBtCoexist) { bool bIsInMpMode = false; u8 H2C_Parameter[2] = {0}; @@ -2780,7 +2780,7 @@ static void halbtc8723b2ant_WifiOffHwCfg(PBTC_COEXIST pBtCoexist) pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x1); /* BT select s0/s1 is controlled by WiFi */ } -static void halbtc8723b2ant_InitHwConfig(PBTC_COEXIST pBtCoexist, bool bBackUp) +static void halbtc8723b2ant_InitHwConfig(struct btc_coexist *pBtCoexist, bool bBackUp) { u8 u1Tmp = 0; @@ -2814,9 +2814,9 @@ static void halbtc8723b2ant_InitHwConfig(PBTC_COEXIST pBtCoexist, bool bBackUp) /* */ /* extern function start with EXhalbtc8723b2ant_ */ /* */ -void EXhalbtc8723b2ant_PowerOnSetting(PBTC_COEXIST pBtCoexist) +void EXhalbtc8723b2ant_PowerOnSetting(struct btc_coexist *pBtCoexist) { - PBTC_BOARD_INFO pBoardInfo = &pBtCoexist->boardInfo; + struct btc_board_info *pBoardInfo = &pBtCoexist->boardInfo; u8 u1Tmp = 0x4; /* Set BIT2 by default since it's 2ant case */ u16 u2Tmp = 0x0; @@ -2824,7 +2824,7 @@ void EXhalbtc8723b2ant_PowerOnSetting(PBTC_COEXIST pBtCoexist) /* enable BB, REG_SYS_FUNC_EN such that we can write 0x948 correctly. */ u2Tmp = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0x2); - pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x2, u2Tmp|BIT0|BIT1); + pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x2, u2Tmp | BIT0 | BIT1); /* set GRAN_BT = 1 */ pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18); @@ -2866,23 +2866,23 @@ void EXhalbtc8723b2ant_PowerOnSetting(PBTC_COEXIST pBtCoexist) } } -void EXhalbtc8723b2ant_InitHwConfig(PBTC_COEXIST pBtCoexist, bool bWifiOnly) +void EXhalbtc8723b2ant_InitHwConfig(struct btc_coexist *pBtCoexist, bool bWifiOnly) { halbtc8723b2ant_InitHwConfig(pBtCoexist, true); } -void EXhalbtc8723b2ant_InitCoexDm(PBTC_COEXIST pBtCoexist) +void EXhalbtc8723b2ant_InitCoexDm(struct btc_coexist *pBtCoexist) { BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], Coex Mechanism Init!!\n")); halbtc8723b2ant_InitCoexDm(pBtCoexist); } -void EXhalbtc8723b2ant_DisplayCoexInfo(PBTC_COEXIST pBtCoexist) +void EXhalbtc8723b2ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) { - PBTC_BOARD_INFO pBoardInfo = &pBtCoexist->boardInfo; - PBTC_STACK_INFO pStackInfo = &pBtCoexist->stackInfo; - PBTC_BT_LINK_INFO pBtLinkInfo = &pBtCoexist->btLinkInfo; + struct btc_board_info *pBoardInfo = &pBtCoexist->boardInfo; + struct btc_stack_info *pStackInfo = &pBtCoexist->stackInfo; + struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; u8 *cliBuf = pBtCoexist->cliBuf; u8 u1Tmp[4], i, btInfoExt, psTdmaCase = 0; u32 u4Tmp[4]; @@ -3019,7 +3019,7 @@ void EXhalbtc8723b2ant_DisplayCoexInfo(PBTC_COEXIST pBtCoexist) cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s", "BT Info A2DP rate", \ - (btInfoExt&BIT0) ? "Basic rate" : "EDR rate" + (btInfoExt & BIT0) ? "Basic rate" : "EDR rate" ); CL_PRINTF(cliBuf); @@ -3126,7 +3126,7 @@ void EXhalbtc8723b2ant_DisplayCoexInfo(PBTC_COEXIST pBtCoexist) BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x", "0x778/0x880[29:25]", \ u1Tmp[0], - (u4Tmp[0]&0x3e000000) >> 25 + (u4Tmp[0] & 0x3e000000) >> 25 ); CL_PRINTF(cliBuf); @@ -3139,7 +3139,7 @@ void EXhalbtc8723b2ant_DisplayCoexInfo(PBTC_COEXIST pBtCoexist) BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "0x948/ 0x67[5] / 0x765", \ u4Tmp[0], - ((u1Tmp[0]&0x20)>>5), + ((u1Tmp[0] & 0x20) >> 5), u1Tmp[1] ); CL_PRINTF(cliBuf); @@ -3151,9 +3151,9 @@ void EXhalbtc8723b2ant_DisplayCoexInfo(PBTC_COEXIST pBtCoexist) cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "0x92c[1:0]/ 0x930[7:0]/0x944[1:0]", \ - u4Tmp[0]&0x3, - u4Tmp[1]&0xff, - u4Tmp[2]&0x3 + u4Tmp[0] & 0x3, + u4Tmp[1] & 0xff, + u4Tmp[2] & 0x3 ); CL_PRINTF(cliBuf); @@ -3166,10 +3166,10 @@ void EXhalbtc8723b2ant_DisplayCoexInfo(PBTC_COEXIST pBtCoexist) cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x", "0x38[11]/0x40/0x4c[24:23]/0x64[0]", \ - ((u1Tmp[0] & 0x8)>>3), + ((u1Tmp[0] & 0x8) >> 3), u1Tmp[1], - ((u4Tmp[0]&0x01800000)>>23), - u1Tmp[2]&0x1 + ((u4Tmp[0] & 0x01800000) >> 23), + u1Tmp[2] & 0x1 ); CL_PRINTF(cliBuf); @@ -3190,7 +3190,7 @@ void EXhalbtc8723b2ant_DisplayCoexInfo(PBTC_COEXIST pBtCoexist) cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x", "0xc50(dig)/0x49c(null-drop)", \ - u4Tmp[0]&0xff, + u4Tmp[0] & 0xff, u1Tmp[0] ); CL_PRINTF(cliBuf); @@ -3204,10 +3204,10 @@ void EXhalbtc8723b2ant_DisplayCoexInfo(PBTC_COEXIST pBtCoexist) u1Tmp[1] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0xa5c); faOfdm = - ((u4Tmp[0]&0xffff0000) >> 16) + - ((u4Tmp[1]&0xffff0000) >> 16) + + ((u4Tmp[0] & 0xffff0000) >> 16) + + ((u4Tmp[1] & 0xffff0000) >> 16) + (u4Tmp[1] & 0xffff) + (u4Tmp[2] & 0xffff) + \ - ((u4Tmp[3]&0xffff0000) >> 16) + + ((u4Tmp[3] & 0xffff0000) >> 16) + (u4Tmp[3] & 0xffff); faCck = (u1Tmp[0] << 8) + u1Tmp[1]; @@ -3216,7 +3216,7 @@ void EXhalbtc8723b2ant_DisplayCoexInfo(PBTC_COEXIST pBtCoexist) cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "OFDM-CCA/OFDM-FA/CCK-FA", \ - u4Tmp[0]&0xffff, + u4Tmp[0] & 0xffff, faOfdm, faCck ); @@ -3259,7 +3259,7 @@ void EXhalbtc8723b2ant_DisplayCoexInfo(PBTC_COEXIST pBtCoexist) } -void EXhalbtc8723b2ant_IpsNotify(PBTC_COEXIST pBtCoexist, u8 type) +void EXhalbtc8723b2ant_IpsNotify(struct btc_coexist *pBtCoexist, u8 type) { if (BTC_IPS_ENTER == type) { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS ENTER notify\n")); @@ -3276,7 +3276,7 @@ void EXhalbtc8723b2ant_IpsNotify(PBTC_COEXIST pBtCoexist, u8 type) } } -void EXhalbtc8723b2ant_LpsNotify(PBTC_COEXIST pBtCoexist, u8 type) +void EXhalbtc8723b2ant_LpsNotify(struct btc_coexist *pBtCoexist, u8 type) { if (BTC_LPS_ENABLE == type) { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], LPS ENABLE notify\n")); @@ -3287,7 +3287,7 @@ void EXhalbtc8723b2ant_LpsNotify(PBTC_COEXIST pBtCoexist, u8 type) } } -void EXhalbtc8723b2ant_ScanNotify(PBTC_COEXIST pBtCoexist, u8 type) +void EXhalbtc8723b2ant_ScanNotify(struct btc_coexist *pBtCoexist, u8 type) { if (BTC_SCAN_START == type) { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN START notify\n")); @@ -3296,7 +3296,7 @@ void EXhalbtc8723b2ant_ScanNotify(PBTC_COEXIST pBtCoexist, u8 type) } } -void EXhalbtc8723b2ant_ConnectNotify(PBTC_COEXIST pBtCoexist, u8 type) +void EXhalbtc8723b2ant_ConnectNotify(struct btc_coexist *pBtCoexist, u8 type) { if (BTC_ASSOCIATE_START == type) { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT START notify\n")); @@ -3305,7 +3305,7 @@ void EXhalbtc8723b2ant_ConnectNotify(PBTC_COEXIST pBtCoexist, u8 type) } } -void EXhalbtc8723b2ant_MediaStatusNotify(PBTC_COEXIST pBtCoexist, u8 type) +void EXhalbtc8723b2ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type) { u8 H2C_Parameter[3] = {0}; u32 wifiBw; @@ -3344,14 +3344,14 @@ void EXhalbtc8723b2ant_MediaStatusNotify(PBTC_COEXIST pBtCoexist, u8 type) ALGO_TRACE_FW_EXEC, ( "[BTCoex], FW write 0x66 = 0x%x\n", - H2C_Parameter[0]<<16|H2C_Parameter[1]<<8|H2C_Parameter[2] + H2C_Parameter[0] << 16 | H2C_Parameter[1] << 8 | H2C_Parameter[2] ) ); pBtCoexist->fBtcFillH2c(pBtCoexist, 0x66, 3, H2C_Parameter); } -void EXhalbtc8723b2ant_SpecialPacketNotify(PBTC_COEXIST pBtCoexist, u8 type) +void EXhalbtc8723b2ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 type) { if (type == BTC_PACKET_DHCP) { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], DHCP Packet notify\n")); @@ -3359,7 +3359,7 @@ void EXhalbtc8723b2ant_SpecialPacketNotify(PBTC_COEXIST pBtCoexist, u8 type) } void EXhalbtc8723b2ant_BtInfoNotify( - PBTC_COEXIST pBtCoexist, u8 *tmpBuf, u8 length + struct btc_coexist *pBtCoexist, u8 *tmpBuf, u8 length ) { u8 btInfo = 0; @@ -3369,7 +3369,7 @@ void EXhalbtc8723b2ant_BtInfoNotify( pCoexSta->bC2hBtInfoReqSent = false; - rspSource = tmpBuf[0]&0xf; + rspSource = tmpBuf[0] & 0xf; if (rspSource >= BT_INFO_SRC_8723B_2ANT_MAX) rspSource = BT_INFO_SRC_8723B_2ANT_WIFI_FW; @@ -3381,7 +3381,7 @@ void EXhalbtc8723b2ant_BtInfoNotify( if (i == 1) btInfo = tmpBuf[i]; - if (i == length-1) { + if (i == length - 1) { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("0x%02x]\n", tmpBuf[i])); } else { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("0x%02x, ", tmpBuf[i])); @@ -3394,13 +3394,13 @@ void EXhalbtc8723b2ant_BtInfoNotify( } if (BT_INFO_SRC_8723B_2ANT_WIFI_FW != rspSource) { - pCoexSta->btRetryCnt = pCoexSta->btInfoC2h[rspSource][2]&0xf; /* [3:0] */ + pCoexSta->btRetryCnt = pCoexSta->btInfoC2h[rspSource][2] & 0xf; /* [3:0] */ - pCoexSta->btRssi = pCoexSta->btInfoC2h[rspSource][3]*2+10; + pCoexSta->btRssi = pCoexSta->btInfoC2h[rspSource][3] * 2 + 10; pCoexSta->btInfoExt = pCoexSta->btInfoC2h[rspSource][4]; - pCoexSta->bBtTxRxMask = (pCoexSta->btInfoC2h[rspSource][2]&0x40); + pCoexSta->bBtTxRxMask = (pCoexSta->btInfoC2h[rspSource][2] & 0x40); pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TX_RX_MASK, &pCoexSta->bBtTxRxMask); if (pCoexSta->bBtTxRxMask) { /* BT into is responded by BT FW and BT RF REG 0x3C != 0x01 => Need to switch BT TRx Mask */ @@ -3435,7 +3435,7 @@ void EXhalbtc8723b2ant_BtInfoNotify( pCoexSta->bC2hBtInquiryPage = false; /* set link exist status */ - if (!(btInfo&BT_INFO_8723B_2ANT_B_CONNECTION)) { + if (!(btInfo & BT_INFO_8723B_2ANT_B_CONNECTION)) { pCoexSta->bBtLinkExist = false; pCoexSta->bPanExist = false; pCoexSta->bA2dpExist = false; @@ -3463,19 +3463,19 @@ void EXhalbtc8723b2ant_BtInfoNotify( halbtc8723b2ant_UpdateBtLinkInfo(pBtCoexist); - if (!(btInfo&BT_INFO_8723B_2ANT_B_CONNECTION)) { + if (!(btInfo & BT_INFO_8723B_2ANT_B_CONNECTION)) { pCoexDm->btStatus = BT_8723B_2ANT_BT_STATUS_NON_CONNECTED_IDLE; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), BT Non-Connected idle!!!\n")); } else if (btInfo == BT_INFO_8723B_2ANT_B_CONNECTION) { /* connection exists but no busy */ pCoexDm->btStatus = BT_8723B_2ANT_BT_STATUS_CONNECTED_IDLE; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), BT Connected-idle!!!\n")); } else if ( - (btInfo&BT_INFO_8723B_2ANT_B_SCO_ESCO) || - (btInfo&BT_INFO_8723B_2ANT_B_SCO_BUSY) + (btInfo & BT_INFO_8723B_2ANT_B_SCO_ESCO) || + (btInfo & BT_INFO_8723B_2ANT_B_SCO_BUSY) ) { pCoexDm->btStatus = BT_8723B_2ANT_BT_STATUS_SCO_BUSY; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), BT SCO busy!!!\n")); - } else if (btInfo&BT_INFO_8723B_2ANT_B_ACL_BUSY) { + } else if (btInfo & BT_INFO_8723B_2ANT_B_ACL_BUSY) { pCoexDm->btStatus = BT_8723B_2ANT_BT_STATUS_ACL_BUSY; BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), BT ACL busy!!!\n")); } else { @@ -3503,7 +3503,7 @@ void EXhalbtc8723b2ant_BtInfoNotify( halbtc8723b2ant_RunCoexistMechanism(pBtCoexist); } -void EXhalbtc8723b2ant_HaltNotify(PBTC_COEXIST pBtCoexist) +void EXhalbtc8723b2ant_HaltNotify(struct btc_coexist *pBtCoexist) { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Halt notify\n")); @@ -3514,7 +3514,7 @@ void EXhalbtc8723b2ant_HaltNotify(PBTC_COEXIST pBtCoexist) EXhalbtc8723b2ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT); } -void EXhalbtc8723b2ant_PnpNotify(PBTC_COEXIST pBtCoexist, u8 pnpState) +void EXhalbtc8723b2ant_PnpNotify(struct btc_coexist *pBtCoexist, u8 pnpState) { BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify\n")); @@ -3528,7 +3528,7 @@ void EXhalbtc8723b2ant_PnpNotify(PBTC_COEXIST pBtCoexist, u8 pnpState) } } -void EXhalbtc8723b2ant_Periodical(PBTC_COEXIST pBtCoexist) +void EXhalbtc8723b2ant_Periodical(struct btc_coexist *pBtCoexist) { static u8 disVerInfoCnt; u32 fwVer = 0, btPatchVer = 0; |