diff options
Diffstat (limited to 'drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c')
-rw-r--r-- | drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c | 414 |
1 files changed, 0 insertions, 414 deletions
diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c index 84241619fb3a..c1c7b5cc17a7 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c +++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c @@ -20,15 +20,6 @@ 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]", - "BT Info[bt rsp]", - "BT Info[bt auto report]", -}; - -static u32 GLCoexVerDate8723b2Ant = 20131211; -static u32 GLCoexVer8723b2Ant = 0x40; - /* local function start with halbtc8723b2ant_ */ static u8 halbtc8723b2ant_BtRssiState( u8 levelNum, u8 rssiThresh, u8 rssiThresh1 @@ -188,31 +179,6 @@ static void halbtc8723b2ant_LimitedRx( pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_AGGREGATE_CTRL, NULL); } -static void halbtc8723b2ant_MonitorBtCtr(struct btc_coexist *pBtCoexist) -{ - u32 regHPTxRx, regLPTxRx, u4Tmp; - u32 regHPTx = 0, regHPRx = 0, regLPTx = 0, regLPRx = 0; - - regHPTxRx = 0x770; - regLPTxRx = 0x774; - - u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, regHPTxRx); - regHPTx = u4Tmp & bMaskLWord; - regHPRx = (u4Tmp & bMaskHWord) >> 16; - - u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, regLPTxRx); - regLPTx = u4Tmp & bMaskLWord; - regLPRx = (u4Tmp & bMaskHWord) >> 16; - - pCoexSta->highPriorityTx = regHPTx; - pCoexSta->highPriorityRx = regHPRx; - pCoexSta->lowPriorityTx = regLPTx; - pCoexSta->lowPriorityRx = regLPRx; - - /* reset counter */ - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); -} - static void halbtc8723b2ant_QueryBtInfo(struct btc_coexist *pBtCoexist) { u8 H2C_Parameter[1] = {0}; @@ -2423,386 +2389,6 @@ void EXhalbtc8723b2ant_InitCoexDm(struct btc_coexist *pBtCoexist) halbtc8723b2ant_InitCoexDm(pBtCoexist); } -void EXhalbtc8723b2ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) -{ - 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]; - bool bRoam = false, bScan = false, bLink = false; - bool bBtHsOn = false, bWifiBusy = false; - s32 wifiRssi = 0, btHsRssi = 0; - u32 wifiBw, wifiTrafficDir, faOfdm, faCck; - u8 wifiDot11Chnl, wifiHsChnl; - u32 fwVer = 0, btPatchVer = 0; - u8 apNum = 0; - - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n ============[BT Coexist info]============"); - CL_PRINTF(cliBuf); - - if (pBtCoexist->bManualControl) { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n ============[Under Manual Control]============"); - CL_PRINTF(cliBuf); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n =========================================="); - CL_PRINTF(cliBuf); - } - - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = %d/ %d ", "Ant PG number/ Ant mechanism:", \ - pBoardInfo->pgAntNum, - pBoardInfo->btdmAntNum - ); - CL_PRINTF(cliBuf); - - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = %s / %d", "BT stack/ hci ext ver", \ - (pStackInfo->bProfileNotified ? "Yes" : "No"), - pStackInfo->hciVersion - ); - CL_PRINTF(cliBuf); - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_BT_PATCH_VER, &btPatchVer); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d_%x/ 0x%x/ 0x%x(%d)", "CoexVer/ FwVer/ PatchVer", \ - GLCoexVerDate8723b2Ant, GLCoexVer8723b2Ant, fwVer, btPatchVer, btPatchVer); - CL_PRINTF(cliBuf); - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_DOT11_CHNL, &wifiDot11Chnl); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifiHsChnl); - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = %d / %d(%d)", "Dot11 channel / HsChnl(HsMode)", \ - wifiDot11Chnl, - wifiHsChnl, - bBtHsOn - ); - CL_PRINTF(cliBuf); - - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = %02x %02x %02x ", "H2C Wifi inform bt chnl Info", \ - pCoexDm->wifiChnlInfo[0], - pCoexDm->wifiChnlInfo[1], - pCoexDm->wifiChnlInfo[2] - ); - CL_PRINTF(cliBuf); - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_HS_RSSI, &btHsRssi); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_AP_NUM, &apNum); - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = %d/ %d/ %d", "Wifi rssi/ HS rssi/ AP#", \ - wifiRssi, - btHsRssi, - apNum - ); - CL_PRINTF(cliBuf); - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = %d/ %d/ %d ", "Wifi bLink/ bRoam/ bScan", \ - bLink, - bRoam, - bScan - ); - CL_PRINTF(cliBuf); - - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, &wifiTrafficDir); - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = %s / %s/ %s ", "Wifi status", \ - ("2.4G"), - ((BTC_WIFI_BW_LEGACY == wifiBw) ? "Legacy" : (((BTC_WIFI_BW_HT40 == wifiBw) ? "HT40" : "HT20"))), - ((!bWifiBusy) ? "idle" : ((BTC_WIFI_TRAFFIC_TX == wifiTrafficDir) ? "uplink" : "downlink")) - ); - CL_PRINTF(cliBuf); - - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = [%s/ %d/ %d] ", "BT [status/ rssi/ retryCnt]", \ - ((pBtCoexist->btInfo.bBtDisabled) ? ("disabled") : ((pCoexSta->bC2hBtInquiryPage) ? ("inquiry/page scan") : ((BT_8723B_2ANT_BT_STATUS_NON_CONNECTED_IDLE == pCoexDm->btStatus) ? "non-connected idle" : - ((BT_8723B_2ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus) ? "connected-idle" : "busy")))), - pCoexSta->btRssi, - pCoexSta->btRetryCnt - ); - CL_PRINTF(cliBuf); - - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = %d / %d / %d / %d", "SCO/HID/PAN/A2DP", \ - pBtLinkInfo->bScoExist, - pBtLinkInfo->bHidExist, - pBtLinkInfo->bPanExist, - pBtLinkInfo->bA2dpExist - ); - CL_PRINTF(cliBuf); - pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_BT_LINK_INFO); - - btInfoExt = pCoexSta->btInfoExt; - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = %s", "BT Info A2DP rate", \ - (btInfoExt & BIT0) ? "Basic rate" : "EDR rate" - ); - CL_PRINTF(cliBuf); - - for (i = 0; i < BT_INFO_SRC_8723B_2ANT_MAX; i++) { - if (pCoexSta->btInfoC2hCnt[i]) { - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = %02x %02x %02x %02x %02x %02x %02x(%d)", GLBtInfoSrc8723b2Ant[i], \ - pCoexSta->btInfoC2h[i][0], - pCoexSta->btInfoC2h[i][1], - pCoexSta->btInfoC2h[i][2], - pCoexSta->btInfoC2h[i][3], - pCoexSta->btInfoC2h[i][4], - pCoexSta->btInfoC2h[i][5], - pCoexSta->btInfoC2h[i][6], - pCoexSta->btInfoC2hCnt[i] - ); - CL_PRINTF(cliBuf); - } - } - - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = %s/%s", "PS state, IPS/LPS", \ - ((pCoexSta->bUnderIps ? "IPS ON" : "IPS OFF")), - ((pCoexSta->bUnderLps ? "LPS ON" : "LPS OFF")) - ); - CL_PRINTF(cliBuf); - pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_FW_PWR_MODE_CMD); - - /* Sw mechanism */ - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s", "============[Sw mechanism]============" - ); - CL_PRINTF(cliBuf); - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = %d/ %d/ %d ", "SM1[ShRf/ LpRA/ LimDig]", \ - pCoexDm->bCurRfRxLpfShrink, - pCoexDm->bCurLowPenaltyRa, - pCoexDm->bLimitedDig - ); - CL_PRINTF(cliBuf); - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = %d/ %d/ %d(0x%x) ", - "SM2[AgcT/ AdcB/ SwDacSwing(lvl)]", \ - pCoexDm->bCurAgcTableEn, - pCoexDm->bCurAdcBackOff, - pCoexDm->bCurDacSwingOn, - pCoexDm->curDacSwingLvl - ); - CL_PRINTF(cliBuf); - - /* Fw mechanism */ - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Fw mechanism]============"); - CL_PRINTF(cliBuf); - - psTdmaCase = pCoexDm->curPsTdma; - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = %02x %02x %02x %02x %02x case-%d (auto:%d)", "PS TDMA", \ - pCoexDm->psTdmaPara[0], - pCoexDm->psTdmaPara[1], - pCoexDm->psTdmaPara[2], - pCoexDm->psTdmaPara[3], - pCoexDm->psTdmaPara[4], - psTdmaCase, pCoexDm->bAutoTdmaAdjust - ); - CL_PRINTF(cliBuf); - - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = %d/ %d ", "DecBtPwr/ IgnWlanAct", \ - pCoexDm->curBtDecPwrLvl, - pCoexDm->bCurIgnoreWlanAct - ); - CL_PRINTF(cliBuf); - - /* Hw setting */ - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Hw setting]============"); - CL_PRINTF(cliBuf); - - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = 0x%x", "RF-A, 0x1e initVal", \ - pCoexDm->btRf0x1eBackup - ); - CL_PRINTF(cliBuf); - - u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x778); - u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x880); - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = 0x%x/ 0x%x", "0x778/0x880[29:25]", \ - u1Tmp[0], - (u4Tmp[0] & 0x3e000000) >> 25 - ); - CL_PRINTF(cliBuf); - - - u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948); - u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x67); - u1Tmp[1] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765); - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "0x948/ 0x67[5] / 0x765", \ - u4Tmp[0], - ((u1Tmp[0] & 0x20) >> 5), - u1Tmp[1] - ); - CL_PRINTF(cliBuf); - - u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x92c); - u4Tmp[1] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x930); - u4Tmp[2] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x944); - CL_SPRINTF( - 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 - ); - CL_PRINTF(cliBuf); - - - u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x39); - u1Tmp[1] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x40); - u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x4c); - u1Tmp[2] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x64); - CL_SPRINTF( - 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[1], - ((u4Tmp[0] & 0x01800000) >> 23), - u1Tmp[2] & 0x1 - ); - CL_PRINTF(cliBuf); - - u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x550); - u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x522); - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = 0x%x/ 0x%x", "0x550(bcn ctrl)/0x522", \ - u4Tmp[0], - u1Tmp[0] - ); - CL_PRINTF(cliBuf); - - u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xc50); - u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x49c); - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = 0x%x/ 0x%x", "0xc50(dig)/0x49c(null-drop)", \ - u4Tmp[0] & 0xff, - u1Tmp[0] - ); - CL_PRINTF(cliBuf); - - u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xda0); - u4Tmp[1] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xda4); - u4Tmp[2] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xda8); - u4Tmp[3] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xcf0); - - u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0xa5b); - u1Tmp[1] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0xa5c); - - faOfdm = - ((u4Tmp[0] & 0xffff0000) >> 16) + - ((u4Tmp[1] & 0xffff0000) >> 16) + - (u4Tmp[1] & 0xffff) + (u4Tmp[2] & 0xffff) + \ - ((u4Tmp[3] & 0xffff0000) >> 16) + - (u4Tmp[3] & 0xffff); - - faCck = (u1Tmp[0] << 8) + u1Tmp[1]; - - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "OFDM-CCA/OFDM-FA/CCK-FA", \ - u4Tmp[0] & 0xffff, - faOfdm, - faCck - ); - CL_PRINTF(cliBuf); - - u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x6c0); - u4Tmp[1] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x6c4); - u4Tmp[2] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x6c8); - u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x6cc); - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x", "0x6c0/0x6c4/0x6c8/0x6cc(coexTable)", \ - u4Tmp[0], - u4Tmp[1], - u4Tmp[2], - u1Tmp[0] - ); - CL_PRINTF(cliBuf); - - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = %d/ %d", "0x770(high-pri rx/tx)", \ - pCoexSta->highPriorityRx, - pCoexSta->highPriorityTx - ); - CL_PRINTF(cliBuf); - CL_SPRINTF( - cliBuf, - BT_TMP_BUF_SIZE, - "\r\n %-35s = %d/ %d", "0x774(low-pri rx/tx)", \ - pCoexSta->lowPriorityRx, - pCoexSta->lowPriorityTx - ); - CL_PRINTF(cliBuf); - - halbtc8723b2ant_MonitorBtCtr(pBtCoexist); - pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_COEX_STATISTICS); -} - - void EXhalbtc8723b2ant_IpsNotify(struct btc_coexist *pBtCoexist, u8 type) { if (BTC_IPS_ENTER == type) { |