diff options
Diffstat (limited to 'drivers/staging/rtl8723bs/hal')
35 files changed, 643 insertions, 4980 deletions
diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c index 503790924532..dc58bb87f1b0 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c +++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c @@ -38,110 +38,44 @@ static u8 halbtc8723b1ant_BtRssiState( (pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) || (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW) ) { - if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) { + if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) btRssiState = BTC_RSSI_STATE_HIGH; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state switch to High\n") - ); - } else { + else btRssiState = BTC_RSSI_STATE_STAY_LOW; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state stay at Low\n") - ); - } } else { - if (btRssi < rssiThresh) { + if (btRssi < rssiThresh) btRssiState = BTC_RSSI_STATE_LOW; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state switch to Low\n") - ); - } else { + else btRssiState = BTC_RSSI_STATE_STAY_HIGH; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state stay at High\n") - ); - } } } else if (levelNum == 3) { - if (rssiThresh > rssiThresh1) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi thresh error!!\n") - ); + if (rssiThresh > rssiThresh1) return pCoexSta->preBtRssiState; - } if ( (pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) || (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW) ) { - if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) { + if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) btRssiState = BTC_RSSI_STATE_MEDIUM; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state switch to Medium\n") - ); - } else { + else btRssiState = BTC_RSSI_STATE_STAY_LOW; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state stay at Low\n") - ); - } } else if ( (pCoexSta->preBtRssiState == BTC_RSSI_STATE_MEDIUM) || (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_MEDIUM) ) { - if (btRssi >= (rssiThresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) { + if (btRssi >= (rssiThresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) 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) { + else if (btRssi < rssiThresh) btRssiState = BTC_RSSI_STATE_LOW; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state switch to Low\n") - ); - } else { + else btRssiState = BTC_RSSI_STATE_STAY_MEDIUM; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state stay at Medium\n") - ); - } } else { - if (btRssi < rssiThresh1) { + if (btRssi < rssiThresh1) btRssiState = BTC_RSSI_STATE_MEDIUM; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state switch to Medium\n") - ); - } else { + else btRssiState = BTC_RSSI_STATE_STAY_HIGH; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state stay at High\n") - ); - } } } @@ -297,7 +231,7 @@ static void halbtc8723b1ant_LimitedRx( u8 rxAggSize = aggBufSize; /* */ - /* Rx Aggregation related setting */ + /* Rx Aggregation related setting */ /* */ pBtCoexist->fBtcSet( pBtCoexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT, &bRejectRxAgg @@ -316,18 +250,12 @@ static void halbtc8723b1ant_LimitedRx( static void halbtc8723b1ant_QueryBtInfo(struct btc_coexist *pBtCoexist) { - u8 H2C_Parameter[1] = {0}; + u8 H2C_Parameter[1] = {0}; pCoexSta->bC2hBtInfoReqSent = true; H2C_Parameter[0] |= BIT0; /* trigger */ - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ("[BTCoex], Query Bt Info, FW write 0x61 = 0x%x\n", H2C_Parameter[0]) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x61, 1, H2C_Parameter); } @@ -367,18 +295,6 @@ static void halbtc8723b1ant_MonitorBtCtr(struct btc_coexist *pBtCoexist) if ((pCoexSta->lowPriorityTx >= 1050) && (!pCoexSta->bC2hBtInquiryPage)) pCoexSta->popEventCnt++; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ( - "[BTCoex], Hi-Pri Rx/Tx: %d/%d, Lo-Pri Rx/Tx: %d/%d\n", - regHPRx, - regHPTx, - regLPRx, - regLPTx - ) - ); - /* reset counter */ pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); @@ -445,15 +361,15 @@ static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *pBtCoexist) ) ) { if (nCCKLockCounter < 5) - nCCKLockCounter++; + nCCKLockCounter++; } else { if (nCCKLockCounter > 0) - nCCKLockCounter--; + nCCKLockCounter--; } } else { if (nCCKLockCounter > 0) - nCCKLockCounter--; + nCCKLockCounter--; } } else { if (nCCKLockCounter > 0) @@ -463,14 +379,14 @@ static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *pBtCoexist) if (!pCoexSta->bPreCCKLock) { if (nCCKLockCounter >= 5) - pCoexSta->bCCKLock = true; + pCoexSta->bCCKLock = true; else - pCoexSta->bCCKLock = false; + pCoexSta->bCCKLock = false; } else { if (nCCKLockCounter == 0) - pCoexSta->bCCKLock = false; + pCoexSta->bCCKLock = false; else - pCoexSta->bCCKLock = true; + pCoexSta->bCCKLock = true; } pCoexSta->bPreCCKLock = pCoexSta->bCCKLock; @@ -586,14 +502,8 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); - if (!pBtLinkInfo->bBtLinkExist) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], No BT link exists!!!\n") - ); + if (!pBtLinkInfo->bBtLinkExist) return algorithm; - } if (pBtLinkInfo->bScoExist) numOfDiffProfile++; @@ -606,151 +516,62 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) if (numOfDiffProfile == 1) { if (pBtLinkInfo->bScoExist) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = SCO only\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_SCO; } else { if (pBtLinkInfo->bHidExist) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = HID only\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_HID; } else if (pBtLinkInfo->bA2dpExist) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = A2DP only\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_A2DP; } else if (pBtLinkInfo->bPanExist) { - if (bBtHsOn) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = PAN(HS) only\n") - ); + if (bBtHsOn) algorithm = BT_8723B_1ANT_COEX_ALGO_PANHS; - } else { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = PAN(EDR) only\n") - ); + else algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR; - } } } } else if (numOfDiffProfile == 2) { if (pBtLinkInfo->bScoExist) { if (pBtLinkInfo->bHidExist) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = SCO + HID\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_HID; } else if (pBtLinkInfo->bA2dpExist) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = SCO + A2DP ==> SCO\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_SCO; } else if (pBtLinkInfo->bPanExist) { - if (bBtHsOn) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = SCO + PAN(HS)\n") - ); + if (bBtHsOn) algorithm = BT_8723B_1ANT_COEX_ALGO_SCO; - } else { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = SCO + PAN(EDR)\n") - ); + else algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID; - } } } else { if (pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = HID + A2DP\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP; } else if (pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist) { - if (bBtHsOn) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = HID + PAN(HS)\n") - ); + if (bBtHsOn) algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP; - } else { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = HID + PAN(EDR)\n") - ); + else algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID; - } } else if (pBtLinkInfo->bPanExist && pBtLinkInfo->bA2dpExist) { - if (bBtHsOn) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = A2DP + PAN(HS)\n") - ); + if (bBtHsOn) algorithm = BT_8723B_1ANT_COEX_ALGO_A2DP_PANHS; - } else { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = A2DP + PAN(EDR)\n") - ); + else algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_A2DP; - } } } } else if (numOfDiffProfile == 3) { if (pBtLinkInfo->bScoExist) { if (pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = SCO + HID + A2DP ==> HID\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_HID; } else if ( pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist ) { - if (bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT Profile = SCO + HID + PAN(HS)\n")); + if (bBtHsOn) algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP; - } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT Profile = SCO + HID + PAN(EDR)\n")); + else algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID; - } } else if (pBtLinkInfo->bPanExist && pBtLinkInfo->bA2dpExist) { - if (bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT Profile = SCO + A2DP + PAN(HS)\n")); + if (bBtHsOn) algorithm = BT_8723B_1ANT_COEX_ALGO_SCO; - } else { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = SCO + A2DP + PAN(EDR) ==> HID\n") - ); + else algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID; - } } } else { if ( @@ -758,21 +579,10 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtLinkInfo->bPanExist && pBtLinkInfo->bA2dpExist ) { - if (bBtHsOn) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = HID + A2DP + PAN(HS)\n") - ); + if (bBtHsOn) algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP; - } else { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = HID + A2DP + PAN(EDR)\n") - ); + else algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP_PANEDR; - } } } } else if (numOfDiffProfile >= 3) { @@ -782,21 +592,9 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtLinkInfo->bPanExist && pBtLinkInfo->bA2dpExist ) { - if (bBtHsOn) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], Error!!! BT Profile = SCO + HID + A2DP + PAN(HS)\n") - ); - - } else { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = SCO + HID + A2DP + PAN(EDR) ==>PAN(EDR)+HID\n") - ); + if (!bBtHsOn) algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID; - } + } } } @@ -808,7 +606,7 @@ static void halbtc8723b1ant_SetSwPenaltyTxRateAdaptive( struct btc_coexist *pBtCoexist, bool bLowPenaltyRa ) { - u8 H2C_Parameter[6] = {0}; + u8 H2C_Parameter[6] = {0}; H2C_Parameter[0] = 0x6; /* opCode, 0x6 = Retry_Penalty */ @@ -820,15 +618,6 @@ static void halbtc8723b1ant_SetSwPenaltyTxRateAdaptive( H2C_Parameter[5] = 0xf9; /* MCS5 or OFDM36 */ } - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ( - "[BTCoex], set WiFi Low-Penalty Retry: %s", - (bLowPenaltyRa ? "ON!!" : "OFF!!") - ) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x69, 6, H2C_Parameter); } @@ -857,32 +646,12 @@ static void halbtc8723b1ant_SetCoexTable( u8 val0x6cc ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_EXEC, - ("[BTCoex], set coex table, set 0x6c0 = 0x%x\n", val0x6c0) - ); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c0, val0x6c0); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_EXEC, - ("[BTCoex], set coex table, set 0x6c4 = 0x%x\n", val0x6c4) - ); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c4, val0x6c4); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_EXEC, - ("[BTCoex], set coex table, set 0x6c8 = 0x%x\n", val0x6c8) - ); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c8, val0x6c8); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_EXEC, - ("[BTCoex], set coex table, set 0x6cc = 0x%x\n", val0x6cc) - ); pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cc, val0x6cc); } @@ -895,15 +664,6 @@ static void halbtc8723b1ant_CoexTable( u8 val0x6cc ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW, - ( - "[BTCoex], %s write Coex Table 0x6c0 = 0x%x, 0x6c4 = 0x%x, 0x6cc = 0x%x\n", - (bForceExec ? "force to" : ""), - val0x6c0, val0x6c4, val0x6cc - ) - ); pCoexDm->curVal0x6c0 = val0x6c0; pCoexDm->curVal0x6c4 = val0x6c4; pCoexDm->curVal0x6c8 = val0x6c8; @@ -933,12 +693,6 @@ static void halbtc8723b1ant_CoexTableWithType( struct btc_coexist *pBtCoexist, bool bForceExec, u8 type ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], ********** CoexTable(%d) **********\n", type) - ); - pCoexSta->nCoexTableType = type; switch (type) { @@ -996,15 +750,6 @@ static void halbtc8723b1ant_SetFwIgnoreWlanAct( if (bEnable) H2C_Parameter[0] |= BIT0; /* function enable */ - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ( - "[BTCoex], set FW for BT Ignore Wlan_Act, FW write 0x63 = 0x%x\n", - H2C_Parameter[0] - ) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x63, 1, H2C_Parameter); } @@ -1012,28 +757,9 @@ static void halbtc8723b1ant_IgnoreWlanAct( struct btc_coexist *pBtCoexist, bool bForceExec, bool bEnable ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW, - ( - "[BTCoex], %s turn Ignore WlanAct %s\n", - (bForceExec ? "force to" : ""), - (bEnable ? "ON" : "OFF") - ) - ); pCoexDm->bCurIgnoreWlanAct = bEnable; if (!bForceExec) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ( - "[BTCoex], bPreIgnoreWlanAct = %d, bCurIgnoreWlanAct = %d!!\n", - pCoexDm->bPreIgnoreWlanAct, - pCoexDm->bCurIgnoreWlanAct - ) - ); - if (pCoexDm->bPreIgnoreWlanAct == pCoexDm->bCurIgnoreWlanAct) return; } @@ -1057,44 +783,14 @@ static void halbtc8723b1ant_LpsRpwm( struct btc_coexist *pBtCoexist, bool bForceExec, u8 lpsVal, u8 rpwmVal ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW, - ( - "[BTCoex], %s set lps/rpwm = 0x%x/0x%x\n", - (bForceExec ? "force to" : ""), - lpsVal, - rpwmVal - ) - ); pCoexDm->curLps = lpsVal; pCoexDm->curRpwm = rpwmVal; if (!bForceExec) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ( - "[BTCoex], LPS-RxBeaconMode = 0x%x , LPS-RPWM = 0x%x!!\n", - pCoexDm->curLps, - pCoexDm->curRpwm - ) - ); - if ( (pCoexDm->preLps == pCoexDm->curLps) && (pCoexDm->preRpwm == pCoexDm->curRpwm) ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ( - "[BTCoex], LPS-RPWM_Last = 0x%x , LPS-RPWM_Now = 0x%x!!\n", - pCoexDm->preRpwm, - pCoexDm->curRpwm - ) - ); - return; } } @@ -1108,12 +804,6 @@ static void halbtc8723b1ant_SwMechanism( struct btc_coexist *pBtCoexist, bool bLowPenaltyRA ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_MONITOR, - ("[BTCoex], SM[LpRA] = %d\n", bLowPenaltyRA) - ); - halbtc8723b1ant_LowPenaltyRa(pBtCoexist, NORMAL_EXEC, bLowPenaltyRA); } @@ -1189,13 +879,10 @@ static void halbtc8723b1ant_SetAntPath( u1Tmp = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x49d); cntBtCalChk++; - if (u1Tmp & BIT0) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ########### BT is calibrating (wait cnt =%d) ###########\n", cntBtCalChk)); + if (u1Tmp & BIT0) mdelay(50); - } else { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ********** BT is NOT calibrating (wait cnt =%d)**********\n", cntBtCalChk)); + else break; - } } /* set grant_bt to PTA */ @@ -1318,11 +1005,6 @@ static void halbtc8723b1ant_SetFwPstdma( if (bApEnable) { if (byte1 & BIT4 && !(byte1 & BIT5)) { - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ("[BTCoex], FW for 1Ant AP mode\n") - ); realByte1 &= ~BIT4; realByte1 |= BIT5; @@ -1343,19 +1025,6 @@ static void halbtc8723b1ant_SetFwPstdma( pCoexDm->psTdmaPara[3] = byte4; pCoexDm->psTdmaPara[4] = realByte5; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ( - "[BTCoex], PS-TDMA H2C cmd = 0x%x%08x\n", - H2C_Parameter[0], - H2C_Parameter[1] << 24 | - H2C_Parameter[2] << 16 | - H2C_Parameter[3] << 8 | - H2C_Parameter[4] - ) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x60, 5, H2C_Parameter); } @@ -1369,35 +1038,13 @@ static void halbtc8723b1ant_PsTdma( u8 rssiAdjustVal = 0; u8 psTdmaByte4Val = 0x50, psTdmaByte0Val = 0x51, psTdmaByte3Val = 0x10; s8 nWiFiDurationAdjust = 0x0; - /* u32 fwVer = 0; */ + /* u32 fwVer = 0; */ - /* BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s turn %s PS TDMA, type =%d\n", */ - /* (bForceExec? "force to":""), (bTurnOn? "ON":"OFF"), type)); */ pCoexDm->bCurPsTdmaOn = bTurnOn; pCoexDm->curPsTdma = type; pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); - if (pCoexDm->bCurPsTdmaOn) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ( - "[BTCoex], ********** TDMA(on, %d) **********\n", - pCoexDm->curPsTdma - ) - ); - } else { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ( - "[BTCoex], ********** TDMA(off, %d) **********\n", - pCoexDm->curPsTdma - ) - ); - } - if (!bForceExec) { if ( (pCoexDm->bPrePsTdmaOn == pCoexDm->bCurPsTdmaOn) && @@ -1670,80 +1317,40 @@ static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *pBtCoexist) if ( !bWifiConnected && - BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE == pCoexDm->btStatus + pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], Wifi non connected-idle + BT non connected-idle!!\n") - ); - /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */ bCommon = true; } else if ( bWifiConnected && - (BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE == pCoexDm->btStatus) + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE) ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], Wifi connected + BT non connected-idle!!\n") - ); - /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */ bCommon = true; } else if ( !bWifiConnected && - (BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus) + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE) ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], Wifi non connected-idle + BT connected-idle!!\n") - ); - /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */ bCommon = true; } else if ( bWifiConnected && - (BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus) + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE) ) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi connected + BT connected-idle!!\n")); - /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */ bCommon = true; } else if ( !bWifiConnected && - (BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE != pCoexDm->btStatus) + (pCoexDm->btStatus != BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE) ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], Wifi non connected-idle + BT Busy!!\n") - ); - /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */ bCommon = true; } else { - if (bWifiBusy) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], Wifi Connected-Busy + BT Busy!!\n") - ); - } else { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], Wifi Connected-Idle + BT Busy!!\n") - ); - } - bCommon = false; } @@ -1759,16 +1366,10 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( s32 result; /* 0: no change, +1: increase WiFi duration, -1: decrease WiFi duration */ u8 retryCount = 0, btInfoExt; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW, - ("[BTCoex], TdmaDurationAdjustForAcl()\n") - ); - if ( - (BT_8723B_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN == wifiStatus) || - (BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN == wifiStatus) || - (BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT == wifiStatus) + (wifiStatus == BT_8723B_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN) || + (wifiStatus == BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN) || + (wifiStatus == BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT) ) { if ( pCoexDm->curPsTdma != 1 && @@ -1791,11 +1392,6 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( if (!pCoexDm->bAutoTdmaAdjust) { pCoexDm->bAutoTdmaAdjust = true; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ("[BTCoex], first run TdmaDurationAdjust()!!\n") - ); halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 2); pCoexDm->psTdmaDuAdjType = 2; @@ -1810,9 +1406,6 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( /* acquire the BT TRx retry count from BT_Info byte2 */ retryCount = pCoexSta->btRetryCnt; btInfoExt = pCoexSta->btInfoExt; - /* BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], retryCount = %d\n", retryCount)); */ - /* BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], up =%d, dn =%d, m =%d, n =%d, WaitCount =%d\n", */ - /* up, dn, m, n, WaitCount)); */ if (pCoexSta->lowPriorityTx > 1050 || pCoexSta->lowPriorityRx > 1250) retryCount++; @@ -1833,11 +1426,6 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( up = 0; dn = 0; result = 1; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ("[BTCoex], Increase wifi duration!!\n") - ); } } else if (retryCount <= 3) { /* <=3 retry in the last 2-second duration */ up--; @@ -1860,7 +1448,6 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( dn = 0; WaitCount = 0; result = -1; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], Decrease wifi duration for retryCounter<3!!\n")); } } else { /* retry count > 3, 只要1次 retry count > 3, 則調窄WiFi duration */ if (WaitCount == 1) @@ -1876,11 +1463,6 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( dn = 0; WaitCount = 0; result = -1; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ("[BTCoex], Decrease wifi duration for retryCounter>3!!\n") - ); } if (result == -1) { @@ -1917,15 +1499,6 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 1); pCoexDm->psTdmaDuAdjType = 1; } - } else { /* no change */ - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ( - "[BTCoex], ********** TDMA(on, %d) **********\n", - pCoexDm->curPsTdma - ) - ); } if ( @@ -2002,13 +1575,13 @@ static void halbtc8723b1ant_PowerSaveState( /* */ /* */ -/* Software Coex Mechanism start */ +/* Software Coex Mechanism start */ /* */ /* */ /* */ /* */ -/* Non-Software Coex Mechanism start */ +/* Non-Software Coex Mechanism start */ /* */ /* */ static void halbtc8723b1ant_ActionWifiMultiPort(struct btc_coexist *pBtCoexist) @@ -2091,6 +1664,7 @@ static void halbtc8723b1ant_ActionWifiConnectedBtAclBusy( ) { struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; + halbtc8723b1ant_BtRssiState(2, 28, 0); if ((pCoexSta->lowPriorityRx >= 1000) && (pCoexSta->lowPriorityRx != 65535)) @@ -2103,7 +1677,7 @@ static void halbtc8723b1ant_ActionWifiConnectedBtAclBusy( pCoexDm->bAutoTdmaAdjust = false; return; } else if (pBtLinkInfo->bA2dpOnly) { /* A2DP */ - if (BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE == wifiStatus) { + if (wifiStatus == BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE) { halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32); halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); pCoexDm->bAutoTdmaAdjust = false; @@ -2158,7 +1732,7 @@ static void halbtc8723b1ant_ActionWifiNotConnectedScan( halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); /* tdma and coex table */ - if (BT_8723B_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) { + if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) { if (pBtLinkInfo->bA2dpExist) { halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32); halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); @@ -2170,8 +1744,8 @@ static void halbtc8723b1ant_ActionWifiNotConnectedScan( halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); } } else if ( - (BT_8723B_1ANT_BT_STATUS_SCO_BUSY == pCoexDm->btStatus) || - (BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY == pCoexDm->btStatus) + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ) { halbtc8723b1ant_ActionBtScoHidOnlyBusy( pBtCoexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN @@ -2215,7 +1789,7 @@ static void halbtc8723b1ant_ActionWifiConnectedScan(struct btc_coexist *pBtCoexi halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); /* tdma and coex table */ - if (BT_8723B_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) { + if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) { if (pBtLinkInfo->bA2dpExist) { halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32); halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); @@ -2227,8 +1801,8 @@ static void halbtc8723b1ant_ActionWifiConnectedScan(struct btc_coexist *pBtCoexi halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); } } else if ( - (BT_8723B_1ANT_BT_STATUS_SCO_BUSY == pCoexDm->btStatus) || - (BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY == pCoexDm->btStatus) + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ) { halbtc8723b1ant_ActionBtScoHidOnlyBusy( pBtCoexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN @@ -2271,20 +1845,9 @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *pBtCoexist) bool bScan = false, bLink = false, bRoam = false; bool bUnder4way = false, bApEnable = false; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], CoexForWifiConnect() ===>\n") - ); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way); if (bUnder4way) { halbtc8723b1ant_ActionWifiConnectedSpecialPacket(pBtCoexist); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], CoexForWifiConnect(), return for wifi is under 4way<===\n") - ); return; } @@ -2296,11 +1859,6 @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *pBtCoexist) halbtc8723b1ant_ActionWifiConnectedScan(pBtCoexist); else halbtc8723b1ant_ActionWifiConnectedSpecialPacket(pBtCoexist); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], CoexForWifiConnect(), return for wifi is under scan<===\n") - ); return; } @@ -2310,7 +1868,7 @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *pBtCoexist) /* power save state */ if ( !bApEnable && - BT_8723B_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus && + pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY && !pBtCoexist->btLinkInfo.bHidOnly ) { if (pBtCoexist->btLinkInfo.bA2dpOnly) { /* A2DP */ @@ -2341,14 +1899,14 @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *pBtCoexist) /* tdma and coex table */ if (!bWifiBusy) { - if (BT_8723B_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) { + if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) { halbtc8723b1ant_ActionWifiConnectedBtAclBusy( pBtCoexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE ); } else if ( - (BT_8723B_1ANT_BT_STATUS_SCO_BUSY == pCoexDm->btStatus) || - (BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY == pCoexDm->btStatus) + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ) { halbtc8723b1ant_ActionBtScoHidOnlyBusy(pBtCoexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE); @@ -2361,14 +1919,14 @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *pBtCoexist) halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); } } else { - if (BT_8723B_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) { + if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) { halbtc8723b1ant_ActionWifiConnectedBtAclBusy( pBtCoexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_BUSY ); } else if ( - (BT_8723B_1ANT_BT_STATUS_SCO_BUSY == pCoexDm->btStatus) || - (BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY == pCoexDm->btStatus) + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ) { halbtc8723b1ant_ActionBtScoHidOnlyBusy( pBtCoexist, @@ -2397,47 +1955,36 @@ static void halbtc8723b1ant_RunSwCoexistMechanism(struct btc_coexist *pBtCoexist } else { switch (pCoexDm->curAlgorithm) { case BT_8723B_1ANT_COEX_ALGO_SCO: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = SCO.\n")); /* halbtc8723b1ant_ActionSco(pBtCoexist); */ break; case BT_8723B_1ANT_COEX_ALGO_HID: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = HID.\n")); /* halbtc8723b1ant_ActionHid(pBtCoexist); */ break; case BT_8723B_1ANT_COEX_ALGO_A2DP: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = A2DP.\n")); /* halbtc8723b1ant_ActionA2dp(pBtCoexist); */ break; case BT_8723B_1ANT_COEX_ALGO_A2DP_PANHS: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = A2DP+PAN(HS).\n")); /* halbtc8723b1ant_ActionA2dpPanHs(pBtCoexist); */ break; case BT_8723B_1ANT_COEX_ALGO_PANEDR: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = PAN(EDR).\n")); /* halbtc8723b1ant_ActionPanEdr(pBtCoexist); */ break; case BT_8723B_1ANT_COEX_ALGO_PANHS: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = HS mode.\n")); /* halbtc8723b1ant_ActionPanHs(pBtCoexist); */ break; case BT_8723B_1ANT_COEX_ALGO_PANEDR_A2DP: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = PAN+A2DP.\n")); /* halbtc8723b1ant_ActionPanEdrA2dp(pBtCoexist); */ break; case BT_8723B_1ANT_COEX_ALGO_PANEDR_HID: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = PAN(EDR)+HID.\n")); /* halbtc8723b1ant_ActionPanEdrHid(pBtCoexist); */ break; case BT_8723B_1ANT_COEX_ALGO_HID_A2DP_PANEDR: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = HID+A2DP+PAN.\n")); /* halbtc8723b1ant_ActionHidA2dpPanEdr(pBtCoexist); */ break; case BT_8723B_1ANT_COEX_ALGO_HID_A2DP: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = HID+A2DP.\n")); /* halbtc8723b1ant_ActionHidA2dp(pBtCoexist); */ break; default: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = coexist All Off!!\n")); break; } pCoexDm->preAlgorithm = pCoexDm->curAlgorithm; @@ -2454,27 +2001,19 @@ static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist) u32 wifiLinkStatus = 0; u32 numOfWifiLink = 0; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], RunCoexistMechanism() ===>\n")); - - if (pBtCoexist->bManualControl) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], RunCoexistMechanism(), return for Manual CTRL <===\n")); + if (pBtCoexist->bManualControl) return; - } - if (pBtCoexist->bStopCoexDm) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], RunCoexistMechanism(), return for Stop Coex DM <===\n")); + if (pBtCoexist->bStopCoexDm) return; - } - if (pCoexSta->bUnderIps) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], wifi is under IPS !!!\n")); + if (pCoexSta->bUnderIps) return; - } if ( - (BT_8723B_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) || - (BT_8723B_1ANT_BT_STATUS_SCO_BUSY == pCoexDm->btStatus) || - (BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY == pCoexDm->btStatus) + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) || + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ){ bIncreaseScanDevNum = true; } @@ -2498,26 +2037,12 @@ static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist) numOfWifiLink = wifiLinkStatus >> 16; if ((numOfWifiLink >= 2) || (wifiLinkStatus & WIFI_P2P_GO_CONNECTED)) { - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ( - "############# [BTCoex], Multi-Port numOfWifiLink = %d, wifiLinkStatus = 0x%x\n", - numOfWifiLink, - wifiLinkStatus - ) - ); halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, bBtCtrlAggBufSize, aggBufSize); - if ((pBtLinkInfo->bA2dpExist) && (pCoexSta->bC2hBtInquiryPage)) { - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ("############# [BTCoex], BT Is Inquirying\n") - ); + if ((pBtLinkInfo->bA2dpExist) && (pCoexSta->bC2hBtInquiryPage)) halbtc8723b1ant_ActionBtInquiry(pBtCoexist); - } else + else halbtc8723b1ant_ActionWifiMultiPort(pBtCoexist); return; @@ -2544,11 +2069,6 @@ static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist) pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); if (pCoexSta->bC2hBtInquiryPage) { - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ("############# [BTCoex], BT Is Inquirying\n") - ); halbtc8723b1ant_ActionBtInquiry(pBtCoexist); return; } else if (bBtHsOn) { @@ -2560,16 +2080,14 @@ static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist) if (!bWifiConnected) { bool bScan = false, bLink = false, bRoam = false; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], wifi is non connected-idle !!!\n")); - 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); if (bScan || bLink || bRoam) { - if (bScan) + if (bScan) halbtc8723b1ant_ActionWifiNotConnectedScan(pBtCoexist); - else + else halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(pBtCoexist); } else halbtc8723b1ant_ActionWifiNotConnected(pBtCoexist); @@ -2596,15 +2114,6 @@ static void halbtc8723b1ant_InitHwConfig( bool bWifiOnly ) { - u32 u4Tmp = 0;/* fwVer; */ - u8 u1Tmpa = 0, u1Tmpb = 0; - - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_INIT, - ("[BTCoex], 1Ant Init HW Config!!\n") - ); - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x550, 0x8, 0x1); /* enable TBTT nterrupt */ /* 0x790[5:0]= 0x5 */ @@ -2624,20 +2133,9 @@ static void halbtc8723b1ant_InitHwConfig( /* PTA parameter */ halbtc8723b1ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 0); - u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948); - u1Tmpa = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765); - u1Tmpb = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x67); - - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ( - "############# [BTCoex], 0x948 = 0x%x, 0x765 = 0x%x, 0x67 = 0x%x\n", - u4Tmp, - u1Tmpa, - u1Tmpb - ) - ); + pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948); + pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765); + pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x67); } /* */ @@ -2666,9 +2164,9 @@ void EXhalbtc8723b1ant_PowerOnSetting(struct btc_coexist *pBtCoexist) /* */ /* S0 or S1 setting and Local register setting(By the setting fw can get ant number, S0/S1, ... info) */ /* Local setting bit define */ - /* BIT0: "0" for no antenna inverse; "1" for antenna inverse */ - /* BIT1: "0" for internal switch; "1" for external switch */ - /* BIT2: "0" for one antenna; "1" for two antenna */ + /* BIT0: "0" for no antenna inverse; "1" for antenna inverse */ + /* BIT1: "0" for internal switch; "1" for external switch */ + /* BIT2: "0" for one antenna; "1" for two antenna */ /* NOTE: here default all internal switch and 1-antenna ==> BIT1 = 0 and BIT2 = 0 */ if (pBtCoexist->chipInterface == BTC_INTF_USB) { /* fixed at S0 for USB interface */ @@ -2705,12 +2203,6 @@ void EXhalbtc8723b1ant_InitHwConfig(struct btc_coexist *pBtCoexist, bool bWifiOn void EXhalbtc8723b1ant_InitCoexDm(struct btc_coexist *pBtCoexist) { - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_INIT, - ("[BTCoex], Coex Mechanism Init!!\n") - ); - pBtCoexist->bStopCoexDm = false; halbtc8723b1ant_InitCoexDm(pBtCoexist); @@ -2730,7 +2222,6 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) bool bRoam = false; bool bScan = false; bool bLink = false; - bool bWifiUnder5G = false; bool bWifiUnderBMode = false; bool bBtHsOn = false; bool bWifiBusy = false; @@ -2778,7 +2269,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = %d/ %d/ %d", "Ant PG Num/ Ant Mech/ Ant Pos:", \ + "\r\n %-35s = %d/ %d/ %d", "Ant PG Num/ Ant Mech/ Ant Pos:", pBoardInfo->pgAntNum, pBoardInfo->btdmAntNum, pBoardInfo->btdmAntPos @@ -2788,7 +2279,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = %s / %d", "BT stack/ hci ext ver", \ + "\r\n %-35s = %s / %d", "BT stack/ hci ext ver", ((pStackInfo->bProfileNotified) ? "Yes" : "No"), pStackInfo->hciVersion ); @@ -2799,7 +2290,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = %d_%x/ 0x%x/ 0x%x(%d)", "CoexVer/ FwVer/ PatchVer", \ + "\r\n %-35s = %d_%x/ 0x%x/ 0x%x(%d)", "CoexVer/ FwVer/ PatchVer", GLCoexVerDate8723b1Ant, GLCoexVer8723b1Ant, fwVer, @@ -2814,7 +2305,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = %d / %d(%d)", "Dot11 channel / HsChnl(HsMode)", \ + "\r\n %-35s = %d / %d(%d)", "Dot11 channel / HsChnl(HsMode)", wifiDot11Chnl, wifiHsChnl, bBtHsOn @@ -2824,7 +2315,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = %02x %02x %02x ", "H2C Wifi inform bt chnl Info", \ + "\r\n %-35s = %02x %02x %02x ", "H2C Wifi inform bt chnl Info", pCoexDm->wifiChnlInfo[0], pCoexDm->wifiChnlInfo[1], pCoexDm->wifiChnlInfo[2] @@ -2836,7 +2327,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = %d/ %d", "Wifi rssi/ HS rssi", \ + "\r\n %-35s = %d/ %d", "Wifi rssi/ HS rssi", wifiRssi - 100, btHsRssi - 100 ); CL_PRINTF(cliBuf); @@ -2847,12 +2338,11 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = %d/ %d/ %d/ %s", "Wifi bLink/ bRoam/ bScan/ bHi-Pri", \ + "\r\n %-35s = %d/ %d/ %d/ %s", "Wifi bLink/ bRoam/ bScan/ bHi-Pri", bLink, bRoam, bScan, ((pCoexSta->bWiFiIsHighPriTask) ? "1" : "0") ); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); pBtCoexist->fBtcGet( @@ -2865,10 +2355,10 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = %s / %s/ %s/ AP =%d/ %s ", "Wifi status", \ - (bWifiUnder5G ? "5G" : "2.4G"), - ((bWifiUnderBMode) ? "11b" : ((BTC_WIFI_BW_LEGACY == wifiBw) ? "11bg" : (((BTC_WIFI_BW_HT40 == wifiBw) ? "HT40" : "HT20")))), - ((!bWifiBusy) ? "idle" : ((BTC_WIFI_TRAFFIC_TX == wifiTrafficDir) ? "uplink" : "downlink")), + "\r\n %-35s = %s / %s/ %s/ AP =%d/ %s ", "Wifi status", + ("2.4G"), + ((bWifiUnderBMode) ? "11b" : ((wifiBw == BTC_WIFI_BW_LEGACY) ? "11bg" : (((wifiBw == BTC_WIFI_BW_HT40) ? "HT40" : "HT20")))), + ((!bWifiBusy) ? "idle" : ((wifiTrafficDir == BTC_WIFI_TRAFFIC_TX) ? "uplink" : "downlink")), pCoexSta->nScanAPNum, (pCoexSta->bCCKLock) ? "Lock" : "noLock" ); @@ -2880,7 +2370,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = %d/ %d/ %d/ %d/ %d", "sta/vwifi/hs/p2pGo/p2pGc", \ + "\r\n %-35s = %d/ %d/ %d/ %d/ %d", "sta/vwifi/hs/p2pGo/p2pGc", ((wifiLinkStatus & WIFI_STA_CONNECTED) ? 1 : 0), ((wifiLinkStatus & WIFI_AP_CONNECTED) ? 1 : 0), ((wifiLinkStatus & WIFI_HS_CONNECTED) ? 1 : 0), @@ -2894,9 +2384,9 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = [%s/ %d/ %d/ %d] ", "BT [status/ rssi/ retryCnt/ popCnt]", \ - ((pBtCoexist->btInfo.bBtDisabled) ? ("disabled") : ((pCoexSta->bC2hBtInquiryPage) ? ("inquiry/page scan") : ((BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE == pCoexDm->btStatus) ? "non-connected idle" : - ((BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus) ? "connected-idle" : "busy")))), + "\r\n %-35s = [%s/ %d/ %d/ %d] ", "BT [status/ rssi/ retryCnt/ popCnt]", + ((pBtCoexist->btInfo.bBtDisabled) ? ("disabled") : ((pCoexSta->bC2hBtInquiryPage) ? ("inquiry/page scan") : ((pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE) ? "non-connected idle" : + ((pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE) ? "connected-idle" : "busy")))), pCoexSta->btRssi, pCoexSta->btRetryCnt, pCoexSta->popEventCnt ); CL_PRINTF(cliBuf); @@ -2910,7 +2400,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = %d / %d / %d / %d", "SCO/HID/PAN/A2DP", \ + "\r\n %-35s = %d / %d / %d / %d", "SCO/HID/PAN/A2DP", pBtLinkInfo->bScoExist, pBtLinkInfo->bHidExist, pBtLinkInfo->bPanExist, @@ -2921,8 +2411,8 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) if (pStackInfo->bProfileNotified) { pBtCoexist->fBtcDispDbgMsg(pBtCoexist, BTC_DBG_DISP_BT_LINK_INFO); } else { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s", "BT Role", \ - (pBtLinkInfo->bSlaveRole) ? "Slave" : "Master"); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s", "BT Role", + (pBtLinkInfo->bSlaveRole) ? "Slave" : "Master"); CL_PRINTF(cliBuf); } @@ -2931,7 +2421,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = %s", "BT Info A2DP rate", \ + "\r\n %-35s = %s", "BT Info A2DP rate", (btInfoExt & BIT0) ? "Basic rate" : "EDR rate" ); CL_PRINTF(cliBuf); @@ -2941,7 +2431,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = %02x %02x %02x %02x %02x %02x %02x(%d)", GLBtInfoSrc8723b1Ant[i], \ + "\r\n %-35s = %02x %02x %02x %02x %02x %02x %02x(%d)", GLBtInfoSrc8723b1Ant[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], @@ -2953,7 +2443,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = %s/%s, (0x%x/0x%x)", "PS state, IPS/LPS, (lps/rpwm)", \ + "\r\n %-35s = %s/%s, (0x%x/0x%x)", "PS state, IPS/LPS, (lps/rpwm)", (pCoexSta->bUnderIps ? "IPS ON" : "IPS OFF"), (pCoexSta->bUnderLps ? "LPS ON" : "LPS OFF"), pBtCoexist->btInfo.lpsVal, @@ -2974,7 +2464,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = %d", "SM[LowPenaltyRA]", \ + "\r\n %-35s = %d", "SM[LowPenaltyRA]", pCoexDm->bCurLowPenaltyRa ); CL_PRINTF(cliBuf); @@ -2982,7 +2472,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = %s/ %s/ %d ", "DelBA/ BtCtrlAgg/ AggSize", \ + "\r\n %-35s = %s/ %s/ %d ", "DelBA/ BtCtrlAgg/ AggSize", (pBtCoexist->btInfo.bRejectAggPkt ? "Yes" : "No"), (pBtCoexist->btInfo.bBtCtrlAggBufSize ? "Yes" : "No"), pBtCoexist->btInfo.aggBufSize @@ -2991,7 +2481,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = 0x%x ", "Rate Mask", \ + "\r\n %-35s = 0x%x ", "Rate Mask", pBtCoexist->btInfo.raMask ); CL_PRINTF(cliBuf); @@ -3001,41 +2491,35 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) 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", "Coex Table Type", \ - pCoexSta->nCoexTableType); + 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", "IgnWlanAct", \ - pCoexDm->bCurIgnoreWlanAct); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "Coex Table Type", + pCoexSta->nCoexTableType); CL_PRINTF(cliBuf); - /* - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x ", "Latest error condition(should be 0)", \ - pCoexDm->errorCondition); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "IgnWlanAct", + 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/0x%x/0x%x/0x%x", "backup ARFR1/ARFR2/RL/AMaxTime", \ - pCoexDm->backupArfrCnt1, pCoexDm->backupArfrCnt2, pCoexDm->backupRetryLimit, pCoexDm->backupAmpduMaxTime); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/0x%x/0x%x/0x%x", "backup ARFR1/ARFR2/RL/AMaxTime", + pCoexDm->backupArfrCnt1, pCoexDm->backupArfrCnt2, pCoexDm->backupRetryLimit, pCoexDm->backupAmpduMaxTime); CL_PRINTF(cliBuf); u4Tmp[0] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x430); u4Tmp[1] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x434); u2Tmp[0] = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0x42a); u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x456); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/0x%x/0x%x/0x%x", "0x430/0x434/0x42a/0x456", \ - u4Tmp[0], u4Tmp[1], u2Tmp[0], u1Tmp[0]); + CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/0x%x/0x%x/0x%x", "0x430/0x434/0x42a/0x456", + u4Tmp[0], u4Tmp[1], u2Tmp[0], u1Tmp[0]); CL_PRINTF(cliBuf); u1Tmp[0] = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x778); @@ -3043,7 +2527,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) u4Tmp[1] = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x880); CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "0x778/0x6cc/0x880[29:25]", \ + "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "0x778/0x6cc/0x880[29:25]", u1Tmp[0], u4Tmp[0], (u4Tmp[1] & 0x3e000000) >> 25 ); CL_PRINTF(cliBuf); @@ -3055,7 +2539,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x", "0x948/ 0x67[5] / 0x764 / 0x76e", \ + "\r\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x", "0x948/ 0x67[5] / 0x764 / 0x76e", u4Tmp[0], ((u1Tmp[0] & 0x20) >> 5), (u4Tmp[1] & 0xffff), u1Tmp[1] ); CL_PRINTF(cliBuf); @@ -3066,7 +2550,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) 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]", \ + "\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); @@ -3078,7 +2562,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) 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]", \ + "\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), @@ -3091,7 +2575,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = 0x%x/ 0x%x", "0x550(bcn ctrl)/0x522", \ + "\r\n %-35s = 0x%x/ 0x%x", "0x550(bcn ctrl)/0x522", u4Tmp[0], u1Tmp[0] ); CL_PRINTF(cliBuf); @@ -3101,7 +2585,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = 0x%x/ 0x%x", "0xc50(dig)/0x49c(null-drop)", \ + "\r\n %-35s = 0x%x/ 0x%x", "0xc50(dig)/0x49c(null-drop)", u4Tmp[0] & 0xff, u1Tmp[0] ); CL_PRINTF(cliBuf); @@ -3117,14 +2601,14 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) faOfdm = ((u4Tmp[0] & 0xffff0000) >> 16) + ((u4Tmp[1] & 0xffff0000) >> 16) + - (u4Tmp[1] & 0xffff) + (u4Tmp[2] & 0xffff) + \ + (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", \ + "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "OFDM-CCA/OFDM-FA/CCK-FA", u4Tmp[0] & 0xffff, faOfdm, faCck ); CL_PRINTF(cliBuf); @@ -3133,7 +2617,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = %d/ %d/ %d/ %d", "CRC_OK CCK/11g/11n/11n-Agg", \ + "\r\n %-35s = %d/ %d/ %d/ %d", "CRC_OK CCK/11g/11n/11n-Agg", pCoexSta->nCRCOK_CCK, pCoexSta->nCRCOK_11g, pCoexSta->nCRCOK_11n, @@ -3144,7 +2628,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = %d/ %d/ %d/ %d", "CRC_Err CCK/11g/11n/11n-Agg", \ + "\r\n %-35s = %d/ %d/ %d/ %d", "CRC_Err CCK/11g/11n/11n-Agg", pCoexSta->nCRCErr_CCK, pCoexSta->nCRCErr_11g, pCoexSta->nCRCErr_11n, @@ -3158,21 +2642,21 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "0x6c0/0x6c4/0x6c8(coexTable)", \ + "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "0x6c0/0x6c4/0x6c8(coexTable)", u4Tmp[0], u4Tmp[1], u4Tmp[2]); CL_PRINTF(cliBuf); CL_SPRINTF( cliBuf, BT_TMP_BUF_SIZE, - "\r\n %-35s = %d/ %d", "0x770(high-pri rx/tx)", \ + "\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)", \ + "\r\n %-35s = %d/ %d", "0x774(low-pri rx/tx)", pCoexSta->lowPriorityRx, pCoexSta->lowPriorityTx ); CL_PRINTF(cliBuf); @@ -3186,19 +2670,13 @@ void EXhalbtc8723b1ant_IpsNotify(struct btc_coexist *pBtCoexist, u8 type) if (pBtCoexist->bManualControl || pBtCoexist->bStopCoexDm) return; - if (BTC_IPS_ENTER == type) { - BTC_PRINT( - BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS ENTER notify\n") - ); + if (type == BTC_IPS_ENTER) { pCoexSta->bUnderIps = true; halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0); halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, false, true); - } else if (BTC_IPS_LEAVE == type) { - BTC_PRINT( - BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS LEAVE notify\n") - ); + } else if (type == BTC_IPS_LEAVE) { pCoexSta->bUnderIps = false; halbtc8723b1ant_InitHwConfig(pBtCoexist, false, false); @@ -3212,17 +2690,10 @@ void EXhalbtc8723b1ant_LpsNotify(struct btc_coexist *pBtCoexist, u8 type) if (pBtCoexist->bManualControl || pBtCoexist->bStopCoexDm) return; - if (BTC_LPS_ENABLE == type) { - BTC_PRINT( - BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], LPS ENABLE notify\n") - ); + if (type == BTC_LPS_ENABLE) pCoexSta->bUnderLps = true; - } else if (BTC_LPS_DISABLE == type) { - BTC_PRINT( - BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], LPS DISABLE notify\n") - ); + else if (type == BTC_LPS_DISABLE) pCoexSta->bUnderLps = false; - } } void EXhalbtc8723b1ant_ScanNotify(struct btc_coexist *pBtCoexist, u8 type) @@ -3233,39 +2704,18 @@ void EXhalbtc8723b1ant_ScanNotify(struct btc_coexist *pBtCoexist, u8 type) bool bBtCtrlAggBufSize = false; u8 aggBufSize = 5; - u8 u1Tmpa, u1Tmpb; - u32 u4Tmp; - if (pBtCoexist->bManualControl || pBtCoexist->bStopCoexDm) return; - if (BTC_SCAN_START == type) { + if (type == BTC_SCAN_START) { pCoexSta->bWiFiIsHighPriTask = true; - BTC_PRINT( - BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN START notify\n") - ); halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 8); /* Force antenna setup for no scan result issue */ - u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948); - u1Tmpa = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765); - u1Tmpb = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x67); - - - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ( - "[BTCoex], 0x948 = 0x%x, 0x765 = 0x%x, 0x67 = 0x%x\n", - u4Tmp, - u1Tmpa, - u1Tmpb - ) - ); + pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948); + pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765); + pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x67); } else { pCoexSta->bWiFiIsHighPriTask = false; - BTC_PRINT( - BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN FINISH notify\n") - ); pBtCoexist->fBtcGet( pBtCoexist, BTC_GET_U1_AP_NUM, &pCoexSta->nScanAPNum @@ -3300,14 +2750,12 @@ void EXhalbtc8723b1ant_ScanNotify(struct btc_coexist *pBtCoexist, u8 type) return; } - if (BTC_SCAN_START == type) { - /* BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN START notify\n")); */ + if (type == BTC_SCAN_START) { if (!bWifiConnected) /* non-connected scan */ halbtc8723b1ant_ActionWifiNotConnectedScan(pBtCoexist); else /* wifi is connected */ halbtc8723b1ant_ActionWifiConnectedScan(pBtCoexist); - } else if (BTC_SCAN_FINISH == type) { - /* BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN FINISH notify\n")); */ + } else if (type == BTC_SCAN_FINISH) { if (!bWifiConnected) /* non-connected scan */ halbtc8723b1ant_ActionWifiNotConnected(pBtCoexist); else @@ -3330,13 +2778,11 @@ void EXhalbtc8723b1ant_ConnectNotify(struct btc_coexist *pBtCoexist, u8 type) ) return; - if (BTC_ASSOCIATE_START == type) { + if (type == BTC_ASSOCIATE_START) { pCoexSta->bWiFiIsHighPriTask = true; - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT START notify\n")); pCoexDm->nArpCnt = 0; } else { pCoexSta->bWiFiIsHighPriTask = false; - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT FINISH notify\n")); /* pCoexDm->nArpCnt = 0; */ } @@ -3358,12 +2804,9 @@ void EXhalbtc8723b1ant_ConnectNotify(struct btc_coexist *pBtCoexist, u8 type) return; } - if (BTC_ASSOCIATE_START == type) { - /* BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT START notify\n")); */ + if (type == BTC_ASSOCIATE_START) { halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(pBtCoexist); - } else if (BTC_ASSOCIATE_FINISH == type) { - /* BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT FINISH notify\n")); */ - + } else if (type == BTC_ASSOCIATE_FINISH) { pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); if (!bWifiConnected) /* non-connected scan */ halbtc8723b1ant_ActionWifiNotConnected(pBtCoexist); @@ -3386,9 +2829,7 @@ void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type ) return; - if (BTC_MEDIA_CONNECT == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA connect notify\n")); - + if (type == BTC_MEDIA_CONNECT) { pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode); /* Set CCK Tx/Rx high Pri except 11b mode */ @@ -3405,7 +2846,6 @@ void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type pCoexDm->backupRetryLimit = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0x42a); pCoexDm->backupAmpduMaxTime = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x456); } else { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA disconnect notify\n")); pCoexDm->nArpCnt = 0; pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cd, 0x0); /* CCK Tx */ @@ -3414,13 +2854,13 @@ void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type /* only 2.4G we need to inform bt the chnl mask */ pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_CENTRAL_CHNL, &wifiCentralChnl); - if ((BTC_MEDIA_CONNECT == type) && (wifiCentralChnl <= 14)) { + if ((type == BTC_MEDIA_CONNECT) && (wifiCentralChnl <= 14)) { /* H2C_Parameter[0] = 0x1; */ H2C_Parameter[0] = 0x0; H2C_Parameter[1] = wifiCentralChnl; pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - if (BTC_WIFI_BW_HT40 == wifiBw) + if (wifiBw == BTC_WIFI_BW_HT40) H2C_Parameter[2] = 0x30; else H2C_Parameter[2] = 0x20; @@ -3430,15 +2870,6 @@ void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type pCoexDm->wifiChnlInfo[1] = H2C_Parameter[1]; pCoexDm->wifiChnlInfo[2] = H2C_Parameter[2]; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ( - "[BTCoex], FW write 0x66 = 0x%x\n", - H2C_Parameter[0] << 16 | H2C_Parameter[1] << 8 | H2C_Parameter[2] - ) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x66, 3, H2C_Parameter); } @@ -3458,23 +2889,12 @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 ty return; if ( - BTC_PACKET_DHCP == type || - BTC_PACKET_EAPOL == type || - BTC_PACKET_ARP == type + type == BTC_PACKET_DHCP || + type == BTC_PACKET_EAPOL || + type == BTC_PACKET_ARP ) { - if (BTC_PACKET_ARP == type) { - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ("[BTCoex], special Packet ARP notify\n") - ); - + if (type == BTC_PACKET_ARP) { pCoexDm->nArpCnt++; - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ("[BTCoex], ARP Packet Count = %d\n", pCoexDm->nArpCnt) - ); if (pCoexDm->nArpCnt >= 10) /* if APR PKT > 10 after connect, do not go to ActionWifiConnectedSpecialPacket(pBtCoexist) */ pCoexSta->bWiFiIsHighPriTask = false; @@ -3482,19 +2902,9 @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 ty pCoexSta->bWiFiIsHighPriTask = true; } else { pCoexSta->bWiFiIsHighPriTask = true; - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ("[BTCoex], special Packet DHCP or EAPOL notify\n") - ); } } else { pCoexSta->bWiFiIsHighPriTask = false; - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ("[BTCoex], special Packet [Type = %d] notify\n", type) - ); } pCoexSta->specialPktPeriodCnt = 0; @@ -3523,9 +2933,9 @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 ty } if ( - BTC_PACKET_DHCP == type || - BTC_PACKET_EAPOL == type || - ((BTC_PACKET_ARP == type) && (pCoexSta->bWiFiIsHighPriTask)) + type == BTC_PACKET_DHCP || + type == BTC_PACKET_EAPOL || + ((type == BTC_PACKET_ARP) && (pCoexSta->bWiFiIsHighPriTask)) ) halbtc8723b1ant_ActionWifiConnectedSpecialPacket(pBtCoexist); } @@ -3546,26 +2956,13 @@ void EXhalbtc8723b1ant_BtInfoNotify( rspSource = BT_INFO_SRC_8723B_1ANT_WIFI_FW; pCoexSta->btInfoC2hCnt[rspSource]++; - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ("[BTCoex], Bt info[%d], length =%d, hex data =[", - rspSource, - length) - ); for (i = 0; i < length; i++) { pCoexSta->btInfoC2h[rspSource][i] = tmpBuf[i]; if (i == 1) btInfo = tmpBuf[i]; - 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])); } - if (BT_INFO_SRC_8723B_1ANT_WIFI_FW != rspSource) { + if (rspSource != BT_INFO_SRC_8723B_1ANT_WIFI_FW) { pCoexSta->btRetryCnt = pCoexSta->btInfoC2h[rspSource][2] & 0xf; if (pCoexSta->btRetryCnt >= 1) @@ -3586,18 +2983,12 @@ void EXhalbtc8723b1ant_BtInfoNotify( if (!pCoexSta->bBtTxRxMask) { /* BT into is responded by BT FW and BT RF REG 0x3C != 0x15 => Need to switch BT TRx Mask */ - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Switch BT TRx Mask since BT RF REG 0x3C != 0x15\n")); pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x15); } /* Here we need to resend some wifi info to BT */ /* because bt is reset and loss of the info. */ if (pCoexSta->btInfoExt & BIT1) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT ext info bit1 check, send wifi BW&Chnl to BT!!\n") - ); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); if (bWifiConnected) EXhalbtc8723b1ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_CONNECT); @@ -3606,14 +2997,8 @@ void EXhalbtc8723b1ant_BtInfoNotify( } if (pCoexSta->btInfoExt & BIT3) { - if (!pBtCoexist->bManualControl && !pBtCoexist->bStopCoexDm) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT ext info bit3 check, set BT NOT to ignore Wlan active!!\n") - ); + if (!pBtCoexist->bManualControl && !pBtCoexist->bStopCoexDm) halbtc8723b1ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, false); - } } else { /* BT already NOT ignore Wlan active, do nothing here. */ } @@ -3661,32 +3046,27 @@ void EXhalbtc8723b1ant_BtInfoNotify( if (!(btInfo & BT_INFO_8723B_1ANT_B_CONNECTION)) { pCoexDm->btStatus = BT_8723B_1ANT_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_1ANT_B_CONNECTION) { /* connection exists but no busy */ pCoexDm->btStatus = BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), BT Connected-idle!!!\n")); } else if ( (btInfo & BT_INFO_8723B_1ANT_B_SCO_ESCO) || (btInfo & BT_INFO_8723B_1ANT_B_SCO_BUSY) ) { pCoexDm->btStatus = BT_8723B_1ANT_BT_STATUS_SCO_BUSY; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), BT SCO busy!!!\n")); } else if (btInfo & BT_INFO_8723B_1ANT_B_ACL_BUSY) { - if (BT_8723B_1ANT_BT_STATUS_ACL_BUSY != pCoexDm->btStatus) + if (pCoexDm->btStatus != BT_8723B_1ANT_BT_STATUS_ACL_BUSY) pCoexDm->bAutoTdmaAdjust = false; pCoexDm->btStatus = BT_8723B_1ANT_BT_STATUS_ACL_BUSY; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), BT ACL busy!!!\n")); } else { pCoexDm->btStatus = BT_8723B_1ANT_BT_STATUS_MAX; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), BT Non-Defined state!!!\n")); } if ( - (BT_8723B_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) || - (BT_8723B_1ANT_BT_STATUS_SCO_BUSY == pCoexDm->btStatus) || - (BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY == pCoexDm->btStatus) + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) || + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ) bBtBusy = true; else @@ -3698,8 +3078,6 @@ void EXhalbtc8723b1ant_BtInfoNotify( void EXhalbtc8723b1ant_HaltNotify(struct btc_coexist *pBtCoexist) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Halt notify\n")); - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 0); halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, false, true); @@ -3713,19 +3091,14 @@ void EXhalbtc8723b1ant_HaltNotify(struct btc_coexist *pBtCoexist) void EXhalbtc8723b1ant_PnpNotify(struct btc_coexist *pBtCoexist, u8 pnpState) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify\n")); - - if (BTC_WIFI_PNP_SLEEP == pnpState) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify to SLEEP\n")); - + if (pnpState == BTC_WIFI_PNP_SLEEP) { halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0); halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, false, true); pBtCoexist->bStopCoexDm = true; - } else if (BTC_WIFI_PNP_WAKE_UP == pnpState) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify to WAKE UP\n")); + } else if (pnpState == BTC_WIFI_PNP_WAKE_UP) { pBtCoexist->bStopCoexDm = false; halbtc8723b1ant_InitHwConfig(pBtCoexist, false, false); halbtc8723b1ant_InitCoexDm(pBtCoexist); @@ -3738,16 +3111,10 @@ void EXhalbtc8723b1ant_Periodical(struct btc_coexist *pBtCoexist) static u8 disVerInfoCnt; u32 fwVer = 0, btPatchVer = 0; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], ==========================Periodical ===========================\n")); - if (disVerInfoCnt <= 5) { disVerInfoCnt += 1; - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ****************************************************************\n")); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_BT_PATCH_VER, &btPatchVer); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], CoexVer/ FwVer/ PatchVer = %d_%x/ 0x%x/ 0x%x(%d)\n", \ - GLCoexVerDate8723b1Ant, GLCoexVer8723b1Ant, fwVer, btPatchVer, btPatchVer)); - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ****************************************************************\n")); } halbtc8723b1ant_MonitorBtCtr(pBtCoexist); diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c index 4b570ec75e67..84241619fb3a 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c +++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c @@ -46,23 +46,18 @@ static u8 halbtc8723b2ant_BtRssiState( ) { 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 { btRssiState = BTC_RSSI_STATE_STAY_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state stay at Low\n")); } } else { if (btRssi < rssiThresh) { btRssiState = BTC_RSSI_STATE_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to Low\n")); } else { btRssiState = BTC_RSSI_STATE_STAY_HIGH; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state stay at High\n")); } } } else if (levelNum == 3) { if (rssiThresh > rssiThresh1) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi thresh error!!\n")); return pCoexSta->preBtRssiState; } @@ -72,10 +67,8 @@ static u8 halbtc8723b2ant_BtRssiState( ) { 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 { btRssiState = BTC_RSSI_STATE_STAY_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state stay at Low\n")); } } else if ( (pCoexSta->preBtRssiState == BTC_RSSI_STATE_MEDIUM) || @@ -83,21 +76,16 @@ static u8 halbtc8723b2ant_BtRssiState( ) { 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) { btRssiState = BTC_RSSI_STATE_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to Low\n")); } else { btRssiState = BTC_RSSI_STATE_STAY_MEDIUM; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state stay at Medium\n")); } } else { if (btRssi < rssiThresh1) { btRssiState = BTC_RSSI_STATE_MEDIUM; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to Medium\n")); } else { btRssiState = BTC_RSSI_STATE_STAY_HIGH; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state stay at High\n")); } } } @@ -127,23 +115,18 @@ static u8 halbtc8723b2ant_WifiRssiState( ) { 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 { wifiRssiState = BTC_RSSI_STATE_STAY_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at Low\n")); } } else { if (wifiRssi < rssiThresh) { wifiRssiState = BTC_RSSI_STATE_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Low\n")); } else { wifiRssiState = BTC_RSSI_STATE_STAY_HIGH; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at High\n")); } } } else if (levelNum == 3) { if (rssiThresh > rssiThresh1) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI thresh error!!\n")); return pCoexSta->preWifiRssiState[index]; } @@ -153,10 +136,8 @@ static u8 halbtc8723b2ant_WifiRssiState( ) { 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 { wifiRssiState = BTC_RSSI_STATE_STAY_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at Low\n")); } } else if ( (pCoexSta->preWifiRssiState[index] == BTC_RSSI_STATE_MEDIUM) || @@ -164,21 +145,16 @@ static u8 halbtc8723b2ant_WifiRssiState( ) { 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) { wifiRssiState = BTC_RSSI_STATE_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Low\n")); } else { wifiRssiState = BTC_RSSI_STATE_STAY_MEDIUM; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at Medium\n")); } } else { if (wifiRssi < rssiThresh1) { wifiRssiState = BTC_RSSI_STATE_MEDIUM; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Medium\n")); } else { wifiRssiState = BTC_RSSI_STATE_STAY_HIGH; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at High\n")); } } } @@ -233,31 +209,6 @@ static void halbtc8723b2ant_MonitorBtCtr(struct btc_coexist *pBtCoexist) pCoexSta->lowPriorityTx = regLPTx; pCoexSta->lowPriorityRx = regLPRx; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_MONITOR, - ( - "[BTCoex], High Priority Tx/Rx (reg 0x%x) = 0x%x(%d)/0x%x(%d)\n", - regHPTxRx, - regHPTx, - regHPTx, - regHPRx, - regHPRx - ) - ); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_MONITOR, - ( - "[BTCoex], Low Priority Tx/Rx (reg 0x%x) = 0x%x(%d)/0x%x(%d)\n", - regLPTxRx, - regLPTx, - regLPTx, - regLPRx, - regLPRx - ) - ); - /* reset counter */ pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); } @@ -270,12 +221,6 @@ static void halbtc8723b2ant_QueryBtInfo(struct btc_coexist *pBtCoexist) H2C_Parameter[0] |= BIT0; /* trigger */ - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ("[BTCoex], Query Bt Info, FW write 0x61 = 0x%x\n", H2C_Parameter[0]) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x61, 1, H2C_Parameter); } @@ -384,7 +329,6 @@ static u8 halbtc8723b2ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); if (!pBtLinkInfo->bBtLinkExist) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], No BT link exists!!!\n")); return algorithm; } @@ -402,21 +346,16 @@ static u8 halbtc8723b2ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) if (numOfDiffProfile == 1) { if (pBtLinkInfo->bScoExist) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO only\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_SCO; } else { if (pBtLinkInfo->bHidExist) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID only\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_HID; } else if (pBtLinkInfo->bA2dpExist) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], A2DP only\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_A2DP; } else if (pBtLinkInfo->bPanExist) { if (bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], PAN(HS) only\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_PANHS; } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], PAN(EDR) only\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR; } } @@ -424,17 +363,13 @@ static u8 halbtc8723b2ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) } else if (numOfDiffProfile == 2) { if (pBtLinkInfo->bScoExist) { if (pBtLinkInfo->bHidExist) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + HID\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; } else if (pBtLinkInfo->bA2dpExist) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + A2DP ==> SCO\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; } else if (pBtLinkInfo->bPanExist) { if (bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + PAN(HS)\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_SCO; } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + PAN(EDR)\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; } } @@ -443,17 +378,14 @@ static u8 halbtc8723b2ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist ) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + A2DP\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_HID_A2DP; } else if ( pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist ) { if (bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + PAN(HS)\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_HID; } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + PAN(EDR)\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; } } else if ( @@ -461,10 +393,8 @@ static u8 halbtc8723b2ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtLinkInfo->bA2dpExist ) { if (bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], A2DP + PAN(HS)\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_A2DP_PANHS; } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], A2DP + PAN(EDR)\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_A2DP; } } @@ -475,42 +405,17 @@ static u8 halbtc8723b2ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], SCO + HID + A2DP ==> HID\n") - ); algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; } else if ( pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist ) { - if (bBtHsOn) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], SCO + HID + PAN(HS)\n") - ); - algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; - } else { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], SCO + HID + PAN(EDR)\n") - ); - algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; - } + algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; } else if ( pBtLinkInfo->bPanExist && pBtLinkInfo->bA2dpExist ) { - if (bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + A2DP + PAN(HS)\n")); - algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; - } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + A2DP + PAN(EDR) ==> HID\n")); - algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; - } + algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; } } else { if ( @@ -519,10 +424,8 @@ static u8 halbtc8723b2ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtLinkInfo->bA2dpExist ) { if (bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + A2DP + PAN(HS)\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_HID_A2DP; } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + A2DP + PAN(EDR)\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_HID_A2DP_PANEDR; } } @@ -535,10 +438,7 @@ static u8 halbtc8723b2ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtLinkInfo->bA2dpExist ) { if (bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Error!!! SCO + HID + A2DP + PAN(HS)\n")); - } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + HID + A2DP + PAN(EDR) ==>PAN(EDR)+HID\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; } } @@ -558,17 +458,6 @@ static void halbtc8723b2ant_SetFwDacSwingLevel( /* 0x18/ 0x10/ 0xc/ 0x8/ 0x4/ 0x6 */ H2C_Parameter[0] = dacSwingLvl; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ("[BTCoex], Set Dac Swing Level = 0x%x\n", dacSwingLvl) - ); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ("[BTCoex], FW write 0x64 = 0x%x\n", H2C_Parameter[0]) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x64, 1, H2C_Parameter); } @@ -580,16 +469,6 @@ static void halbtc8723b2ant_SetFwDecBtPwr( H2C_Parameter[0] = decBtPwrLvl; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ( - "[BTCoex], decrease Bt Power level = %d, FW write 0x62 = 0x%x\n", - decBtPwrLvl, - H2C_Parameter[0] - ) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x62, 1, H2C_Parameter); } @@ -597,28 +476,9 @@ static void halbtc8723b2ant_DecBtPwr( struct btc_coexist *pBtCoexist, bool bForceExec, u8 decBtPwrLvl ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW, - ( - "[BTCoex], %s Dec BT power level = %d\n", - (bForceExec ? "force to" : ""), - decBtPwrLvl - ) - ); pCoexDm->curBtDecPwrLvl = decBtPwrLvl; if (!bForceExec) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ( - "[BTCoex], preBtDecPwrLvl =%d, curBtDecPwrLvl =%d\n", - pCoexDm->preBtDecPwrLvl, - pCoexDm->curBtDecPwrLvl - ) - ); - if (pCoexDm->preBtDecPwrLvl == pCoexDm->curBtDecPwrLvl) return; } @@ -631,28 +491,9 @@ static void halbtc8723b2ant_FwDacSwingLvl( struct btc_coexist *pBtCoexist, bool bForceExec, u8 fwDacSwingLvl ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW, - ( - "[BTCoex], %s set FW Dac Swing level = %d\n", - (bForceExec ? "force to" : ""), - fwDacSwingLvl - ) - ); pCoexDm->curFwDacSwingLvl = fwDacSwingLvl; if (!bForceExec) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ( - "[BTCoex], preFwDacSwingLvl =%d, curFwDacSwingLvl =%d\n", - pCoexDm->preFwDacSwingLvl, - pCoexDm->curFwDacSwingLvl - ) - ); - if (pCoexDm->preFwDacSwingLvl == pCoexDm->curFwDacSwingLvl) return; } @@ -669,17 +510,11 @@ static void halbtc8723b2ant_SetSwRfRxLpfCorner( { if (bRxRfShrinkOn) { /* Shrink RF Rx LPF corner */ - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_EXEC, - ("[BTCoex], Shrink RF Rx LPF corner!!\n") - ); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1e, 0xfffff, 0xffffc); } else { /* Resume RF Rx LPF corner */ /* After initialized, we can use pCoexDm->btRf0x1eBackup */ if (pBtCoexist->bInitilized) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Resume RF Rx LPF corner!!\n")); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1e, 0xfffff, pCoexDm->btRf0x1eBackup); } } @@ -689,28 +524,9 @@ static void halbtc8723b2ant_RfShrink( struct btc_coexist *pBtCoexist, bool bForceExec, bool bRxRfShrinkOn ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW, - ( - "[BTCoex], %s turn Rx RF Shrink = %s\n", - (bForceExec ? "force to" : ""), - (bRxRfShrinkOn ? "ON" : "OFF") - ) - ); pCoexDm->bCurRfRxLpfShrink = bRxRfShrinkOn; if (!bForceExec) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_DETAIL, - ( - "[BTCoex], bPreRfRxLpfShrink =%d, bCurRfRxLpfShrink =%d\n", - pCoexDm->bPreRfRxLpfShrink, - pCoexDm->bCurRfRxLpfShrink - ) - ); - if (pCoexDm->bPreRfRxLpfShrink == pCoexDm->bCurRfRxLpfShrink) return; } @@ -735,15 +551,6 @@ static void halbtc8723b2ant_SetSwPenaltyTxRateAdaptive( H2C_Parameter[5] = 0xf9; /* MCS5 or OFDM36 */ } - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ( - "[BTCoex], set WiFi Low-Penalty Retry: %s", - (bLowPenaltyRa ? "ON!!" : "OFF!!") - ) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x69, 6, H2C_Parameter); } @@ -752,28 +559,9 @@ static void halbtc8723b2ant_LowPenaltyRa( ) { /* return; */ - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW, - ( - "[BTCoex], %s turn LowPenaltyRA = %s\n", - (bForceExec ? "force to" : ""), - (bLowPenaltyRa ? "ON" : "OFF") - ) - ); pCoexDm->bCurLowPenaltyRa = bLowPenaltyRa; if (!bForceExec) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_DETAIL, - ( - "[BTCoex], bPreLowPenaltyRa =%d, bCurLowPenaltyRa =%d\n", - pCoexDm->bPreLowPenaltyRa, - pCoexDm->bCurLowPenaltyRa - ) - ); - if (pCoexDm->bPreLowPenaltyRa == pCoexDm->bCurLowPenaltyRa) return; } @@ -786,11 +574,6 @@ static void halbtc8723b2ant_SetDacSwingReg(struct btc_coexist *pBtCoexist, u32 l { u8 val = (u8)level; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_EXEC, - ("[BTCoex], Write SwDacSwing = 0x%x\n", level) - ); pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x883, 0x3e, val); } @@ -812,32 +595,10 @@ static void halbtc8723b2ant_DacSwing( u32 dacSwingLvl ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW, - ( - "[BTCoex], %s turn DacSwing =%s, dacSwingLvl = 0x%x\n", - (bForceExec ? "force to" : ""), - (bDacSwingOn ? "ON" : "OFF"), - dacSwingLvl - ) - ); pCoexDm->bCurDacSwingOn = bDacSwingOn; pCoexDm->curDacSwingLvl = dacSwingLvl; if (!bForceExec) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_DETAIL, - ( - "[BTCoex], bPreDacSwingOn =%d, preDacSwingLvl = 0x%x, bCurDacSwingOn =%d, curDacSwingLvl = 0x%x\n", - pCoexDm->bPreDacSwingOn, - pCoexDm->preDacSwingLvl, - pCoexDm->bCurDacSwingOn, - pCoexDm->curDacSwingLvl - ) - ); - if ((pCoexDm->bPreDacSwingOn == pCoexDm->bCurDacSwingOn) && (pCoexDm->preDacSwingLvl == pCoexDm->curDacSwingLvl)) return; @@ -857,7 +618,6 @@ static void halbtc8723b2ant_SetAgcTable( /* BB AGC Gain Table */ if (bAgcTableEn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], BB Agc Table On!\n")); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0x6e1A0001); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0x6d1B0001); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0x6c1C0001); @@ -866,7 +626,6 @@ static void halbtc8723b2ant_SetAgcTable( pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0x691F0001); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0x68200001); } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], BB Agc Table Off!\n")); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0xaa1A0001); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0xa91B0001); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0xa81C0001); @@ -880,11 +639,9 @@ static void halbtc8723b2ant_SetAgcTable( /* RF Gain */ pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0xef, 0xfffff, 0x02000); if (bAgcTableEn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Agc Table On!\n")); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x3b, 0xfffff, 0x38fff); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x3b, 0xfffff, 0x38ffe); } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Agc Table Off!\n")); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x3b, 0xfffff, 0x380c3); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x3b, 0xfffff, 0x28ce6); } @@ -892,11 +649,9 @@ static void halbtc8723b2ant_SetAgcTable( pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0xed, 0xfffff, 0x1); if (bAgcTableEn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Agc Table On!\n")); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x40, 0xfffff, 0x38fff); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x40, 0xfffff, 0x38ffe); } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Agc Table Off!\n")); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x40, 0xfffff, 0x380c3); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x40, 0xfffff, 0x28ce6); } @@ -913,28 +668,9 @@ static void halbtc8723b2ant_AgcTable( struct btc_coexist *pBtCoexist, bool bForceExec, bool bAgcTableEn ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW, - ( - "[BTCoex], %s %s Agc Table\n", - (bForceExec ? "force to" : ""), - (bAgcTableEn ? "Enable" : "Disable") - ) - ); pCoexDm->bCurAgcTableEn = bAgcTableEn; if (!bForceExec) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_DETAIL, - ( - "[BTCoex], bPreAgcTableEn =%d, bCurAgcTableEn =%d\n", - pCoexDm->bPreAgcTableEn, - pCoexDm->bCurAgcTableEn - ) - ); - if (pCoexDm->bPreAgcTableEn == pCoexDm->bCurAgcTableEn) return; } @@ -951,32 +687,12 @@ static void halbtc8723b2ant_SetCoexTable( u8 val0x6cc ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_EXEC, - ("[BTCoex], set coex table, set 0x6c0 = 0x%x\n", val0x6c0) - ); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c0, val0x6c0); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_EXEC, - ("[BTCoex], set coex table, set 0x6c4 = 0x%x\n", val0x6c4) - ); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c4, val0x6c4); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_EXEC, - ("[BTCoex], set coex table, set 0x6c8 = 0x%x\n", val0x6c8) - ); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c8, val0x6c8); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_EXEC, - ("[BTCoex], set coex table, set 0x6cc = 0x%x\n", val0x6cc) - ); pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cc, val0x6cc); } @@ -989,47 +705,12 @@ static void halbtc8723b2ant_CoexTable( u8 val0x6cc ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW, - ( - "[BTCoex], %s write Coex Table 0x6c0 = 0x%x, 0x6c4 = 0x%x, 0x6c8 = 0x%x, 0x6cc = 0x%x\n", - (bForceExec ? "force to" : ""), - val0x6c0, - val0x6c4, - val0x6c8, - val0x6cc - ) - ); pCoexDm->curVal0x6c0 = val0x6c0; pCoexDm->curVal0x6c4 = val0x6c4; pCoexDm->curVal0x6c8 = val0x6c8; pCoexDm->curVal0x6cc = val0x6cc; if (!bForceExec) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_DETAIL, - ( - "[BTCoex], preVal0x6c0 = 0x%x, preVal0x6c4 = 0x%x, preVal0x6c8 = 0x%x, preVal0x6cc = 0x%x !!\n", - pCoexDm->preVal0x6c0, - pCoexDm->preVal0x6c4, - pCoexDm->preVal0x6c8, - pCoexDm->preVal0x6cc - ) - ); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_DETAIL, - ( - "[BTCoex], curVal0x6c0 = 0x%x, curVal0x6c4 = 0x%x, curVal0x6c8 = 0x%x, curVal0x6cc = 0x%x !!\n", - pCoexDm->curVal0x6c0, - pCoexDm->curVal0x6c4, - pCoexDm->curVal0x6c8, - pCoexDm->curVal0x6cc - ) - ); - if ( (pCoexDm->preVal0x6c0 == pCoexDm->curVal0x6c0) && (pCoexDm->preVal0x6c4 == pCoexDm->curVal0x6c4) && @@ -1104,15 +785,6 @@ static void halbtc8723b2ant_SetFwIgnoreWlanAct( if (bEnable) H2C_Parameter[0] |= BIT0; /* function enable */ - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ( - "[BTCoex], set FW for BT Ignore Wlan_Act, FW write 0x63 = 0x%x\n", - H2C_Parameter[0] - ) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x63, 1, H2C_Parameter); } @@ -1120,22 +792,9 @@ static void halbtc8723b2ant_IgnoreWlanAct( struct btc_coexist *pBtCoexist, bool bForceExec, bool bEnable ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW, - ( - "[BTCoex], %s turn Ignore WlanAct %s\n", - (bForceExec ? "force to" : ""), - (bEnable ? "ON" : "OFF") - ) - ); - pCoexDm->bCurIgnoreWlanAct = bEnable; if (!bForceExec) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPreIgnoreWlanAct = %d, bCurIgnoreWlanAct = %d!!\n", - pCoexDm->bPreIgnoreWlanAct, pCoexDm->bCurIgnoreWlanAct)); - if (pCoexDm->bPreIgnoreWlanAct == pCoexDm->bCurIgnoreWlanAct) return; } @@ -1167,19 +826,6 @@ static void halbtc8723b2ant_SetFwPstdma( pCoexDm->psTdmaPara[3] = byte4; pCoexDm->psTdmaPara[4] = byte5; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ( - "[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[4] - ) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x60, 5, H2C_Parameter); } @@ -1305,38 +951,10 @@ static void halbtc8723b2ant_PsTdma( struct btc_coexist *pBtCoexist, bool bForceExec, bool bTurnOn, u8 type ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW, - ( - "[BTCoex], %s turn %s PS TDMA, type =%d\n", - (bForceExec ? "force to" : ""), - (bTurnOn ? "ON" : "OFF"), - type - ) - ); pCoexDm->bCurPsTdmaOn = bTurnOn; pCoexDm->curPsTdma = type; if (!bForceExec) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ( - "[BTCoex], bPrePsTdmaOn = %d, bCurPsTdmaOn = %d!!\n", - pCoexDm->bPrePsTdmaOn, - pCoexDm->bCurPsTdmaOn - ) - ); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ( - "[BTCoex], prePsTdma = %d, curPsTdma = %d!!\n", - pCoexDm->prePsTdma, pCoexDm->curPsTdma - ) - ); - if ( (pCoexDm->bPrePsTdmaOn == pCoexDm->bCurPsTdmaOn) && (pCoexDm->prePsTdma == pCoexDm->curPsTdma) @@ -1505,8 +1123,6 @@ static bool halbtc8723b2ant_IsCommonAction(struct btc_coexist *pBtCoexist) pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, false, 0x8); - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi non-connected idle!!\n")); - pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 1); @@ -1523,8 +1139,6 @@ static bool halbtc8723b2ant_IsCommonAction(struct btc_coexist *pBtCoexist) pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, false, 0x8); - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi connected + BT non connected-idle!!\n")); - pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 1); @@ -1542,7 +1156,6 @@ static bool halbtc8723b2ant_IsCommonAction(struct btc_coexist *pBtCoexist) if (bBtHsOn) return false; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi connected + BT connected-idle!!\n")); halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, false, 0x8); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); @@ -1560,13 +1173,11 @@ static bool halbtc8723b2ant_IsCommonAction(struct btc_coexist *pBtCoexist) pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); if (bWifiBusy) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi Connected-Busy + BT Busy!!\n")); bCommon = false; } else { if (bBtHsOn) return false; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi Connected-Idle + BT Busy!!\n")); btRssiState = halbtc8723b2ant_BtRssiState(2, 29, 0); halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, false, 0x8); @@ -1598,11 +1209,8 @@ static void halbtc8723b2ant_TdmaDurationAdjust( s32 result; /* 0: no change, +1: increase WiFi duration, -1: decrease WiFi duration */ u8 retryCount = 0; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], TdmaDurationAdjust()\n")); - if (!pCoexDm->bAutoTdmaAdjust) { pCoexDm->bAutoTdmaAdjust = true; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], first run TdmaDurationAdjust()!!\n")); { if (bScoHid) { if (bTxPause) { @@ -1648,15 +1256,6 @@ static void halbtc8723b2ant_TdmaDurationAdjust( } else { /* acquire the BT TRx retry count from BT_Info byte2 */ retryCount = pCoexSta->btRetryCnt; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], retryCount = %d\n", retryCount)); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ( - "[BTCoex], up =%d, dn =%d, m =%d, n =%d, WaitCount =%d\n", - up, dn, m, n, WaitCount - ) - ); result = 0; WaitCount++; @@ -1673,7 +1272,6 @@ static void halbtc8723b2ant_TdmaDurationAdjust( up = 0; dn = 0; result = 1; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], Increase wifi duration!!\n")); } } else if (retryCount <= 3) { /* <=3 retry in the last 2-second duration */ up--; @@ -1696,7 +1294,6 @@ static void halbtc8723b2ant_TdmaDurationAdjust( dn = 0; WaitCount = 0; result = -1; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], Decrease wifi duration for retryCounter<3!!\n")); } } else { /* retry count > 3, 只要1次 retry count > 3, 則調窄WiFi duration */ if (WaitCount == 1) @@ -1712,14 +1309,10 @@ static void halbtc8723b2ant_TdmaDurationAdjust( dn = 0; WaitCount = 0; result = -1; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], Decrease wifi duration for retryCounter>3!!\n")); } - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], max Interval = %d\n", maxInterval)); if (maxInterval == 1) { if (bTxPause) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 1\n")); - if (pCoexDm->curPsTdma == 71) HAL_BTC8723B2ANT_DMA_DURATION_ADJUST(5); else if (pCoexDm->curPsTdma == 1) @@ -1768,7 +1361,6 @@ static void halbtc8723b2ant_TdmaDurationAdjust( HAL_BTC8723B2ANT_DMA_DURATION_ADJUST(13); } } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 0\n")); if (pCoexDm->curPsTdma == 5) HAL_BTC8723B2ANT_DMA_DURATION_ADJUST(71); else if (pCoexDm->curPsTdma == 6) @@ -1821,7 +1413,6 @@ static void halbtc8723b2ant_TdmaDurationAdjust( } } else if (maxInterval == 2) { if (bTxPause) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 1\n")); if (pCoexDm->curPsTdma == 1) HAL_BTC8723B2ANT_DMA_DURATION_ADJUST(6); else if (pCoexDm->curPsTdma == 2) @@ -1868,7 +1459,6 @@ static void halbtc8723b2ant_TdmaDurationAdjust( HAL_BTC8723B2ANT_DMA_DURATION_ADJUST(14); } } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 0\n")); if (pCoexDm->curPsTdma == 5) HAL_BTC8723B2ANT_DMA_DURATION_ADJUST(2); else if (pCoexDm->curPsTdma == 6) @@ -1917,7 +1507,6 @@ static void halbtc8723b2ant_TdmaDurationAdjust( } } else if (maxInterval == 3) { if (bTxPause) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 1\n")); if (pCoexDm->curPsTdma == 1) HAL_BTC8723B2ANT_DMA_DURATION_ADJUST(7); else if (pCoexDm->curPsTdma == 2) @@ -1964,7 +1553,6 @@ static void halbtc8723b2ant_TdmaDurationAdjust( HAL_BTC8723B2ANT_DMA_DURATION_ADJUST(15); } } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 0\n")); if (pCoexDm->curPsTdma == 5) HAL_BTC8723B2ANT_DMA_DURATION_ADJUST(3); else if (pCoexDm->curPsTdma == 6) @@ -2018,15 +1606,6 @@ static void halbtc8723b2ant_TdmaDurationAdjust( /* then we have to adjust it back to the previous record one. */ if (pCoexDm->curPsTdma != pCoexDm->psTdmaDuAdjType) { bool bScan = false, bLink = false, bRoam = false; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ( - "[BTCoex], PsTdma type mismatch!!!, curPsTdma =%d, recordPsTdma =%d\n", - pCoexDm->curPsTdma, - pCoexDm->psTdmaDuAdjType - ) - ); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); @@ -2034,9 +1613,7 @@ static void halbtc8723b2ant_TdmaDurationAdjust( if (!bScan && !bLink && !bRoam) halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, pCoexDm->psTdmaDuAdjType); - else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], roaming/link/scan is under progress, will adjust next time!!!\n")); - } + } } @@ -2171,7 +1748,6 @@ static void halbtc8723b2ant_ActionA2dp(struct btc_coexist *pBtCoexist) /* define the office environment */ if (apNum >= 10 && BTC_RSSI_HIGH(wifiRssiState1)) { - /* DbgPrint(" AP#>10(%d)\n", apNum); */ pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, false, 0x8); halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); @@ -2660,21 +2236,16 @@ static void halbtc8723b2ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist) { u8 algorithm = 0; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], RunCoexistMechanism() ===>\n")); - if (pBtCoexist->bManualControl) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], RunCoexistMechanism(), return for Manual CTRL <===\n")); return; } if (pCoexSta->bUnderIps) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], wifi is under IPS !!!\n")); return; } algorithm = halbtc8723b2ant_ActionAlgorithm(pBtCoexist); if (pCoexSta->bC2hBtInquiryPage && (BT_8723B_2ANT_COEX_ALGO_PANHS != algorithm)) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT is under inquiry/page scan !!\n")); halbtc8723b2ant_ActionBtInquiry(pBtCoexist); return; } else { @@ -2685,69 +2256,47 @@ static void halbtc8723b2ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist) } pCoexDm->curAlgorithm = algorithm; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Algorithm = %d\n", pCoexDm->curAlgorithm)); if (halbtc8723b2ant_IsCommonAction(pBtCoexist)) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant common.\n")); pCoexDm->bAutoTdmaAdjust = false; } else { if (pCoexDm->curAlgorithm != pCoexDm->preAlgorithm) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ( - "[BTCoex], preAlgorithm =%d, curAlgorithm =%d\n", - pCoexDm->preAlgorithm, - pCoexDm->curAlgorithm - ) - ); pCoexDm->bAutoTdmaAdjust = false; } switch (pCoexDm->curAlgorithm) { case BT_8723B_2ANT_COEX_ALGO_SCO: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = SCO.\n")); halbtc8723b2ant_ActionSco(pBtCoexist); break; case BT_8723B_2ANT_COEX_ALGO_HID: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = HID.\n")); halbtc8723b2ant_ActionHid(pBtCoexist); break; case BT_8723B_2ANT_COEX_ALGO_A2DP: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = A2DP.\n")); halbtc8723b2ant_ActionA2dp(pBtCoexist); break; case BT_8723B_2ANT_COEX_ALGO_A2DP_PANHS: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = A2DP+PAN(HS).\n")); halbtc8723b2ant_ActionA2dpPanHs(pBtCoexist); break; case BT_8723B_2ANT_COEX_ALGO_PANEDR: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = PAN(EDR).\n")); halbtc8723b2ant_ActionPanEdr(pBtCoexist); break; case BT_8723B_2ANT_COEX_ALGO_PANHS: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = HS mode.\n")); halbtc8723b2ant_ActionPanHs(pBtCoexist); break; case BT_8723B_2ANT_COEX_ALGO_PANEDR_A2DP: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = PAN+A2DP.\n")); halbtc8723b2ant_ActionPanEdrA2dp(pBtCoexist); break; case BT_8723B_2ANT_COEX_ALGO_PANEDR_HID: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = PAN(EDR)+HID.\n")); halbtc8723b2ant_ActionPanEdrHid(pBtCoexist); break; case BT_8723B_2ANT_COEX_ALGO_HID_A2DP_PANEDR: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = HID+A2DP+PAN.\n")); halbtc8723b2ant_ActionHidA2dpPanEdr(pBtCoexist); break; case BT_8723B_2ANT_COEX_ALGO_HID_A2DP: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = HID+A2DP.\n")); halbtc8723b2ant_ActionHidA2dp(pBtCoexist); break; default: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = coexist All Off!!\n")); halbtc8723b2ant_CoexAllOff(pBtCoexist); break; } @@ -2784,8 +2333,6 @@ static void halbtc8723b2ant_InitHwConfig(struct btc_coexist *pBtCoexist, bool bB { u8 u1Tmp = 0; - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], 2Ant Init HW Config!!\n")); - /* backup rf 0x1e value */ pCoexDm->btRf0x1eBackup = pBtCoexist->fBtcGetRfReg(pBtCoexist, BTC_RF_A, 0x1e, 0xfffff); @@ -2873,8 +2420,6 @@ void EXhalbtc8723b2ant_InitHwConfig(struct btc_coexist *pBtCoexist, bool bWifiOn void EXhalbtc8723b2ant_InitCoexDm(struct btc_coexist *pBtCoexist) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], Coex Mechanism Init!!\n")); - halbtc8723b2ant_InitCoexDm(pBtCoexist); } @@ -2886,7 +2431,7 @@ void EXhalbtc8723b2ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) u8 *cliBuf = pBtCoexist->cliBuf; u8 u1Tmp[4], i, btInfoExt, psTdmaCase = 0; u32 u4Tmp[4]; - bool bRoam = false, bScan = false, bLink = false, bWifiUnder5G = false; + bool bRoam = false, bScan = false, bLink = false; bool bBtHsOn = false, bWifiBusy = false; s32 wifiRssi = 0, btHsRssi = 0; u32 wifiBw, wifiTrafficDir, faOfdm, faCck; @@ -2977,7 +2522,6 @@ void EXhalbtc8723b2ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) ); CL_PRINTF(cliBuf); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_5G, &bWifiUnder5G); 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); @@ -2985,7 +2529,7 @@ void EXhalbtc8723b2ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s / %s/ %s ", "Wifi status", \ - (bWifiUnder5G ? "5G" : "2.4G"), + ("2.4G"), ((BTC_WIFI_BW_LEGACY == wifiBw) ? "Legacy" : (((BTC_WIFI_BW_HT40 == wifiBw) ? "HT40" : "HT20"))), ((!bWifiBusy) ? "idle" : ((BTC_WIFI_TRAFFIC_TX == wifiTrafficDir) ? "uplink" : "downlink")) ); @@ -3262,13 +2806,11 @@ void EXhalbtc8723b2ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) 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")); pCoexSta->bUnderIps = true; halbtc8723b2ant_WifiOffHwCfg(pBtCoexist); halbtc8723b2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, true); halbtc8723b2ant_CoexAllOff(pBtCoexist); } else if (BTC_IPS_LEAVE == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS LEAVE notify\n")); pCoexSta->bUnderIps = false; halbtc8723b2ant_InitHwConfig(pBtCoexist, false); halbtc8723b2ant_InitCoexDm(pBtCoexist); @@ -3279,10 +2821,8 @@ void EXhalbtc8723b2ant_IpsNotify(struct btc_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")); pCoexSta->bUnderLps = true; } else if (BTC_LPS_DISABLE == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], LPS DISABLE notify\n")); pCoexSta->bUnderLps = false; } } @@ -3290,18 +2830,14 @@ void EXhalbtc8723b2ant_LpsNotify(struct btc_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")); } else if (BTC_SCAN_FINISH == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN FINISH notify\n")); } } 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")); } else if (BTC_ASSOCIATE_FINISH == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT FINISH notify\n")); } } @@ -3312,12 +2848,6 @@ void EXhalbtc8723b2ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type u8 wifiCentralChnl; u8 apNum = 0; - if (BTC_MEDIA_CONNECT == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA connect notify\n")); - } else { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA disconnect notify\n")); - } - /* only 2.4G we need to inform bt the chnl mask */ pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_CENTRAL_CHNL, &wifiCentralChnl); if ((BTC_MEDIA_CONNECT == type) && (wifiCentralChnl <= 14)) { @@ -3339,23 +2869,11 @@ void EXhalbtc8723b2ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type pCoexDm->wifiChnlInfo[1] = H2C_Parameter[1]; pCoexDm->wifiChnlInfo[2] = H2C_Parameter[2]; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ( - "[BTCoex], FW write 0x66 = 0x%x\n", - H2C_Parameter[0] << 16 | H2C_Parameter[1] << 8 | H2C_Parameter[2] - ) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x66, 3, H2C_Parameter); } 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")); - } } void EXhalbtc8723b2ant_BtInfoNotify( @@ -3375,21 +2893,14 @@ void EXhalbtc8723b2ant_BtInfoNotify( pCoexSta->btInfoC2hCnt[rspSource]++; - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Bt info[%d], length =%d, hex data =[", rspSource, length)); for (i = 0; i < length; i++) { pCoexSta->btInfoC2h[rspSource][i] = tmpBuf[i]; if (i == 1) btInfo = tmpBuf[i]; - 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])); - } } if (pBtCoexist->bManualControl) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), return for Manual CTRL<===\n")); return; } @@ -3404,14 +2915,12 @@ void EXhalbtc8723b2ant_BtInfoNotify( 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 */ - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Switch BT TRx Mask since BT RF REG 0x3C != 0x01\n")); pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x01); } /* Here we need to resend some wifi info to BT */ /* because bt is reset and loss of the info. */ if ((pCoexSta->btInfoExt & BIT1)) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT ext info bit1 check, send wifi BW&Chnl to BT!!\n")); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); if (bWifiConnected) @@ -3421,7 +2930,6 @@ void EXhalbtc8723b2ant_BtInfoNotify( } if ((pCoexSta->btInfoExt & BIT3)) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT ext info bit3 check, set BT NOT to ignore Wlan active!!\n")); halbtc8723b2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, false); } else { /* BT already NOT ignore Wlan active, do nothing here. */ @@ -3465,22 +2973,17 @@ void EXhalbtc8723b2ant_BtInfoNotify( 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) ) { 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) { pCoexDm->btStatus = BT_8723B_2ANT_BT_STATUS_ACL_BUSY; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), BT ACL busy!!!\n")); } else { pCoexDm->btStatus = BT_8723B_2ANT_BT_STATUS_MAX; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), BT Non-Defined state!!!\n")); } if ( @@ -3505,8 +3008,6 @@ void EXhalbtc8723b2ant_BtInfoNotify( void EXhalbtc8723b2ant_HaltNotify(struct btc_coexist *pBtCoexist) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Halt notify\n")); - halbtc8723b2ant_WifiOffHwCfg(pBtCoexist); pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x15); /* BT goto standby while GNT_BT 1-->0 */ halbtc8723b2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, true); @@ -3516,12 +3017,8 @@ void EXhalbtc8723b2ant_HaltNotify(struct btc_coexist *pBtCoexist) void EXhalbtc8723b2ant_PnpNotify(struct btc_coexist *pBtCoexist, u8 pnpState) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify\n")); - if (BTC_WIFI_PNP_SLEEP == pnpState) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify to SLEEP\n")); } else if (BTC_WIFI_PNP_WAKE_UP == pnpState) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify to WAKE UP\n")); halbtc8723b2ant_InitHwConfig(pBtCoexist, false); halbtc8723b2ant_InitCoexDm(pBtCoexist); halbtc8723b2ant_QueryBtInfo(pBtCoexist); @@ -3533,16 +3030,10 @@ void EXhalbtc8723b2ant_Periodical(struct btc_coexist *pBtCoexist) static u8 disVerInfoCnt; u32 fwVer = 0, btPatchVer = 0; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], ==========================Periodical ===========================\n")); - if (disVerInfoCnt <= 5) { disVerInfoCnt += 1; - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ****************************************************************\n")); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_BT_PATCH_VER, &btPatchVer); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], CoexVer/ FwVer/ PatchVer = %d_%x/ 0x%x/ 0x%x(%d)\n", \ - GLCoexVerDate8723b2Ant, GLCoexVer8723b2Ant, fwVer, btPatchVer, btPatchVer)); - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ****************************************************************\n")); } if ( diff --git a/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h b/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h index 7b2d94a33d9c..deb57fa15eaf 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h +++ b/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h @@ -78,29 +78,6 @@ enum { BTC_CHIP_MAX }; -enum { - BTC_MSG_INTERFACE = 0x0, - BTC_MSG_ALGORITHM = 0x1, - BTC_MSG_MAX -}; -extern u32 GLBtcDbgType[]; - -/* following is for BTC_MSG_INTERFACE */ -#define INTF_INIT BIT0 -#define INTF_NOTIFY BIT2 - -/* following is for BTC_ALGORITHM */ -#define ALGO_BT_RSSI_STATE BIT0 -#define ALGO_WIFI_RSSI_STATE BIT1 -#define ALGO_BT_MONITOR BIT2 -#define ALGO_TRACE BIT3 -#define ALGO_TRACE_FW BIT4 -#define ALGO_TRACE_FW_DETAIL BIT5 -#define ALGO_TRACE_FW_EXEC BIT6 -#define ALGO_TRACE_SW BIT7 -#define ALGO_TRACE_SW_DETAIL BIT8 -#define ALGO_TRACE_SW_EXEC BIT9 - /* following is for wifi link status */ #define WIFI_STA_CONNECTED BIT0 #define WIFI_AP_CONNECTED BIT1 @@ -112,50 +89,6 @@ extern u32 GLBtcDbgType[]; #define CL_SPRINTF snprintf #define CL_PRINTF DCMD_Printf -/* The following is for dbgview print */ -#if DBG -#define BTC_PRINT(dbgtype, dbgflag, printstr)\ -{\ - if (GLBtcDbgType[dbgtype] & dbgflag)\ - DbgPrint printstr;\ -} - -#define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr)\ -{\ - if (GLBtcDbgType[dbgtype] & dbgflag) {\ - int __i;\ - u8 *ptr = (u8 *)_Ptr;\ - DbgPrint printstr;\ - DbgPrint(" ");\ - for (__i = 0; __i < 6; __i++)\ - DbgPrint("%02X%s", ptr[__i], (__i == 5) ? "" : "-");\ - DbgPrint("\n");\ - } \ -} - -#define BTC_PRINT_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen)\ -{\ - if (GLBtcDbgType[dbgtype] & dbgflag) {\ - int __i;\ - u8 *ptr = (u8 *)_HexData;\ - DbgPrint(_TitleString);\ - for (__i = 0; __i < (int)_HexDataLen; __i++) {\ - DbgPrint("%02X%s", ptr[__i], (((__i + 1) % 4) == 0) ? " " : " ");\ - if (((__i + 1) % 16) == 0)\ - DbgPrint("\n");\ - } \ - DbgPrint("\n");\ - } \ -} - -#else -#define BTC_PRINT(dbgtype, dbgflag, printstr) no_printk printstr -#define BTC_PRINT_F(dbgtype, dbgflag, printstr) no_printk printstr -#define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr) no_printk printstr -#define BTC_PRINT_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen) \ - no_printk("%s %p %zu", _TitleString, _HexData, _HexDataLen) -#endif - struct btc_board_info { /* The following is some board information */ u8 btChipType; @@ -209,7 +142,6 @@ enum { BTC_GET_BL_WIFI_LINK, BTC_GET_BL_WIFI_ROAM, BTC_GET_BL_WIFI_4_WAY_PROGRESS, - BTC_GET_BL_WIFI_UNDER_5G, BTC_GET_BL_WIFI_AP_MODE_ENABLE, BTC_GET_BL_WIFI_ENABLE_ENCRYPTION, BTC_GET_BL_WIFI_UNDER_B_MODE, diff --git a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c index 016d257b90a0..3de8dcb5ed7c 100644 --- a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c +++ b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c @@ -33,47 +33,6 @@ static bool CheckPositive( pDM_Odm->TypeALNA << 16 | pDM_Odm->TypeAPA << 24; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> [8812A] CheckPositive (cond1, cond2) = (0x%X 0x%X)\n", - cond1, - cond2 - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> [8812A] CheckPositive (driver1, driver2) = (0x%X 0x%X)\n", - driver1, - driver2 - ) - ); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - (" (Platform, Interface) = (0x%X, 0x%X)\n", - pDM_Odm->SupportPlatform, - pDM_Odm->SupportInterface - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - " (Board, Package) = (0x%X, 0x%X)\n", - pDM_Odm->BoardType, - pDM_Odm->PackageType - ) - ); - /* Value Defined Check =============== */ /* QFN Type [15:12] and Cut Version [27:24] need to do value check */ @@ -263,13 +222,6 @@ void ODM_ReadAndConfig_MP_8723B_AGC_TAB(struct dm_odm_t *pDM_Odm) u32 ArrayLen = ARRAY_SIZE(Array_MP_8723B_AGC_TAB); u32 *Array = Array_MP_8723B_AGC_TAB; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_LOUD, - ("===> ODM_ReadAndConfig_MP_8723B_AGC_TAB\n") - ); - for (i = 0; i < ArrayLen; i += 2) { u32 v1 = Array[i]; u32 v2 = Array[i+1]; @@ -532,13 +484,6 @@ void ODM_ReadAndConfig_MP_8723B_PHY_REG(struct dm_odm_t *pDM_Odm) u32 ArrayLen = ARRAY_SIZE(Array_MP_8723B_PHY_REG); u32 *Array = Array_MP_8723B_PHY_REG; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_LOUD, - ("===> ODM_ReadAndConfig_MP_8723B_PHY_REG\n") - ); - for (i = 0; i < ArrayLen; i += 2) { u32 v1 = Array[i]; u32 v2 = Array[i+1]; @@ -598,12 +543,12 @@ void ODM_ReadAndConfig_MP_8723B_PHY_REG(struct dm_odm_t *pDM_Odm) ******************************************************************************/ static u32 Array_MP_8723B_PHY_REG_PG[] = { - 0, 0, 0, 0x00000e08, 0x0000ff00, 0x00003800, - 0, 0, 0, 0x0000086c, 0xffffff00, 0x32343600, - 0, 0, 0, 0x00000e00, 0xffffffff, 0x40424444, - 0, 0, 0, 0x00000e04, 0xffffffff, 0x28323638, - 0, 0, 0, 0x00000e10, 0xffffffff, 0x38404244, - 0, 0, 0, 0x00000e14, 0xffffffff, 0x26303436 + 0, 0, 0x00000e08, 0x0000ff00, 0x00003800, + 0, 0, 0x0000086c, 0xffffff00, 0x32343600, + 0, 0, 0x00000e00, 0xffffffff, 0x40424444, + 0, 0, 0x00000e04, 0xffffffff, 0x28323638, + 0, 0, 0x00000e10, 0xffffffff, 0x38404244, + 0, 0, 0x00000e14, 0xffffffff, 0x26303436 }; void ODM_ReadAndConfig_MP_8723B_PHY_REG_PG(struct dm_odm_t *pDM_Odm) @@ -611,24 +556,16 @@ void ODM_ReadAndConfig_MP_8723B_PHY_REG_PG(struct dm_odm_t *pDM_Odm) u32 i = 0; u32 *Array = Array_MP_8723B_PHY_REG_PG; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_LOUD, - ("===> ODM_ReadAndConfig_MP_8723B_PHY_REG_PG\n") - ); - pDM_Odm->PhyRegPgVersion = 1; pDM_Odm->PhyRegPgValueType = PHY_REG_PG_EXACT_VALUE; - for (i = 0; i < ARRAY_SIZE(Array_MP_8723B_PHY_REG_PG); i += 6) { + for (i = 0; i < ARRAY_SIZE(Array_MP_8723B_PHY_REG_PG); i += 5) { u32 v1 = Array[i]; u32 v2 = Array[i+1]; u32 v3 = Array[i+2]; u32 v4 = Array[i+3]; u32 v5 = Array[i+4]; - u32 v6 = Array[i+5]; - odm_ConfigBB_PHY_REG_PG_8723B(pDM_Odm, v1, v2, v3, v4, v5, v6); + odm_ConfigBB_PHY_REG_PG_8723B(pDM_Odm, v1, v2, v3, v4, v5); } } diff --git a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c index 677bcfa10b0d..47e66f4ad9d1 100644 --- a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c +++ b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c @@ -33,48 +33,6 @@ static bool CheckPositive( pDM_Odm->TypeALNA << 16 | pDM_Odm->TypeAPA << 24; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> [8812A] CheckPositive (cond1, cond2) = (0x%X 0x%X)\n", - cond1, - cond2 - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> [8812A] CheckPositive (driver1, driver2) = (0x%X 0x%X)\n", - driver1, - driver2 - ) - ); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - " (Platform, Interface) = (0x%X, 0x%X)\n", - pDM_Odm->SupportPlatform, - pDM_Odm->SupportInterface - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - " (Board, Package) = (0x%X, 0x%X)\n", - pDM_Odm->BoardType, - pDM_Odm->PackageType - ) - ); - /* Value Defined Check =============== */ /* QFN Type [15:12] and Cut Version [27:24] need to do value check */ @@ -234,13 +192,6 @@ void ODM_ReadAndConfig_MP_8723B_MAC_REG(struct dm_odm_t *pDM_Odm) u32 ArrayLen = ARRAY_SIZE(Array_MP_8723B_MAC_REG); u32 *Array = Array_MP_8723B_MAC_REG; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_LOUD, - ("===> ODM_ReadAndConfig_MP_8723B_MAC_REG\n") - ); - for (i = 0; i < ArrayLen; i += 2) { u32 v1 = Array[i]; u32 v2 = Array[i+1]; diff --git a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.c b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.c index 2c450c1ce7e7..00d429977ea9 100644 --- a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.c +++ b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.c @@ -33,48 +33,6 @@ static bool CheckPositive( pDM_Odm->TypeALNA << 16 | pDM_Odm->TypeAPA << 24; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> [8812A] CheckPositive (cond1, cond2) = (0x%X 0x%X)\n", - cond1, - cond2 - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> [8812A] CheckPositive (driver1, driver2) = (0x%X 0x%X)\n", - driver1, - driver2 - ) - ); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - " (Platform, Interface) = (0x%X, 0x%X)\n", - pDM_Odm->SupportPlatform, - pDM_Odm->SupportInterface - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - " (Board, Package) = (0x%X, 0x%X)\n", - pDM_Odm->BoardType, - pDM_Odm->PackageType - ) - ); - /* Value Defined Check =============== */ /* QFN Type [15:12] and Cut Version [27:24] need to do value check */ @@ -265,13 +223,6 @@ void ODM_ReadAndConfig_MP_8723B_RadioA(struct dm_odm_t *pDM_Odm) u32 ArrayLen = ARRAY_SIZE(Array_MP_8723B_RadioA); u32 *Array = Array_MP_8723B_RadioA; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_LOUD, - ("===> ODM_ReadAndConfig_MP_8723B_RadioA\n") - ); - for (i = 0; i < ArrayLen; i += 2) { u32 v1 = Array[i]; u32 v2 = Array[i+1]; @@ -331,62 +282,6 @@ void ODM_ReadAndConfig_MP_8723B_RadioA(struct dm_odm_t *pDM_Odm) * TxPowerTrack_SDIO.TXT ******************************************************************************/ -static u8 gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_SDIO_8723B[][DELTA_SWINGIDX_SIZE] = { - { - 0, 1, 1, 2, 2, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, - 9, 10, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14 - }, - { - 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, - 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14 - }, - { - 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, - 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14 - }, -}; -static u8 gDeltaSwingTableIdx_MP_5GB_P_TxPowerTrack_SDIO_8723B[][DELTA_SWINGIDX_SIZE] = { - { - 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, - 12, 13, 14, 15, 15, 16, 16, 17, 17, 18, 19, 20, 20, 20 - }, - { - 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, - 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 19, 20, 20, 20 - }, - { - 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, - 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21 - }, -}; -static u8 gDeltaSwingTableIdx_MP_5GA_N_TxPowerTrack_SDIO_8723B[][DELTA_SWINGIDX_SIZE] = { - { - 0, 1, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 8, 9, 9, 10, - 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14 - }, - { - 0, 1, 2, 3, 3, 4, 5, 6, 6, 6, 7, 7, 8, 8, 9, 10, - 11, 11, 12, 13, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16 - }, - { - 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 10, 11, - 11, 12, 13, 14, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16 - }, -}; -static u8 gDeltaSwingTableIdx_MP_5GA_P_TxPowerTrack_SDIO_8723B[][DELTA_SWINGIDX_SIZE] = { - { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }, - { - 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, - 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21 - }, - { - 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, - 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21 - }, -}; static u8 gDeltaSwingTableIdx_MP_2GB_N_TxPowerTrack_SDIO_8723B[] = { 0, 0, 1, 2, 2, 2, 3, 3, 3, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 9, 9, 10, 10, 11, 12, 13, 14, 15 @@ -424,13 +319,6 @@ void ODM_ReadAndConfig_MP_8723B_TxPowerTrack_SDIO(struct dm_odm_t *pDM_Odm) { struct odm_rf_cal_t *pRFCalibrateInfo = &pDM_Odm->RFCalibrateInfo; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_LOUD, - ("===> ODM_ReadAndConfig_MP_MP_8723B\n") - ); - memcpy( pRFCalibrateInfo->DeltaSwingTableIdx_2GA_P, @@ -473,27 +361,6 @@ void ODM_ReadAndConfig_MP_8723B_TxPowerTrack_SDIO(struct dm_odm_t *pDM_Odm) gDeltaSwingTableIdx_MP_2GCCKB_N_TxPowerTrack_SDIO_8723B, DELTA_SWINGIDX_SIZE ); - - memcpy( - pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P, - gDeltaSwingTableIdx_MP_5GA_P_TxPowerTrack_SDIO_8723B, - DELTA_SWINGIDX_SIZE*3 - ); - memcpy( - pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N, - gDeltaSwingTableIdx_MP_5GA_N_TxPowerTrack_SDIO_8723B, - DELTA_SWINGIDX_SIZE*3 - ); - memcpy( - pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P, - gDeltaSwingTableIdx_MP_5GB_P_TxPowerTrack_SDIO_8723B, - DELTA_SWINGIDX_SIZE*3 - ); - memcpy( - pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N, - gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_SDIO_8723B, - DELTA_SWINGIDX_SIZE*3 - ); } /****************************************************************************** @@ -501,258 +368,258 @@ void ODM_ReadAndConfig_MP_8723B_TxPowerTrack_SDIO(struct dm_odm_t *pDM_Odm) ******************************************************************************/ static u8 *Array_MP_8723B_TXPWR_LMT[] = { - "FCC", "2.4G", "20M", "CCK", "1T", "01", "32", - "ETSI", "2.4G", "20M", "CCK", "1T", "01", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "01", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "02", "32", - "ETSI", "2.4G", "20M", "CCK", "1T", "02", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "02", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "03", "32", - "ETSI", "2.4G", "20M", "CCK", "1T", "03", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "03", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "04", "32", - "ETSI", "2.4G", "20M", "CCK", "1T", "04", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "04", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "05", "32", - "ETSI", "2.4G", "20M", "CCK", "1T", "05", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "05", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "06", "32", - "ETSI", "2.4G", "20M", "CCK", "1T", "06", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "06", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "07", "32", - "ETSI", "2.4G", "20M", "CCK", "1T", "07", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "07", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "08", "32", - "ETSI", "2.4G", "20M", "CCK", "1T", "08", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "08", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "09", "32", - "ETSI", "2.4G", "20M", "CCK", "1T", "09", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "09", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "10", "32", - "ETSI", "2.4G", "20M", "CCK", "1T", "10", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "10", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "11", "32", - "ETSI", "2.4G", "20M", "CCK", "1T", "11", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "11", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "12", "63", - "ETSI", "2.4G", "20M", "CCK", "1T", "12", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "12", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "13", "63", - "ETSI", "2.4G", "20M", "CCK", "1T", "13", "32", - "MKK", "2.4G", "20M", "CCK", "1T", "13", "32", - "FCC", "2.4G", "20M", "CCK", "1T", "14", "63", - "ETSI", "2.4G", "20M", "CCK", "1T", "14", "63", - "MKK", "2.4G", "20M", "CCK", "1T", "14", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "01", "28", - "ETSI", "2.4G", "20M", "OFDM", "1T", "01", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "01", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "02", "28", - "ETSI", "2.4G", "20M", "OFDM", "1T", "02", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "02", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "03", "32", - "ETSI", "2.4G", "20M", "OFDM", "1T", "03", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "03", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "04", "32", - "ETSI", "2.4G", "20M", "OFDM", "1T", "04", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "04", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "05", "32", - "ETSI", "2.4G", "20M", "OFDM", "1T", "05", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "05", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "06", "32", - "ETSI", "2.4G", "20M", "OFDM", "1T", "06", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "06", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "07", "32", - "ETSI", "2.4G", "20M", "OFDM", "1T", "07", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "07", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "08", "32", - "ETSI", "2.4G", "20M", "OFDM", "1T", "08", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "08", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "09", "32", - "ETSI", "2.4G", "20M", "OFDM", "1T", "09", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "09", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "10", "28", - "ETSI", "2.4G", "20M", "OFDM", "1T", "10", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "10", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "11", "28", - "ETSI", "2.4G", "20M", "OFDM", "1T", "11", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "11", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "12", "63", - "ETSI", "2.4G", "20M", "OFDM", "1T", "12", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "12", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "13", "63", - "ETSI", "2.4G", "20M", "OFDM", "1T", "13", "32", - "MKK", "2.4G", "20M", "OFDM", "1T", "13", "32", - "FCC", "2.4G", "20M", "OFDM", "1T", "14", "63", - "ETSI", "2.4G", "20M", "OFDM", "1T", "14", "63", - "MKK", "2.4G", "20M", "OFDM", "1T", "14", "63", - "FCC", "2.4G", "20M", "HT", "1T", "01", "26", - "ETSI", "2.4G", "20M", "HT", "1T", "01", "32", - "MKK", "2.4G", "20M", "HT", "1T", "01", "32", - "FCC", "2.4G", "20M", "HT", "1T", "02", "26", - "ETSI", "2.4G", "20M", "HT", "1T", "02", "32", - "MKK", "2.4G", "20M", "HT", "1T", "02", "32", - "FCC", "2.4G", "20M", "HT", "1T", "03", "32", - "ETSI", "2.4G", "20M", "HT", "1T", "03", "32", - "MKK", "2.4G", "20M", "HT", "1T", "03", "32", - "FCC", "2.4G", "20M", "HT", "1T", "04", "32", - "ETSI", "2.4G", "20M", "HT", "1T", "04", "32", - "MKK", "2.4G", "20M", "HT", "1T", "04", "32", - "FCC", "2.4G", "20M", "HT", "1T", "05", "32", - "ETSI", "2.4G", "20M", "HT", "1T", "05", "32", - "MKK", "2.4G", "20M", "HT", "1T", "05", "32", - "FCC", "2.4G", "20M", "HT", "1T", "06", "32", - "ETSI", "2.4G", "20M", "HT", "1T", "06", "32", - "MKK", "2.4G", "20M", "HT", "1T", "06", "32", - "FCC", "2.4G", "20M", "HT", "1T", "07", "32", - "ETSI", "2.4G", "20M", "HT", "1T", "07", "32", - "MKK", "2.4G", "20M", "HT", "1T", "07", "32", - "FCC", "2.4G", "20M", "HT", "1T", "08", "32", - "ETSI", "2.4G", "20M", "HT", "1T", "08", "32", - "MKK", "2.4G", "20M", "HT", "1T", "08", "32", - "FCC", "2.4G", "20M", "HT", "1T", "09", "32", - "ETSI", "2.4G", "20M", "HT", "1T", "09", "32", - "MKK", "2.4G", "20M", "HT", "1T", "09", "32", - "FCC", "2.4G", "20M", "HT", "1T", "10", "26", - "ETSI", "2.4G", "20M", "HT", "1T", "10", "32", - "MKK", "2.4G", "20M", "HT", "1T", "10", "32", - "FCC", "2.4G", "20M", "HT", "1T", "11", "26", - "ETSI", "2.4G", "20M", "HT", "1T", "11", "32", - "MKK", "2.4G", "20M", "HT", "1T", "11", "32", - "FCC", "2.4G", "20M", "HT", "1T", "12", "63", - "ETSI", "2.4G", "20M", "HT", "1T", "12", "32", - "MKK", "2.4G", "20M", "HT", "1T", "12", "32", - "FCC", "2.4G", "20M", "HT", "1T", "13", "63", - "ETSI", "2.4G", "20M", "HT", "1T", "13", "32", - "MKK", "2.4G", "20M", "HT", "1T", "13", "32", - "FCC", "2.4G", "20M", "HT", "1T", "14", "63", - "ETSI", "2.4G", "20M", "HT", "1T", "14", "63", - "MKK", "2.4G", "20M", "HT", "1T", "14", "63", - "FCC", "2.4G", "20M", "HT", "2T", "01", "30", - "ETSI", "2.4G", "20M", "HT", "2T", "01", "32", - "MKK", "2.4G", "20M", "HT", "2T", "01", "32", - "FCC", "2.4G", "20M", "HT", "2T", "02", "32", - "ETSI", "2.4G", "20M", "HT", "2T", "02", "32", - "MKK", "2.4G", "20M", "HT", "2T", "02", "32", - "FCC", "2.4G", "20M", "HT", "2T", "03", "32", - "ETSI", "2.4G", "20M", "HT", "2T", "03", "32", - "MKK", "2.4G", "20M", "HT", "2T", "03", "32", - "FCC", "2.4G", "20M", "HT", "2T", "04", "32", - "ETSI", "2.4G", "20M", "HT", "2T", "04", "32", - "MKK", "2.4G", "20M", "HT", "2T", "04", "32", - "FCC", "2.4G", "20M", "HT", "2T", "05", "32", - "ETSI", "2.4G", "20M", "HT", "2T", "05", "32", - "MKK", "2.4G", "20M", "HT", "2T", "05", "32", - "FCC", "2.4G", "20M", "HT", "2T", "06", "32", - "ETSI", "2.4G", "20M", "HT", "2T", "06", "32", - "MKK", "2.4G", "20M", "HT", "2T", "06", "32", - "FCC", "2.4G", "20M", "HT", "2T", "07", "32", - "ETSI", "2.4G", "20M", "HT", "2T", "07", "32", - "MKK", "2.4G", "20M", "HT", "2T", "07", "32", - "FCC", "2.4G", "20M", "HT", "2T", "08", "32", - "ETSI", "2.4G", "20M", "HT", "2T", "08", "32", - "MKK", "2.4G", "20M", "HT", "2T", "08", "32", - "FCC", "2.4G", "20M", "HT", "2T", "09", "32", - "ETSI", "2.4G", "20M", "HT", "2T", "09", "32", - "MKK", "2.4G", "20M", "HT", "2T", "09", "32", - "FCC", "2.4G", "20M", "HT", "2T", "10", "32", - "ETSI", "2.4G", "20M", "HT", "2T", "10", "32", - "MKK", "2.4G", "20M", "HT", "2T", "10", "32", - "FCC", "2.4G", "20M", "HT", "2T", "11", "30", - "ETSI", "2.4G", "20M", "HT", "2T", "11", "32", - "MKK", "2.4G", "20M", "HT", "2T", "11", "32", - "FCC", "2.4G", "20M", "HT", "2T", "12", "63", - "ETSI", "2.4G", "20M", "HT", "2T", "12", "32", - "MKK", "2.4G", "20M", "HT", "2T", "12", "32", - "FCC", "2.4G", "20M", "HT", "2T", "13", "63", - "ETSI", "2.4G", "20M", "HT", "2T", "13", "32", - "MKK", "2.4G", "20M", "HT", "2T", "13", "32", - "FCC", "2.4G", "20M", "HT", "2T", "14", "63", - "ETSI", "2.4G", "20M", "HT", "2T", "14", "63", - "MKK", "2.4G", "20M", "HT", "2T", "14", "63", - "FCC", "2.4G", "40M", "HT", "1T", "01", "63", - "ETSI", "2.4G", "40M", "HT", "1T", "01", "63", - "MKK", "2.4G", "40M", "HT", "1T", "01", "63", - "FCC", "2.4G", "40M", "HT", "1T", "02", "63", - "ETSI", "2.4G", "40M", "HT", "1T", "02", "63", - "MKK", "2.4G", "40M", "HT", "1T", "02", "63", - "FCC", "2.4G", "40M", "HT", "1T", "03", "26", - "ETSI", "2.4G", "40M", "HT", "1T", "03", "32", - "MKK", "2.4G", "40M", "HT", "1T", "03", "32", - "FCC", "2.4G", "40M", "HT", "1T", "04", "26", - "ETSI", "2.4G", "40M", "HT", "1T", "04", "32", - "MKK", "2.4G", "40M", "HT", "1T", "04", "32", - "FCC", "2.4G", "40M", "HT", "1T", "05", "32", - "ETSI", "2.4G", "40M", "HT", "1T", "05", "32", - "MKK", "2.4G", "40M", "HT", "1T", "05", "32", - "FCC", "2.4G", "40M", "HT", "1T", "06", "32", - "ETSI", "2.4G", "40M", "HT", "1T", "06", "32", - "MKK", "2.4G", "40M", "HT", "1T", "06", "32", - "FCC", "2.4G", "40M", "HT", "1T", "07", "32", - "ETSI", "2.4G", "40M", "HT", "1T", "07", "32", - "MKK", "2.4G", "40M", "HT", "1T", "07", "32", - "FCC", "2.4G", "40M", "HT", "1T", "08", "26", - "ETSI", "2.4G", "40M", "HT", "1T", "08", "32", - "MKK", "2.4G", "40M", "HT", "1T", "08", "32", - "FCC", "2.4G", "40M", "HT", "1T", "09", "26", - "ETSI", "2.4G", "40M", "HT", "1T", "09", "32", - "MKK", "2.4G", "40M", "HT", "1T", "09", "32", - "FCC", "2.4G", "40M", "HT", "1T", "10", "26", - "ETSI", "2.4G", "40M", "HT", "1T", "10", "32", - "MKK", "2.4G", "40M", "HT", "1T", "10", "32", - "FCC", "2.4G", "40M", "HT", "1T", "11", "26", - "ETSI", "2.4G", "40M", "HT", "1T", "11", "32", - "MKK", "2.4G", "40M", "HT", "1T", "11", "32", - "FCC", "2.4G", "40M", "HT", "1T", "12", "63", - "ETSI", "2.4G", "40M", "HT", "1T", "12", "32", - "MKK", "2.4G", "40M", "HT", "1T", "12", "32", - "FCC", "2.4G", "40M", "HT", "1T", "13", "63", - "ETSI", "2.4G", "40M", "HT", "1T", "13", "32", - "MKK", "2.4G", "40M", "HT", "1T", "13", "32", - "FCC", "2.4G", "40M", "HT", "1T", "14", "63", - "ETSI", "2.4G", "40M", "HT", "1T", "14", "63", - "MKK", "2.4G", "40M", "HT", "1T", "14", "63", - "FCC", "2.4G", "40M", "HT", "2T", "01", "63", - "ETSI", "2.4G", "40M", "HT", "2T", "01", "63", - "MKK", "2.4G", "40M", "HT", "2T", "01", "63", - "FCC", "2.4G", "40M", "HT", "2T", "02", "63", - "ETSI", "2.4G", "40M", "HT", "2T", "02", "63", - "MKK", "2.4G", "40M", "HT", "2T", "02", "63", - "FCC", "2.4G", "40M", "HT", "2T", "03", "30", - "ETSI", "2.4G", "40M", "HT", "2T", "03", "30", - "MKK", "2.4G", "40M", "HT", "2T", "03", "30", - "FCC", "2.4G", "40M", "HT", "2T", "04", "32", - "ETSI", "2.4G", "40M", "HT", "2T", "04", "30", - "MKK", "2.4G", "40M", "HT", "2T", "04", "30", - "FCC", "2.4G", "40M", "HT", "2T", "05", "32", - "ETSI", "2.4G", "40M", "HT", "2T", "05", "30", - "MKK", "2.4G", "40M", "HT", "2T", "05", "30", - "FCC", "2.4G", "40M", "HT", "2T", "06", "32", - "ETSI", "2.4G", "40M", "HT", "2T", "06", "30", - "MKK", "2.4G", "40M", "HT", "2T", "06", "30", - "FCC", "2.4G", "40M", "HT", "2T", "07", "32", - "ETSI", "2.4G", "40M", "HT", "2T", "07", "30", - "MKK", "2.4G", "40M", "HT", "2T", "07", "30", - "FCC", "2.4G", "40M", "HT", "2T", "08", "32", - "ETSI", "2.4G", "40M", "HT", "2T", "08", "30", - "MKK", "2.4G", "40M", "HT", "2T", "08", "30", - "FCC", "2.4G", "40M", "HT", "2T", "09", "32", - "ETSI", "2.4G", "40M", "HT", "2T", "09", "30", - "MKK", "2.4G", "40M", "HT", "2T", "09", "30", - "FCC", "2.4G", "40M", "HT", "2T", "10", "32", - "ETSI", "2.4G", "40M", "HT", "2T", "10", "30", - "MKK", "2.4G", "40M", "HT", "2T", "10", "30", - "FCC", "2.4G", "40M", "HT", "2T", "11", "30", - "ETSI", "2.4G", "40M", "HT", "2T", "11", "30", - "MKK", "2.4G", "40M", "HT", "2T", "11", "30", - "FCC", "2.4G", "40M", "HT", "2T", "12", "63", - "ETSI", "2.4G", "40M", "HT", "2T", "12", "32", - "MKK", "2.4G", "40M", "HT", "2T", "12", "32", - "FCC", "2.4G", "40M", "HT", "2T", "13", "63", - "ETSI", "2.4G", "40M", "HT", "2T", "13", "32", - "MKK", "2.4G", "40M", "HT", "2T", "13", "32", - "FCC", "2.4G", "40M", "HT", "2T", "14", "63", - "ETSI", "2.4G", "40M", "HT", "2T", "14", "63", - "MKK", "2.4G", "40M", "HT", "2T", "14", "63" + "FCC", "20M", "CCK", "1T", "01", "32", + "ETSI", "20M", "CCK", "1T", "01", "32", + "MKK", "20M", "CCK", "1T", "01", "32", + "FCC", "20M", "CCK", "1T", "02", "32", + "ETSI", "20M", "CCK", "1T", "02", "32", + "MKK", "20M", "CCK", "1T", "02", "32", + "FCC", "20M", "CCK", "1T", "03", "32", + "ETSI", "20M", "CCK", "1T", "03", "32", + "MKK", "20M", "CCK", "1T", "03", "32", + "FCC", "20M", "CCK", "1T", "04", "32", + "ETSI", "20M", "CCK", "1T", "04", "32", + "MKK", "20M", "CCK", "1T", "04", "32", + "FCC", "20M", "CCK", "1T", "05", "32", + "ETSI", "20M", "CCK", "1T", "05", "32", + "MKK", "20M", "CCK", "1T", "05", "32", + "FCC", "20M", "CCK", "1T", "06", "32", + "ETSI", "20M", "CCK", "1T", "06", "32", + "MKK", "20M", "CCK", "1T", "06", "32", + "FCC", "20M", "CCK", "1T", "07", "32", + "ETSI", "20M", "CCK", "1T", "07", "32", + "MKK", "20M", "CCK", "1T", "07", "32", + "FCC", "20M", "CCK", "1T", "08", "32", + "ETSI", "20M", "CCK", "1T", "08", "32", + "MKK", "20M", "CCK", "1T", "08", "32", + "FCC", "20M", "CCK", "1T", "09", "32", + "ETSI", "20M", "CCK", "1T", "09", "32", + "MKK", "20M", "CCK", "1T", "09", "32", + "FCC", "20M", "CCK", "1T", "10", "32", + "ETSI", "20M", "CCK", "1T", "10", "32", + "MKK", "20M", "CCK", "1T", "10", "32", + "FCC", "20M", "CCK", "1T", "11", "32", + "ETSI", "20M", "CCK", "1T", "11", "32", + "MKK", "20M", "CCK", "1T", "11", "32", + "FCC", "20M", "CCK", "1T", "12", "63", + "ETSI", "20M", "CCK", "1T", "12", "32", + "MKK", "20M", "CCK", "1T", "12", "32", + "FCC", "20M", "CCK", "1T", "13", "63", + "ETSI", "20M", "CCK", "1T", "13", "32", + "MKK", "20M", "CCK", "1T", "13", "32", + "FCC", "20M", "CCK", "1T", "14", "63", + "ETSI", "20M", "CCK", "1T", "14", "63", + "MKK", "20M", "CCK", "1T", "14", "32", + "FCC", "20M", "OFDM", "1T", "01", "28", + "ETSI", "20M", "OFDM", "1T", "01", "32", + "MKK", "20M", "OFDM", "1T", "01", "32", + "FCC", "20M", "OFDM", "1T", "02", "28", + "ETSI", "20M", "OFDM", "1T", "02", "32", + "MKK", "20M", "OFDM", "1T", "02", "32", + "FCC", "20M", "OFDM", "1T", "03", "32", + "ETSI", "20M", "OFDM", "1T", "03", "32", + "MKK", "20M", "OFDM", "1T", "03", "32", + "FCC", "20M", "OFDM", "1T", "04", "32", + "ETSI", "20M", "OFDM", "1T", "04", "32", + "MKK", "20M", "OFDM", "1T", "04", "32", + "FCC", "20M", "OFDM", "1T", "05", "32", + "ETSI", "20M", "OFDM", "1T", "05", "32", + "MKK", "20M", "OFDM", "1T", "05", "32", + "FCC", "20M", "OFDM", "1T", "06", "32", + "ETSI", "20M", "OFDM", "1T", "06", "32", + "MKK", "20M", "OFDM", "1T", "06", "32", + "FCC", "20M", "OFDM", "1T", "07", "32", + "ETSI", "20M", "OFDM", "1T", "07", "32", + "MKK", "20M", "OFDM", "1T", "07", "32", + "FCC", "20M", "OFDM", "1T", "08", "32", + "ETSI", "20M", "OFDM", "1T", "08", "32", + "MKK", "20M", "OFDM", "1T", "08", "32", + "FCC", "20M", "OFDM", "1T", "09", "32", + "ETSI", "20M", "OFDM", "1T", "09", "32", + "MKK", "20M", "OFDM", "1T", "09", "32", + "FCC", "20M", "OFDM", "1T", "10", "28", + "ETSI", "20M", "OFDM", "1T", "10", "32", + "MKK", "20M", "OFDM", "1T", "10", "32", + "FCC", "20M", "OFDM", "1T", "11", "28", + "ETSI", "20M", "OFDM", "1T", "11", "32", + "MKK", "20M", "OFDM", "1T", "11", "32", + "FCC", "20M", "OFDM", "1T", "12", "63", + "ETSI", "20M", "OFDM", "1T", "12", "32", + "MKK", "20M", "OFDM", "1T", "12", "32", + "FCC", "20M", "OFDM", "1T", "13", "63", + "ETSI", "20M", "OFDM", "1T", "13", "32", + "MKK", "20M", "OFDM", "1T", "13", "32", + "FCC", "20M", "OFDM", "1T", "14", "63", + "ETSI", "20M", "OFDM", "1T", "14", "63", + "MKK", "20M", "OFDM", "1T", "14", "63", + "FCC", "20M", "HT", "1T", "01", "26", + "ETSI", "20M", "HT", "1T", "01", "32", + "MKK", "20M", "HT", "1T", "01", "32", + "FCC", "20M", "HT", "1T", "02", "26", + "ETSI", "20M", "HT", "1T", "02", "32", + "MKK", "20M", "HT", "1T", "02", "32", + "FCC", "20M", "HT", "1T", "03", "32", + "ETSI", "20M", "HT", "1T", "03", "32", + "MKK", "20M", "HT", "1T", "03", "32", + "FCC", "20M", "HT", "1T", "04", "32", + "ETSI", "20M", "HT", "1T", "04", "32", + "MKK", "20M", "HT", "1T", "04", "32", + "FCC", "20M", "HT", "1T", "05", "32", + "ETSI", "20M", "HT", "1T", "05", "32", + "MKK", "20M", "HT", "1T", "05", "32", + "FCC", "20M", "HT", "1T", "06", "32", + "ETSI", "20M", "HT", "1T", "06", "32", + "MKK", "20M", "HT", "1T", "06", "32", + "FCC", "20M", "HT", "1T", "07", "32", + "ETSI", "20M", "HT", "1T", "07", "32", + "MKK", "20M", "HT", "1T", "07", "32", + "FCC", "20M", "HT", "1T", "08", "32", + "ETSI", "20M", "HT", "1T", "08", "32", + "MKK", "20M", "HT", "1T", "08", "32", + "FCC", "20M", "HT", "1T", "09", "32", + "ETSI", "20M", "HT", "1T", "09", "32", + "MKK", "20M", "HT", "1T", "09", "32", + "FCC", "20M", "HT", "1T", "10", "26", + "ETSI", "20M", "HT", "1T", "10", "32", + "MKK", "20M", "HT", "1T", "10", "32", + "FCC", "20M", "HT", "1T", "11", "26", + "ETSI", "20M", "HT", "1T", "11", "32", + "MKK", "20M", "HT", "1T", "11", "32", + "FCC", "20M", "HT", "1T", "12", "63", + "ETSI", "20M", "HT", "1T", "12", "32", + "MKK", "20M", "HT", "1T", "12", "32", + "FCC", "20M", "HT", "1T", "13", "63", + "ETSI", "20M", "HT", "1T", "13", "32", + "MKK", "20M", "HT", "1T", "13", "32", + "FCC", "20M", "HT", "1T", "14", "63", + "ETSI", "20M", "HT", "1T", "14", "63", + "MKK", "20M", "HT", "1T", "14", "63", + "FCC", "20M", "HT", "2T", "01", "30", + "ETSI", "20M", "HT", "2T", "01", "32", + "MKK", "20M", "HT", "2T", "01", "32", + "FCC", "20M", "HT", "2T", "02", "32", + "ETSI", "20M", "HT", "2T", "02", "32", + "MKK", "20M", "HT", "2T", "02", "32", + "FCC", "20M", "HT", "2T", "03", "32", + "ETSI", "20M", "HT", "2T", "03", "32", + "MKK", "20M", "HT", "2T", "03", "32", + "FCC", "20M", "HT", "2T", "04", "32", + "ETSI", "20M", "HT", "2T", "04", "32", + "MKK", "20M", "HT", "2T", "04", "32", + "FCC", "20M", "HT", "2T", "05", "32", + "ETSI", "20M", "HT", "2T", "05", "32", + "MKK", "20M", "HT", "2T", "05", "32", + "FCC", "20M", "HT", "2T", "06", "32", + "ETSI", "20M", "HT", "2T", "06", "32", + "MKK", "20M", "HT", "2T", "06", "32", + "FCC", "20M", "HT", "2T", "07", "32", + "ETSI", "20M", "HT", "2T", "07", "32", + "MKK", "20M", "HT", "2T", "07", "32", + "FCC", "20M", "HT", "2T", "08", "32", + "ETSI", "20M", "HT", "2T", "08", "32", + "MKK", "20M", "HT", "2T", "08", "32", + "FCC", "20M", "HT", "2T", "09", "32", + "ETSI", "20M", "HT", "2T", "09", "32", + "MKK", "20M", "HT", "2T", "09", "32", + "FCC", "20M", "HT", "2T", "10", "32", + "ETSI", "20M", "HT", "2T", "10", "32", + "MKK", "20M", "HT", "2T", "10", "32", + "FCC", "20M", "HT", "2T", "11", "30", + "ETSI", "20M", "HT", "2T", "11", "32", + "MKK", "20M", "HT", "2T", "11", "32", + "FCC", "20M", "HT", "2T", "12", "63", + "ETSI", "20M", "HT", "2T", "12", "32", + "MKK", "20M", "HT", "2T", "12", "32", + "FCC", "20M", "HT", "2T", "13", "63", + "ETSI", "20M", "HT", "2T", "13", "32", + "MKK", "20M", "HT", "2T", "13", "32", + "FCC", "20M", "HT", "2T", "14", "63", + "ETSI", "20M", "HT", "2T", "14", "63", + "MKK", "20M", "HT", "2T", "14", "63", + "FCC", "40M", "HT", "1T", "01", "63", + "ETSI", "40M", "HT", "1T", "01", "63", + "MKK", "40M", "HT", "1T", "01", "63", + "FCC", "40M", "HT", "1T", "02", "63", + "ETSI", "40M", "HT", "1T", "02", "63", + "MKK", "40M", "HT", "1T", "02", "63", + "FCC", "40M", "HT", "1T", "03", "26", + "ETSI", "40M", "HT", "1T", "03", "32", + "MKK", "40M", "HT", "1T", "03", "32", + "FCC", "40M", "HT", "1T", "04", "26", + "ETSI", "40M", "HT", "1T", "04", "32", + "MKK", "40M", "HT", "1T", "04", "32", + "FCC", "40M", "HT", "1T", "05", "32", + "ETSI", "40M", "HT", "1T", "05", "32", + "MKK", "40M", "HT", "1T", "05", "32", + "FCC", "40M", "HT", "1T", "06", "32", + "ETSI", "40M", "HT", "1T", "06", "32", + "MKK", "40M", "HT", "1T", "06", "32", + "FCC", "40M", "HT", "1T", "07", "32", + "ETSI", "40M", "HT", "1T", "07", "32", + "MKK", "40M", "HT", "1T", "07", "32", + "FCC", "40M", "HT", "1T", "08", "26", + "ETSI", "40M", "HT", "1T", "08", "32", + "MKK", "40M", "HT", "1T", "08", "32", + "FCC", "40M", "HT", "1T", "09", "26", + "ETSI", "40M", "HT", "1T", "09", "32", + "MKK", "40M", "HT", "1T", "09", "32", + "FCC", "40M", "HT", "1T", "10", "26", + "ETSI", "40M", "HT", "1T", "10", "32", + "MKK", "40M", "HT", "1T", "10", "32", + "FCC", "40M", "HT", "1T", "11", "26", + "ETSI", "40M", "HT", "1T", "11", "32", + "MKK", "40M", "HT", "1T", "11", "32", + "FCC", "40M", "HT", "1T", "12", "63", + "ETSI", "40M", "HT", "1T", "12", "32", + "MKK", "40M", "HT", "1T", "12", "32", + "FCC", "40M", "HT", "1T", "13", "63", + "ETSI", "40M", "HT", "1T", "13", "32", + "MKK", "40M", "HT", "1T", "13", "32", + "FCC", "40M", "HT", "1T", "14", "63", + "ETSI", "40M", "HT", "1T", "14", "63", + "MKK", "40M", "HT", "1T", "14", "63", + "FCC", "40M", "HT", "2T", "01", "63", + "ETSI", "40M", "HT", "2T", "01", "63", + "MKK", "40M", "HT", "2T", "01", "63", + "FCC", "40M", "HT", "2T", "02", "63", + "ETSI", "40M", "HT", "2T", "02", "63", + "MKK", "40M", "HT", "2T", "02", "63", + "FCC", "40M", "HT", "2T", "03", "30", + "ETSI", "40M", "HT", "2T", "03", "30", + "MKK", "40M", "HT", "2T", "03", "30", + "FCC", "40M", "HT", "2T", "04", "32", + "ETSI", "40M", "HT", "2T", "04", "30", + "MKK", "40M", "HT", "2T", "04", "30", + "FCC", "40M", "HT", "2T", "05", "32", + "ETSI", "40M", "HT", "2T", "05", "30", + "MKK", "40M", "HT", "2T", "05", "30", + "FCC", "40M", "HT", "2T", "06", "32", + "ETSI", "40M", "HT", "2T", "06", "30", + "MKK", "40M", "HT", "2T", "06", "30", + "FCC", "40M", "HT", "2T", "07", "32", + "ETSI", "40M", "HT", "2T", "07", "30", + "MKK", "40M", "HT", "2T", "07", "30", + "FCC", "40M", "HT", "2T", "08", "32", + "ETSI", "40M", "HT", "2T", "08", "30", + "MKK", "40M", "HT", "2T", "08", "30", + "FCC", "40M", "HT", "2T", "09", "32", + "ETSI", "40M", "HT", "2T", "09", "30", + "MKK", "40M", "HT", "2T", "09", "30", + "FCC", "40M", "HT", "2T", "10", "32", + "ETSI", "40M", "HT", "2T", "10", "30", + "MKK", "40M", "HT", "2T", "10", "30", + "FCC", "40M", "HT", "2T", "11", "30", + "ETSI", "40M", "HT", "2T", "11", "30", + "MKK", "40M", "HT", "2T", "11", "30", + "FCC", "40M", "HT", "2T", "12", "63", + "ETSI", "40M", "HT", "2T", "12", "32", + "MKK", "40M", "HT", "2T", "12", "32", + "FCC", "40M", "HT", "2T", "13", "63", + "ETSI", "40M", "HT", "2T", "13", "32", + "MKK", "40M", "HT", "2T", "13", "32", + "FCC", "40M", "HT", "2T", "14", "63", + "ETSI", "40M", "HT", "2T", "14", "63", + "MKK", "40M", "HT", "2T", "14", "63" }; void ODM_ReadAndConfig_MP_8723B_TXPWR_LMT(struct dm_odm_t *pDM_Odm) @@ -760,26 +627,17 @@ void ODM_ReadAndConfig_MP_8723B_TXPWR_LMT(struct dm_odm_t *pDM_Odm) u32 i = 0; u8 **Array = Array_MP_8723B_TXPWR_LMT; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_LOUD, - ("===> ODM_ReadAndConfig_MP_8723B_TXPWR_LMT\n") - ); - - for (i = 0; i < ARRAY_SIZE(Array_MP_8723B_TXPWR_LMT); i += 7) { + for (i = 0; i < ARRAY_SIZE(Array_MP_8723B_TXPWR_LMT); i += 6) { u8 *regulation = Array[i]; - u8 *band = Array[i+1]; - u8 *bandwidth = Array[i+2]; - u8 *rate = Array[i+3]; - u8 *rfPath = Array[i+4]; - u8 *chnl = Array[i+5]; - u8 *val = Array[i+6]; + u8 *bandwidth = Array[i+1]; + u8 *rate = Array[i+2]; + u8 *rfPath = Array[i+3]; + u8 *chnl = Array[i+4]; + u8 *val = Array[i+5]; odm_ConfigBB_TXPWR_LMT_8723B( pDM_Odm, regulation, - band, bandwidth, rate, rfPath, diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf.c b/drivers/staging/rtl8723bs/hal/HalPhyRf.c index 14426151faae..365e1195b5e5 100644 --- a/drivers/staging/rtl8723bs/hal/HalPhyRf.c +++ b/drivers/staging/rtl8723bs/hal/HalPhyRf.c @@ -76,7 +76,7 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); struct dm_odm_t *pDM_Odm = &pHalData->odmpriv; - u8 ThermalValue = 0, delta, delta_LCK, delta_IQK, p = 0, i = 0; + u8 ThermalValue = 0, delta, delta_LCK, p = 0, i = 0; u8 ThermalValue_AVG_count = 0; u32 ThermalValue_AVG = 0; @@ -108,18 +108,6 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) pDM_Odm->RFCalibrateInfo.TXPowerTrackingCallbackCnt++; pDM_Odm->RFCalibrateInfo.bTXPowerTrackingInit = true; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "===>ODM_TXPowerTrackingCallback_ThermalMeter,\npDM_Odm->BbSwingIdxCckBase: %d, pDM_Odm->BbSwingIdxOfdmBase[A]: %d, pDM_Odm->DefaultOfdmIndex: %d\n", - pDM_Odm->BbSwingIdxCckBase, - pDM_Odm->BbSwingIdxOfdmBase[ODM_RF_PATH_A], - pDM_Odm->DefaultOfdmIndex - ) - ); - ThermalValue = (u8)PHY_QueryRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, c.ThermalRegAddr, 0xfc00); /* 0x42: RF Reg[15:10] 88E */ if ( !pDM_Odm->RFCalibrateInfo.TxPowerTrackControl || @@ -130,13 +118,6 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) /* 4 3. Initialize ThermalValues of RFCalibrateInfo */ - if (pDM_Odm->RFCalibrateInfo.bReloadtxpowerindex) - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ("reload ofdm index for band switch\n") - ); - /* 4 4. Calculate average thermal meter */ pDM_Odm->RFCalibrateInfo.ThermalValue_AVG[pDM_Odm->RFCalibrateInfo.ThermalValue_AVG_index] = ThermalValue; @@ -154,19 +135,9 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) /* Calculate Average ThermalValue after average enough times */ if (ThermalValue_AVG_count) { ThermalValue = (u8)(ThermalValue_AVG / ThermalValue_AVG_count); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "AVG Thermal Meter = 0x%X, EFUSE Thermal Base = 0x%X\n", - ThermalValue, - pHalData->EEPROMThermalMeter - ) - ); } - /* 4 5. Calculate delta, delta_LCK, delta_IQK. */ + /* 4 5. Calculate delta, delta_LCK */ /* delta" here is used to determine whether thermal value changes or not. */ delta = (ThermalValue > pDM_Odm->RFCalibrateInfo.ThermalValue) ? @@ -176,36 +147,10 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) (ThermalValue > pDM_Odm->RFCalibrateInfo.ThermalValue_LCK) ? (ThermalValue - pDM_Odm->RFCalibrateInfo.ThermalValue_LCK) : (pDM_Odm->RFCalibrateInfo.ThermalValue_LCK - ThermalValue); - delta_IQK = - (ThermalValue > pDM_Odm->RFCalibrateInfo.ThermalValue_IQK) ? - (ThermalValue - pDM_Odm->RFCalibrateInfo.ThermalValue_IQK) : - (pDM_Odm->RFCalibrateInfo.ThermalValue_IQK - ThermalValue); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "(delta, delta_LCK, delta_IQK) = (%d, %d, %d)\n", - delta, - delta_LCK, - delta_IQK - ) - ); /* 4 6. If necessary, do LCK. */ /* Delta temperature is equal to or larger than 20 centigrade. */ if (delta_LCK >= c.Threshold_IQK) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "delta_LCK(%d) >= Threshold_IQK(%d)\n", - delta_LCK, - c.Threshold_IQK - ) - ); pDM_Odm->RFCalibrateInfo.ThermalValue_LCK = ThermalValue; if (c.PHY_LCCalibrate) (*c.PHY_LCCalibrate)(pDM_Odm); @@ -224,16 +169,6 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) /* 4 7.1 The Final Power Index = BaseIndex + PowerIndexOffset */ if (ThermalValue > pHalData->EEPROMThermalMeter) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "deltaSwingTableIdx_TUP_A[%d] = %d\n", - delta, - deltaSwingTableIdx_TUP_A[delta] - ) - ); pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[ODM_RF_PATH_A] = pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_A]; pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_A] = @@ -243,27 +178,7 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = deltaSwingTableIdx_TUP_A[delta]; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "******Temp is higher and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n", - pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] - ) - ); - if (c.RfPathCount > 1) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "deltaSwingTableIdx_TUP_B[%d] = %d\n", - delta, - deltaSwingTableIdx_TUP_B[delta] - ) - ); pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[ODM_RF_PATH_B] = pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_B]; pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_B] = @@ -272,29 +187,9 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) /* Record delta swing for mix mode power tracking */ pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = deltaSwingTableIdx_TUP_B[delta]; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "******Temp is higher and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = %d\n", - pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] - ) - ); } } else { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "deltaSwingTableIdx_TDOWN_A[%d] = %d\n", - delta, - deltaSwingTableIdx_TDOWN_A[delta] - ) - ); - pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[ODM_RF_PATH_A] = pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_A]; pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_A] = @@ -304,28 +199,7 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = -1 * deltaSwingTableIdx_TDOWN_A[delta]; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "******Temp is lower and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n", - pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] - ) - ); - if (c.RfPathCount > 1) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "deltaSwingTableIdx_TDOWN_B[%d] = %d\n", - delta, - deltaSwingTableIdx_TDOWN_B[delta] - ) - ); - pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[ODM_RF_PATH_B] = pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_B]; pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_B] = @@ -334,30 +208,10 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) /* Record delta swing for mix mode power tracking */ pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = -1 * deltaSwingTableIdx_TDOWN_B[delta]; - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "******Temp is lower and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = %d\n", - pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] - ) - ); } } for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "\n\n ================================ [Path-%c] Calculating PowerIndexOffset ================================\n", - (p == ODM_RF_PATH_A ? 'A' : 'B') - ) - ); - if ( pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[p] == pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[p] @@ -366,20 +220,6 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) else pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p] = pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[p] - pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[p]; /* Power Index Diff between 2 times Power Tracking */ - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "[Path-%c] PowerIndexOffset(%d) = DeltaPowerIndex(%d) - DeltaPowerIndexLast(%d)\n", - ( - p == ODM_RF_PATH_A ? 'A' : 'B'), - pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p], - pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[p], - pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[p] - ) - ); - pDM_Odm->RFCalibrateInfo.OFDM_index[p] = pDM_Odm->BbSwingIdxOfdmBase[p] + pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p]; @@ -394,87 +234,23 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) pDM_Odm->BbSwingIdxOfdm[p] = pDM_Odm->RFCalibrateInfo.OFDM_index[p]; - /* *************Print BB Swing Base and Index Offset************* */ - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "The 'CCK' final index(%d) = BaseIndex(%d) + PowerIndexOffset(%d)\n", - pDM_Odm->BbSwingIdxCck, - pDM_Odm->BbSwingIdxCckBase, - pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p] - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "The 'OFDM' final index(%d) = BaseIndex[%c](%d) + PowerIndexOffset(%d)\n", - pDM_Odm->BbSwingIdxOfdm[p], - (p == ODM_RF_PATH_A ? 'A' : 'B'), - pDM_Odm->BbSwingIdxOfdmBase[p], - pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p] - ) - ); - /* 4 7.1 Handle boundary conditions of index. */ if (pDM_Odm->RFCalibrateInfo.OFDM_index[p] > c.SwingTableSize_OFDM-1) pDM_Odm->RFCalibrateInfo.OFDM_index[p] = c.SwingTableSize_OFDM-1; else if (pDM_Odm->RFCalibrateInfo.OFDM_index[p] < OFDM_min_index) pDM_Odm->RFCalibrateInfo.OFDM_index[p] = OFDM_min_index; } - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ("\n\n ========================================================================================================\n") - ); if (pDM_Odm->RFCalibrateInfo.CCK_index > c.SwingTableSize_CCK-1) pDM_Odm->RFCalibrateInfo.CCK_index = c.SwingTableSize_CCK-1; /* else if (pDM_Odm->RFCalibrateInfo.CCK_index < 0) */ /* pDM_Odm->RFCalibrateInfo.CCK_index = 0; */ } else { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "The thermal meter is unchanged or TxPowerTracking OFF(%d): ThermalValue: %d , pDM_Odm->RFCalibrateInfo.ThermalValue: %d\n", - pDM_Odm->RFCalibrateInfo.TxPowerTrackControl, - ThermalValue, - pDM_Odm->RFCalibrateInfo.ThermalValue - ) - ); - for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++) pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p] = 0; } - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "TxPowerTracking: [CCK] Swing Current Index: %d, Swing Base Index: %d\n", - pDM_Odm->RFCalibrateInfo.CCK_index, - pDM_Odm->BbSwingIdxCckBase - ) - ); /* Print Swing base & current */ for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "TxPowerTracking: [OFDM] Swing Current Index: %d, Swing Base Index[%c]: %d\n", - pDM_Odm->RFCalibrateInfo.OFDM_index[p], - (p == ODM_RF_PATH_A ? 'A' : 'B'), - pDM_Odm->BbSwingIdxOfdmBase[p] - ) - ); } if ( @@ -490,106 +266,11 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) /* to increase TX power. Otherwise, EVM will be bad. */ /* */ /* 2012/04/25 MH Add for tx power tracking to set tx power in tx agc for 88E. */ - if (ThermalValue > pDM_Odm->RFCalibrateInfo.ThermalValue) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "Temperature Increasing(A): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", - pDM_Odm->RFCalibrateInfo.PowerIndexOffset[ODM_RF_PATH_A], - delta, - ThermalValue, - pHalData->EEPROMThermalMeter, - pDM_Odm->RFCalibrateInfo.ThermalValue - ) - ); - - if (c.RfPathCount > 1) - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "Temperature Increasing(B): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", - pDM_Odm->RFCalibrateInfo.PowerIndexOffset[ODM_RF_PATH_B], - delta, - ThermalValue, - pHalData->EEPROMThermalMeter, - pDM_Odm->RFCalibrateInfo.ThermalValue - ) - ); - - } else if (ThermalValue < pDM_Odm->RFCalibrateInfo.ThermalValue) { /* Low temperature */ - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "Temperature Decreasing(A): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", - pDM_Odm->RFCalibrateInfo.PowerIndexOffset[ODM_RF_PATH_A], - delta, - ThermalValue, - pHalData->EEPROMThermalMeter, - pDM_Odm->RFCalibrateInfo.ThermalValue - ) - ); - - if (c.RfPathCount > 1) - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "Temperature Decreasing(B): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", - pDM_Odm->RFCalibrateInfo.PowerIndexOffset[ODM_RF_PATH_B], - delta, - ThermalValue, - pHalData->EEPROMThermalMeter, - pDM_Odm->RFCalibrateInfo.ThermalValue - ) - ); - - } if (ThermalValue > pHalData->EEPROMThermalMeter) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "Temperature(%d) higher than PG value(%d)\n", - ThermalValue, - pHalData->EEPROMThermalMeter - ) - ); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ("**********Enter POWER Tracking MIX_MODE**********\n") - ); for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++) (*c.ODM_TxPwrTrackSetPwr)(pDM_Odm, MIX_MODE, p, 0); } else { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "Temperature(%d) lower than PG value(%d)\n", - ThermalValue, - pHalData->EEPROMThermalMeter - ) - ); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ("**********Enter POWER Tracking MIX_MODE**********\n") - ); for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++) (*c.ODM_TxPwrTrackSetPwr)(pDM_Odm, MIX_MODE, p, Indexforchannel); } @@ -599,26 +280,9 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++) pDM_Odm->BbSwingIdxOfdmBase[p] = pDM_Odm->BbSwingIdxOfdm[p]; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ( - "pDM_Odm->RFCalibrateInfo.ThermalValue = %d ThermalValue = %d\n", - pDM_Odm->RFCalibrateInfo.ThermalValue, - ThermalValue - ) - ); - /* Record last Power Tracking Thermal Value */ pDM_Odm->RFCalibrateInfo.ThermalValue = ThermalValue; } - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ("<===ODM_TXPowerTrackingCallback_ThermalMeter\n") - ); - pDM_Odm->RFCalibrateInfo.TXPowercount = 0; } diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c index c70b9cf2da32..8121b8eb45b6 100644 --- a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c +++ b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c @@ -69,7 +69,7 @@ static void setIqkMatrix_8723B( ele_D = (OFDMSwingTable_New[OFDM_index] & 0xFFC00000)>>22; /* new element A = element D x X */ - if ((IqkResult_X != 0) && (*(pDM_Odm->pBandType) == ODM_BAND_2_4G)) { + if (IqkResult_X != 0) { if ((IqkResult_X & 0x00000200) != 0) /* consider minus */ IqkResult_X = IqkResult_X | 0xFFFFFC00; ele_A = ((IqkResult_X * ele_D)>>8)&0x000003FF; @@ -129,9 +129,6 @@ static void setIqkMatrix_8723B( break; } } - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, ("TxPwrTracking path B: X = 0x%x, Y = 0x%x ele_A = 0x%x ele_C = 0x%x ele_D = 0x%x 0xeb4 = 0x%x 0xebc = 0x%x\n", - (u32)IqkResult_X, (u32)IqkResult_Y, (u32)ele_A, (u32)ele_C, (u32)ele_D, (u32)IqkResult_X, (u32)IqkResult_Y)); } @@ -210,8 +207,6 @@ void ODM_TxPwrTrackSetPwr_8723B( } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, ("===>ODM_TxPwrTrackSetPwr8723B\n")); - if (TxRate != 0xFF) { /* 2 CCK */ if ((TxRate >= MGN_1M) && (TxRate <= MGN_11M)) @@ -233,13 +228,10 @@ void ODM_TxPwrTrackSetPwr_8723B( else PwrTrackingLimit_OFDM = pDM_Odm->DefaultOfdmIndex; /* Default OFDM index = 30 */ } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, ("TxRate = 0x%x, PwrTrackingLimit =%d\n", TxRate, PwrTrackingLimit_OFDM)); if (Method == TXAGC) { struct adapter *Adapter = pDM_Odm->Adapter; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, ("odm_TxPwrTrackSetPwr8723B CH =%d\n", *(pDM_Odm->pChannel))); - pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = pDM_Odm->Absolute_OFDMSwingIdx[RFPath]; pDM_Odm->Modify_TxAGC_Flag_PathA = true; @@ -270,10 +262,6 @@ void ODM_TxPwrTrackSetPwr_8723B( setCCKFilterCoefficient(pDM_Odm, Final_CCK_Swing_Index); } else if (Method == MIX_MODE) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ("pDM_Odm->DefaultOfdmIndex =%d, pDM_Odm->DefaultCCKIndex =%d, pDM_Odm->Absolute_OFDMSwingIdx[RFPath]=%d, RF_Path = %d\n", - pDM_Odm->DefaultOfdmIndex, pDM_Odm->DefaultCckIndex, pDM_Odm->Absolute_OFDMSwingIdx[RFPath], RFPath)); - Final_OFDM_Swing_Index = pDM_Odm->DefaultOfdmIndex + pDM_Odm->Absolute_OFDMSwingIdx[RFPath]; Final_CCK_Swing_Index = pDM_Odm->DefaultCckIndex + pDM_Odm->Absolute_OFDMSwingIdx[RFPath]; @@ -287,10 +275,6 @@ void ODM_TxPwrTrackSetPwr_8723B( pDM_Odm->Modify_TxAGC_Flag_PathA = true; PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, OFDM); PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, HT_MCS0_MCS7); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ("******Path_A Over BBSwing Limit , PwrTrackingLimit = %d , Remnant TxAGC Value = %d\n", - PwrTrackingLimit_OFDM, pDM_Odm->Remnant_OFDMSwingIdx[RFPath])); } else if (Final_OFDM_Swing_Index <= 0) { pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = Final_OFDM_Swing_Index; @@ -301,26 +285,16 @@ void ODM_TxPwrTrackSetPwr_8723B( pDM_Odm->Modify_TxAGC_Flag_PathA = true; PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, OFDM); PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, HT_MCS0_MCS7); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ("******Path_A Lower then BBSwing lower bound 0 , Remnant TxAGC Value = %d\n", - pDM_Odm->Remnant_OFDMSwingIdx[RFPath])); } else { setIqkMatrix_8723B(pDM_Odm, Final_OFDM_Swing_Index, RFPath, pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0], pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ("******Path_A Compensate with BBSwing , Final_OFDM_Swing_Index = %d\n", Final_OFDM_Swing_Index)); - if (pDM_Odm->Modify_TxAGC_Flag_PathA) { /* If TxAGC has changed, reset TxAGC again */ pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = 0; PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, OFDM); PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, HT_MCS0_MCS7); pDM_Odm->Modify_TxAGC_Flag_PathA = false; - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ("******Path_A pDM_Odm->Modify_TxAGC_Flag = false\n")); } } @@ -329,30 +303,18 @@ void ODM_TxPwrTrackSetPwr_8723B( setCCKFilterCoefficient(pDM_Odm, PwrTrackingLimit_CCK); pDM_Odm->Modify_TxAGC_Flag_PathA_CCK = true; PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, CCK); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ("******Path_A CCK Over Limit , PwrTrackingLimit_CCK = %d , pDM_Odm->Remnant_CCKSwingIdx = %d\n", PwrTrackingLimit_CCK, pDM_Odm->Remnant_CCKSwingIdx)); } else if (Final_CCK_Swing_Index <= 0) { /* Lowest CCK Index = 0 */ pDM_Odm->Remnant_CCKSwingIdx = Final_CCK_Swing_Index; setCCKFilterCoefficient(pDM_Odm, 0); pDM_Odm->Modify_TxAGC_Flag_PathA_CCK = true; PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, CCK); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ("******Path_A CCK Under Limit , PwrTrackingLimit_CCK = %d , pDM_Odm->Remnant_CCKSwingIdx = %d\n", 0, pDM_Odm->Remnant_CCKSwingIdx)); } else { setCCKFilterCoefficient(pDM_Odm, Final_CCK_Swing_Index); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ("******Path_A CCK Compensate with BBSwing , Final_CCK_Swing_Index = %d\n", Final_CCK_Swing_Index)); - if (pDM_Odm->Modify_TxAGC_Flag_PathA_CCK) { /* If TxAGC has changed, reset TxAGC again */ pDM_Odm->Remnant_CCKSwingIdx = 0; PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, CCK); pDM_Odm->Modify_TxAGC_Flag_PathA_CCK = false; - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ("******Path_A pDM_Odm->Modify_TxAGC_Flag_CCK = false\n")); } } } else @@ -385,22 +347,7 @@ static void GetDeltaSwingTable_8723B( *TemperatureUP_B = pRFCalibrateInfo->DeltaSwingTableIdx_2GB_P; *TemperatureDOWN_B = pRFCalibrateInfo->DeltaSwingTableIdx_2GB_N; } - } /*else if (36 <= channel && channel <= 64) { - *TemperatureUP_A = pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P[0]; - *TemperatureDOWN_A = pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N[0]; - *TemperatureUP_B = pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P[0]; - *TemperatureDOWN_B = pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N[0]; - } else if (100 <= channel && channel <= 140) { - *TemperatureUP_A = pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P[1]; - *TemperatureDOWN_A = pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N[1]; - *TemperatureUP_B = pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P[1]; - *TemperatureDOWN_B = pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N[1]; - } else if (149 <= channel && channel <= 173) { - *TemperatureUP_A = pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P[2]; - *TemperatureDOWN_A = pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N[2]; - *TemperatureUP_B = pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P[2]; - *TemperatureDOWN_B = pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N[2]; - }*/else { + } else { *TemperatureUP_A = (u8 *)DeltaSwingTableIdx_2GA_P_8188E; *TemperatureDOWN_A = (u8 *)DeltaSwingTableIdx_2GA_N_8188E; *TemperatureUP_B = (u8 *)DeltaSwingTableIdx_2GA_P_8188E; @@ -442,8 +389,6 @@ static u8 phy_PathA_IQK_8723B( /* Save RF Path */ Path_SEL_BB = PHY_QueryBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A IQK!\n")); - /* leave IQK mode */ PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x000000); @@ -461,7 +406,6 @@ static u8 phy_PathA_IQK_8723B( PHY_SetBBReg(pDM_Odm->Adapter, rTx_IQK, bMaskDWord, 0x01007c00); PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK, bMaskDWord, 0x01004800); /* path-A IQK setting */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path-A IQK setting!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rTx_IQK_Tone_A, bMaskDWord, 0x18008c1c); PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK_Tone_A, bMaskDWord, 0x38008c1c); PHY_SetBBReg(pDM_Odm->Adapter, rTx_IQK_Tone_B, bMaskDWord, 0x38008c1c); @@ -473,7 +417,6 @@ static u8 phy_PathA_IQK_8723B( PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK_PI_B, bMaskDWord, 0x28110000); /* LO calibration setting */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LO calibration setting!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Rsp, bMaskDWord, 0x00462911); /* enter IQK mode */ @@ -491,12 +434,10 @@ static u8 phy_PathA_IQK_8723B( PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00000800); /* One shot, path A LOK & IQK */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("One shot, path A LOK & IQK!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf9000000); PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf8000000); /* delay x ms */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Delay %d ms for One shot, path A LOK & IQK.\n", IQK_DELAY_TIME_8723B)); */ /* PlatformStallExecution(IQK_DELAY_TIME_8723B*1000); */ mdelay(IQK_DELAY_TIME_8723B); @@ -513,11 +454,6 @@ static u8 phy_PathA_IQK_8723B( regEAC = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord); regE94 = PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_Before_IQK_A, bMaskDWord); regE9C = PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_After_IQK_A, bMaskDWord); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xeac = 0x%x\n", regEAC)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe94 = 0x%x, 0xe9c = 0x%x\n", regE94, regE9C)); - /* monitor image power before & after IQK */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe90(before IQK) = 0x%x, 0xe98(afer IQK) = 0x%x\n", - PHY_QueryBBReg(pDM_Odm->Adapter, 0xe90, bMaskDWord), PHY_QueryBBReg(pDM_Odm->Adapter, 0xe98, bMaskDWord))); /* Allen 20131125 */ @@ -550,18 +486,13 @@ static u8 phy_PathA_RxIQK8723B( struct hal_com_data *pHalData = GET_HAL_DATA(padapter); struct dm_odm_t *pDM_Odm = &pHalData->odmpriv; -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A Rx IQK!\n")); */ - /* Save RF Path */ Path_SEL_BB = PHY_QueryBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord); /* leave IQK mode */ PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x000000); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A RX IQK:Get TXIMR setting\n")); /* 1 Get TXIMR setting */ /* modify RXIQK mode table */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path-A Rx IQK modify RXIQK mode table!\n")); */ PHY_SetRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, RF_WE_LUT, 0x80000, 0x1); PHY_SetRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, RF_RCK_OS, bRFRegOffsetMask, 0x18000); PHY_SetRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, RF_TXPA_G1, bRFRegOffsetMask, 0x0001f); @@ -587,7 +518,6 @@ static u8 phy_PathA_RxIQK8723B( PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK_PI_B, bMaskDWord, 0x28110000); /* LO calibration setting */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LO calibration setting!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Rsp, bMaskDWord, 0x0046a911); /* enter IQK mode */ @@ -605,12 +535,10 @@ static u8 phy_PathA_RxIQK8723B( PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00000800); /* One shot, path A LOK & IQK */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("One shot, path A LOK & IQK!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf9000000); PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf8000000); /* delay x ms */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Delay %d ms for One shot, path A LOK & IQK.\n", IQK_DELAY_TIME_8723B)); */ /* PlatformStallExecution(IQK_DELAY_TIME_8723B*1000); */ mdelay(IQK_DELAY_TIME_8723B); @@ -626,11 +554,6 @@ static u8 phy_PathA_RxIQK8723B( regEAC = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord); regE94 = PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_Before_IQK_A, bMaskDWord); regE9C = PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_After_IQK_A, bMaskDWord); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xeac = 0x%x\n", regEAC)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe94 = 0x%x, 0xe9c = 0x%x\n", regE94, regE9C)); - /* monitor image power before & after IQK */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe90(before IQK) = 0x%x, 0xe98(afer IQK) = 0x%x\n", - PHY_QueryBBReg(pDM_Odm->Adapter, 0xe90, bMaskDWord), PHY_QueryBBReg(pDM_Odm->Adapter, 0xe98, bMaskDWord))); /* Allen 20131125 */ tmp = (regE9C & 0x03FF0000)>>16; @@ -651,14 +574,8 @@ static u8 phy_PathA_RxIQK8723B( u4tmp = 0x80007C00 | (regE94&0x3FF0000) | ((regE9C&0x3FF0000) >> 16); PHY_SetBBReg(pDM_Odm->Adapter, rTx_IQK, bMaskDWord, u4tmp); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe40 = 0x%x u4tmp = 0x%x\n", PHY_QueryBBReg(pDM_Odm->Adapter, rTx_IQK, bMaskDWord), u4tmp)); - - - /* 1 RX IQK */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A RX IQK\n")); /* modify RXIQK mode table */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path-A Rx IQK modify RXIQK mode table 2!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x000000); PHY_SetRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, RF_WE_LUT, 0x80000, 0x1); PHY_SetRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, RF_RCK_OS, bRFRegOffsetMask, 0x18000); @@ -688,7 +605,6 @@ static u8 phy_PathA_RxIQK8723B( PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK_PI_B, bMaskDWord, 0x28110000); /* LO calibration setting */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LO calibration setting!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Rsp, bMaskDWord, 0x0046a8d1); /* enter IQK mode */ @@ -706,12 +622,10 @@ static u8 phy_PathA_RxIQK8723B( PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00000800); /* One shot, path A LOK & IQK */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("One shot, path A LOK & IQK!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf9000000); PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf8000000); /* delay x ms */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Delay %d ms for One shot, path A LOK & IQK.\n", IQK_DELAY_TIME_88E)); */ /* PlatformStallExecution(IQK_DELAY_TIME_8723B*1000); */ mdelay(IQK_DELAY_TIME_8723B); @@ -726,11 +640,6 @@ static u8 phy_PathA_RxIQK8723B( /* Check failed */ regEAC = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord); regEA4 = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_Before_IQK_A_2, bMaskDWord); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xeac = 0x%x\n", regEAC)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xea4 = 0x%x, 0xeac = 0x%x\n", regEA4, regEAC)); - /* monitor image power before & after IQK */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xea0(before IQK) = 0x%x, 0xea8(afer IQK) = 0x%x\n", - PHY_QueryBBReg(pDM_Odm->Adapter, 0xea0, bMaskDWord), PHY_QueryBBReg(pDM_Odm->Adapter, 0xea8, bMaskDWord))); /* PA/PAD controlled by 0x0 */ /* leave IQK mode */ @@ -751,8 +660,7 @@ static u8 phy_PathA_RxIQK8723B( (tmp < 0xf) ) result |= 0x02; - else /* if Tx not OK, ignore Rx */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A Rx IQK fail!!\n")); + return result; } @@ -764,8 +672,6 @@ static u8 phy_PathB_IQK_8723B(struct adapter *padapter) struct hal_com_data *pHalData = GET_HAL_DATA(padapter); struct dm_odm_t *pDM_Odm = &pHalData->odmpriv; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B IQK!\n")); - /* Save RF Path */ Path_SEL_BB = PHY_QueryBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord); @@ -788,7 +694,6 @@ static u8 phy_PathB_IQK_8723B(struct adapter *padapter) PHY_SetBBReg(pDM_Odm->Adapter, rTx_IQK, bMaskDWord, 0x01007c00); PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK, bMaskDWord, 0x01004800); /* path-A IQK setting */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path-B IQK setting!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rTx_IQK_Tone_A, bMaskDWord, 0x18008c1c); PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK_Tone_A, bMaskDWord, 0x38008c1c); PHY_SetBBReg(pDM_Odm->Adapter, rTx_IQK_Tone_B, bMaskDWord, 0x38008c1c); @@ -801,7 +706,6 @@ static u8 phy_PathB_IQK_8723B(struct adapter *padapter) PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK_PI_B, bMaskDWord, 0x28110000); /* LO calibration setting */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LO calibration setting!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Rsp, bMaskDWord, 0x00462911); /* enter IQK mode */ @@ -815,12 +719,10 @@ static u8 phy_PathB_IQK_8723B(struct adapter *padapter) PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00000800); /* One shot, path B LOK & IQK */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("One shot, path B LOK & IQK!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf9000000); PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf8000000); /* delay x ms */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Delay %d ms for One shot, path B LOK & IQK.\n", IQK_DELAY_TIME_88E)); */ /* PlatformStallExecution(IQK_DELAY_TIME_88E*1000); */ mdelay(IQK_DELAY_TIME_8723B); @@ -832,18 +734,10 @@ static u8 phy_PathB_IQK_8723B(struct adapter *padapter) /* leave IQK mode */ PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x000000); -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0x948 = 0x%x\n", PHY_QueryBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord))); */ - - /* Check failed */ regEAC = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord); regE94 = PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_Before_IQK_A, bMaskDWord); regE9C = PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_After_IQK_A, bMaskDWord); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xeac = 0x%x\n", regEAC)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe94 = 0x%x, 0xe9c = 0x%x\n", regE94, regE9C)); - /* monitor image power before & after IQK */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe90(before IQK) = 0x%x, 0xe98(afer IQK) = 0x%x\n", - PHY_QueryBBReg(pDM_Odm->Adapter, 0xe90, bMaskDWord), PHY_QueryBBReg(pDM_Odm->Adapter, 0xe98, bMaskDWord))); /* Allen 20131125 */ tmp = (regE9C & 0x03FF0000)>>16; @@ -871,8 +765,6 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) struct hal_com_data *pHalData = GET_HAL_DATA(padapter); struct dm_odm_t *pDM_Odm = &pHalData->odmpriv; -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B Rx IQK!\n")); */ - /* Save RF Path */ Path_SEL_BB = PHY_QueryBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord); /* leave IQK mode */ @@ -880,11 +772,7 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) /* switch to path B */ PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, 0x00000280); - - /* 1 Get TXIMR setting */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B RX IQK:Get TXIMR setting!\n")); /* modify RXIQK mode table */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path-A Rx IQK modify RXIQK mode table!\n")); */ PHY_SetRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, RF_WE_LUT, 0x80000, 0x1); PHY_SetRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, RF_RCK_OS, bRFRegOffsetMask, 0x18000); PHY_SetRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, RF_TXPA_G1, bRFRegOffsetMask, 0x0001f); @@ -912,7 +800,6 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK_PI_B, bMaskDWord, 0x28110000); /* LO calibration setting */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LO calibration setting!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Rsp, bMaskDWord, 0x0046a911); /* enter IQK mode */ @@ -926,13 +813,11 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00000800); /* One shot, path B TXIQK @ RXIQK */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("One shot, path B LOK & IQK!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf9000000); PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf8000000); /* delay x ms */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Delay %d ms for One shot, path A LOK & IQK.\n", IQK_DELAY_TIME_88E)); */ /* PlatformStallExecution(IQK_DELAY_TIME_88E*1000); */ mdelay(IQK_DELAY_TIME_8723B); @@ -948,18 +833,11 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) regEAC = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord); regE94 = PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_Before_IQK_A, bMaskDWord); regE9C = PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_After_IQK_A, bMaskDWord); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xeac = 0x%x\n", regEAC)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe94 = 0x%x, 0xe9c = 0x%x\n", regE94, regE9C)); - /* monitor image power before & after IQK */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe90(before IQK) = 0x%x, 0xe98(afer IQK) = 0x%x\n", - PHY_QueryBBReg(pDM_Odm->Adapter, 0xe90, bMaskDWord), PHY_QueryBBReg(pDM_Odm->Adapter, 0xe98, bMaskDWord))); /* Allen 20131125 */ tmp = (regE9C & 0x03FF0000)>>16; -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("tmp1 = 0x%x\n", tmp)); */ if ((tmp & 0x200) > 0) tmp = 0x400 - tmp; -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("tmp2 = 0x%x\n", tmp)); */ if ( !(regEAC & BIT28) && @@ -975,10 +853,6 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) u4tmp = 0x80007C00 | (regE94&0x3FF0000) | ((regE9C&0x3FF0000) >> 16); PHY_SetBBReg(pDM_Odm->Adapter, rTx_IQK, bMaskDWord, u4tmp); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe40 = 0x%x u4tmp = 0x%x\n", PHY_QueryBBReg(pDM_Odm->Adapter, rTx_IQK, bMaskDWord), u4tmp)); - - /* 1 RX IQK */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B RX IQK\n")); /* modify RXIQK mode table */ /* 20121009, Kordan> RF Mode = 3 */ @@ -1013,7 +887,6 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK_PI_B, bMaskDWord, 0x28110000); /* LO calibration setting */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LO calibration setting!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Rsp, bMaskDWord, 0x0046a8d1); /* enter IQK mode */ @@ -1027,12 +900,10 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00000800); /* One shot, path B LOK & IQK */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("One shot, path B LOK & IQK!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf9000000); PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf8000000); /* delay x ms */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Delay %d ms for One shot, path A LOK & IQK.\n", IQK_DELAY_TIME_88E)); */ /* PlatformStallExecution(IQK_DELAY_TIME_88E*1000); */ mdelay(IQK_DELAY_TIME_8723B); @@ -1048,12 +919,6 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) regEAC = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord); regEA4 = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_Before_IQK_A_2, bMaskDWord); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xeac = 0x%x\n", regEAC)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xea4 = 0x%x, 0xeac = 0x%x\n", regEA4, regEAC)); - /* monitor image power before & after IQK */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xea0(before IQK) = 0x%x, 0xea8(afer IQK) = 0x%x\n", - PHY_QueryBBReg(pDM_Odm->Adapter, 0xea0, bMaskDWord), PHY_QueryBBReg(pDM_Odm->Adapter, 0xea8, bMaskDWord))); - /* PA/PAD controlled by 0x0 */ /* leave IQK mode */ /* PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, 0xffffff00, 0x00000000); */ @@ -1075,8 +940,6 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) (tmp < 0xf) ) result |= 0x02; - else - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B Rx IQK fail!!\n")); return result; } @@ -1096,8 +959,6 @@ static void _PHY_PathAFillIQKMatrix8723B( struct odm_rf_cal_t *pRFCalibrateInfo = &pDM_Odm->RFCalibrateInfo; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A IQ Calibration %s !\n", (bIQKOK)?"Success":"Failed")); - if (final_candidate == 0xFF) return; @@ -1108,7 +969,6 @@ static void _PHY_PathAFillIQKMatrix8723B( if ((X & 0x00000200) != 0) X = X | 0xFFFFFC00; TX0_A = (X * Oldval_0) >> 8; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("X = 0x%x, TX0_A = 0x%x, Oldval_0 0x%x\n", X, TX0_A, Oldval_0)); PHY_SetBBReg(pDM_Odm->Adapter, rOFDM0_XATxIQImbalance, 0x3FF, TX0_A); PHY_SetBBReg(pDM_Odm->Adapter, rOFDM0_ECCAThreshold, BIT(31), ((X*Oldval_0>>7) & 0x1)); @@ -1119,7 +979,6 @@ static void _PHY_PathAFillIQKMatrix8723B( /* 2 Tx IQC */ TX0_C = (Y * Oldval_0) >> 8; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Y = 0x%x, TX = 0x%x\n", Y, TX0_C)); PHY_SetBBReg(pDM_Odm->Adapter, rOFDM0_XCTxAFE, 0xF0000000, ((TX0_C&0x3C0)>>6)); pRFCalibrateInfo->TxIQC_8723B[PATH_S1][IDX_0xC94][KEY] = rOFDM0_XCTxAFE; pRFCalibrateInfo->TxIQC_8723B[PATH_S1][IDX_0xC94][VAL] = PHY_QueryBBReg(pDM_Odm->Adapter, rOFDM0_XCTxAFE, bMaskDWord); @@ -1133,8 +992,6 @@ static void _PHY_PathAFillIQKMatrix8723B( pRFCalibrateInfo->TxIQC_8723B[PATH_S1][IDX_0xC4C][VAL] = PHY_QueryBBReg(pDM_Odm->Adapter, rOFDM0_ECCAThreshold, bMaskDWord); if (bTxOnly) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("_PHY_PathAFillIQKMatrix8723B only Tx OK\n")); - /* <20130226, Kordan> Saving RxIQC, otherwise not initialized. */ pRFCalibrateInfo->RxIQC_8723B[PATH_S1][IDX_0xCA0][KEY] = rOFDM0_RxIQExtAnta; pRFCalibrateInfo->RxIQC_8723B[PATH_S1][IDX_0xCA0][VAL] = 0xfffffff & PHY_QueryBBReg(pDM_Odm->Adapter, rOFDM0_RxIQExtAnta, bMaskDWord); @@ -1176,8 +1033,6 @@ static void _PHY_PathBFillIQKMatrix8723B( struct odm_rf_cal_t *pRFCalibrateInfo = &pDM_Odm->RFCalibrateInfo; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B IQ Calibration %s !\n", (bIQKOK)?"Success":"Failed")); - if (final_candidate == 0xFF) return; @@ -1188,7 +1043,6 @@ static void _PHY_PathBFillIQKMatrix8723B( if ((X & 0x00000200) != 0) X = X | 0xFFFFFC00; TX1_A = (X * Oldval_1) >> 8; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("X = 0x%x, TX1_A = 0x%x\n", X, TX1_A)); PHY_SetBBReg(pDM_Odm->Adapter, rOFDM0_XBTxIQImbalance, 0x3FF, TX1_A); @@ -1199,7 +1053,6 @@ static void _PHY_PathBFillIQKMatrix8723B( Y = Y | 0xFFFFFC00; TX1_C = (Y * Oldval_1) >> 8; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Y = 0x%x, TX1_C = 0x%x\n", Y, TX1_C)); /* 2 Tx IQC */ PHY_SetBBReg(pDM_Odm->Adapter, rOFDM0_XDTxAFE, 0xF0000000, ((TX1_C&0x3C0)>>6)); @@ -1217,8 +1070,6 @@ static void _PHY_PathBFillIQKMatrix8723B( pRFCalibrateInfo->TxIQC_8723B[PATH_S0][IDX_0xC4C][VAL] = PHY_QueryBBReg(pDM_Odm->Adapter, rOFDM0_ECCAThreshold, bMaskDWord); if (bTxOnly) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("_PHY_PathBFillIQKMatrix8723B only Tx OK\n")); - pRFCalibrateInfo->RxIQC_8723B[PATH_S0][IDX_0xC14][KEY] = rOFDM0_XARxIQImbalance; /* pRFCalibrateInfo->RxIQC_8723B[PATH_S0][IDX_0xC14][VAL] = PHY_QueryBBReg(pDM_Odm->Adapter, rOFDM0_XARxIQImbalance, bMaskDWord); */ pRFCalibrateInfo->RxIQC_8723B[PATH_S0][IDX_0xC14][VAL] = 0x40000100; @@ -1297,7 +1148,6 @@ static void _PHY_SaveADDARegisters8723B( if (!ODM_CheckPowerStatus(padapter)) return; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Save ADDA parameters.\n")); for (i = 0 ; i < RegisterNum ; i++) { ADDABackup[i] = PHY_QueryBBReg(pDM_Odm->Adapter, ADDAReg[i], bMaskDWord); } @@ -1312,7 +1162,6 @@ static void _PHY_SaveMACRegisters8723B( struct hal_com_data *pHalData = GET_HAL_DATA(padapter); struct dm_odm_t *pDM_Odm = &pHalData->odmpriv; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Save MAC parameters.\n")); for (i = 0 ; i < (IQK_MAC_REG_NUM - 1); i++) { MACBackup[i] = rtw_read8(pDM_Odm->Adapter, MACReg[i]); } @@ -1332,7 +1181,6 @@ static void _PHY_ReloadADDARegisters8723B( struct hal_com_data *pHalData = GET_HAL_DATA(padapter); struct dm_odm_t *pDM_Odm = &pHalData->odmpriv; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Reload ADDA power saving parameters !\n")); for (i = 0 ; i < RegiesterNum; i++) { PHY_SetBBReg(pDM_Odm->Adapter, ADDAReg[i], bMaskDWord, ADDABackup[i]); } @@ -1362,8 +1210,6 @@ static void _PHY_PathADDAOn8723B( struct hal_com_data *pHalData = GET_HAL_DATA(padapter); struct dm_odm_t *pDM_Odm = &pHalData->odmpriv; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("ADDA ON.\n")); - pathOn = 0x01c00014; if (!is2T) { pathOn = 0x01c00014; @@ -1386,8 +1232,6 @@ static void _PHY_MACSettingCalibration8723B( struct hal_com_data *pHalData = GET_HAL_DATA(padapter); struct dm_odm_t *pDM_Odm = &pHalData->odmpriv; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("MAC settings for Calibration.\n")); - rtw_write8(pDM_Odm->Adapter, MACReg[i], 0x3F); for (i = 1 ; i < (IQK_MAC_REG_NUM - 1); i++) { @@ -1540,17 +1384,12 @@ static void phy_IQCalibrate_8723B( /* u32 bbvalue; */ if (t == 0) { -/* bbvalue = PHY_QueryBBReg(pDM_Odm->Adapter, rFPGA0_RFMOD, bMaskDWord); */ -/* RT_DISP(FINIT, INIT_IQK, ("phy_IQCalibrate_8188E() ==>0x%08x\n", bbvalue)); */ - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQ Calibration for %s for %d times\n", (is2T ? "2T2R" : "1T1R"), t)); /* Save ADDA parameters, turn Path A ADDA on */ _PHY_SaveADDARegisters8723B(padapter, ADDA_REG, pDM_Odm->RFCalibrateInfo.ADDA_backup, IQK_ADDA_REG_NUM); _PHY_SaveMACRegisters8723B(padapter, IQK_MAC_REG, pDM_Odm->RFCalibrateInfo.IQK_MAC_backup); _PHY_SaveADDARegisters8723B(padapter, IQK_BB_REG_92C, pDM_Odm->RFCalibrateInfo.IQK_BB_backup, IQK_BB_REG_NUM); } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQ Calibration for %s for %d times\n", (is2T ? "2T2R" : "1T1R"), t)); _PHY_PathADDAOn8723B(padapter, ADDA_REG, is2T); @@ -1596,7 +1435,6 @@ static void phy_IQCalibrate_8723B( PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x000000); pDM_Odm->RFCalibrateInfo.TxLOK[ODM_RF_PATH_A] = PHY_QueryRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, 0x8, bRFRegOffsetMask); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A Tx IQK Success!!\n")); result[t][0] = (PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_Before_IQK_A, bMaskDWord)&0x3FF0000)>>16; result[t][1] = (PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_After_IQK_A, bMaskDWord)&0x3FF0000)>>16; break; @@ -1607,19 +1445,15 @@ static void phy_IQCalibrate_8723B( for (i = 0 ; i < retryCount ; i++) { PathAOK = phy_PathA_RxIQK8723B(padapter, is2T, RF_Path); if (PathAOK == 0x03) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A Rx IQK Success!!\n")); /* result[t][0] = (PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_Before_IQK_A, bMaskDWord)&0x3FF0000)>>16; */ /* result[t][1] = (PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_After_IQK_A, bMaskDWord)&0x3FF0000)>>16; */ result[t][2] = (PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_Before_IQK_A_2, bMaskDWord)&0x3FF0000)>>16; result[t][3] = (PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord)&0x3FF0000)>>16; break; - } else { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A Rx IQK Fail!!\n")); } } if (0x00 == PathAOK) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A IQK failed!!\n")); } /* path B IQK */ @@ -1633,7 +1467,6 @@ static void phy_IQCalibrate_8723B( PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x000000); pDM_Odm->RFCalibrateInfo.TxLOK[ODM_RF_PATH_B] = PHY_QueryRFReg(pDM_Odm->Adapter, ODM_RF_PATH_B, 0x8, bRFRegOffsetMask); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B Tx IQK Success!!\n")); result[t][4] = (PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_Before_IQK_A, bMaskDWord)&0x3FF0000)>>16; result[t][5] = (PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_After_IQK_A, bMaskDWord)&0x3FF0000)>>16; break; @@ -1644,25 +1477,18 @@ static void phy_IQCalibrate_8723B( for (i = 0 ; i < retryCount ; i++) { PathBOK = phy_PathB_RxIQK8723B(padapter, is2T); if (PathBOK == 0x03) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B Rx IQK Success!!\n")); /* result[t][0] = (PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_Before_IQK_A, bMaskDWord)&0x3FF0000)>>16; */ /* result[t][1] = (PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_After_IQK_A, bMaskDWord)&0x3FF0000)>>16; */ result[t][6] = (PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_Before_IQK_A_2, bMaskDWord)&0x3FF0000)>>16; result[t][7] = (PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord)&0x3FF0000)>>16; break; - } else { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B Rx IQK Fail!!\n")); } } /* Allen end */ - if (0x00 == PathBOK) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B IQK failed!!\n")); - } } /* Back to BB mode, load original value */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK:Back to BB mode, load original value!\n")); PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0); if (t != 0) { @@ -1692,7 +1518,6 @@ static void phy_IQCalibrate_8723B( PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK_Tone_A, bMaskDWord, 0x01008c00); } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("phy_IQCalibrate_8723B() <==\n")); } @@ -1789,7 +1614,7 @@ void PHY_IQCalibrate_8723B( s32 result[4][8]; /* last is final result */ u8 i, final_candidate; bool bPathAOK, bPathBOK; - s32 RegE94, RegE9C, RegEA4, RegEAC, RegEB4, RegEBC, RegEC4, RegECC, RegTmp = 0; + s32 RegE94, RegE9C, RegEA4, RegEB4, RegEBC, RegEC4, RegTmp = 0; bool is12simular, is13simular, is23simular; bool bSingleTone = false, bCarrierSuppression = false; u32 IQK_BB_REG_92C[IQK_BB_REG_NUM] = { @@ -1805,8 +1630,6 @@ void PHY_IQCalibrate_8723B( }; /* u32 Path_SEL_BB = 0; */ u32 GNT_BT_default; - u32 StartTime; - s32 ProgressingTime; if (!ODM_CheckPowerStatus(padapter)) return; @@ -1818,9 +1641,6 @@ void PHY_IQCalibrate_8723B( if (bSingleTone || bCarrierSuppression) return; -#if DISABLE_BB_RF - return; -#endif if (pDM_Odm->RFCalibrateInfo.bIQKInProgress) return; @@ -1868,12 +1688,9 @@ void PHY_IQCalibrate_8723B( } if (bReCovery) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("PHY_IQCalibrate_8723B: Return due to bReCovery!\n")); _PHY_ReloadADDARegisters8723B(padapter, IQK_BB_REG_92C, pDM_Odm->RFCalibrateInfo.IQK_BB_backup_recover, 9); return; } - StartTime = jiffies; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK:Start!!!\n")); /* save default GNT_BT */ GNT_BT_default = PHY_QueryBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord); @@ -1908,7 +1725,6 @@ void PHY_IQCalibrate_8723B( is12simular = phy_SimularityCompare_8723B(padapter, result, 0, 1); if (is12simular) { final_candidate = 0; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: is12simular final_candidate is %x\n", final_candidate)); break; } } @@ -1917,7 +1733,6 @@ void PHY_IQCalibrate_8723B( is13simular = phy_SimularityCompare_8723B(padapter, result, 0, 2); if (is13simular) { final_candidate = 0; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: is13simular final_candidate is %x\n", final_candidate)); break; } @@ -1925,7 +1740,6 @@ void PHY_IQCalibrate_8723B( is23simular = phy_SimularityCompare_8723B(padapter, result, 1, 2); if (is23simular) { final_candidate = 1; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: is23simular final_candidate is %x\n", final_candidate)); } else { for (i = 0; i < 8; i++) RegTmp += result[3][i]; @@ -1942,29 +1756,20 @@ void PHY_IQCalibrate_8723B( RegE94 = result[i][0]; RegE9C = result[i][1]; RegEA4 = result[i][2]; - RegEAC = result[i][3]; RegEB4 = result[i][4]; RegEBC = result[i][5]; RegEC4 = result[i][6]; - RegECC = result[i][7]; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: RegE94 =%x RegE9C =%x RegEA4 =%x RegEAC =%x RegEB4 =%x RegEBC =%x RegEC4 =%x RegECC =%x\n ", RegE94, RegE9C, RegEA4, RegEAC, RegEB4, RegEBC, RegEC4, RegECC)); } if (final_candidate != 0xff) { pDM_Odm->RFCalibrateInfo.RegE94 = RegE94 = result[final_candidate][0]; pDM_Odm->RFCalibrateInfo.RegE9C = RegE9C = result[final_candidate][1]; RegEA4 = result[final_candidate][2]; - RegEAC = result[final_candidate][3]; pDM_Odm->RFCalibrateInfo.RegEB4 = RegEB4 = result[final_candidate][4]; pDM_Odm->RFCalibrateInfo.RegEBC = RegEBC = result[final_candidate][5]; RegEC4 = result[final_candidate][6]; - RegECC = result[final_candidate][7]; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: final_candidate is %x\n", final_candidate)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: RegE94 =%x RegE9C =%x RegEA4 =%x RegEAC =%x RegEB4 =%x RegEBC =%x RegEC4 =%x RegECC =%x\n ", RegE94, RegE9C, RegEA4, RegEAC, RegEB4, RegEBC, RegEC4, RegECC)); bPathAOK = bPathBOK = true; } else { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: FAIL use default value\n")); - pDM_Odm->RFCalibrateInfo.RegE94 = pDM_Odm->RFCalibrateInfo.RegEB4 = 0x100; /* X default value */ pDM_Odm->RFCalibrateInfo.RegE9C = pDM_Odm->RFCalibrateInfo.RegEBC = 0x0; /* Y default value */ } @@ -1985,7 +1790,6 @@ void PHY_IQCalibrate_8723B( pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[0].Value[0][i] = result[final_candidate][i]; pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[0].bIQKDone = true; } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("\nIQK OK Indexforchannel %d.\n", 0)); _PHY_SaveADDARegisters8723B(padapter, IQK_BB_REG_92C, pDM_Odm->RFCalibrateInfo.IQK_BB_backup_recover, 9); @@ -2015,12 +1819,6 @@ void PHY_IQCalibrate_8723B( } pDM_Odm->RFCalibrateInfo.bIQKInProgress = false; - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK finished\n")); - ProgressingTime = jiffies_to_msecs(jiffies - StartTime); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK ProgressingTime = %d\n", ProgressingTime)); - - } @@ -2028,12 +1826,6 @@ void PHY_LCCalibrate_8723B(struct dm_odm_t *pDM_Odm) { bool bSingleTone = false, bCarrierSuppression = false; u32 timeout = 2000, timecount = 0; - u32 StartTime; - s32 ProgressingTime; - -#if DISABLE_BB_RF - return; -#endif if (!(pDM_Odm->SupportAbility & ODM_RF_CALIBRATION)) return; @@ -2042,7 +1834,6 @@ void PHY_LCCalibrate_8723B(struct dm_odm_t *pDM_Odm) if (bSingleTone || bCarrierSuppression) return; - StartTime = jiffies; while (*(pDM_Odm->pbScanInProcess) && timecount < timeout) { mdelay(50); timecount += 50; @@ -2055,8 +1846,4 @@ void PHY_LCCalibrate_8723B(struct dm_odm_t *pDM_Odm) pDM_Odm->RFCalibrateInfo.bLCKInProgress = false; - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LCK:Finish!!!interface %d\n", pDM_Odm->InterfaceIndex)); - ProgressingTime = jiffies_to_msecs(jiffies - StartTime); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LCK ProgressingTime = %d\n", ProgressingTime)); } diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c index 5802ed4c6f82..3b0573885dce 100644 --- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c +++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c @@ -17,7 +17,6 @@ struct btc_coexist GLBtCoexist; static u8 GLBtcWiFiInScanState; static u8 GLBtcWiFiInIQKState; -u32 GLBtcDbgType[BTC_MSG_MAX]; static u8 GLBtcDbgBuf[BT_TMP_BUF_SIZE]; struct btcdbginfo { /* _btcoexdbginfo */ @@ -75,32 +74,6 @@ static u8 halbtcoutsrc_IsBtCoexistAvailable(struct btc_coexist *pBtCoexist) return true; } -static void halbtcoutsrc_DbgInit(void) -{ - u8 i; - - for (i = 0; i < BTC_MSG_MAX; i++) - GLBtcDbgType[i] = 0; - - GLBtcDbgType[BTC_MSG_INTERFACE] = \ -/* INTF_INIT | */ -/* INTF_NOTIFY | */ - 0; - - GLBtcDbgType[BTC_MSG_ALGORITHM] = \ -/* ALGO_BT_RSSI_STATE | */ -/* ALGO_WIFI_RSSI_STATE | */ -/* ALGO_BT_MONITOR | */ -/* ALGO_TRACE | */ -/* ALGO_TRACE_FW | */ -/* ALGO_TRACE_FW_DETAIL | */ -/* ALGO_TRACE_FW_EXEC | */ -/* ALGO_TRACE_SW | */ -/* ALGO_TRACE_SW_DETAIL | */ -/* ALGO_TRACE_SW_EXEC | */ - 0; -} - static void halbtcoutsrc_LeaveLps(struct btc_coexist *pBtCoexist) { struct adapter *padapter; @@ -131,9 +104,6 @@ static void halbtcoutsrc_NormalLps(struct btc_coexist *pBtCoexist) { struct adapter *padapter; - - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Normal LPS behavior!!!\n")); - padapter = pBtCoexist->Adapter; if (pBtCoexist->btInfo.bBtCtrlLps) { @@ -398,10 +368,6 @@ static u8 halbtcoutsrc_Get(void *pBtcContext, u8 getType, void *pOutBuf) *pu8 = false; break; - case BTC_GET_BL_WIFI_UNDER_5G: - *pu8 = pHalData->CurrentBandType == 1; - break; - case BTC_GET_BL_WIFI_AP_MODE_ENABLE: *pu8 = check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE); break; @@ -922,8 +888,6 @@ void hal_btcoex_Initialize(void *padapter) /* pBtCoexist->statistics.cntBind++; */ - halbtcoutsrc_DbgInit(); - pBtCoexist->chipInterface = BTC_INTF_SDIO; EXhalbtcoutsrc_BindBtCoexWithAdapter(padapter); @@ -1481,10 +1445,6 @@ u32 hal_btcoex_GetRaMask(struct adapter *padapter) void hal_btcoex_RecordPwrMode(struct adapter *padapter, u8 *pCmdBuf, u8 cmdLen) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], FW write pwrModeCmd = 0x%04x%08x\n", - pCmdBuf[0] << 8 | pCmdBuf[1], - pCmdBuf[2] << 24 | pCmdBuf[3] << 16 | pCmdBuf[4] << 8 | pCmdBuf[5])); - memcpy(GLBtCoexist.pwrModeVal, pCmdBuf, cmdLen); } @@ -1499,138 +1459,3 @@ void hal_btcoex_DisplayBtCoexInfo(struct adapter *padapter, u8 *pbuf, u32 bufsiz DBG_BT_INFO_INIT(pinfo, NULL, 0); } -void hal_btcoex_SetDBG(struct adapter *padapter, u32 *pDbgModule) -{ - u32 i; - - - if (!pDbgModule) - return; - - for (i = 0; i < BTC_MSG_MAX; i++) - GLBtcDbgType[i] = pDbgModule[i]; -} - -u32 hal_btcoex_GetDBG(struct adapter *padapter, u8 *pStrBuf, u32 bufSize) -{ - s32 count; - u8 *pstr; - u32 leftSize; - - - if (!pStrBuf || bufSize == 0) - return 0; - - pstr = pStrBuf; - leftSize = bufSize; - - count = rtw_sprintf(pstr, leftSize, "#define DBG\t%d\n", DBG); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - - count = rtw_sprintf(pstr, leftSize, "BTCOEX Debug Setting:\n"); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - - count = rtw_sprintf(pstr, leftSize, - "INTERFACE / ALGORITHM: 0x%08X / 0x%08X\n\n", - GLBtcDbgType[BTC_MSG_INTERFACE], - GLBtcDbgType[BTC_MSG_ALGORITHM]); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - - count = rtw_sprintf(pstr, leftSize, "INTERFACE Debug Setting Definition:\n"); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[0]=%d for INTF_INIT\n", - (GLBtcDbgType[BTC_MSG_INTERFACE] & INTF_INIT) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[2]=%d for INTF_NOTIFY\n\n", - (GLBtcDbgType[BTC_MSG_INTERFACE] & INTF_NOTIFY) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - - count = rtw_sprintf(pstr, leftSize, "ALGORITHM Debug Setting Definition:\n"); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[0]=%d for BT_RSSI_STATE\n", - (GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_BT_RSSI_STATE) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[1]=%d for WIFI_RSSI_STATE\n", - (GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_WIFI_RSSI_STATE) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[2]=%d for BT_MONITOR\n", - (GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_BT_MONITOR) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[3]=%d for TRACE\n", - (GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[4]=%d for TRACE_FW\n", - (GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_FW) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[5]=%d for TRACE_FW_DETAIL\n", - (GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_FW_DETAIL) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[6]=%d for TRACE_FW_EXEC\n", - (GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_FW_EXEC) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[7]=%d for TRACE_SW\n", - (GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_SW) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[8]=%d for TRACE_SW_DETAIL\n", - (GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_SW_DETAIL) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[9]=%d for TRACE_SW_EXEC\n", - (GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_SW_EXEC) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - -exit: - count = pstr - pStrBuf; - - return count; -} diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c index e82f59fc5e9b..eebd48438733 100644 --- a/drivers/staging/rtl8723bs/hal/hal_com.c +++ b/drivers/staging/rtl8723bs/hal/hal_com.c @@ -295,126 +295,6 @@ u8 MRateToHwRate(u8 rate) case MGN_MCS31: ret = DESC_RATEMCS31; break; - case MGN_VHT1SS_MCS0: - ret = DESC_RATEVHTSS1MCS0; - break; - case MGN_VHT1SS_MCS1: - ret = DESC_RATEVHTSS1MCS1; - break; - case MGN_VHT1SS_MCS2: - ret = DESC_RATEVHTSS1MCS2; - break; - case MGN_VHT1SS_MCS3: - ret = DESC_RATEVHTSS1MCS3; - break; - case MGN_VHT1SS_MCS4: - ret = DESC_RATEVHTSS1MCS4; - break; - case MGN_VHT1SS_MCS5: - ret = DESC_RATEVHTSS1MCS5; - break; - case MGN_VHT1SS_MCS6: - ret = DESC_RATEVHTSS1MCS6; - break; - case MGN_VHT1SS_MCS7: - ret = DESC_RATEVHTSS1MCS7; - break; - case MGN_VHT1SS_MCS8: - ret = DESC_RATEVHTSS1MCS8; - break; - case MGN_VHT1SS_MCS9: - ret = DESC_RATEVHTSS1MCS9; - break; - case MGN_VHT2SS_MCS0: - ret = DESC_RATEVHTSS2MCS0; - break; - case MGN_VHT2SS_MCS1: - ret = DESC_RATEVHTSS2MCS1; - break; - case MGN_VHT2SS_MCS2: - ret = DESC_RATEVHTSS2MCS2; - break; - case MGN_VHT2SS_MCS3: - ret = DESC_RATEVHTSS2MCS3; - break; - case MGN_VHT2SS_MCS4: - ret = DESC_RATEVHTSS2MCS4; - break; - case MGN_VHT2SS_MCS5: - ret = DESC_RATEVHTSS2MCS5; - break; - case MGN_VHT2SS_MCS6: - ret = DESC_RATEVHTSS2MCS6; - break; - case MGN_VHT2SS_MCS7: - ret = DESC_RATEVHTSS2MCS7; - break; - case MGN_VHT2SS_MCS8: - ret = DESC_RATEVHTSS2MCS8; - break; - case MGN_VHT2SS_MCS9: - ret = DESC_RATEVHTSS2MCS9; - break; - case MGN_VHT3SS_MCS0: - ret = DESC_RATEVHTSS3MCS0; - break; - case MGN_VHT3SS_MCS1: - ret = DESC_RATEVHTSS3MCS1; - break; - case MGN_VHT3SS_MCS2: - ret = DESC_RATEVHTSS3MCS2; - break; - case MGN_VHT3SS_MCS3: - ret = DESC_RATEVHTSS3MCS3; - break; - case MGN_VHT3SS_MCS4: - ret = DESC_RATEVHTSS3MCS4; - break; - case MGN_VHT3SS_MCS5: - ret = DESC_RATEVHTSS3MCS5; - break; - case MGN_VHT3SS_MCS6: - ret = DESC_RATEVHTSS3MCS6; - break; - case MGN_VHT3SS_MCS7: - ret = DESC_RATEVHTSS3MCS7; - break; - case MGN_VHT3SS_MCS8: - ret = DESC_RATEVHTSS3MCS8; - break; - case MGN_VHT3SS_MCS9: - ret = DESC_RATEVHTSS3MCS9; - break; - case MGN_VHT4SS_MCS0: - ret = DESC_RATEVHTSS4MCS0; - break; - case MGN_VHT4SS_MCS1: - ret = DESC_RATEVHTSS4MCS1; - break; - case MGN_VHT4SS_MCS2: - ret = DESC_RATEVHTSS4MCS2; - break; - case MGN_VHT4SS_MCS3: - ret = DESC_RATEVHTSS4MCS3; - break; - case MGN_VHT4SS_MCS4: - ret = DESC_RATEVHTSS4MCS4; - break; - case MGN_VHT4SS_MCS5: - ret = DESC_RATEVHTSS4MCS5; - break; - case MGN_VHT4SS_MCS6: - ret = DESC_RATEVHTSS4MCS6; - break; - case MGN_VHT4SS_MCS7: - ret = DESC_RATEVHTSS4MCS7; - break; - case MGN_VHT4SS_MCS8: - ret = DESC_RATEVHTSS4MCS8; - break; - case MGN_VHT4SS_MCS9: - ret = DESC_RATEVHTSS4MCS9; - break; default: break; } @@ -559,127 +439,6 @@ u8 HwRateToMRate(u8 rate) case DESC_RATEMCS31: ret_rate = MGN_MCS31; break; - case DESC_RATEVHTSS1MCS0: - ret_rate = MGN_VHT1SS_MCS0; - break; - case DESC_RATEVHTSS1MCS1: - ret_rate = MGN_VHT1SS_MCS1; - break; - case DESC_RATEVHTSS1MCS2: - ret_rate = MGN_VHT1SS_MCS2; - break; - case DESC_RATEVHTSS1MCS3: - ret_rate = MGN_VHT1SS_MCS3; - break; - case DESC_RATEVHTSS1MCS4: - ret_rate = MGN_VHT1SS_MCS4; - break; - case DESC_RATEVHTSS1MCS5: - ret_rate = MGN_VHT1SS_MCS5; - break; - case DESC_RATEVHTSS1MCS6: - ret_rate = MGN_VHT1SS_MCS6; - break; - case DESC_RATEVHTSS1MCS7: - ret_rate = MGN_VHT1SS_MCS7; - break; - case DESC_RATEVHTSS1MCS8: - ret_rate = MGN_VHT1SS_MCS8; - break; - case DESC_RATEVHTSS1MCS9: - ret_rate = MGN_VHT1SS_MCS9; - break; - case DESC_RATEVHTSS2MCS0: - ret_rate = MGN_VHT2SS_MCS0; - break; - case DESC_RATEVHTSS2MCS1: - ret_rate = MGN_VHT2SS_MCS1; - break; - case DESC_RATEVHTSS2MCS2: - ret_rate = MGN_VHT2SS_MCS2; - break; - case DESC_RATEVHTSS2MCS3: - ret_rate = MGN_VHT2SS_MCS3; - break; - case DESC_RATEVHTSS2MCS4: - ret_rate = MGN_VHT2SS_MCS4; - break; - case DESC_RATEVHTSS2MCS5: - ret_rate = MGN_VHT2SS_MCS5; - break; - case DESC_RATEVHTSS2MCS6: - ret_rate = MGN_VHT2SS_MCS6; - break; - case DESC_RATEVHTSS2MCS7: - ret_rate = MGN_VHT2SS_MCS7; - break; - case DESC_RATEVHTSS2MCS8: - ret_rate = MGN_VHT2SS_MCS8; - break; - case DESC_RATEVHTSS2MCS9: - ret_rate = MGN_VHT2SS_MCS9; - break; - case DESC_RATEVHTSS3MCS0: - ret_rate = MGN_VHT3SS_MCS0; - break; - case DESC_RATEVHTSS3MCS1: - ret_rate = MGN_VHT3SS_MCS1; - break; - case DESC_RATEVHTSS3MCS2: - ret_rate = MGN_VHT3SS_MCS2; - break; - case DESC_RATEVHTSS3MCS3: - ret_rate = MGN_VHT3SS_MCS3; - break; - case DESC_RATEVHTSS3MCS4: - ret_rate = MGN_VHT3SS_MCS4; - break; - case DESC_RATEVHTSS3MCS5: - ret_rate = MGN_VHT3SS_MCS5; - break; - case DESC_RATEVHTSS3MCS6: - ret_rate = MGN_VHT3SS_MCS6; - break; - case DESC_RATEVHTSS3MCS7: - ret_rate = MGN_VHT3SS_MCS7; - break; - case DESC_RATEVHTSS3MCS8: - ret_rate = MGN_VHT3SS_MCS8; - break; - case DESC_RATEVHTSS3MCS9: - ret_rate = MGN_VHT3SS_MCS9; - break; - case DESC_RATEVHTSS4MCS0: - ret_rate = MGN_VHT4SS_MCS0; - break; - case DESC_RATEVHTSS4MCS1: - ret_rate = MGN_VHT4SS_MCS1; - break; - case DESC_RATEVHTSS4MCS2: - ret_rate = MGN_VHT4SS_MCS2; - break; - case DESC_RATEVHTSS4MCS3: - ret_rate = MGN_VHT4SS_MCS3; - break; - case DESC_RATEVHTSS4MCS4: - ret_rate = MGN_VHT4SS_MCS4; - break; - case DESC_RATEVHTSS4MCS5: - ret_rate = MGN_VHT4SS_MCS5; - break; - case DESC_RATEVHTSS4MCS6: - ret_rate = MGN_VHT4SS_MCS6; - break; - case DESC_RATEVHTSS4MCS7: - ret_rate = MGN_VHT4SS_MCS7; - break; - case DESC_RATEVHTSS4MCS8: - ret_rate = MGN_VHT4SS_MCS8; - break; - case DESC_RATEVHTSS4MCS9: - ret_rate = MGN_VHT4SS_MCS9; - break; - default: break; } @@ -916,16 +675,10 @@ s32 c2h_evt_read_88xx(struct adapter *adapter, u8 *buf) c2h_evt->seq = rtw_read8(adapter, REG_C2HEVT_CMD_SEQ_88XX); c2h_evt->plen = rtw_read8(adapter, REG_C2HEVT_CMD_LEN_88XX); - print_hex_dump_debug(DRIVER_PREFIX ": c2h_evt_read(): ", DUMP_PREFIX_NONE, - 16, 1, &c2h_evt, sizeof(c2h_evt), false); - /* Read the content */ for (i = 0; i < c2h_evt->plen; i++) c2h_evt->payload[i] = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL + 2 + i); - print_hex_dump_debug(DRIVER_PREFIX ": c2h_evt_read(): Command Content:\n", - DUMP_PREFIX_NONE, 16, 1, c2h_evt->payload, c2h_evt->plen, false); - ret = _SUCCESS; clear_evt: @@ -1093,13 +846,6 @@ u8 SetHalDefVar( u8 bResult = _SUCCESS; switch (variable) { - case HW_DEF_FA_CNT_DUMP: - /* ODM_COMP_COMMON */ - if (*((u8 *)value)) - odm->DebugComponents |= (ODM_COMP_DIG | ODM_COMP_FA_CNT); - else - odm->DebugComponents &= ~(ODM_COMP_DIG | ODM_COMP_FA_CNT); - break; case HAL_DEF_DBG_RX_INFO_DUMP: if (odm->bLinked) { @@ -1166,7 +912,6 @@ u8 GetHalDefVar( ) { struct hal_com_data *hal_data = GET_HAL_DATA(adapter); - struct dm_odm_t *odm = &(hal_data->odmpriv); u8 bResult = _SUCCESS; switch (variable) { @@ -1183,12 +928,6 @@ u8 GetHalDefVar( *((int *)value) = psta->rssi_stat.UndecoratedSmoothedPWDB; } break; - case HW_DEF_ODM_DBG_FLAG: - *((u64 *)value) = odm->DebugComponents; - break; - case HW_DEF_ODM_DBG_LEVEL: - *((u32 *)value) = odm->DebugLevel; - break; case HAL_DEF_DBG_DM_FUNC: *((u32 *)value) = hal_data->odmpriv.SupportAbility; break; diff --git a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c index 94d11689b4ac..bb7941aee0c4 100644 --- a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c +++ b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c @@ -11,7 +11,7 @@ #include <hal_data.h> #include <linux/kernel.h> -u8 PHY_GetTxPowerByRateBase(struct adapter *Adapter, u8 Band, u8 RfPath, +u8 PHY_GetTxPowerByRateBase(struct adapter *Adapter, u8 RfPath, u8 TxNum, enum rate_section RateSection) { struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); @@ -20,73 +20,27 @@ u8 PHY_GetTxPowerByRateBase(struct adapter *Adapter, u8 Band, u8 RfPath, if (RfPath > ODM_RF_PATH_D) return 0; - if (Band == BAND_ON_2_4G) { - switch (RateSection) { - case CCK: - value = pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][0]; - break; - case OFDM: - value = pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][1]; - break; - case HT_MCS0_MCS7: - value = pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][2]; - break; - case HT_MCS8_MCS15: - value = pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][3]; - break; - case HT_MCS16_MCS23: - value = pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][4]; - break; - case HT_MCS24_MCS31: - value = pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][5]; - break; - case VHT_1SSMCS0_1SSMCS9: - value = pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][6]; - break; - case VHT_2SSMCS0_2SSMCS9: - value = pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][7]; - break; - case VHT_3SSMCS0_3SSMCS9: - value = pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][8]; - break; - case VHT_4SSMCS0_4SSMCS9: - value = pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][9]; - break; - default: - break; - } - } else if (Band == BAND_ON_5G) { - switch (RateSection) { - case OFDM: - value = pHalData->TxPwrByRateBase5G[RfPath][TxNum][0]; - break; - case HT_MCS0_MCS7: - value = pHalData->TxPwrByRateBase5G[RfPath][TxNum][1]; - break; - case HT_MCS8_MCS15: - value = pHalData->TxPwrByRateBase5G[RfPath][TxNum][2]; - break; - case HT_MCS16_MCS23: - value = pHalData->TxPwrByRateBase5G[RfPath][TxNum][3]; - break; - case HT_MCS24_MCS31: - value = pHalData->TxPwrByRateBase5G[RfPath][TxNum][4]; - break; - case VHT_1SSMCS0_1SSMCS9: - value = pHalData->TxPwrByRateBase5G[RfPath][TxNum][5]; - break; - case VHT_2SSMCS0_2SSMCS9: - value = pHalData->TxPwrByRateBase5G[RfPath][TxNum][6]; - break; - case VHT_3SSMCS0_3SSMCS9: - value = pHalData->TxPwrByRateBase5G[RfPath][TxNum][7]; - break; - case VHT_4SSMCS0_4SSMCS9: - value = pHalData->TxPwrByRateBase5G[RfPath][TxNum][8]; - break; - default: - break; - } + switch (RateSection) { + case CCK: + value = pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][0]; + break; + case OFDM: + value = pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][1]; + break; + case HT_MCS0_MCS7: + value = pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][2]; + break; + case HT_MCS8_MCS15: + value = pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][3]; + break; + case HT_MCS16_MCS23: + value = pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][4]; + break; + case HT_MCS24_MCS31: + value = pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][5]; + break; + default: + break; } return value; @@ -95,7 +49,6 @@ u8 PHY_GetTxPowerByRateBase(struct adapter *Adapter, u8 Band, u8 RfPath, static void phy_SetTxPowerByRateBase( struct adapter *Adapter, - u8 Band, u8 RfPath, enum rate_section RateSection, u8 TxNum, @@ -107,73 +60,27 @@ phy_SetTxPowerByRateBase( if (RfPath > ODM_RF_PATH_D) return; - if (Band == BAND_ON_2_4G) { - switch (RateSection) { - case CCK: - pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][0] = Value; - break; - case OFDM: - pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][1] = Value; - break; - case HT_MCS0_MCS7: - pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][2] = Value; - break; - case HT_MCS8_MCS15: - pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][3] = Value; - break; - case HT_MCS16_MCS23: - pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][4] = Value; - break; - case HT_MCS24_MCS31: - pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][5] = Value; - break; - case VHT_1SSMCS0_1SSMCS9: - pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][6] = Value; - break; - case VHT_2SSMCS0_2SSMCS9: - pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][7] = Value; - break; - case VHT_3SSMCS0_3SSMCS9: - pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][8] = Value; - break; - case VHT_4SSMCS0_4SSMCS9: - pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][9] = Value; - break; - default: - break; - } - } else if (Band == BAND_ON_5G) { - switch (RateSection) { - case OFDM: - pHalData->TxPwrByRateBase5G[RfPath][TxNum][0] = Value; - break; - case HT_MCS0_MCS7: - pHalData->TxPwrByRateBase5G[RfPath][TxNum][1] = Value; - break; - case HT_MCS8_MCS15: - pHalData->TxPwrByRateBase5G[RfPath][TxNum][2] = Value; - break; - case HT_MCS16_MCS23: - pHalData->TxPwrByRateBase5G[RfPath][TxNum][3] = Value; - break; - case HT_MCS24_MCS31: - pHalData->TxPwrByRateBase5G[RfPath][TxNum][4] = Value; - break; - case VHT_1SSMCS0_1SSMCS9: - pHalData->TxPwrByRateBase5G[RfPath][TxNum][5] = Value; - break; - case VHT_2SSMCS0_2SSMCS9: - pHalData->TxPwrByRateBase5G[RfPath][TxNum][6] = Value; - break; - case VHT_3SSMCS0_3SSMCS9: - pHalData->TxPwrByRateBase5G[RfPath][TxNum][7] = Value; - break; - case VHT_4SSMCS0_4SSMCS9: - pHalData->TxPwrByRateBase5G[RfPath][TxNum][8] = Value; - break; - default: - break; - } + switch (RateSection) { + case CCK: + pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][0] = Value; + break; + case OFDM: + pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][1] = Value; + break; + case HT_MCS0_MCS7: + pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][2] = Value; + break; + case HT_MCS8_MCS15: + pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][3] = Value; + break; + case HT_MCS16_MCS23: + pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][4] = Value; + break; + case HT_MCS24_MCS31: + pHalData->TxPwrByRateBase2_4G[RfPath][TxNum][5] = Value; + break; + default: + break; } } @@ -185,50 +92,21 @@ struct adapter *padapter u8 path, base; for (path = ODM_RF_PATH_A; path <= ODM_RF_PATH_B; ++path) { - base = PHY_GetTxPowerByRate(padapter, BAND_ON_2_4G, path, RF_1TX, MGN_11M); - phy_SetTxPowerByRateBase(padapter, BAND_ON_2_4G, path, CCK, RF_1TX, base); - - base = PHY_GetTxPowerByRate(padapter, BAND_ON_2_4G, path, RF_1TX, MGN_54M); - phy_SetTxPowerByRateBase(padapter, BAND_ON_2_4G, path, OFDM, RF_1TX, base); - - base = PHY_GetTxPowerByRate(padapter, BAND_ON_2_4G, path, RF_1TX, MGN_MCS7); - phy_SetTxPowerByRateBase(padapter, BAND_ON_2_4G, path, HT_MCS0_MCS7, RF_1TX, base); - - base = PHY_GetTxPowerByRate(padapter, BAND_ON_2_4G, path, RF_2TX, MGN_MCS15); - phy_SetTxPowerByRateBase(padapter, BAND_ON_2_4G, path, HT_MCS8_MCS15, RF_2TX, base); - - base = PHY_GetTxPowerByRate(padapter, BAND_ON_2_4G, path, RF_3TX, MGN_MCS23); - phy_SetTxPowerByRateBase(padapter, BAND_ON_2_4G, path, HT_MCS16_MCS23, RF_3TX, base); - - base = PHY_GetTxPowerByRate(padapter, BAND_ON_2_4G, path, RF_1TX, MGN_VHT1SS_MCS7); - phy_SetTxPowerByRateBase(padapter, BAND_ON_2_4G, path, VHT_1SSMCS0_1SSMCS9, RF_1TX, base); - - base = PHY_GetTxPowerByRate(padapter, BAND_ON_2_4G, path, RF_2TX, MGN_VHT2SS_MCS7); - phy_SetTxPowerByRateBase(padapter, BAND_ON_2_4G, path, VHT_2SSMCS0_2SSMCS9, RF_2TX, base); - - base = PHY_GetTxPowerByRate(padapter, BAND_ON_2_4G, path, RF_3TX, MGN_VHT3SS_MCS7); - phy_SetTxPowerByRateBase(padapter, BAND_ON_2_4G, path, VHT_3SSMCS0_3SSMCS9, RF_3TX, base); + base = PHY_GetTxPowerByRate(padapter, path, RF_1TX, MGN_11M); + phy_SetTxPowerByRateBase(padapter, path, CCK, RF_1TX, base); - base = PHY_GetTxPowerByRate(padapter, BAND_ON_5G, path, RF_1TX, MGN_54M); - phy_SetTxPowerByRateBase(padapter, BAND_ON_5G, path, OFDM, RF_1TX, base); + base = PHY_GetTxPowerByRate(padapter, path, RF_1TX, MGN_54M); + phy_SetTxPowerByRateBase(padapter, path, OFDM, RF_1TX, base); - base = PHY_GetTxPowerByRate(padapter, BAND_ON_5G, path, RF_1TX, MGN_MCS7); - phy_SetTxPowerByRateBase(padapter, BAND_ON_5G, path, HT_MCS0_MCS7, RF_1TX, base); + base = PHY_GetTxPowerByRate(padapter, path, RF_1TX, MGN_MCS7); + phy_SetTxPowerByRateBase(padapter, path, HT_MCS0_MCS7, RF_1TX, base); - base = PHY_GetTxPowerByRate(padapter, BAND_ON_5G, path, RF_2TX, MGN_MCS15); - phy_SetTxPowerByRateBase(padapter, BAND_ON_5G, path, HT_MCS8_MCS15, RF_2TX, base); + base = PHY_GetTxPowerByRate(padapter, path, RF_2TX, MGN_MCS15); + phy_SetTxPowerByRateBase(padapter, path, HT_MCS8_MCS15, RF_2TX, base); - base = PHY_GetTxPowerByRate(padapter, BAND_ON_5G, path, RF_3TX, MGN_MCS23); - phy_SetTxPowerByRateBase(padapter, BAND_ON_5G, path, HT_MCS16_MCS23, RF_3TX, base); + base = PHY_GetTxPowerByRate(padapter, path, RF_3TX, MGN_MCS23); + phy_SetTxPowerByRateBase(padapter, path, HT_MCS16_MCS23, RF_3TX, base); - base = PHY_GetTxPowerByRate(padapter, BAND_ON_5G, path, RF_1TX, MGN_VHT1SS_MCS7); - phy_SetTxPowerByRateBase(padapter, BAND_ON_5G, path, VHT_1SSMCS0_1SSMCS9, RF_1TX, base); - - base = PHY_GetTxPowerByRate(padapter, BAND_ON_5G, path, RF_2TX, MGN_VHT2SS_MCS7); - phy_SetTxPowerByRateBase(padapter, BAND_ON_5G, path, VHT_2SSMCS0_2SSMCS9, RF_2TX, base); - - base = PHY_GetTxPowerByRate(padapter, BAND_ON_5G, path, RF_3TX, MGN_VHT2SS_MCS7); - phy_SetTxPowerByRateBase(padapter, BAND_ON_5G, path, VHT_3SSMCS0_3SSMCS9, RF_3TX, base); } } @@ -532,81 +410,6 @@ PHY_GetRateValuesOfTxPowerByRate( *RateNum = 4; break; - case 0xC3C: - case 0xE3C: - case 0x183C: - case 0x1a3C: - RateIndex[0] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT1SS_MCS0); - RateIndex[1] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT1SS_MCS1); - RateIndex[2] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT1SS_MCS2); - RateIndex[3] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT1SS_MCS3); - for (i = 0; i < 4; ++i) { - PwrByRateVal[i] = (s8) ((((Value >> (i * 8 + 4)) & 0xF)) * 10 + - ((Value >> (i * 8)) & 0xF)); - } - *RateNum = 4; - break; - - case 0xC40: - case 0xE40: - case 0x1840: - case 0x1a40: - RateIndex[0] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT1SS_MCS4); - RateIndex[1] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT1SS_MCS5); - RateIndex[2] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT1SS_MCS6); - RateIndex[3] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT1SS_MCS7); - for (i = 0; i < 4; ++i) { - PwrByRateVal[i] = (s8) ((((Value >> (i * 8 + 4)) & 0xF)) * 10 + - ((Value >> (i * 8)) & 0xF)); - } - *RateNum = 4; - break; - - case 0xC44: - case 0xE44: - case 0x1844: - case 0x1a44: - RateIndex[0] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT1SS_MCS8); - RateIndex[1] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT1SS_MCS9); - RateIndex[2] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT2SS_MCS0); - RateIndex[3] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT2SS_MCS1); - for (i = 0; i < 4; ++i) { - PwrByRateVal[i] = (s8) ((((Value >> (i * 8 + 4)) & 0xF)) * 10 + - ((Value >> (i * 8)) & 0xF)); - } - *RateNum = 4; - break; - - case 0xC48: - case 0xE48: - case 0x1848: - case 0x1a48: - RateIndex[0] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT2SS_MCS2); - RateIndex[1] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT2SS_MCS3); - RateIndex[2] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT2SS_MCS4); - RateIndex[3] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT2SS_MCS5); - for (i = 0; i < 4; ++i) { - PwrByRateVal[i] = (s8) ((((Value >> (i * 8 + 4)) & 0xF)) * 10 + - ((Value >> (i * 8)) & 0xF)); - } - *RateNum = 4; - break; - - case 0xC4C: - case 0xE4C: - case 0x184C: - case 0x1a4C: - RateIndex[0] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT2SS_MCS6); - RateIndex[1] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT2SS_MCS7); - RateIndex[2] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT2SS_MCS8); - RateIndex[3] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT2SS_MCS9); - for (i = 0; i < 4; ++i) { - PwrByRateVal[i] = (s8) ((((Value >> (i * 8 + 4)) & 0xF)) * 10 + - ((Value >> (i * 8)) & 0xF)); - } - *RateNum = 4; - break; - case 0xCD8: case 0xED8: case 0x18D8: @@ -637,49 +440,6 @@ PHY_GetRateValuesOfTxPowerByRate( *RateNum = 4; break; - case 0xCE0: - case 0xEE0: - case 0x18E0: - case 0x1aE0: - RateIndex[0] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT3SS_MCS0); - RateIndex[1] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT3SS_MCS1); - RateIndex[2] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT3SS_MCS2); - RateIndex[3] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT3SS_MCS3); - for (i = 0; i < 4; ++i) { - PwrByRateVal[i] = (s8) ((((Value >> (i * 8 + 4)) & 0xF)) * 10 + - ((Value >> (i * 8)) & 0xF)); - } - *RateNum = 4; - break; - - case 0xCE4: - case 0xEE4: - case 0x18E4: - case 0x1aE4: - RateIndex[0] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT3SS_MCS4); - RateIndex[1] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT3SS_MCS5); - RateIndex[2] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT3SS_MCS6); - RateIndex[3] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT3SS_MCS7); - for (i = 0; i < 4; ++i) { - PwrByRateVal[i] = (s8) ((((Value >> (i * 8 + 4)) & 0xF)) * 10 + - ((Value >> (i * 8)) & 0xF)); - } - *RateNum = 4; - break; - - case 0xCE8: - case 0xEE8: - case 0x18E8: - case 0x1aE8: - RateIndex[0] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT3SS_MCS8); - RateIndex[1] = PHY_GetRateIndexOfTxPowerByRate(MGN_VHT3SS_MCS9); - for (i = 0; i < 2; ++i) { - PwrByRateVal[i] = (s8) ((((Value >> (i * 8 + 4)) & 0xF)) * 10 + - ((Value >> (i * 8)) & 0xF)); - } - *RateNum = 4; - break; - default: break; } @@ -687,7 +447,6 @@ PHY_GetRateValuesOfTxPowerByRate( static void PHY_StoreTxPowerByRateNew( struct adapter *padapter, - u32 Band, u32 RfPath, u32 TxNum, u32 RegAddr, @@ -701,9 +460,6 @@ static void PHY_StoreTxPowerByRateNew( PHY_GetRateValuesOfTxPowerByRate(padapter, RegAddr, BitMask, Data, rateIndex, PwrByRateVal, &rateNum); - if (Band != BAND_ON_2_4G && Band != BAND_ON_5G) - return; - if (RfPath > ODM_RF_PATH_D) return; @@ -711,11 +467,7 @@ static void PHY_StoreTxPowerByRateNew( return; for (i = 0; i < rateNum; ++i) { - if (rateIndex[i] == PHY_GetRateIndexOfTxPowerByRate(MGN_VHT2SS_MCS0) || - rateIndex[i] == PHY_GetRateIndexOfTxPowerByRate(MGN_VHT2SS_MCS1)) - TxNum = RF_2TX; - - pHalData->TxPwrByRateOffset[Band][RfPath][TxNum][rateIndex[i]] = PwrByRateVal[i]; + pHalData->TxPwrByRateOffset[RfPath][TxNum][rateIndex[i]] = PwrByRateVal[i]; } } @@ -732,18 +484,16 @@ static void PHY_StoreTxPowerByRateOld( void PHY_InitTxPowerByRate(struct adapter *padapter) { struct hal_com_data *pHalData = GET_HAL_DATA(padapter); - u8 band, rfPath, TxNum, rate; + u8 rfPath, TxNum, rate; - for (band = BAND_ON_2_4G; band <= BAND_ON_5G; ++band) - for (rfPath = 0; rfPath < TX_PWR_BY_RATE_NUM_RF; ++rfPath) - for (TxNum = 0; TxNum < TX_PWR_BY_RATE_NUM_RF; ++TxNum) - for (rate = 0; rate < TX_PWR_BY_RATE_NUM_RATE; ++rate) - pHalData->TxPwrByRateOffset[band][rfPath][TxNum][rate] = 0; + for (rfPath = 0; rfPath < TX_PWR_BY_RATE_NUM_RF; ++rfPath) + for (TxNum = 0; TxNum < TX_PWR_BY_RATE_NUM_RF; ++TxNum) + for (rate = 0; rate < TX_PWR_BY_RATE_NUM_RATE; ++rate) + pHalData->TxPwrByRateOffset[rfPath][TxNum][rate] = 0; } void PHY_StoreTxPowerByRate( struct adapter *padapter, - u32 Band, u32 RfPath, u32 TxNum, u32 RegAddr, @@ -755,7 +505,7 @@ void PHY_StoreTxPowerByRate( struct dm_odm_t *pDM_Odm = &pHalData->odmpriv; if (pDM_Odm->PhyRegPgVersion > 0) - PHY_StoreTxPowerByRateNew(padapter, Band, RfPath, TxNum, RegAddr, BitMask, Data); + PHY_StoreTxPowerByRateNew(padapter, RfPath, TxNum, RegAddr, BitMask, Data); else if (pDM_Odm->PhyRegPgVersion == 0) { PHY_StoreTxPowerByRateOld(padapter, RegAddr, BitMask, Data); @@ -771,7 +521,7 @@ phy_ConvertTxPowerByRateInDbmToRelativeValues( struct adapter *padapter ) { - u8 base = 0, i = 0, value = 0, band = 0, path = 0, txNum = 0; + u8 base = 0, i = 0, value = 0, path = 0, txNum = 0; u8 cckRates[4] = { MGN_1M, MGN_2M, MGN_5_5M, MGN_11M }; @@ -787,77 +537,42 @@ struct adapter *padapter u8 mcs16_23Rates[8] = { MGN_MCS16, MGN_MCS17, MGN_MCS18, MGN_MCS19, MGN_MCS20, MGN_MCS21, MGN_MCS22, MGN_MCS23 }; - u8 vht1ssRates[10] = { - MGN_VHT1SS_MCS0, MGN_VHT1SS_MCS1, MGN_VHT1SS_MCS2, MGN_VHT1SS_MCS3, MGN_VHT1SS_MCS4, - MGN_VHT1SS_MCS5, MGN_VHT1SS_MCS6, MGN_VHT1SS_MCS7, MGN_VHT1SS_MCS8, MGN_VHT1SS_MCS9 - }; - u8 vht2ssRates[10] = { - MGN_VHT2SS_MCS0, MGN_VHT2SS_MCS1, MGN_VHT2SS_MCS2, MGN_VHT2SS_MCS3, MGN_VHT2SS_MCS4, - MGN_VHT2SS_MCS5, MGN_VHT2SS_MCS6, MGN_VHT2SS_MCS7, MGN_VHT2SS_MCS8, MGN_VHT2SS_MCS9 - }; - u8 vht3ssRates[10] = { - MGN_VHT3SS_MCS0, MGN_VHT3SS_MCS1, MGN_VHT3SS_MCS2, MGN_VHT3SS_MCS3, MGN_VHT3SS_MCS4, - MGN_VHT3SS_MCS5, MGN_VHT3SS_MCS6, MGN_VHT3SS_MCS7, MGN_VHT3SS_MCS8, MGN_VHT3SS_MCS9 - }; - - for (band = BAND_ON_2_4G; band <= BAND_ON_5G; ++band) { - for (path = ODM_RF_PATH_A; path <= ODM_RF_PATH_D; ++path) { - for (txNum = RF_1TX; txNum < RF_MAX_TX_NUM; ++txNum) { - /* CCK */ - base = PHY_GetTxPowerByRate(padapter, band, path, txNum, MGN_11M); - for (i = 0; i < ARRAY_SIZE(cckRates); ++i) { - value = PHY_GetTxPowerByRate(padapter, band, path, txNum, cckRates[i]); - PHY_SetTxPowerByRate(padapter, band, path, txNum, cckRates[i], value - base); - } - /* OFDM */ - base = PHY_GetTxPowerByRate(padapter, band, path, txNum, MGN_54M); - for (i = 0; i < sizeof(ofdmRates); ++i) { - value = PHY_GetTxPowerByRate(padapter, band, path, txNum, ofdmRates[i]); - PHY_SetTxPowerByRate(padapter, band, path, txNum, ofdmRates[i], value - base); - } - - /* HT MCS0~7 */ - base = PHY_GetTxPowerByRate(padapter, band, path, txNum, MGN_MCS7); - for (i = 0; i < sizeof(mcs0_7Rates); ++i) { - value = PHY_GetTxPowerByRate(padapter, band, path, txNum, mcs0_7Rates[i]); - PHY_SetTxPowerByRate(padapter, band, path, txNum, mcs0_7Rates[i], value - base); - } - - /* HT MCS8~15 */ - base = PHY_GetTxPowerByRate(padapter, band, path, txNum, MGN_MCS15); - for (i = 0; i < sizeof(mcs8_15Rates); ++i) { - value = PHY_GetTxPowerByRate(padapter, band, path, txNum, mcs8_15Rates[i]); - PHY_SetTxPowerByRate(padapter, band, path, txNum, mcs8_15Rates[i], value - base); - } + for (path = ODM_RF_PATH_A; path <= ODM_RF_PATH_D; ++path) { + for (txNum = RF_1TX; txNum < RF_MAX_TX_NUM; ++txNum) { + /* CCK */ + base = PHY_GetTxPowerByRate(padapter, path, txNum, MGN_11M); + for (i = 0; i < ARRAY_SIZE(cckRates); ++i) { + value = PHY_GetTxPowerByRate(padapter, path, txNum, cckRates[i]); + PHY_SetTxPowerByRate(padapter, path, txNum, cckRates[i], value - base); + } - /* HT MCS16~23 */ - base = PHY_GetTxPowerByRate(padapter, band, path, txNum, MGN_MCS23); - for (i = 0; i < sizeof(mcs16_23Rates); ++i) { - value = PHY_GetTxPowerByRate(padapter, band, path, txNum, mcs16_23Rates[i]); - PHY_SetTxPowerByRate(padapter, band, path, txNum, mcs16_23Rates[i], value - base); - } + /* OFDM */ + base = PHY_GetTxPowerByRate(padapter, path, txNum, MGN_54M); + for (i = 0; i < sizeof(ofdmRates); ++i) { + value = PHY_GetTxPowerByRate(padapter, path, txNum, ofdmRates[i]); + PHY_SetTxPowerByRate(padapter, path, txNum, ofdmRates[i], value - base); + } - /* VHT 1SS */ - base = PHY_GetTxPowerByRate(padapter, band, path, txNum, MGN_VHT1SS_MCS7); - for (i = 0; i < sizeof(vht1ssRates); ++i) { - value = PHY_GetTxPowerByRate(padapter, band, path, txNum, vht1ssRates[i]); - PHY_SetTxPowerByRate(padapter, band, path, txNum, vht1ssRates[i], value - base); - } + /* HT MCS0~7 */ + base = PHY_GetTxPowerByRate(padapter, path, txNum, MGN_MCS7); + for (i = 0; i < sizeof(mcs0_7Rates); ++i) { + value = PHY_GetTxPowerByRate(padapter, path, txNum, mcs0_7Rates[i]); + PHY_SetTxPowerByRate(padapter, path, txNum, mcs0_7Rates[i], value - base); + } - /* VHT 2SS */ - base = PHY_GetTxPowerByRate(padapter, band, path, txNum, MGN_VHT2SS_MCS7); - for (i = 0; i < sizeof(vht2ssRates); ++i) { - value = PHY_GetTxPowerByRate(padapter, band, path, txNum, vht2ssRates[i]); - PHY_SetTxPowerByRate(padapter, band, path, txNum, vht2ssRates[i], value - base); - } + /* HT MCS8~15 */ + base = PHY_GetTxPowerByRate(padapter, path, txNum, MGN_MCS15); + for (i = 0; i < sizeof(mcs8_15Rates); ++i) { + value = PHY_GetTxPowerByRate(padapter, path, txNum, mcs8_15Rates[i]); + PHY_SetTxPowerByRate(padapter, path, txNum, mcs8_15Rates[i], value - base); + } - /* VHT 3SS */ - base = PHY_GetTxPowerByRate(padapter, band, path, txNum, MGN_VHT3SS_MCS7); - for (i = 0; i < sizeof(vht3ssRates); ++i) { - value = PHY_GetTxPowerByRate(padapter, band, path, txNum, vht3ssRates[i]); - PHY_SetTxPowerByRate(padapter, band, path, txNum, vht3ssRates[i], value - base); - } + /* HT MCS16~23 */ + base = PHY_GetTxPowerByRate(padapter, path, txNum, MGN_MCS23); + for (i = 0; i < sizeof(mcs16_23Rates); ++i) { + value = PHY_GetTxPowerByRate(padapter, path, txNum, mcs16_23Rates[i]); + PHY_SetTxPowerByRate(padapter, path, txNum, mcs16_23Rates[i], value - base); } } } @@ -881,11 +596,10 @@ void PHY_SetTxPowerIndexByRateSection( if (RateSection == CCK) { u8 cckRates[] = {MGN_1M, MGN_2M, MGN_5_5M, MGN_11M}; - if (pHalData->CurrentBandType == BAND_ON_2_4G) - PHY_SetTxPowerIndexByRateArray(padapter, RFPath, - pHalData->CurrentChannelBW, - Channel, cckRates, - ARRAY_SIZE(cckRates)); + PHY_SetTxPowerIndexByRateArray(padapter, RFPath, + pHalData->CurrentChannelBW, + Channel, cckRates, + ARRAY_SIZE(cckRates)); } else if (RateSection == OFDM) { u8 ofdmRates[] = {MGN_6M, MGN_9M, MGN_12M, MGN_18M, MGN_24M, MGN_36M, MGN_48M, MGN_54M}; @@ -922,67 +636,7 @@ void PHY_SetTxPowerIndexByRateSection( Channel, htRates4T, ARRAY_SIZE(htRates4T)); - } else if (RateSection == VHT_1SSMCS0_1SSMCS9) { - u8 vhtRates1T[] = {MGN_VHT1SS_MCS0, MGN_VHT1SS_MCS1, MGN_VHT1SS_MCS2, MGN_VHT1SS_MCS3, MGN_VHT1SS_MCS4, - MGN_VHT1SS_MCS5, MGN_VHT1SS_MCS6, MGN_VHT1SS_MCS7, MGN_VHT1SS_MCS8, MGN_VHT1SS_MCS9}; - PHY_SetTxPowerIndexByRateArray(padapter, RFPath, - pHalData->CurrentChannelBW, - Channel, vhtRates1T, - ARRAY_SIZE(vhtRates1T)); - - } else if (RateSection == VHT_2SSMCS0_2SSMCS9) { - u8 vhtRates2T[] = {MGN_VHT2SS_MCS0, MGN_VHT2SS_MCS1, MGN_VHT2SS_MCS2, MGN_VHT2SS_MCS3, MGN_VHT2SS_MCS4, - MGN_VHT2SS_MCS5, MGN_VHT2SS_MCS6, MGN_VHT2SS_MCS7, MGN_VHT2SS_MCS8, MGN_VHT2SS_MCS9}; - - PHY_SetTxPowerIndexByRateArray(padapter, RFPath, - pHalData->CurrentChannelBW, - Channel, vhtRates2T, - ARRAY_SIZE(vhtRates2T)); - } else if (RateSection == VHT_3SSMCS0_3SSMCS9) { - u8 vhtRates3T[] = {MGN_VHT3SS_MCS0, MGN_VHT3SS_MCS1, MGN_VHT3SS_MCS2, MGN_VHT3SS_MCS3, MGN_VHT3SS_MCS4, - MGN_VHT3SS_MCS5, MGN_VHT3SS_MCS6, MGN_VHT3SS_MCS7, MGN_VHT3SS_MCS8, MGN_VHT3SS_MCS9}; - - PHY_SetTxPowerIndexByRateArray(padapter, RFPath, - pHalData->CurrentChannelBW, - Channel, vhtRates3T, - ARRAY_SIZE(vhtRates3T)); - } else if (RateSection == VHT_4SSMCS0_4SSMCS9) { - u8 vhtRates4T[] = {MGN_VHT4SS_MCS0, MGN_VHT4SS_MCS1, MGN_VHT4SS_MCS2, MGN_VHT4SS_MCS3, MGN_VHT4SS_MCS4, - MGN_VHT4SS_MCS5, MGN_VHT4SS_MCS6, MGN_VHT4SS_MCS7, MGN_VHT4SS_MCS8, MGN_VHT4SS_MCS9}; - - PHY_SetTxPowerIndexByRateArray(padapter, RFPath, - pHalData->CurrentChannelBW, - Channel, vhtRates4T, - ARRAY_SIZE(vhtRates4T)); - } -} - -static bool phy_GetChnlIndex(u8 Channel, u8 *ChannelIdx) -{ - u8 channel5G[CHANNEL_MAX_NUMBER_5G] = { - 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 100, 102, - 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, - 132, 134, 136, 138, 140, 142, 144, 149, 151, 153, 155, 157, 159, 161, - 163, 165, 167, 168, 169, 171, 173, 175, 177 - }; - u8 i = 0; - bool bIn24G = true; - - if (Channel <= 14) { - bIn24G = true; - *ChannelIdx = Channel-1; - } else { - bIn24G = false; - - for (i = 0; i < ARRAY_SIZE(channel5G); ++i) { - if (channel5G[i] == Channel) { - *ChannelIdx = i; - return bIn24G; - } - } } - - return bIn24G; } u8 PHY_GetTxPowerIndexBase( @@ -990,110 +644,45 @@ u8 PHY_GetTxPowerIndexBase( u8 RFPath, u8 Rate, enum channel_width BandWidth, - u8 Channel, - bool *bIn24G + u8 Channel ) { struct hal_com_data *pHalData = GET_HAL_DATA(padapter); - u8 i = 0; /* default set to 1S */ u8 txPower = 0; u8 chnlIdx = (Channel-1); if (HAL_IsLegalChannel(padapter, Channel) == false) chnlIdx = 0; - *bIn24G = phy_GetChnlIndex(Channel, &chnlIdx); - - if (*bIn24G) { /* 3 ============================== 2.4 G ============================== */ - if (IS_CCK_RATE(Rate)) - txPower = pHalData->Index24G_CCK_Base[RFPath][chnlIdx]; - else if (MGN_6M <= Rate) - txPower = pHalData->Index24G_BW40_Base[RFPath][chnlIdx]; - - /* OFDM-1T */ - if ((MGN_6M <= Rate && Rate <= MGN_54M) && !IS_CCK_RATE(Rate)) - txPower += pHalData->OFDM_24G_Diff[RFPath][TX_1S]; - - if (BandWidth == CHANNEL_WIDTH_20) { /* BW20-1S, BW20-2S */ - if ((MGN_MCS0 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT1SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW20_24G_Diff[RFPath][TX_1S]; - if ((MGN_MCS8 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT2SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW20_24G_Diff[RFPath][TX_2S]; - if ((MGN_MCS16 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT3SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW20_24G_Diff[RFPath][TX_3S]; - if ((MGN_MCS24 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT4SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW20_24G_Diff[RFPath][TX_4S]; - - } else if (BandWidth == CHANNEL_WIDTH_40) { /* BW40-1S, BW40-2S */ - if ((MGN_MCS0 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT1SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW40_24G_Diff[RFPath][TX_1S]; - if ((MGN_MCS8 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT2SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW40_24G_Diff[RFPath][TX_2S]; - if ((MGN_MCS16 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT3SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW40_24G_Diff[RFPath][TX_3S]; - if ((MGN_MCS24 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT4SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW40_24G_Diff[RFPath][TX_4S]; - - } - /* Willis suggest adopt BW 40M power index while in BW 80 mode */ - else if (BandWidth == CHANNEL_WIDTH_80) { - if ((MGN_MCS0 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT1SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW40_24G_Diff[RFPath][TX_1S]; - if ((MGN_MCS8 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT2SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW40_24G_Diff[RFPath][TX_2S]; - if ((MGN_MCS16 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT3SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW40_24G_Diff[RFPath][TX_3S]; - if ((MGN_MCS24 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT4SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW40_24G_Diff[RFPath][TX_4S]; + if (IS_CCK_RATE(Rate)) + txPower = pHalData->Index24G_CCK_Base[RFPath][chnlIdx]; + else if (MGN_6M <= Rate) + txPower = pHalData->Index24G_BW40_Base[RFPath][chnlIdx]; + + /* OFDM-1T */ + if ((MGN_6M <= Rate && Rate <= MGN_54M) && !IS_CCK_RATE(Rate)) + txPower += pHalData->OFDM_24G_Diff[RFPath][TX_1S]; + + if (BandWidth == CHANNEL_WIDTH_20) { /* BW20-1S, BW20-2S */ + if (MGN_MCS0 <= Rate && Rate <= MGN_MCS31) + txPower += pHalData->BW20_24G_Diff[RFPath][TX_1S]; + if (MGN_MCS8 <= Rate && Rate <= MGN_MCS31) + txPower += pHalData->BW20_24G_Diff[RFPath][TX_2S]; + if (MGN_MCS16 <= Rate && Rate <= MGN_MCS31) + txPower += pHalData->BW20_24G_Diff[RFPath][TX_3S]; + if (MGN_MCS24 <= Rate && Rate <= MGN_MCS31) + txPower += pHalData->BW20_24G_Diff[RFPath][TX_4S]; + + } else if (BandWidth == CHANNEL_WIDTH_40) { /* BW40-1S, BW40-2S */ + if (MGN_MCS0 <= Rate && Rate <= MGN_MCS31) + txPower += pHalData->BW40_24G_Diff[RFPath][TX_1S]; + if (MGN_MCS8 <= Rate && Rate <= MGN_MCS31) + txPower += pHalData->BW40_24G_Diff[RFPath][TX_2S]; + if (MGN_MCS16 <= Rate && Rate <= MGN_MCS31) + txPower += pHalData->BW40_24G_Diff[RFPath][TX_3S]; + if (MGN_MCS24 <= Rate && Rate <= MGN_MCS31) + txPower += pHalData->BW40_24G_Diff[RFPath][TX_4S]; - } - } else {/* 3 ============================== 5 G ============================== */ - if (MGN_6M <= Rate) - txPower = pHalData->Index5G_BW40_Base[RFPath][chnlIdx]; - - /* OFDM-1T */ - if ((MGN_6M <= Rate && Rate <= MGN_54M) && !IS_CCK_RATE(Rate)) - txPower += pHalData->OFDM_5G_Diff[RFPath][TX_1S]; - - /* BW20-1S, BW20-2S */ - if (BandWidth == CHANNEL_WIDTH_20) { - if ((MGN_MCS0 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT1SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW20_5G_Diff[RFPath][TX_1S]; - if ((MGN_MCS8 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT2SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW20_5G_Diff[RFPath][TX_2S]; - if ((MGN_MCS16 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT3SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW20_5G_Diff[RFPath][TX_3S]; - if ((MGN_MCS24 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT4SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW20_5G_Diff[RFPath][TX_4S]; - - } else if (BandWidth == CHANNEL_WIDTH_40) { /* BW40-1S, BW40-2S */ - if ((MGN_MCS0 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT1SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW40_5G_Diff[RFPath][TX_1S]; - if ((MGN_MCS8 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT2SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW40_5G_Diff[RFPath][TX_2S]; - if ((MGN_MCS16 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT3SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW40_5G_Diff[RFPath][TX_3S]; - if ((MGN_MCS24 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT4SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW40_5G_Diff[RFPath][TX_4S]; - - } else if (BandWidth == CHANNEL_WIDTH_80) { /* BW80-1S, BW80-2S */ - /* <20121220, Kordan> Get the index of array "Index5G_BW80_Base". */ - u8 channel5G_80M[CHANNEL_MAX_NUMBER_5G_80M] = {42, 58, 106, 122, 138, 155, 171}; - for (i = 0; i < ARRAY_SIZE(channel5G_80M); ++i) - if (channel5G_80M[i] == Channel) - chnlIdx = i; - - txPower = pHalData->Index5G_BW80_Base[RFPath][chnlIdx]; - - if ((MGN_MCS0 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT1SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += + pHalData->BW80_5G_Diff[RFPath][TX_1S]; - if ((MGN_MCS8 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT2SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW80_5G_Diff[RFPath][TX_2S]; - if ((MGN_MCS16 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT3SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW80_5G_Diff[RFPath][TX_3S]; - if ((MGN_MCS23 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT4SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) - txPower += pHalData->BW80_5G_Diff[RFPath][TX_4S]; - } } return txPower; @@ -1252,126 +841,6 @@ u8 PHY_GetRateIndexOfTxPowerByRate(u8 Rate) case MGN_MCS31: index = 43; break; - case MGN_VHT1SS_MCS0: - index = 44; - break; - case MGN_VHT1SS_MCS1: - index = 45; - break; - case MGN_VHT1SS_MCS2: - index = 46; - break; - case MGN_VHT1SS_MCS3: - index = 47; - break; - case MGN_VHT1SS_MCS4: - index = 48; - break; - case MGN_VHT1SS_MCS5: - index = 49; - break; - case MGN_VHT1SS_MCS6: - index = 50; - break; - case MGN_VHT1SS_MCS7: - index = 51; - break; - case MGN_VHT1SS_MCS8: - index = 52; - break; - case MGN_VHT1SS_MCS9: - index = 53; - break; - case MGN_VHT2SS_MCS0: - index = 54; - break; - case MGN_VHT2SS_MCS1: - index = 55; - break; - case MGN_VHT2SS_MCS2: - index = 56; - break; - case MGN_VHT2SS_MCS3: - index = 57; - break; - case MGN_VHT2SS_MCS4: - index = 58; - break; - case MGN_VHT2SS_MCS5: - index = 59; - break; - case MGN_VHT2SS_MCS6: - index = 60; - break; - case MGN_VHT2SS_MCS7: - index = 61; - break; - case MGN_VHT2SS_MCS8: - index = 62; - break; - case MGN_VHT2SS_MCS9: - index = 63; - break; - case MGN_VHT3SS_MCS0: - index = 64; - break; - case MGN_VHT3SS_MCS1: - index = 65; - break; - case MGN_VHT3SS_MCS2: - index = 66; - break; - case MGN_VHT3SS_MCS3: - index = 67; - break; - case MGN_VHT3SS_MCS4: - index = 68; - break; - case MGN_VHT3SS_MCS5: - index = 69; - break; - case MGN_VHT3SS_MCS6: - index = 70; - break; - case MGN_VHT3SS_MCS7: - index = 71; - break; - case MGN_VHT3SS_MCS8: - index = 72; - break; - case MGN_VHT3SS_MCS9: - index = 73; - break; - case MGN_VHT4SS_MCS0: - index = 74; - break; - case MGN_VHT4SS_MCS1: - index = 75; - break; - case MGN_VHT4SS_MCS2: - index = 76; - break; - case MGN_VHT4SS_MCS3: - index = 77; - break; - case MGN_VHT4SS_MCS4: - index = 78; - break; - case MGN_VHT4SS_MCS5: - index = 79; - break; - case MGN_VHT4SS_MCS6: - index = 80; - break; - case MGN_VHT4SS_MCS7: - index = 81; - break; - case MGN_VHT4SS_MCS8: - index = 82; - break; - case MGN_VHT4SS_MCS9: - index = 83; - break; default: break; } @@ -1379,7 +848,7 @@ u8 PHY_GetRateIndexOfTxPowerByRate(u8 Rate) } s8 PHY_GetTxPowerByRate( - struct adapter *padapter, u8 Band, u8 RFPath, u8 TxNum, u8 Rate + struct adapter *padapter, u8 RFPath, u8 TxNum, u8 Rate ) { struct hal_com_data *pHalData = GET_HAL_DATA(padapter); @@ -1390,9 +859,6 @@ s8 PHY_GetTxPowerByRate( padapter->registrypriv.RegEnableTxPowerByRate == 0) return 0; - if (Band != BAND_ON_2_4G && Band != BAND_ON_5G) - return value; - if (RFPath > ODM_RF_PATH_D) return value; @@ -1402,13 +868,12 @@ s8 PHY_GetTxPowerByRate( if (rateIndex >= TX_PWR_BY_RATE_NUM_RATE) return value; - return pHalData->TxPwrByRateOffset[Band][RFPath][TxNum][rateIndex]; + return pHalData->TxPwrByRateOffset[RFPath][TxNum][rateIndex]; } void PHY_SetTxPowerByRate( struct adapter *padapter, - u8 Band, u8 RFPath, u8 TxNum, u8 Rate, @@ -1418,9 +883,6 @@ void PHY_SetTxPowerByRate( struct hal_com_data *pHalData = GET_HAL_DATA(padapter); u8 rateIndex = PHY_GetRateIndexOfTxPowerByRate(Rate); - if (Band != BAND_ON_2_4G && Band != BAND_ON_5G) - return; - if (RFPath > ODM_RF_PATH_D) return; @@ -1430,18 +892,16 @@ void PHY_SetTxPowerByRate( if (rateIndex >= TX_PWR_BY_RATE_NUM_RATE) return; - pHalData->TxPwrByRateOffset[Band][RFPath][TxNum][rateIndex] = Value; + pHalData->TxPwrByRateOffset[RFPath][TxNum][rateIndex] = Value; } void PHY_SetTxPowerLevelByPath(struct adapter *Adapter, u8 channel, u8 path) { struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); - bool bIsIn24G = (pHalData->CurrentBandType == BAND_ON_2_4G); /* if (pMgntInfo->RegNByteAccess == 0) */ { - if (bIsIn24G) - PHY_SetTxPowerIndexByRateSection(Adapter, path, channel, CCK); + PHY_SetTxPowerIndexByRateSection(Adapter, path, channel, CCK); PHY_SetTxPowerIndexByRateSection(Adapter, path, channel, OFDM); PHY_SetTxPowerIndexByRateSection(Adapter, path, channel, HT_MCS0_MCS7); @@ -1483,26 +943,9 @@ static s8 phy_GetWorldWideLimit(s8 *LimitTable) return min; } -static s8 phy_GetChannelIndexOfTxPowerLimit(u8 Band, u8 Channel) +static s8 phy_GetChannelIndexOfTxPowerLimit(u8 Channel) { - s8 channelIndex = -1; - u8 channel5G[CHANNEL_MAX_NUMBER_5G] = { - 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 100, 102, - 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, - 132, 134, 136, 138, 140, 142, 144, 149, 151, 153, 155, 157, 159, 161, - 163, 165, 167, 168, 169, 171, 173, 175, 177 - }; - u8 i = 0; - if (Band == BAND_ON_2_4G) - channelIndex = Channel - 1; - else if (Band == BAND_ON_5G) { - for (i = 0; i < ARRAY_SIZE(channel5G); ++i) { - if (channel5G[i] == Channel) - channelIndex = i; - } - } - - return channelIndex; + return Channel - 1; } static s16 get_bandwidth_idx(const enum channel_width bandwidth) @@ -1512,10 +955,6 @@ static s16 get_bandwidth_idx(const enum channel_width bandwidth) return 0; case CHANNEL_WIDTH_40: return 1; - case CHANNEL_WIDTH_80: - return 2; - case CHANNEL_WIDTH_160: - return 3; default: return -1; } @@ -1541,42 +980,22 @@ static s16 get_rate_sctn_idx(const u8 rate) case MGN_MCS24: case MGN_MCS25: case MGN_MCS26: case MGN_MCS27: case MGN_MCS28: case MGN_MCS29: case MGN_MCS30: case MGN_MCS31: return 5; - case MGN_VHT1SS_MCS0: case MGN_VHT1SS_MCS1: case MGN_VHT1SS_MCS2: - case MGN_VHT1SS_MCS3: case MGN_VHT1SS_MCS4: case MGN_VHT1SS_MCS5: - case MGN_VHT1SS_MCS6: case MGN_VHT1SS_MCS7: case MGN_VHT1SS_MCS8: - case MGN_VHT1SS_MCS9: - return 6; - case MGN_VHT2SS_MCS0: case MGN_VHT2SS_MCS1: case MGN_VHT2SS_MCS2: - case MGN_VHT2SS_MCS3: case MGN_VHT2SS_MCS4: case MGN_VHT2SS_MCS5: - case MGN_VHT2SS_MCS6: case MGN_VHT2SS_MCS7: case MGN_VHT2SS_MCS8: - case MGN_VHT2SS_MCS9: - return 7; - case MGN_VHT3SS_MCS0: case MGN_VHT3SS_MCS1: case MGN_VHT3SS_MCS2: - case MGN_VHT3SS_MCS3: case MGN_VHT3SS_MCS4: case MGN_VHT3SS_MCS5: - case MGN_VHT3SS_MCS6: case MGN_VHT3SS_MCS7: case MGN_VHT3SS_MCS8: - case MGN_VHT3SS_MCS9: - return 8; - case MGN_VHT4SS_MCS0: case MGN_VHT4SS_MCS1: case MGN_VHT4SS_MCS2: - case MGN_VHT4SS_MCS3: case MGN_VHT4SS_MCS4: case MGN_VHT4SS_MCS5: - case MGN_VHT4SS_MCS6: case MGN_VHT4SS_MCS7: case MGN_VHT4SS_MCS8: - case MGN_VHT4SS_MCS9: - return 9; default: return -1; } } s8 phy_get_tx_pwr_lmt(struct adapter *adapter, u32 reg_pwr_tbl_sel, - enum band_type band_type, enum channel_width bandwidth, + enum channel_width bandwidth, u8 rf_path, u8 data_rate, u8 channel) { - s16 idx_band = -1; s16 idx_regulation = -1; s16 idx_bandwidth = -1; s16 idx_rate_sctn = -1; s16 idx_channel = -1; s8 pwr_lmt = MAX_POWER_INDEX; struct hal_com_data *hal_data = GET_HAL_DATA(adapter); + s8 limits[10] = {0}; u8 i = 0; if (((adapter->registrypriv.RegEnableTxPowerLimit == 2) && (hal_data->EEPROMRegulatory != 1)) || @@ -1597,17 +1016,10 @@ s8 phy_get_tx_pwr_lmt(struct adapter *adapter, u32 reg_pwr_tbl_sel, idx_regulation = TXPWR_LMT_WW; break; default: - idx_regulation = (band_type == BAND_ON_2_4G) ? - hal_data->Regulation2_4G : - hal_data->Regulation5G; + idx_regulation = hal_data->Regulation2_4G; break; } - if (band_type == BAND_ON_2_4G) - idx_band = 0; - else if (band_type == BAND_ON_5G) - idx_band = 1; - idx_bandwidth = get_bandwidth_idx(bandwidth); idx_rate_sctn = get_rate_sctn_idx(data_rate); @@ -1617,107 +1029,30 @@ s8 phy_get_tx_pwr_lmt(struct adapter *adapter, u32 reg_pwr_tbl_sel, /* HT on 80M will reference to HT on 40M */ if (idx_rate_sctn == 0 || idx_rate_sctn == 1) idx_bandwidth = 0; - else if ((idx_rate_sctn == 2 || idx_rate_sctn == 3) && - (band_type == BAND_ON_5G) && (idx_bandwidth == 2)) - idx_bandwidth = 1; - if (band_type == BAND_ON_2_4G || band_type == BAND_ON_5G) - channel = phy_GetChannelIndexOfTxPowerLimit(band_type, channel); + channel = phy_GetChannelIndexOfTxPowerLimit(channel); - if (idx_band == -1 || idx_regulation == -1 || idx_bandwidth == -1 || + if (idx_regulation == -1 || idx_bandwidth == -1 || idx_rate_sctn == -1 || idx_channel == -1) return MAX_POWER_INDEX; - if (band_type == BAND_ON_2_4G) { - s8 limits[10] = {0}; u8 i = 0; - - for (i = 0; i < MAX_REGULATION_NUM; i++) - limits[i] = hal_data->TxPwrLimit_2_4G[i] - [idx_bandwidth] - [idx_rate_sctn] - [idx_channel] - [rf_path]; - - pwr_lmt = (idx_regulation == TXPWR_LMT_WW) ? - phy_GetWorldWideLimit(limits) : - hal_data->TxPwrLimit_2_4G[idx_regulation] - [idx_bandwidth] - [idx_rate_sctn] - [idx_channel] - [rf_path]; - - } else if (band_type == BAND_ON_5G) { - s8 limits[10] = {0}; u8 i = 0; - - for (i = 0; i < MAX_REGULATION_NUM; ++i) - limits[i] = hal_data->TxPwrLimit_5G[i] - [idx_bandwidth] - [idx_rate_sctn] - [idx_channel] - [rf_path]; - - pwr_lmt = (idx_regulation == TXPWR_LMT_WW) ? - phy_GetWorldWideLimit(limits) : - hal_data->TxPwrLimit_5G[idx_regulation] - [idx_bandwidth] - [idx_rate_sctn] - [idx_channel] - [rf_path]; - } - return pwr_lmt; -} + for (i = 0; i < MAX_REGULATION_NUM; i++) + limits[i] = hal_data->TxPwrLimit_2_4G[i] + [idx_bandwidth] + [idx_rate_sctn] + [idx_channel] + [rf_path]; -static void phy_CrossReferenceHTAndVHTTxPowerLimit(struct adapter *padapter) -{ - struct hal_com_data *pHalData = GET_HAL_DATA(padapter); - u8 regulation, bw, channel, rateSection; - s8 tempPwrLmt = 0; + pwr_lmt = (idx_regulation == TXPWR_LMT_WW) ? + phy_GetWorldWideLimit(limits) : + hal_data->TxPwrLimit_2_4G[idx_regulation] + [idx_bandwidth] + [idx_rate_sctn] + [idx_channel] + [rf_path]; - for (regulation = 0; regulation < MAX_REGULATION_NUM; ++regulation) { - for (bw = 0; bw < MAX_5G_BANDWIDTH_NUM; ++bw) { - for (channel = 0; channel < CHANNEL_MAX_NUMBER_5G; ++channel) { - for (rateSection = 0; rateSection < MAX_RATE_SECTION_NUM; ++rateSection) { - tempPwrLmt = pHalData->TxPwrLimit_5G[regulation][bw][rateSection][channel][ODM_RF_PATH_A]; - if (tempPwrLmt == MAX_POWER_INDEX) { - u8 baseSection = 2, refSection = 6; - if (bw == 0 || bw == 1) { /* 5G 20M 40M VHT and HT can cross reference */ - /* 1, bw, rateSection, channel, ODM_RF_PATH_A); */ - if (rateSection >= 2 && rateSection <= 9) { - if (rateSection == 2) { - baseSection = 2; - refSection = 6; - } else if (rateSection == 3) { - baseSection = 3; - refSection = 7; - } else if (rateSection == 4) { - baseSection = 4; - refSection = 8; - } else if (rateSection == 5) { - baseSection = 5; - refSection = 9; - } else if (rateSection == 6) { - baseSection = 6; - refSection = 2; - } else if (rateSection == 7) { - baseSection = 7; - refSection = 3; - } else if (rateSection == 8) { - baseSection = 8; - refSection = 4; - } else if (rateSection == 9) { - baseSection = 9; - refSection = 5; - } - pHalData->TxPwrLimit_5G[regulation][bw][baseSection][channel][ODM_RF_PATH_A] = - pHalData->TxPwrLimit_5G[regulation][bw][refSection][channel][ODM_RF_PATH_A]; - } - } - } - } - } - } - } + return pwr_lmt; } void PHY_ConvertTxPowerLimitToPowerIndex(struct adapter *Adapter) @@ -1728,8 +1063,6 @@ void PHY_ConvertTxPowerLimitToPowerIndex(struct adapter *Adapter) s8 tempValue = 0, tempPwrLmt = 0; u8 rfPath = 0; - phy_CrossReferenceHTAndVHTTxPowerLimit(Adapter); - for (regulation = 0; regulation < MAX_REGULATION_NUM; ++regulation) { for (bw = 0; bw < MAX_2_4G_BANDWIDTH_NUM; ++bw) { for (channel = 0; channel < CHANNEL_MAX_NUMBER_2G; ++channel) { @@ -1739,17 +1072,17 @@ void PHY_ConvertTxPowerLimitToPowerIndex(struct adapter *Adapter) for (rfPath = ODM_RF_PATH_A; rfPath < MAX_RF_PATH_NUM; ++rfPath) { if (pHalData->odmpriv.PhyRegPgValueType == PHY_REG_PG_EXACT_VALUE) { if (rateSection == 5) /* HT 4T */ - BW40PwrBasedBm2_4G = PHY_GetTxPowerByRateBase(Adapter, BAND_ON_2_4G, rfPath, RF_4TX, HT_MCS24_MCS31); + BW40PwrBasedBm2_4G = PHY_GetTxPowerByRateBase(Adapter, rfPath, RF_4TX, HT_MCS24_MCS31); else if (rateSection == 4) /* HT 3T */ - BW40PwrBasedBm2_4G = PHY_GetTxPowerByRateBase(Adapter, BAND_ON_2_4G, rfPath, RF_3TX, HT_MCS16_MCS23); + BW40PwrBasedBm2_4G = PHY_GetTxPowerByRateBase(Adapter, rfPath, RF_3TX, HT_MCS16_MCS23); else if (rateSection == 3) /* HT 2T */ - BW40PwrBasedBm2_4G = PHY_GetTxPowerByRateBase(Adapter, BAND_ON_2_4G, rfPath, RF_2TX, HT_MCS8_MCS15); + BW40PwrBasedBm2_4G = PHY_GetTxPowerByRateBase(Adapter, rfPath, RF_2TX, HT_MCS8_MCS15); else if (rateSection == 2) /* HT 1T */ - BW40PwrBasedBm2_4G = PHY_GetTxPowerByRateBase(Adapter, BAND_ON_2_4G, rfPath, RF_1TX, HT_MCS0_MCS7); + BW40PwrBasedBm2_4G = PHY_GetTxPowerByRateBase(Adapter, rfPath, RF_1TX, HT_MCS0_MCS7); else if (rateSection == 1) /* OFDM */ - BW40PwrBasedBm2_4G = PHY_GetTxPowerByRateBase(Adapter, BAND_ON_2_4G, rfPath, RF_1TX, OFDM); + BW40PwrBasedBm2_4G = PHY_GetTxPowerByRateBase(Adapter, rfPath, RF_1TX, OFDM); else if (rateSection == 0) /* CCK */ - BW40PwrBasedBm2_4G = PHY_GetTxPowerByRateBase(Adapter, BAND_ON_2_4G, rfPath, RF_1TX, CCK); + BW40PwrBasedBm2_4G = PHY_GetTxPowerByRateBase(Adapter, rfPath, RF_1TX, CCK); } else BW40PwrBasedBm2_4G = Adapter->registrypriv.RegPowerBase * 2; @@ -1776,20 +1109,11 @@ void PHY_InitTxPowerLimit(struct adapter *Adapter) for (l = 0; l < MAX_RF_PATH_NUM; ++l) pHalData->TxPwrLimit_2_4G[i][j][k][m][l] = MAX_POWER_INDEX; } - - for (i = 0; i < MAX_REGULATION_NUM; ++i) { - for (j = 0; j < MAX_5G_BANDWIDTH_NUM; ++j) - for (k = 0; k < MAX_RATE_SECTION_NUM; ++k) - for (m = 0; m < CHANNEL_MAX_NUMBER_5G; ++m) - for (l = 0; l < MAX_RF_PATH_NUM; ++l) - pHalData->TxPwrLimit_5G[i][j][k][m][l] = MAX_POWER_INDEX; - } } void PHY_SetTxPowerLimit( struct adapter *Adapter, u8 *Regulation, - u8 *Band, u8 *Bandwidth, u8 *RateSection, u8 *RfPath, @@ -1827,14 +1151,6 @@ void PHY_SetTxPowerLimit( rateSection = 4; else if (eqNByte(RateSection, (u8 *)("HT"), 2) && eqNByte(RfPath, (u8 *)("4T"), 2)) rateSection = 5; - else if (eqNByte(RateSection, (u8 *)("VHT"), 3) && eqNByte(RfPath, (u8 *)("1T"), 2)) - rateSection = 6; - else if (eqNByte(RateSection, (u8 *)("VHT"), 3) && eqNByte(RfPath, (u8 *)("2T"), 2)) - rateSection = 7; - else if (eqNByte(RateSection, (u8 *)("VHT"), 3) && eqNByte(RfPath, (u8 *)("3T"), 2)) - rateSection = 8; - else if (eqNByte(RateSection, (u8 *)("VHT"), 3) && eqNByte(RfPath, (u8 *)("4T"), 2)) - rateSection = 9; else return; @@ -1847,38 +1163,21 @@ void PHY_SetTxPowerLimit( else if (eqNByte(Bandwidth, (u8 *)("160M"), 4)) bandwidth = 3; - if (eqNByte(Band, (u8 *)("2.4G"), 4)) { - channelIndex = phy_GetChannelIndexOfTxPowerLimit(BAND_ON_2_4G, channel); + channelIndex = phy_GetChannelIndexOfTxPowerLimit(channel); - if (channelIndex == -1) - return; - - prevPowerLimit = pHalData->TxPwrLimit_2_4G[regulation][bandwidth][rateSection][channelIndex][ODM_RF_PATH_A]; - - if (powerLimit < prevPowerLimit) - pHalData->TxPwrLimit_2_4G[regulation][bandwidth][rateSection][channelIndex][ODM_RF_PATH_A] = powerLimit; - - } else if (eqNByte(Band, (u8 *)("5G"), 2)) { - channelIndex = phy_GetChannelIndexOfTxPowerLimit(BAND_ON_5G, channel); - - if (channelIndex == -1) - return; - - prevPowerLimit = pHalData->TxPwrLimit_5G[regulation][bandwidth][rateSection][channelIndex][ODM_RF_PATH_A]; + if (channelIndex == -1) + return; - if (powerLimit < prevPowerLimit) - pHalData->TxPwrLimit_5G[regulation][bandwidth][rateSection][channelIndex][ODM_RF_PATH_A] = powerLimit; + prevPowerLimit = pHalData->TxPwrLimit_2_4G[regulation][bandwidth][rateSection][channelIndex][ODM_RF_PATH_A]; - } else { - return; - } + if (powerLimit < prevPowerLimit) + pHalData->TxPwrLimit_2_4G[regulation][bandwidth][rateSection][channelIndex][ODM_RF_PATH_A] = powerLimit; } void Hal_ChannelPlanToRegulation(struct adapter *Adapter, u16 ChannelPlan) { struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); pHalData->Regulation2_4G = TXPWR_LMT_WW; - pHalData->Regulation5G = TXPWR_LMT_WW; switch (ChannelPlan) { case RT_CHANNEL_DOMAIN_WORLD_NULL: @@ -1898,139 +1197,105 @@ void Hal_ChannelPlanToRegulation(struct adapter *Adapter, u16 ChannelPlan) break; case RT_CHANNEL_DOMAIN_FCC1_FCC1: pHalData->Regulation2_4G = TXPWR_LMT_FCC; - pHalData->Regulation5G = TXPWR_LMT_FCC; break; case RT_CHANNEL_DOMAIN_WORLD_ETSI1: pHalData->Regulation2_4G = TXPWR_LMT_FCC; - pHalData->Regulation5G = TXPWR_LMT_ETSI; break; case RT_CHANNEL_DOMAIN_MKK1_MKK1: pHalData->Regulation2_4G = TXPWR_LMT_MKK; - pHalData->Regulation5G = TXPWR_LMT_MKK; break; case RT_CHANNEL_DOMAIN_WORLD_KCC1: pHalData->Regulation2_4G = TXPWR_LMT_FCC; - pHalData->Regulation5G = TXPWR_LMT_MKK; break; case RT_CHANNEL_DOMAIN_WORLD_FCC2: pHalData->Regulation2_4G = TXPWR_LMT_FCC; - pHalData->Regulation5G = TXPWR_LMT_FCC; break; case RT_CHANNEL_DOMAIN_WORLD_FCC3: pHalData->Regulation2_4G = TXPWR_LMT_FCC; - pHalData->Regulation5G = TXPWR_LMT_FCC; break; case RT_CHANNEL_DOMAIN_WORLD_FCC4: pHalData->Regulation2_4G = TXPWR_LMT_FCC; - pHalData->Regulation5G = TXPWR_LMT_FCC; break; case RT_CHANNEL_DOMAIN_WORLD_FCC5: pHalData->Regulation2_4G = TXPWR_LMT_FCC; - pHalData->Regulation5G = TXPWR_LMT_FCC; break; case RT_CHANNEL_DOMAIN_WORLD_FCC6: pHalData->Regulation2_4G = TXPWR_LMT_FCC; - pHalData->Regulation5G = TXPWR_LMT_FCC; break; case RT_CHANNEL_DOMAIN_FCC1_FCC7: pHalData->Regulation2_4G = TXPWR_LMT_FCC; - pHalData->Regulation5G = TXPWR_LMT_FCC; break; case RT_CHANNEL_DOMAIN_WORLD_ETSI2: pHalData->Regulation2_4G = TXPWR_LMT_FCC; - pHalData->Regulation5G = TXPWR_LMT_FCC; break; case RT_CHANNEL_DOMAIN_WORLD_ETSI3: pHalData->Regulation2_4G = TXPWR_LMT_FCC; - pHalData->Regulation5G = TXPWR_LMT_FCC; break; case RT_CHANNEL_DOMAIN_MKK1_MKK2: pHalData->Regulation2_4G = TXPWR_LMT_MKK; - pHalData->Regulation5G = TXPWR_LMT_FCC; break; case RT_CHANNEL_DOMAIN_MKK1_MKK3: pHalData->Regulation2_4G = TXPWR_LMT_MKK; - pHalData->Regulation5G = TXPWR_LMT_FCC; break; case RT_CHANNEL_DOMAIN_FCC1_NCC1: pHalData->Regulation2_4G = TXPWR_LMT_FCC; - pHalData->Regulation5G = TXPWR_LMT_FCC; break; case RT_CHANNEL_DOMAIN_FCC1_NCC2: pHalData->Regulation2_4G = TXPWR_LMT_FCC; - pHalData->Regulation5G = TXPWR_LMT_FCC; break; case RT_CHANNEL_DOMAIN_GLOBAL_NULL: pHalData->Regulation2_4G = TXPWR_LMT_WW; - pHalData->Regulation5G = TXPWR_LMT_WW; break; case RT_CHANNEL_DOMAIN_ETSI1_ETSI4: pHalData->Regulation2_4G = TXPWR_LMT_ETSI; - pHalData->Regulation5G = TXPWR_LMT_ETSI; break; case RT_CHANNEL_DOMAIN_FCC1_FCC2: pHalData->Regulation2_4G = TXPWR_LMT_FCC; - pHalData->Regulation5G = TXPWR_LMT_FCC; break; case RT_CHANNEL_DOMAIN_FCC1_NCC3: pHalData->Regulation2_4G = TXPWR_LMT_FCC; - pHalData->Regulation5G = TXPWR_LMT_FCC; break; case RT_CHANNEL_DOMAIN_WORLD_ETSI5: pHalData->Regulation2_4G = TXPWR_LMT_ETSI; - pHalData->Regulation5G = TXPWR_LMT_ETSI; break; case RT_CHANNEL_DOMAIN_FCC1_FCC8: pHalData->Regulation2_4G = TXPWR_LMT_FCC; - pHalData->Regulation5G = TXPWR_LMT_FCC; break; case RT_CHANNEL_DOMAIN_WORLD_ETSI6: pHalData->Regulation2_4G = TXPWR_LMT_ETSI; - pHalData->Regulation5G = TXPWR_LMT_ETSI; break; case RT_CHANNEL_DOMAIN_WORLD_ETSI7: pHalData->Regulation2_4G = TXPWR_LMT_ETSI; - pHalData->Regulation5G = TXPWR_LMT_ETSI; break; case RT_CHANNEL_DOMAIN_WORLD_ETSI8: pHalData->Regulation2_4G = TXPWR_LMT_ETSI; - pHalData->Regulation5G = TXPWR_LMT_ETSI; break; case RT_CHANNEL_DOMAIN_WORLD_ETSI9: pHalData->Regulation2_4G = TXPWR_LMT_ETSI; - pHalData->Regulation5G = TXPWR_LMT_ETSI; break; case RT_CHANNEL_DOMAIN_WORLD_ETSI10: pHalData->Regulation2_4G = TXPWR_LMT_ETSI; - pHalData->Regulation5G = TXPWR_LMT_ETSI; break; case RT_CHANNEL_DOMAIN_WORLD_ETSI11: pHalData->Regulation2_4G = TXPWR_LMT_ETSI; - pHalData->Regulation5G = TXPWR_LMT_ETSI; break; case RT_CHANNEL_DOMAIN_FCC1_NCC4: pHalData->Regulation2_4G = TXPWR_LMT_FCC; - pHalData->Regulation5G = TXPWR_LMT_FCC; break; case RT_CHANNEL_DOMAIN_WORLD_ETSI12: pHalData->Regulation2_4G = TXPWR_LMT_ETSI; - pHalData->Regulation5G = TXPWR_LMT_ETSI; break; case RT_CHANNEL_DOMAIN_FCC1_FCC9: pHalData->Regulation2_4G = TXPWR_LMT_FCC; - pHalData->Regulation5G = TXPWR_LMT_FCC; break; case RT_CHANNEL_DOMAIN_WORLD_ETSI13: pHalData->Regulation2_4G = TXPWR_LMT_ETSI; - pHalData->Regulation5G = TXPWR_LMT_ETSI; break; case RT_CHANNEL_DOMAIN_FCC1_FCC10: pHalData->Regulation2_4G = TXPWR_LMT_FCC; - pHalData->Regulation5G = TXPWR_LMT_FCC; break; case RT_CHANNEL_DOMAIN_REALTEK_DEFINE: /* Realtek Reserve */ pHalData->Regulation2_4G = TXPWR_LMT_WW; - pHalData->Regulation5G = TXPWR_LMT_WW; break; default: break; diff --git a/drivers/staging/rtl8723bs/hal/hal_intf.c b/drivers/staging/rtl8723bs/hal/hal_intf.c index 8dc4dd8c6d4c..4868a69cdb8f 100644 --- a/drivers/staging/rtl8723bs/hal/hal_intf.c +++ b/drivers/staging/rtl8723bs/hal/hal_intf.c @@ -4,9 +4,6 @@ * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. * ******************************************************************************/ - -#define _HAL_INTF_C_ - #include <drv_types.h> #include <rtw_debug.h> #include <hal_data.h> diff --git a/drivers/staging/rtl8723bs/hal/odm.c b/drivers/staging/rtl8723bs/hal/odm.c index 092b32c41ff3..68dfb77772b2 100644 --- a/drivers/staging/rtl8723bs/hal/odm.c +++ b/drivers/staging/rtl8723bs/hal/odm.c @@ -290,8 +290,6 @@ static void odm_CommonInfoSelfInit(struct dm_odm_t *pDM_Odm) pDM_Odm->bCckHighPower = (bool) PHY_QueryBBReg(pDM_Odm->Adapter, ODM_REG(CCK_RPT_FORMAT, pDM_Odm), ODM_BIT(CCK_RPT_FORMAT, pDM_Odm)); pDM_Odm->RFPathRxEnable = (u8) PHY_QueryBBReg(pDM_Odm->Adapter, ODM_REG(BB_RX_PATH, pDM_Odm), ODM_BIT(BB_RX_PATH, pDM_Odm)); - ODM_InitDebugSetting(pDM_Odm); - pDM_Odm->TxRate = 0xFF; } @@ -323,32 +321,10 @@ static void odm_CommonInfoSelfUpdate(struct dm_odm_t *pDM_Odm) static void odm_CmnInfoInit_Debug(struct dm_odm_t *pDM_Odm) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("odm_CmnInfoInit_Debug ==>\n")); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("SupportPlatform =%d\n", pDM_Odm->SupportPlatform)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("SupportAbility = 0x%x\n", pDM_Odm->SupportAbility)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("SupportInterface =%d\n", pDM_Odm->SupportInterface)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("SupportICType = 0x%x\n", pDM_Odm->SupportICType)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("CutVersion =%d\n", pDM_Odm->CutVersion)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("FabVersion =%d\n", pDM_Odm->FabVersion)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("RFType =%d\n", pDM_Odm->RFType)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("BoardType =%d\n", pDM_Odm->BoardType)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("ExtLNA =%d\n", pDM_Odm->ExtLNA)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("ExtPA =%d\n", pDM_Odm->ExtPA)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("ExtTRSW =%d\n", pDM_Odm->ExtTRSW)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("PatchID =%d\n", pDM_Odm->PatchID)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("bInHctTest =%d\n", pDM_Odm->bInHctTest)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("bWIFITest =%d\n", pDM_Odm->bWIFITest)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("bDualMacSmartConcurrent =%d\n", pDM_Odm->bDualMacSmartConcurrent)); - } static void odm_BasicDbgMessage(struct dm_odm_t *pDM_Odm) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("odm_BasicDbgMsg ==>\n")); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("bLinked = %d, RSSI_Min = %d,\n", - pDM_Odm->bLinked, pDM_Odm->RSSI_Min)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("RxRate = 0x%x, RSSI_A = %d, RSSI_B = %d\n", - pDM_Odm->RxRate, pDM_Odm->RSSI_A, pDM_Odm->RSSI_B)); } /* 3 ============================================================ */ @@ -401,7 +377,6 @@ u32 ODM_Get_Rate_Bitmap( break; case (ODM_WM_G): - case (ODM_WM_A): if (rssi_level == DM_RATR_STA_HIGH) rate_bitmap = 0x00000f00; else @@ -420,7 +395,6 @@ u32 ODM_Get_Rate_Bitmap( case (ODM_WM_B|ODM_WM_G|ODM_WM_N24G): case (ODM_WM_B|ODM_WM_N24G): case (ODM_WM_G|ODM_WM_N24G): - case (ODM_WM_A|ODM_WM_N5G): if (pDM_Odm->RFType == ODM_1T2R || pDM_Odm->RFType == ODM_1T1R) { if (rssi_level == DM_RATR_STA_HIGH) rate_bitmap = 0x000f0000; @@ -446,34 +420,6 @@ u32 ODM_Get_Rate_Bitmap( } break; - case (ODM_WM_AC|ODM_WM_G): - if (rssi_level == 1) - rate_bitmap = 0xfc3f0000; - else if (rssi_level == 2) - rate_bitmap = 0xfffff000; - else - rate_bitmap = 0xffffffff; - break; - - case (ODM_WM_AC|ODM_WM_A): - - if (pDM_Odm->RFType == RF_1T1R) { - if (rssi_level == 1) /* add by Gary for ac-series */ - rate_bitmap = 0x003f8000; - else if (rssi_level == 2) - rate_bitmap = 0x003ff000; - else - rate_bitmap = 0x003ff010; - } else { - if (rssi_level == 1) /* add by Gary for ac-series */ - rate_bitmap = 0xfe3f8000; /* VHT 2SS MCS3~9 */ - else if (rssi_level == 2) - rate_bitmap = 0xfffff000; /* VHT 2SS MCS0~9 */ - else - rate_bitmap = 0xfffff010; /* All */ - } - break; - default: if (pDM_Odm->RFType == RF_1T2R) rate_bitmap = 0x000fffff; @@ -482,9 +428,6 @@ u32 ODM_Get_Rate_Bitmap( break; } - /* printk("%s ==> rssi_level:0x%02x, WirelessMode:0x%02x, rate_bitmap:0x%08x\n", __func__, rssi_level, WirelessMode, rate_bitmap); */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, (" ==> rssi_level:0x%02x, WirelessMode:0x%02x, rate_bitmap:0x%08x\n", rssi_level, WirelessMode, rate_bitmap)); - return ra_mask & rate_bitmap; } @@ -495,12 +438,10 @@ static void odm_RefreshRateAdaptiveMaskCE(struct dm_odm_t *pDM_Odm) struct adapter *padapter = pDM_Odm->Adapter; if (padapter->bDriverStopped) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_TRACE, ("<---- odm_RefreshRateAdaptiveMask(): driver is going to unload\n")); return; } if (!pDM_Odm->bUseRAMask) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("<---- odm_RefreshRateAdaptiveMask(): driver does not control rate adaptive mask\n")); return; } @@ -512,7 +453,6 @@ static void odm_RefreshRateAdaptiveMaskCE(struct dm_odm_t *pDM_Odm) continue; if (true == ODM_RAStateCheck(pDM_Odm, pstat->rssi_stat.UndecoratedSmoothedPWDB, false, &pstat->rssi_level)) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RSSI:%d, RSSI_LEVEL:%d\n", pstat->rssi_stat.UndecoratedSmoothedPWDB, pstat->rssi_level)); /* printk("RSSI:%d, RSSI_LEVEL:%d\n", pstat->rssi_stat.UndecoratedSmoothedPWDB, pstat->rssi_level); */ rtw_hal_update_ra_mask(pstat, pstat->rssi_level); } @@ -541,9 +481,7 @@ static void odm_RefreshRateAdaptiveMaskCE(struct dm_odm_t *pDM_Odm) static void odm_RefreshRateAdaptiveMask(struct dm_odm_t *pDM_Odm) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_TRACE, ("odm_RefreshRateAdaptiveMask()---------->\n")); if (!(pDM_Odm->SupportAbility & ODM_BB_RA_MASK)) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_TRACE, ("odm_RefreshRateAdaptiveMask(): Return cos not supported\n")); return; } odm_RefreshRateAdaptiveMaskCE(pDM_Odm); @@ -582,7 +520,8 @@ bool ODM_RAStateCheck( break; default: - ODM_RT_ASSERT(pDM_Odm, false, ("wrong rssi level setting %d !", *pRATRState)); + netdev_dbg(pDM_Odm->Adapter->pnetdev, + "wrong rssi level setting %d !", *pRATRState); break; } @@ -596,7 +535,6 @@ bool ODM_RAStateCheck( /* printk("==>%s, RATRState:0x%02x , RSSI:%d\n", __func__, RATRState, RSSI); */ if (*pRATRState != RATRState || bForceUpdate) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RSSI Level %d -> %d\n", *pRATRState, RATRState)); *pRATRState = RATRState; return true; } @@ -631,11 +569,8 @@ static void FindMinimumRSSI(struct adapter *padapter) (pdmpriv->EntryMinUndecoratedSmoothedPWDB == 0) ) { pdmpriv->MinUndecoratedPWDBForDM = 0; - /* ODM_RT_TRACE(pDM_Odm, COMP_BB_POWERSAVING, DBG_LOUD, ("Not connected to any\n")); */ } else pdmpriv->MinUndecoratedPWDBForDM = pdmpriv->EntryMinUndecoratedSmoothedPWDB; - - /* ODM_RT_TRACE(pDM_Odm, COMP_DIG, DBG_LOUD, ("MinUndecoratedPWDBForDM =%d\n", pHalData->MinUndecoratedPWDBForDM)); */ } static void odm_RSSIMonitorCheckCE(struct dm_odm_t *pDM_Odm) @@ -838,9 +773,6 @@ void ODM_DMInit(struct dm_odm_t *pDM_Odm) ODM_ClearTxPowerTrackingState(pDM_Odm); - if (*(pDM_Odm->mp_mode) != 1) - odm_PathDiversityInit(pDM_Odm); - odm_DynamicBBPowerSavingInit(pDM_Odm); odm_DynamicTxPowerInit(pDM_Odm); @@ -858,7 +790,6 @@ void ODM_DMWatchdog(struct dm_odm_t *pDM_Odm) odm_BasicDbgMessage(pDM_Odm); odm_FalseAlarmCounterStatistics(pDM_Odm); odm_NHMCounterStatistics(pDM_Odm); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): RSSI = 0x%x\n", pDM_Odm->RSSI_Min)); odm_RSSIMonitorCheck(pDM_Odm); @@ -872,8 +803,6 @@ void ODM_DMWatchdog(struct dm_odm_t *pDM_Odm) /* (pDM_Odm->SupportICType & (ODM_RTL8188E) &&(&&(((pDM_Odm->SupportInterface == ODM_ITRF_SDIO))) */ /* */ ) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("----Step1: odm_DIG is in LPS mode\n")); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("---Step2: 8723AS is in LPS mode\n")); odm_DIGbyRSSI_LPS(pDM_Odm); } else odm_DIG(pDM_Odm); @@ -891,7 +820,6 @@ void ODM_DMWatchdog(struct dm_odm_t *pDM_Odm) odm_RefreshRateAdaptiveMask(pDM_Odm); odm_EdcaTurboCheck(pDM_Odm); - odm_PathDiversity(pDM_Odm); ODM_CfoTracking(pDM_Odm); ODM_TXPowerTrackingCheck(pDM_Odm); @@ -956,10 +884,6 @@ void ODM_CmnInfoInit(struct dm_odm_t *pDM_Odm, enum odm_cmninfo_e CmnInfo, u32 V pDM_Odm->AntDivType = (u8)Value; break; - case ODM_CMNINFO_BOARD_TYPE: - pDM_Odm->BoardType = (u8)Value; - break; - case ODM_CMNINFO_PACKAGE_TYPE: pDM_Odm->PackageType = (u8)Value; break; @@ -968,18 +892,10 @@ void ODM_CmnInfoInit(struct dm_odm_t *pDM_Odm, enum odm_cmninfo_e CmnInfo, u32 V pDM_Odm->ExtLNA = (u8)Value; break; - case ODM_CMNINFO_5G_EXT_LNA: - pDM_Odm->ExtLNA5G = (u8)Value; - break; - case ODM_CMNINFO_EXT_PA: pDM_Odm->ExtPA = (u8)Value; break; - case ODM_CMNINFO_5G_EXT_PA: - pDM_Odm->ExtPA5G = (u8)Value; - break; - case ODM_CMNINFO_GPA: pDM_Odm->TypeGPA = (enum odm_type_gpa_e)Value; break; @@ -1044,10 +960,6 @@ void ODM_CmnInfoHook(struct dm_odm_t *pDM_Odm, enum odm_cmninfo_e CmnInfo, void pDM_Odm->pwirelessmode = pValue; break; - case ODM_CMNINFO_BAND: - pDM_Odm->pBandType = pValue; - break; - case ODM_CMNINFO_SEC_CHNL_OFFSET: pDM_Odm->pSecChOffset = pValue; break; @@ -1214,13 +1126,6 @@ void ODM_CmnInfoUpdate(struct dm_odm_t *pDM_Odm, u32 CmnInfo, u64 Value) pDM_Odm->RSSI_Min = (u8)Value; break; - case ODM_CMNINFO_DBG_COMP: - pDM_Odm->DebugComponents = Value; - break; - - case ODM_CMNINFO_DBG_LEVEL: - pDM_Odm->DebugLevel = (u32)Value; - break; case ODM_CMNINFO_RA_THRESHOLD_HIGH: pDM_Odm->RateAdaptive.HighRSSIThresh = (u8)Value; break; @@ -1262,10 +1167,6 @@ void ODM_CmnInfoUpdate(struct dm_odm_t *pDM_Odm, u32 CmnInfo, u64 Value) pDM_Odm->WirelessMode = (u8)Value; break; - case ODM_CMNINFO_BAND: - pDM_Odm->BandType = (u8)Value; - break; - case ODM_CMNINFO_SEC_CHNL_OFFSET: pDM_Odm->SecChOffset = (u8)Value; break; diff --git a/drivers/staging/rtl8723bs/hal/odm.h b/drivers/staging/rtl8723bs/hal/odm.h index ff21343fbe0b..abf6547518fb 100644 --- a/drivers/staging/rtl8723bs/hal/odm.h +++ b/drivers/staging/rtl8723bs/hal/odm.h @@ -11,7 +11,6 @@ #include "odm_EdcaTurboCheck.h" #include "odm_DIG.h" -#include "odm_PathDiv.h" #include "odm_DynamicBBPowerSaving.h" #include "odm_DynamicTxPower.h" #include "odm_CfoTracking.h" @@ -152,7 +151,6 @@ struct swat_t { /* _SW_Antenna_Switch_ */ bool ANTB_ON; /* To indicate Ant B is on or not */ bool Pre_Aux_FailDetec; bool RSSI_AntDect_bResult; - u8 Ant5G; u8 Ant2G; s32 RSSI_sum_A; @@ -197,10 +195,7 @@ struct odm_rate_adaptive { #define AVG_THERMAL_NUM 8 #define IQK_Matrix_REG_NUM 8 -#define IQK_Matrix_Settings_NUM (14 + 24 + 21) /* Channels_2_4G_NUM - * + Channels_5G_20M_NUM - * + Channels_5G - */ +#define IQK_Matrix_Settings_NUM 14 /* Channels_2_4G_NUM */ #define DM_Type_ByFW 0 #define DM_Type_ByDriver 1 @@ -293,12 +288,9 @@ enum odm_cmninfo_e { ODM_CMNINFO_FAB_VER, /* ODM_FAB_E */ ODM_CMNINFO_RF_TYPE, /* ODM_RF_PATH_E or ODM_RF_TYPE_E? */ ODM_CMNINFO_RFE_TYPE, - ODM_CMNINFO_BOARD_TYPE, /* ODM_BOARD_TYPE_E */ ODM_CMNINFO_PACKAGE_TYPE, ODM_CMNINFO_EXT_LNA, /* true */ - ODM_CMNINFO_5G_EXT_LNA, ODM_CMNINFO_EXT_PA, - ODM_CMNINFO_5G_EXT_PA, ODM_CMNINFO_GPA, ODM_CMNINFO_APA, ODM_CMNINFO_GLNA, @@ -316,7 +308,6 @@ enum odm_cmninfo_e { ODM_CMNINFO_TX_UNI, ODM_CMNINFO_RX_UNI, ODM_CMNINFO_WM_MODE, /* ODM_WIRELESS_MODE_E */ - ODM_CMNINFO_BAND, /* ODM_BAND_TYPE_E */ ODM_CMNINFO_SEC_CHNL_OFFSET, /* ODM_SEC_CHNL_OFFSET_E */ ODM_CMNINFO_SEC_MODE, /* ODM_SECURITY_E */ ODM_CMNINFO_BW, /* ODM_BW_E */ @@ -456,33 +447,17 @@ enum { /* tag_Wireless_Mode_Definition */ ODM_WM_UNKNOWN = 0x0, ODM_WM_B = BIT0, ODM_WM_G = BIT1, - ODM_WM_A = BIT2, ODM_WM_N24G = BIT3, - ODM_WM_N5G = BIT4, ODM_WM_AUTO = BIT5, - ODM_WM_AC = BIT6, -}; - -/* ODM_CMNINFO_BAND */ -enum { /* tag_Band_Type_Definition */ - ODM_BAND_2_4G = 0, - ODM_BAND_5G, - ODM_BAND_ON_BOTH, - ODM_BANDMAX }; /* ODM_CMNINFO_BW */ enum { /* tag_Bandwidth_Definition */ ODM_BW20M = 0, ODM_BW40M = 1, - ODM_BW80M = 2, - ODM_BW160M = 3, - ODM_BW10M = 4, }; -/* ODM_CMNINFO_BOARD_TYPE */ -/* For non-AC-series IC , ODM_BOARD_5G_EXT_PA and ODM_BOARD_5G_EXT_LNA are ignored */ -/* For AC-series IC, external PA & LNA can be indivisuallly added on 2.4G and/or 5G */ +/* For AC-series IC, external PA & LNA can be individually added on 2.4G */ enum odm_type_gpa_e { /* tag_ODM_TYPE_GPA_Definition */ TYPE_GPA0 = 0, @@ -530,7 +505,6 @@ struct odm_rf_cal_t { /* ODM_RF_Calibration_Structure */ bool bTXPowerTracking; u8 TxPowerTrackControl; /* for mp mode, turn off txpwrtracking as default */ u8 TM_Trigger; - u8 InternalPA5G[2]; /* pathA / pathB */ u8 ThermalMeter[2]; /* ThermalMeter, index 0 for RFIC0, and 1 for RFIC1 */ u8 ThermalValue; @@ -565,7 +539,7 @@ struct odm_rf_cal_t { /* ODM_RF_Calibration_Structure */ bool bIQKInProgress; u8 Delta_IQK; u8 Delta_LCK; - s8 BBSwingDiff2G, BBSwingDiff5G; /* Unit: dB */ + s8 BBSwingDiff2G; /* Unit: dB */ u8 DeltaSwingTableIdx_2GCCKA_P[DELTA_SWINGIDX_SIZE]; u8 DeltaSwingTableIdx_2GCCKA_N[DELTA_SWINGIDX_SIZE]; u8 DeltaSwingTableIdx_2GCCKB_P[DELTA_SWINGIDX_SIZE]; @@ -574,10 +548,6 @@ struct odm_rf_cal_t { /* ODM_RF_Calibration_Structure */ u8 DeltaSwingTableIdx_2GA_N[DELTA_SWINGIDX_SIZE]; u8 DeltaSwingTableIdx_2GB_P[DELTA_SWINGIDX_SIZE]; u8 DeltaSwingTableIdx_2GB_N[DELTA_SWINGIDX_SIZE]; - u8 DeltaSwingTableIdx_5GA_P[BAND_NUM][DELTA_SWINGIDX_SIZE]; - u8 DeltaSwingTableIdx_5GA_N[BAND_NUM][DELTA_SWINGIDX_SIZE]; - u8 DeltaSwingTableIdx_5GB_P[BAND_NUM][DELTA_SWINGIDX_SIZE]; - u8 DeltaSwingTableIdx_5GB_N[BAND_NUM][DELTA_SWINGIDX_SIZE]; u8 DeltaSwingTableIdx_2GA_P_8188E[DELTA_SWINGIDX_SIZE]; u8 DeltaSwingTableIdx_2GA_N_8188E[DELTA_SWINGIDX_SIZE]; @@ -643,8 +613,6 @@ struct fat_t { /* _FAST_ANTENNA_TRAINNING_ */ bool bBecomeLinked; u32 MinMaxRSSI; u8 idx_AntDiv_counter_2G; - u8 idx_AntDiv_counter_5G; - u32 AntDiv_2G_5G; u32 CCK_counter_main; u32 CCK_counter_aux; u32 OFDM_counter_main; @@ -710,9 +678,6 @@ struct dm_odm_t { /* DM_Out_Source_Dynamic_Mechanism_Structure */ enum phy_reg_pg_type PhyRegPgValueType; u8 PhyRegPgVersion; - u64 DebugComponents; - u32 DebugLevel; - u32 NumQryPhyStatusAll; /* CCK + OFDM */ u32 LastNumQryPhyStatusAll; u32 RxPWDBAve; @@ -766,10 +731,8 @@ struct dm_odm_t { /* DM_Out_Source_Dynamic_Mechanism_Structure */ u8 TypeAPA; /* with external LNA NO/Yes = 0/1 */ u8 ExtLNA; - u8 ExtLNA5G; /* with external PA NO/Yes = 0/1 */ u8 ExtPA; - u8 ExtPA5G; /* with external TRSW NO/Yes = 0/1 */ u8 ExtTRSW; u8 PatchID; /* Customer ID */ @@ -798,8 +761,6 @@ struct dm_odm_t { /* DM_Out_Source_Dynamic_Mechanism_Structure */ u64 *pNumRxBytesUnicast; /* Wireless mode B/G/A/N = BIT0/BIT1/BIT2/BIT3 */ u8 *pwirelessmode; /* ODM_WIRELESS_MODE_E */ - /* Frequence band 2.4G/5G = 0/1 */ - u8 *pBandType; /* Secondary channel offset don't_care/below/above = 0/1/2 */ u8 *pSecChOffset; /* Security mode Open/WEP/AES/TKIP = 0/1/2/3 */ @@ -1068,7 +1029,6 @@ enum ODM_BB_Config_Type { CONFIG_BB_PHY_REG, CONFIG_BB_AGC_TAB, CONFIG_BB_AGC_TAB_2G, - CONFIG_BB_AGC_TAB_5G, CONFIG_BB_PHY_REG_PG, CONFIG_BB_PHY_REG_MP, CONFIG_BB_AGC_TAB_DIFF, diff --git a/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c b/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c index 75471c6c168e..0f6b9d661e39 100644 --- a/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c +++ b/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c @@ -25,16 +25,6 @@ static void odm_SetCrystalCap(void *pDM_VOID, u8 CrystalCap) 0x00FFF000, (CrystalCap | (CrystalCap << 6)) ); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ( - "odm_SetCrystalCap(): CrystalCap = 0x%x\n", - CrystalCap - ) - ); } static u8 odm_GetDefaultCrytaltalCap(void *pDM_VOID) @@ -98,22 +88,6 @@ void ODM_CfoTrackingInit(void *pDM_VOID) pCfoTrack->CrystalCap = odm_GetDefaultCrytaltalCap(pDM_Odm); pCfoTrack->bATCStatus = odm_GetATCStatus(pDM_Odm); pCfoTrack->bAdjust = true; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ("ODM_CfoTracking_init() =========>\n") - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ( - "ODM_CfoTracking_init(): bATCStatus = %d, CrystalCap = 0x%x\n", - pCfoTrack->bATCStatus, - pCfoTrack->DefXCap - ) - ); } void ODM_CfoTracking(void *pDM_VOID) @@ -127,47 +101,16 @@ void ODM_CfoTracking(void *pDM_VOID) /* 4 Support ability */ if (!(pDM_Odm->SupportAbility & ODM_BB_CFO_TRACKING)) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ("ODM_CfoTracking(): Return: SupportAbility ODM_BB_CFO_TRACKING is disabled\n") - ); return; } - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ("ODM_CfoTracking() =========>\n") - ); - if (!pDM_Odm->bLinked || !pDM_Odm->bOneEntryOnly) { /* 4 No link or more than one entry */ ODM_CfoTrackingReset(pDM_Odm); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ( - "ODM_CfoTracking(): Reset: bLinked = %d, bOneEntryOnly = %d\n", - pDM_Odm->bLinked, - pDM_Odm->bOneEntryOnly - ) - ); } else { /* 3 1. CFO Tracking */ /* 4 1.1 No new packet */ if (pCfoTrack->packetCount == pCfoTrack->packetCount_pre) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ( - "ODM_CfoTracking(): packet counter doesn't change\n" - ) - ); return; } pCfoTrack->packetCount_pre = pCfoTrack->packetCount; @@ -180,17 +123,6 @@ void ODM_CfoTracking(void *pDM_VOID) CFO_ave = CFO_kHz_A; else CFO_ave = (int)(CFO_kHz_A + CFO_kHz_B) >> 1; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ( - "ODM_CfoTracking(): CFO_kHz_A = %dkHz, CFO_kHz_B = %dkHz, CFO_ave = %dkHz\n", - CFO_kHz_A, - CFO_kHz_B, - CFO_ave - ) - ); /* 4 1.3 Avoid abnormal large CFO */ CFO_ave_diff = @@ -203,7 +135,6 @@ void ODM_CfoTracking(void *pDM_VOID) pCfoTrack->largeCFOHit == 0 && !pCfoTrack->bAdjust ) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CFO_TRACKING, ODM_DBG_LOUD, ("ODM_CfoTracking(): first large CFO hit\n")); pCfoTrack->largeCFOHit = 1; return; } else @@ -223,12 +154,6 @@ void ODM_CfoTracking(void *pDM_VOID) if (pDM_Odm->bBtEnabled) { pCfoTrack->bAdjust = false; odm_SetCrystalCap(pDM_Odm, pCfoTrack->DefXCap); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ("ODM_CfoTracking(): Disable CFO tracking for BT!!\n") - ); } /* 4 1.6 Big jump */ @@ -237,16 +162,6 @@ void ODM_CfoTracking(void *pDM_VOID) Adjust_Xtal = Adjust_Xtal+((CFO_ave-CFO_TH_XTAL_LOW)>>2); else if (CFO_ave < (-CFO_TH_XTAL_LOW)) Adjust_Xtal = Adjust_Xtal+((CFO_TH_XTAL_LOW-CFO_ave)>>2); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ( - "ODM_CfoTracking(): Crystal cap offset = %d\n", - Adjust_Xtal - ) - ); } /* 4 1.7 Adjust Crystal Cap. */ @@ -263,34 +178,12 @@ void ODM_CfoTracking(void *pDM_VOID) odm_SetCrystalCap(pDM_Odm, (u8)CrystalCap); } - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ( - "ODM_CfoTracking(): Crystal cap = 0x%x, Default Crystal cap = 0x%x\n", - pCfoTrack->CrystalCap, - pCfoTrack->DefXCap - ) - ); /* 3 2. Dynamic ATC switch */ if (CFO_ave < CFO_TH_ATC && CFO_ave > -CFO_TH_ATC) { odm_SetATCStatus(pDM_Odm, false); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ("ODM_CfoTracking(): Disable ATC!!\n") - ); } else { odm_SetATCStatus(pDM_Odm, true); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ("ODM_CfoTracking(): Enable ATC!!\n") - ); } } } diff --git a/drivers/staging/rtl8723bs/hal/odm_DIG.c b/drivers/staging/rtl8723bs/hal/odm_DIG.c index dcef7fb17389..ef5b48bb01b2 100644 --- a/drivers/staging/rtl8723bs/hal/odm_DIG.c +++ b/drivers/staging/rtl8723bs/hal/odm_DIG.c @@ -81,17 +81,6 @@ void odm_NHMBB(void *pDM_VOID) *(pDM_Odm->pNumTxBytesUnicast); pDM_Odm->NHMLastRxOkcnt = *(pDM_Odm->pNumRxBytesUnicast); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ( - "NHM_cnt_0 =%d, NHMCurTxOkcnt = %llu, NHMCurRxOkcnt = %llu\n", - pDM_Odm->NHM_cnt_0, - pDM_Odm->NHMCurTxOkcnt, - pDM_Odm->NHMCurRxOkcnt - ) - ); if ((pDM_Odm->NHMCurTxOkcnt) + 1 > (u64)(pDM_Odm->NHMCurRxOkcnt<<2) + 1) { /* Tx > 4*Rx possible for adaptivity test */ @@ -127,8 +116,6 @@ void odm_NHMBB(void *pDM_VOID) } } } - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("adaptivity_flag = %d\n ", pDM_Odm->adaptivity_flag)); } void odm_SearchPwdBLowerBound(void *pDM_VOID, u8 IGI_target) @@ -165,7 +152,6 @@ void odm_SearchPwdBLowerBound(void *pDM_VOID, u8 IGI_target) else pDM_Odm->txEdcca0 = pDM_Odm->txEdcca0 + 1; } - /* DbgPrint("txEdcca1 = %d, txEdcca0 = %d\n", pDM_Odm->txEdcca1, pDM_Odm->txEdcca0); */ if (pDM_Odm->txEdcca1 > 5) { IGI = IGI-1; @@ -199,8 +185,6 @@ void odm_SearchPwdBLowerBound(void *pDM_VOID, u8 IGI_target) pDM_Odm->Adaptivity_IGI_upper = IGI; } } - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("IGI = 0x%x, H2L_lb = 0x%x, L2H_lb = 0x%x\n", IGI, pDM_Odm->H2L_lb, pDM_Odm->L2H_lb)); } void odm_AdaptivityInit(void *pDM_VOID) @@ -239,19 +223,13 @@ void odm_Adaptivity(void *pDM_VOID, u8 IGI) bool EDCCA_State = false; if (!(pDM_Odm->SupportAbility & ODM_BB_ADAPTIVITY)) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("Go to odm_DynamicEDCCA()\n")); return; } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_Adaptivity() =====>\n")); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("ForceEDCCA =%d, IGI_Base = 0x%x, TH_L2H_ini = %d, TH_EDCCA_HL_diff = %d, AdapEn_RSSI = %d\n", - pDM_Odm->ForceEDCCA, pDM_Odm->IGI_Base, pDM_Odm->TH_L2H_ini, pDM_Odm->TH_EDCCA_HL_diff, pDM_Odm->AdapEn_RSSI)); if (*pDM_Odm->pBandWidth == ODM_BW20M) /* CHANNEL_WIDTH_20 */ IGI_target = pDM_Odm->IGI_Base; else if (*pDM_Odm->pBandWidth == ODM_BW40M) IGI_target = pDM_Odm->IGI_Base + 2; - else if (*pDM_Odm->pBandWidth == ODM_BW80M) - IGI_target = pDM_Odm->IGI_Base + 2; else IGI_target = pDM_Odm->IGI_Base; pDM_Odm->IGI_target = (u8) IGI_target; @@ -284,19 +262,6 @@ void odm_Adaptivity(void *pDM_VOID, u8 IGI) ) odm_NHMBB(pDM_Odm); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ( - "BandWidth =%s, IGI_target = 0x%x, EDCCA_State =%d\n", - (*pDM_Odm->pBandWidth == ODM_BW80M) ? "80M" : - ((*pDM_Odm->pBandWidth == ODM_BW40M) ? "40M" : "20M"), - IGI_target, - EDCCA_State - ) - ); - if (EDCCA_State) { Diff = IGI_target-(s8)IGI; TH_L2H_dmc = pDM_Odm->TH_L2H_ini + Diff; @@ -314,8 +279,6 @@ void odm_Adaptivity(void *pDM_VOID, u8 IGI) TH_L2H_dmc = 0x7f; TH_H2L_dmc = 0x7f; } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("IGI = 0x%x, TH_L2H_dmc = %d, TH_H2L_dmc = %d\n", - IGI, TH_L2H_dmc, TH_H2L_dmc)); PHY_SetBBReg(pDM_Odm->Adapter, rOFDM0_ECCAThreshold, bMaskByte0, (u8)TH_L2H_dmc); PHY_SetBBReg(pDM_Odm->Adapter, rOFDM0_ECCAThreshold, bMaskByte2, (u8)TH_H2L_dmc); } @@ -326,18 +289,13 @@ void ODM_Write_DIG(void *pDM_VOID, u8 CurrentIGI) struct dig_t *pDM_DigTable = &pDM_Odm->DM_DigTable; if (pDM_DigTable->bStopDIG) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("Stop Writing IGI\n")); return; } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_TRACE, ("ODM_REG(IGI_A, pDM_Odm) = 0x%x, ODM_BIT(IGI, pDM_Odm) = 0x%x\n", - ODM_REG(IGI_A, pDM_Odm), ODM_BIT(IGI, pDM_Odm))); - if (pDM_DigTable->CurIGValue != CurrentIGI) { /* 1 Check initial gain by upper bound */ if (!pDM_DigTable->bPSDInProgress) { if (CurrentIGI > pDM_DigTable->rx_gain_range_max) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_TRACE, ("CurrentIGI(0x%02x) is larger than upper bound !!\n", pDM_DigTable->rx_gain_range_max)); CurrentIGI = pDM_DigTable->rx_gain_range_max; } @@ -352,8 +310,6 @@ void ODM_Write_DIG(void *pDM_VOID, u8 CurrentIGI) pDM_DigTable->CurIGValue = CurrentIGI; } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_TRACE, ("CurrentIGI(0x%02x).\n", CurrentIGI)); - } void odm_PauseDIG( @@ -366,18 +322,10 @@ void odm_PauseDIG( struct dig_t *pDM_DigTable = &pDM_Odm->DM_DigTable; static bool bPaused; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG() =========>\n")); - if ( (pDM_Odm->SupportAbility & ODM_BB_ADAPTIVITY) && pDM_Odm->TxHangFlg == true ) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ("odm_PauseDIG(): Dynamic adjust threshold in progress !!\n") - ); return; } @@ -385,12 +333,6 @@ void odm_PauseDIG( !bPaused && (!(pDM_Odm->SupportAbility & ODM_BB_DIG) || !(pDM_Odm->SupportAbility & ODM_BB_FA_CNT)) ){ - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ("odm_PauseDIG(): Return: SupportAbility ODM_BB_DIG or ODM_BB_FA_CNT is disabled\n") - ); return; } @@ -399,18 +341,15 @@ void odm_PauseDIG( case ODM_PAUSE_DIG: /* 2 Disable DIG */ ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_ABILITY, pDM_Odm->SupportAbility & (~ODM_BB_DIG)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG(): Pause DIG !!\n")); /* 2 Backup IGI value */ if (!bPaused) { pDM_DigTable->IGIBackup = pDM_DigTable->CurIGValue; bPaused = true; } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG(): Backup IGI = 0x%x\n", pDM_DigTable->IGIBackup)); /* 2 Write new IGI value */ ODM_Write_DIG(pDM_Odm, IGIValue); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG(): Write new IGI = 0x%x\n", IGIValue)); break; /* 1 Resume DIG */ @@ -419,16 +358,13 @@ void odm_PauseDIG( /* 2 Write backup IGI value */ ODM_Write_DIG(pDM_Odm, pDM_DigTable->IGIBackup); bPaused = false; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG(): Write original IGI = 0x%x\n", pDM_DigTable->IGIBackup)); /* 2 Enable DIG */ ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_ABILITY, pDM_Odm->SupportAbility | ODM_BB_DIG); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG(): Resume DIG !!\n")); } break; default: - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG(): Wrong type !!\n")); break; } } @@ -439,25 +375,21 @@ bool odm_DigAbort(void *pDM_VOID) /* SupportAbility */ if (!(pDM_Odm->SupportAbility & ODM_BB_FA_CNT)) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Return: SupportAbility ODM_BB_FA_CNT is disabled\n")); return true; } /* SupportAbility */ if (!(pDM_Odm->SupportAbility & ODM_BB_DIG)) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Return: SupportAbility ODM_BB_DIG is disabled\n")); return true; } /* ScanInProcess */ if (*(pDM_Odm->pbScanInProcess)) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Return: In Scan Progress\n")); return true; } /* add by Neil Chen to avoid PSD is processing */ if (pDM_Odm->bDMInitialGainEnable == false) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Return: PSD is Processing\n")); return true; } @@ -523,8 +455,6 @@ void odm_DIG(void *pDM_VOID) if (odm_DigAbort(pDM_Odm)) return; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG() ===========================>\n\n")); - if (pDM_Odm->adaptivity_flag == true) Adap_IGI_Upper = pDM_Odm->Adaptivity_IGI_upper; @@ -540,15 +470,12 @@ void odm_DIG(void *pDM_VOID) dm_dig_min = DM_DIG_MIN_NIC; DIG_MaxOfMin = DM_DIG_MAX_AP; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Absolutely upper bound = 0x%x, lower bound = 0x%x\n", dm_dig_max, dm_dig_min)); - /* 1 Adjust boundary by RSSI */ if (pDM_Odm->bLinked && bPerformance) { /* 2 Modify DIG upper bound */ /* 4 Modify DIG upper bound for 92E, 8723A\B, 8821 & 8812 BT */ if (pDM_Odm->bBtLimitedDig == 1) { offset = 10; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Coex. case: Force upper bound to RSSI + %d !!!!!!\n", offset)); } else offset = 15; @@ -586,49 +513,9 @@ void odm_DIG(void *pDM_VOID) DIG_Dynamic_MIN = DIG_MaxOfMin; else DIG_Dynamic_MIN = (u8) pDM_DigTable->AntDiv_RSSI_max; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_ANT_DIV, - ODM_DBG_LOUD, - ( - "odm_DIG(): Antenna diversity case: Force lower bound to 0x%x !!!!!!\n", - DIG_Dynamic_MIN - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_ANT_DIV, - ODM_DBG_LOUD, - ( - "odm_DIG(): Antenna diversity case: RSSI_max = 0x%x !!!!!!\n", - pDM_DigTable->AntDiv_RSSI_max - ) - ); } } } - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ( - "odm_DIG(): Adjust boundary by RSSI Upper bound = 0x%x, Lower bound = 0x%x\n", - pDM_DigTable->rx_gain_range_max, - DIG_Dynamic_MIN - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ( - "odm_DIG(): Link status: bLinked = %d, RSSI = %d, bFirstConnect = %d, bFirsrDisConnect = %d\n\n", - pDM_Odm->bLinked, - pDM_Odm->RSSI_Min, - FirstConnect, - FirstDisConnect - ) - ); /* 1 Modify DIG lower bound, deal with abnormal case */ /* 2 Abnormal false alarm case */ @@ -645,47 +532,20 @@ void odm_DIG(void *pDM_VOID) pDM_Odm->bsta_state ) { pDM_DigTable->rx_gain_range_min = dm_dig_min; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ( - "odm_DIG(): Abnormal #beacon (%d) case in STA mode: Force lower bound to 0x%x !!!!!!\n\n", - pDM_Odm->PhyDbgInfo.NumQryBeaconPkt, - pDM_DigTable->rx_gain_range_min - ) - ); } } /* 2 Abnormal lower bound case */ if (pDM_DigTable->rx_gain_range_min > pDM_DigTable->rx_gain_range_max) { pDM_DigTable->rx_gain_range_min = pDM_DigTable->rx_gain_range_max; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ( - "odm_DIG(): Abnormal lower bound case: Force lower bound to 0x%x !!!!!!\n\n", - pDM_DigTable->rx_gain_range_min - ) - ); } /* 1 False alarm threshold decision */ odm_FAThresholdCheck(pDM_Odm, bDFSBand, bPerformance, RxTp, TxTp, dm_FA_thres); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): False alarm threshold = %d, %d, %d\n\n", dm_FA_thres[0], dm_FA_thres[1], dm_FA_thres[2])); /* 1 Adjust initial gain by false alarm */ if (pDM_Odm->bLinked && bPerformance) { - /* 2 After link */ - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ("odm_DIG(): Adjust IGI after link\n") - ); if (bFirstTpTarget || (FirstConnect && bPerformance)) { pDM_DigTable->LargeFAHit = 0; @@ -698,16 +558,6 @@ void odm_DIG(void *pDM_VOID) CurrentIGI = DIG_MaxOfMin; } - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ( - "odm_DIG(): First connect case: IGI does on-shot to 0x%x\n", - CurrentIGI - ) - ); - } else { if (pFalseAlmCnt->Cnt_all > dm_FA_thres[2]) CurrentIGI = CurrentIGI + 4; @@ -722,35 +572,12 @@ void odm_DIG(void *pDM_VOID) (pDM_Odm->bsta_state) ) { CurrentIGI = pDM_DigTable->rx_gain_range_min; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ( - "odm_DIG(): Abnormal #beacon (%d) case: IGI does one-shot to 0x%x\n", - pDM_Odm->PhyDbgInfo.NumQryBeaconPkt, - CurrentIGI - ) - ); } } } else { - /* 2 Before link */ - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ("odm_DIG(): Adjust IGI before link\n") - ); if (FirstDisConnect || bFirstCoverage) { CurrentIGI = dm_dig_min; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ("odm_DIG(): First disconnect case: IGI does on-shot to lower bound\n") - ); } else { if (pFalseAlmCnt->Cnt_all > dm_FA_thres[2]) CurrentIGI = CurrentIGI + 4; @@ -768,17 +595,6 @@ void odm_DIG(void *pDM_VOID) if (CurrentIGI > pDM_DigTable->rx_gain_range_max) CurrentIGI = pDM_DigTable->rx_gain_range_max; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ( - "odm_DIG(): CurIGValue = 0x%x, TotalFA = %d\n\n", - CurrentIGI, - pFalseAlmCnt->Cnt_all - ) - ); - /* 1 Force upper bound and lower bound for adaptivity */ if ( pDM_Odm->SupportAbility & ODM_BB_ADAPTIVITY && @@ -791,8 +607,6 @@ void odm_DIG(void *pDM_VOID) if (CurrentIGI < pDM_Odm->IGI_LowerBound) CurrentIGI = pDM_Odm->IGI_LowerBound; } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Adaptivity case: Force upper bound to 0x%x !!!!!!\n", Adap_IGI_Upper)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Adaptivity case: Force lower bound to 0x%x !!!!!!\n\n", pDM_Odm->IGI_LowerBound)); } @@ -831,13 +645,6 @@ void odm_DIGbyRSSI_LPS(void *pDM_VOID) CurrentIGI = CurrentIGI+RSSI_OFFSET_DIG; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ("odm_DIGbyRSSI_LPS() ==>\n") - ); - /* Using FW PS mode to make IGI */ /* Adjust by FA in LPS MODE */ if (pFalseAlmCnt->Cnt_all > DM_DIG_FA_TH2_LPS) @@ -862,26 +669,6 @@ void odm_DIGbyRSSI_LPS(void *pDM_VOID) else if (CurrentIGI < RSSI_Lower) CurrentIGI = RSSI_Lower; - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ("odm_DIGbyRSSI_LPS(): pFalseAlmCnt->Cnt_all = %d\n", pFalseAlmCnt->Cnt_all) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ("odm_DIGbyRSSI_LPS(): pDM_Odm->RSSI_Min = %d\n", pDM_Odm->RSSI_Min) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ("odm_DIGbyRSSI_LPS(): CurrentIGI = 0x%x\n", CurrentIGI) - ); - ODM_Write_DIG(pDM_Odm, CurrentIGI); /* ODM_Write_DIG(pDM_Odm, pDM_DigTable->CurIGValue); */ } @@ -970,86 +757,6 @@ void odm_FalseAlarmCounterStatistics(void *pDM_VOID) FalseAlmCnt->Cnt_CCA_all = FalseAlmCnt->Cnt_OFDM_CCA + FalseAlmCnt->Cnt_CCK_CCA; - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ("Enter odm_FalseAlarmCounterStatistics\n") - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ( - "Cnt_Fast_Fsync =%d, Cnt_SB_Search_fail =%d\n", - FalseAlmCnt->Cnt_Fast_Fsync, - FalseAlmCnt->Cnt_SB_Search_fail - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ( - "Cnt_Parity_Fail =%d, Cnt_Rate_Illegal =%d\n", - FalseAlmCnt->Cnt_Parity_Fail, - FalseAlmCnt->Cnt_Rate_Illegal - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ( - "Cnt_Crc8_fail =%d, Cnt_Mcs_fail =%d\n", - FalseAlmCnt->Cnt_Crc8_fail, - FalseAlmCnt->Cnt_Mcs_fail - ) - ); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ("Cnt_OFDM_CCA =%d\n", FalseAlmCnt->Cnt_OFDM_CCA) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ("Cnt_CCK_CCA =%d\n", FalseAlmCnt->Cnt_CCK_CCA) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ("Cnt_CCA_all =%d\n", FalseAlmCnt->Cnt_CCA_all) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ("Cnt_Ofdm_fail =%d\n", FalseAlmCnt->Cnt_Ofdm_fail) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ("Cnt_Cck_fail =%d\n", FalseAlmCnt->Cnt_Cck_fail) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ("Cnt_Ofdm_fail =%d\n", FalseAlmCnt->Cnt_Ofdm_fail) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ("Total False Alarm =%d\n", FalseAlmCnt->Cnt_all) - ); } @@ -1084,8 +791,6 @@ u8 odm_ForbiddenIGICheck(void *pDM_VOID, u8 DIG_Dynamic_MIN, u8 CurrentIGI) u8 rx_gain_range_min = pDM_DigTable->rx_gain_range_min; if (pFalseAlmCnt->Cnt_all > 10000) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Abnormally false alarm case.\n")); - if (pDM_DigTable->LargeFAHit != 3) pDM_DigTable->LargeFAHit++; @@ -1102,22 +807,18 @@ u8 odm_ForbiddenIGICheck(void *pDM_VOID, u8 DIG_Dynamic_MIN, u8 CurrentIGI) else rx_gain_range_min = (pDM_DigTable->ForbiddenIGI + 2); pDM_DigTable->Recover_cnt = 1800; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Abnormally false alarm case: Recover_cnt = %d\n", pDM_DigTable->Recover_cnt)); } } else { if (pDM_DigTable->Recover_cnt != 0) { pDM_DigTable->Recover_cnt--; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Normal Case: Recover_cnt = %d\n", pDM_DigTable->Recover_cnt)); } else { if (pDM_DigTable->LargeFAHit < 3) { if ((pDM_DigTable->ForbiddenIGI - 2) < DIG_Dynamic_MIN) { /* DM_DIG_MIN) */ pDM_DigTable->ForbiddenIGI = DIG_Dynamic_MIN; /* DM_DIG_MIN; */ rx_gain_range_min = DIG_Dynamic_MIN; /* DM_DIG_MIN; */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Normal Case: At Lower Bound\n")); } else { pDM_DigTable->ForbiddenIGI -= 2; rx_gain_range_min = (pDM_DigTable->ForbiddenIGI + 2); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Normal Case: Approach Lower Bound\n")); } } else pDM_DigTable->LargeFAHit = 0; @@ -1143,25 +844,12 @@ void odm_CCKPacketDetectionThresh(void *pDM_VOID) !(pDM_Odm->SupportAbility & ODM_BB_CCK_PD) || !(pDM_Odm->SupportAbility & ODM_BB_FA_CNT) ) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CCK_PD, - ODM_DBG_LOUD, - ("odm_CCKPacketDetectionThresh() return ==========\n") - ); return; } if (pDM_Odm->ExtLNA) return; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CCK_PD, - ODM_DBG_LOUD, - ("odm_CCKPacketDetectionThresh() ==========>\n") - ); - if (pDM_Odm->bLinked) { if (pDM_Odm->RSSI_Min > 25) CurCCK_CCAThres = 0xcd; @@ -1181,16 +869,6 @@ void odm_CCKPacketDetectionThresh(void *pDM_VOID) } ODM_Write_CCK_CCA_Thres(pDM_Odm, CurCCK_CCAThres); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CCK_PD, - ODM_DBG_LOUD, - ( - "odm_CCKPacketDetectionThresh() CurCCK_CCAThres = 0x%x\n", - CurCCK_CCAThres - ) - ); } void ODM_Write_CCK_CCA_Thres(void *pDM_VOID, u8 CurCCK_CCAThres) diff --git a/drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c b/drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c index 12b37c17ea0c..578d5712645c 100644 --- a/drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c +++ b/drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c @@ -37,19 +37,6 @@ void ODM_EdcaTurboInit(void *pDM_VOID) pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA = false; pDM_Odm->DM_EDCA_Table.bIsCurRDLState = false; Adapter->recvpriv.bIsAnyNonBEPkts = false; - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO, ODM_DBG_LOUD, - ("Original VO PARAM: 0x%x\n", - rtw_read32(pDM_Odm->Adapter, ODM_EDCA_VO_PARAM))); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO, ODM_DBG_LOUD, - ("Original VI PARAM: 0x%x\n", - rtw_read32(pDM_Odm->Adapter, ODM_EDCA_VI_PARAM))); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO, ODM_DBG_LOUD, - ("Original BE PARAM: 0x%x\n", - rtw_read32(pDM_Odm->Adapter, ODM_EDCA_BE_PARAM))); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO, ODM_DBG_LOUD, - ("Original BK PARAM: 0x%x\n", - rtw_read32(pDM_Odm->Adapter, ODM_EDCA_BK_PARAM))); } /* ODM_InitEdcaTurbo */ void odm_EdcaTurboCheck(void *pDM_VOID) @@ -60,15 +47,10 @@ void odm_EdcaTurboCheck(void *pDM_VOID) */ struct dm_odm_t *pDM_Odm = (struct dm_odm_t *)pDM_VOID; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO, ODM_DBG_LOUD, - ("odm_EdcaTurboCheck ========================>\n")); - if (!(pDM_Odm->SupportAbility & ODM_MAC_EDCA_TURBO)) return; odm_EdcaTurboCheckCE(pDM_Odm); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO, ODM_DBG_LOUD, - ("<========================odm_EdcaTurboCheck\n")); } /* odm_CheckEdcaTurbo */ void odm_EdcaTurboCheckCE(void *pDM_VOID) @@ -142,12 +124,10 @@ void odm_EdcaTurboCheckCE(void *pDM_VOID) } else if ((iot_peer == HT_IOT_PEER_CISCO) && ((wirelessmode == ODM_WM_G) || (wirelessmode == (ODM_WM_B | ODM_WM_G)) || - (wirelessmode == ODM_WM_A) || (wirelessmode == ODM_WM_B))) { EDCA_BE_DL = edca_setting_DL_GMode[iot_peer]; } else if ((iot_peer == HT_IOT_PEER_AIRGO) && - ((wirelessmode == ODM_WM_G) || - (wirelessmode == ODM_WM_A))) { + (wirelessmode == ODM_WM_G)) { EDCA_BE_DL = 0xa630; } else if (iot_peer == HT_IOT_PEER_MARVELL) { EDCA_BE_DL = edca_setting_DL[iot_peer]; diff --git a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c index 638c16f5c668..32f7eb952ca8 100644 --- a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c +++ b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c @@ -59,9 +59,6 @@ static u8 odm_EVMdbToPercentage(s8 Value) ret_val = Value; ret_val /= 2; - /* DbgPrint("Value =%d\n", Value); */ - /* ODM_RT_DISP(FRX, RX_PHY_SQ, ("EVMdbToPercentage92C Value =%d / %x\n", ret_val, ret_val)); */ - if (ret_val >= 0) ret_val = 0; if (ret_val <= -33) @@ -141,7 +138,6 @@ static void odm_RxPhyStatus92CSeries_Parsing( } - /* DbgPrint("cck SQ = %d\n", SQ); */ pPhyInfo->signal_quality = SQ; pPhyInfo->rx_mimo_signal_quality[ODM_RF_PATH_A] = SQ; pPhyInfo->rx_mimo_signal_quality[ODM_RF_PATH_B] = -1; @@ -168,7 +164,6 @@ static void odm_RxPhyStatus92CSeries_Parsing( /* Translate DBM to percentage. */ RSSI = odm_QueryRxPwrPercentage(rx_pwr[i]); total_rssi += RSSI; - /* RT_DISP(FRX, RX_PHY_SS, ("RF-%d RXPWR =%x RSSI =%d\n", i, rx_pwr[i], RSSI)); */ pPhyInfo->rx_mimo_signal_strength[i] = (u8) RSSI; @@ -183,10 +178,8 @@ static void odm_RxPhyStatus92CSeries_Parsing( rx_pwr_all = (((pPhyStaRpt->cck_sig_qual_ofdm_pwdb_all) >> 1)&0x7f)-110; PWDB_ALL_BT = PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all); - /* RT_DISP(FRX, RX_PHY_SS, ("PWDB_ALL =%d\n", PWDB_ALL)); */ pPhyInfo->rx_pwd_ba11 = PWDB_ALL; - /* ODM_RT_TRACE(pDM_Odm, ODM_COMP_RSSI_MONITOR, ODM_DBG_LOUD, ("ODM OFDM RSSI =%d\n", pPhyInfo->rx_pwd_ba11)); */ pPhyInfo->bt_rx_rssi_percentage = PWDB_ALL_BT; pPhyInfo->rx_power = rx_pwr_all; pPhyInfo->recv_signal_power = rx_pwr_all; @@ -206,9 +199,6 @@ static void odm_RxPhyStatus92CSeries_Parsing( /* value to positive one, then the dbm value (which is supposed to be negative) is not correct anymore. */ EVM = odm_EVMdbToPercentage((pPhyStaRpt->stream_rxevm[i])); /* dbm */ - /* RT_DISP(FRX, RX_PHY_SQ, ("RXRATE =%x RXEVM =%x EVM =%s%d\n", */ - /* GET_RX_STATUS_DESC_RX_MCS(pDesc), pDrvInfo->rxevm[i], "%", EVM)); */ - /* if (pPktinfo->bPacketMatchBSSID) */ { if (i == ODM_RF_PATH_A) /* Fill value in RFD, Get the first spatial stream only */ @@ -232,9 +222,6 @@ static void odm_RxPhyStatus92CSeries_Parsing( pPhyInfo->signal_strength = (u8)(odm_SignalScaleMapping(pDM_Odm, total_rssi /= rf_rx_num)); } } - - /* DbgPrint("isCCKrate = %d, pPhyInfo->rx_pwd_ba11 = %d, pPhyStaRpt->cck_agc_rpt_ofdm_cfosho_a = 0x%x\n", */ - /* isCCKrate, pPhyInfo->rx_pwd_ba11, pPhyStaRpt->cck_agc_rpt_ofdm_cfosho_a); */ } static void odm_Process_RSSIForDM( @@ -286,8 +273,6 @@ static void odm_Process_RSSIForDM( pDM_Odm->RSSI_A = pPhyInfo->rx_mimo_signal_strength[ODM_RF_PATH_A]; pDM_Odm->RSSI_B = 0; } else { - /* DbgPrint("pRfd->Status.rx_mimo_signal_strength[0] = %d, pRfd->Status.rx_mimo_signal_strength[1] = %d\n", */ - /* pRfd->Status.rx_mimo_signal_strength[0], pRfd->Status.rx_mimo_signal_strength[1]); */ pDM_Odm->RSSI_A = pPhyInfo->rx_mimo_signal_strength[ODM_RF_PATH_A]; pDM_Odm->RSSI_B = pPhyInfo->rx_mimo_signal_strength[ODM_RF_PATH_B]; @@ -377,11 +362,6 @@ static void odm_Process_RSSIForDM( pEntry->rssi_stat.UndecoratedSmoothedCCK = UndecoratedSmoothedCCK; pEntry->rssi_stat.UndecoratedSmoothedOFDM = UndecoratedSmoothedOFDM; pEntry->rssi_stat.UndecoratedSmoothedPWDB = UndecoratedSmoothedPWDB; - - /* DbgPrint("OFDM_pkt =%d, Weighting =%d\n", OFDM_pkt, Weighting); */ - /* DbgPrint("UndecoratedSmoothedOFDM =%d, UndecoratedSmoothedPWDB =%d, UndecoratedSmoothedCCK =%d\n", */ - /* UndecoratedSmoothedOFDM, UndecoratedSmoothedPWDB, UndecoratedSmoothedCCK); */ - } } @@ -427,12 +407,6 @@ enum hal_status ODM_ConfigRFWithHeaderFile( enum odm_rf_radio_path_e eRFPath ) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, - ("===>ODM_ConfigRFWithHeaderFile (%s)\n", (pDM_Odm->bIsMPChip) ? "MPChip" : "TestChip")); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, - ("pDM_Odm->SupportPlatform: 0x%X, pDM_Odm->SupportInterface: 0x%X, pDM_Odm->BoardType: 0x%X\n", - pDM_Odm->SupportPlatform, pDM_Odm->SupportInterface, pDM_Odm->BoardType)); - if (ConfigType == CONFIG_RF_RADIO) READ_AND_CONFIG(8723B, _RadioA); else if (ConfigType == CONFIG_RF_TXPWR_LMT) @@ -443,12 +417,6 @@ enum hal_status ODM_ConfigRFWithHeaderFile( enum hal_status ODM_ConfigRFWithTxPwrTrackHeaderFile(struct dm_odm_t *pDM_Odm) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, - ("===>ODM_ConfigRFWithTxPwrTrackHeaderFile (%s)\n", (pDM_Odm->bIsMPChip) ? "MPChip" : "TestChip")); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, - ("pDM_Odm->SupportPlatform: 0x%X, pDM_Odm->SupportInterface: 0x%X, pDM_Odm->BoardType: 0x%X\n", - pDM_Odm->SupportPlatform, pDM_Odm->SupportInterface, pDM_Odm->BoardType)); - if (pDM_Odm->SupportInterface == ODM_ITRF_SDIO) READ_AND_CONFIG(8723B, _TxPowerTrack_SDIO); @@ -459,12 +427,6 @@ enum hal_status ODM_ConfigBBWithHeaderFile( struct dm_odm_t *pDM_Odm, enum ODM_BB_Config_Type ConfigType ) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, - ("===>ODM_ConfigBBWithHeaderFile (%s)\n", (pDM_Odm->bIsMPChip) ? "MPChip" : "TestChip")); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, - ("pDM_Odm->SupportPlatform: 0x%X, pDM_Odm->SupportInterface: 0x%X, pDM_Odm->BoardType: 0x%X\n", - pDM_Odm->SupportPlatform, pDM_Odm->SupportInterface, pDM_Odm->BoardType)); - if (ConfigType == CONFIG_BB_PHY_REG) READ_AND_CONFIG(8723B, _PHY_REG); else if (ConfigType == CONFIG_BB_AGC_TAB) diff --git a/drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c b/drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c index c3de123e2a48..ad169704f3e9 100644 --- a/drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c +++ b/drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c @@ -29,9 +29,8 @@ static s16 odm_InbandNoise_Monitor_NSeries( u8 max_rf_path = 0, rf_path; u8 reg_c50, reg_c58, valid_done = 0; struct noise_level noise_data; - u32 start = 0, func_start = 0, func_end = 0; + u32 start = 0; - func_start = jiffies; pDM_Odm->noise_level.noise_all = 0; if ((pDM_Odm->RFType == ODM_1T2R) || (pDM_Odm->RFType == ODM_2T2R)) @@ -39,8 +38,6 @@ static s16 odm_InbandNoise_Monitor_NSeries( else max_rf_path = 1; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("odm_DebugControlInbandNoise_Nseries() ==>\n")); - memset(&noise_data, 0, sizeof(struct noise_level)); /* */ @@ -65,7 +62,6 @@ static s16 odm_InbandNoise_Monitor_NSeries( /* Read Noise Floor Report */ tmp4b = PHY_QueryBBReg(pDM_Odm->Adapter, 0x8f8, bMaskDWord); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("Noise Floor Report (0x8f8) = 0x%08x\n", tmp4b)); /* PHY_SetBBReg(pDM_Odm->Adapter, rOFDM0_XAAGCCore1, bMaskByte0, TestInitialGain); */ /* if (max_rf_path == 2) */ @@ -77,17 +73,10 @@ static s16 odm_InbandNoise_Monitor_NSeries( noise_data.value[ODM_RF_PATH_A] = (u8)(tmp4b&0xff); noise_data.value[ODM_RF_PATH_B] = (u8)((tmp4b&0xff00)>>8); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("value_a = 0x%x(%d), value_b = 0x%x(%d)\n", - noise_data.value[ODM_RF_PATH_A], noise_data.value[ODM_RF_PATH_A], noise_data.value[ODM_RF_PATH_B], noise_data.value[ODM_RF_PATH_B])); - for (rf_path = ODM_RF_PATH_A; rf_path < max_rf_path; rf_path++) { noise_data.sval[rf_path] = (s8)noise_data.value[rf_path]; noise_data.sval[rf_path] /= 2; } - - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("sval_a = %d, sval_b = %d\n", - noise_data.sval[ODM_RF_PATH_A], noise_data.sval[ODM_RF_PATH_B])); /* mdelay(10); */ /* msleep(10); */ @@ -95,11 +84,8 @@ static s16 odm_InbandNoise_Monitor_NSeries( if ((noise_data.valid_cnt[rf_path] < ValidCnt) && (noise_data.sval[rf_path] < Valid_Max && noise_data.sval[rf_path] >= Valid_Min)) { noise_data.valid_cnt[rf_path]++; noise_data.sum[rf_path] += noise_data.sval[rf_path]; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("RF_Path:%d Valid sval = %d\n", rf_path, noise_data.sval[rf_path])); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("Sum of sval = %d,\n", noise_data.sum[rf_path])); if (noise_data.valid_cnt[rf_path] == ValidCnt) { valid_done++; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("After divided, RF_Path:%d , sum = %d\n", rf_path, noise_data.sum[rf_path])); } } @@ -120,43 +106,23 @@ static s16 odm_InbandNoise_Monitor_NSeries( } reg_c50 = (s32)PHY_QueryBBReg(pDM_Odm->Adapter, rOFDM0_XAAGCCore1, bMaskByte0); reg_c50 &= ~BIT7; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("0x%x = 0x%02x(%d)\n", rOFDM0_XAAGCCore1, reg_c50, reg_c50)); pDM_Odm->noise_level.noise[ODM_RF_PATH_A] = -110 + reg_c50 + noise_data.sum[ODM_RF_PATH_A]; pDM_Odm->noise_level.noise_all += pDM_Odm->noise_level.noise[ODM_RF_PATH_A]; if (max_rf_path == 2) { reg_c58 = (s32)PHY_QueryBBReg(pDM_Odm->Adapter, rOFDM0_XBAGCCore1, bMaskByte0); reg_c58 &= ~BIT7; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("0x%x = 0x%02x(%d)\n", rOFDM0_XBAGCCore1, reg_c58, reg_c58)); pDM_Odm->noise_level.noise[ODM_RF_PATH_B] = -110 + reg_c58 + noise_data.sum[ODM_RF_PATH_B]; pDM_Odm->noise_level.noise_all += pDM_Odm->noise_level.noise[ODM_RF_PATH_B]; } pDM_Odm->noise_level.noise_all /= max_rf_path; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_COMMON, - ODM_DBG_LOUD, - ( - "noise_a = %d, noise_b = %d\n", - pDM_Odm->noise_level.noise[ODM_RF_PATH_A], - pDM_Odm->noise_level.noise[ODM_RF_PATH_B] - ) - ); - /* */ /* Step 4. Recover the Dig */ /* */ if (bPauseDIG) odm_PauseDIG(pDM_Odm, ODM_RESUME_DIG, IGIValue); - func_end = jiffies_to_msecs(jiffies - func_start); - /* printk("%s noise_a = %d, noise_b = %d noise_all:%d (%d ms)\n", __func__, */ - /* pDM_Odm->noise_level.noise[ODM_RF_PATH_A], */ - /* pDM_Odm->noise_level.noise[ODM_RF_PATH_B], */ - /* pDM_Odm->noise_level.noise_all, func_end); */ - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("odm_DebugControlInbandNoise_Nseries() <==\n")); return pDM_Odm->noise_level.noise_all; } diff --git a/drivers/staging/rtl8723bs/hal/odm_PathDiv.c b/drivers/staging/rtl8723bs/hal/odm_PathDiv.c deleted file mode 100644 index 92b708265d47..000000000000 --- a/drivers/staging/rtl8723bs/hal/odm_PathDiv.c +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/****************************************************************************** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - ******************************************************************************/ - -#include "odm_precomp.h" - -void odm_PathDiversityInit(void *pDM_VOID) -{ - struct dm_odm_t *pDM_Odm = (struct dm_odm_t *)pDM_VOID; - - if (!(pDM_Odm->SupportAbility & ODM_BB_PATH_DIV)) - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_PATH_DIV, - ODM_DBG_LOUD, - ("Return: Not Support PathDiv\n") - ); -} - -void odm_PathDiversity(void *pDM_VOID) -{ - struct dm_odm_t *pDM_Odm = (struct dm_odm_t *)pDM_VOID; - - if (!(pDM_Odm->SupportAbility & ODM_BB_PATH_DIV)) - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_PATH_DIV, - ODM_DBG_LOUD, - ("Return: Not Support PathDiv\n") - ); -} diff --git a/drivers/staging/rtl8723bs/hal/odm_PathDiv.h b/drivers/staging/rtl8723bs/hal/odm_PathDiv.h deleted file mode 100644 index 7a5bc00c3682..000000000000 --- a/drivers/staging/rtl8723bs/hal/odm_PathDiv.h +++ /dev/null @@ -1,21 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/****************************************************************************** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - ******************************************************************************/ - -#ifndef __ODMPATHDIV_H__ -#define __ODMPATHDIV_H__ - -void -odm_PathDiversityInit( - void *pDM_VOID - ); - -void -odm_PathDiversity( - void *pDM_VOID - ); - - #endif /* ifndef __ODMPATHDIV_H__ */ diff --git a/drivers/staging/rtl8723bs/hal/odm_RTL8723B.c b/drivers/staging/rtl8723bs/hal/odm_RTL8723B.c index ecf0045fcad9..54518ea1be6b 100644 --- a/drivers/staging/rtl8723bs/hal/odm_RTL8723B.c +++ b/drivers/staging/rtl8723bs/hal/odm_RTL8723B.c @@ -29,7 +29,6 @@ s8 odm_CCKRSSI_8723B(u8 LNA_idx, u8 VGA_idx) break; default: /* rx_pwr_all = -53+(2*(31-VGA_idx)); */ - /* DbgPrint("wrong LNA index\n"); */ break; } diff --git a/drivers/staging/rtl8723bs/hal/odm_RegConfig8723B.c b/drivers/staging/rtl8723bs/hal/odm_RegConfig8723B.c index 63bf5ba3e0d5..a29bd9375023 100644 --- a/drivers/staging/rtl8723bs/hal/odm_RegConfig8723B.c +++ b/drivers/staging/rtl8723bs/hal/odm_RegConfig8723B.c @@ -38,17 +38,6 @@ void odm_ConfigRFReg_8723B( PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH, RegAddr, bRFRegOffsetMask, Data); udelay(1); getvalue = PHY_QueryRFReg(pDM_Odm->Adapter, RF_PATH, Addr, bMaskDWord); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> ODM_ConfigRFWithHeaderFile: [B6] getvalue 0x%x, Data 0x%x, count %d\n", - getvalue, - Data, - count - ) - ); if (count > 5) break; } @@ -86,17 +75,6 @@ void odm_ConfigRFReg_8723B( getvalue = PHY_QueryRFReg( pDM_Odm->Adapter, RF_PATH, Addr, bMaskDWord ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> ODM_ConfigRFWithHeaderFile: [B2] getvalue 0x%x, Data 0x%x, count %d\n", - getvalue, - Data, - count - ) - ); if (count > 5) break; @@ -118,32 +96,11 @@ void odm_ConfigRF_RadioA_8723B(struct dm_odm_t *pDM_Odm, u32 Addr, u32 Data) ODM_RF_PATH_A, Addr|maskforPhySet ); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> ODM_ConfigRFWithHeaderFile: [RadioA] %08X %08X\n", - Addr, - Data - ) - ); } void odm_ConfigMAC_8723B(struct dm_odm_t *pDM_Odm, u32 Addr, u8 Data) { rtw_write8(pDM_Odm->Adapter, Addr, Data); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> ODM_ConfigMACWithHeaderFile: [MAC_REG] %08X %08X\n", - Addr, - Data - ) - ); } void odm_ConfigBB_AGC_8723B( @@ -156,22 +113,10 @@ void odm_ConfigBB_AGC_8723B( PHY_SetBBReg(pDM_Odm->Adapter, Addr, Bitmask, Data); /* Add 1us delay between BB/RF register setting. */ udelay(1); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> ODM_ConfigBBWithHeaderFile: [AGC_TAB] %08X %08X\n", - Addr, - Data - ) - ); } void odm_ConfigBB_PHY_REG_PG_8723B( struct dm_odm_t *pDM_Odm, - u32 Band, u32 RfPath, u32 TxNum, u32 Addr, @@ -182,19 +127,8 @@ void odm_ConfigBB_PHY_REG_PG_8723B( if (Addr == 0xfe || Addr == 0xffe) msleep(50); else { - PHY_StoreTxPowerByRate(pDM_Odm->Adapter, Band, RfPath, TxNum, Addr, Bitmask, Data); + PHY_StoreTxPowerByRate(pDM_Odm->Adapter, RfPath, TxNum, Addr, Bitmask, Data); } - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_LOUD, - ( - "===> ODM_ConfigBBWithHeaderFile: [PHY_REG] %08X %08X %08X\n", - Addr, - Bitmask, - Data - ) - ); } void odm_ConfigBB_PHY_8723B( @@ -222,13 +156,11 @@ void odm_ConfigBB_PHY_8723B( /* Add 1us delay between BB/RF register setting. */ udelay(1); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigBBWithHeaderFile: [PHY_REG] %08X %08X\n", Addr, Data)); } void odm_ConfigBB_TXPWR_LMT_8723B( struct dm_odm_t *pDM_Odm, u8 *Regulation, - u8 *Band, u8 *Bandwidth, u8 *RateSection, u8 *RfPath, @@ -239,7 +171,6 @@ void odm_ConfigBB_TXPWR_LMT_8723B( PHY_SetTxPowerLimit( pDM_Odm->Adapter, Regulation, - Band, Bandwidth, RateSection, RfPath, diff --git a/drivers/staging/rtl8723bs/hal/odm_RegConfig8723B.h b/drivers/staging/rtl8723bs/hal/odm_RegConfig8723B.h index b392d14c389d..bdd6fde49fc6 100644 --- a/drivers/staging/rtl8723bs/hal/odm_RegConfig8723B.h +++ b/drivers/staging/rtl8723bs/hal/odm_RegConfig8723B.h @@ -25,7 +25,6 @@ void odm_ConfigBB_AGC_8723B(struct dm_odm_t *pDM_Odm, ); void odm_ConfigBB_PHY_REG_PG_8723B(struct dm_odm_t *pDM_Odm, - u32 Band, u32 RfPath, u32 TxNum, u32 Addr, @@ -41,7 +40,6 @@ void odm_ConfigBB_PHY_8723B(struct dm_odm_t *pDM_Odm, void odm_ConfigBB_TXPWR_LMT_8723B(struct dm_odm_t *pDM_Odm, u8 *Regulation, - u8 *Band, u8 *Bandwidth, u8 *RateSection, u8 *RfPath, diff --git a/drivers/staging/rtl8723bs/hal/odm_debug.c b/drivers/staging/rtl8723bs/hal/odm_debug.c deleted file mode 100644 index b35451bcb437..000000000000 --- a/drivers/staging/rtl8723bs/hal/odm_debug.c +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/****************************************************************************** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - ******************************************************************************/ - -#include "odm_precomp.h" - -void ODM_InitDebugSetting(struct dm_odm_t *pDM_Odm) -{ - pDM_Odm->DebugLevel = ODM_DBG_LOUD; - - pDM_Odm->DebugComponents = -/* BB Functions */ -/* ODM_COMP_DIG | */ -/* ODM_COMP_RA_MASK | */ -/* ODM_COMP_DYNAMIC_TXPWR | */ -/* ODM_COMP_FA_CNT | */ -/* ODM_COMP_RSSI_MONITOR | */ -/* ODM_COMP_CCK_PD | */ -/* ODM_COMP_ANT_DIV | */ -/* ODM_COMP_PWR_SAVE | */ -/* ODM_COMP_PWR_TRAIN | */ -/* ODM_COMP_RATE_ADAPTIVE | */ -/* ODM_COMP_PATH_DIV | */ -/* ODM_COMP_DYNAMIC_PRICCA | */ -/* ODM_COMP_RXHP | */ -/* ODM_COMP_MP | */ -/* ODM_COMP_CFO_TRACKING | */ - -/* MAC Functions */ -/* ODM_COMP_EDCA_TURBO | */ -/* ODM_COMP_EARLY_MODE | */ -/* RF Functions */ -/* ODM_COMP_TX_PWR_TRACK | */ -/* ODM_COMP_RX_GAIN_TRACK | */ -/* ODM_COMP_CALIBRATION | */ -/* Common */ -/* ODM_COMP_COMMON | */ -/* ODM_COMP_INIT | */ -/* ODM_COMP_PSD | */ -0; -} diff --git a/drivers/staging/rtl8723bs/hal/odm_debug.h b/drivers/staging/rtl8723bs/hal/odm_debug.h deleted file mode 100644 index be0d4c49a747..000000000000 --- a/drivers/staging/rtl8723bs/hal/odm_debug.h +++ /dev/null @@ -1,165 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/****************************************************************************** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - ******************************************************************************/ - -#ifndef __ODM_DBG_H__ -#define __ODM_DBG_H__ - - -/* */ -/* Define the debug levels */ -/* */ -/* 1. DBG_TRACE and DBG_LOUD are used for normal cases. */ -/* So that, they can help SW engineer to developed or trace states changed */ -/* and also help HW enginner to trace every operation to and from HW, */ -/* e.g IO, Tx, Rx. */ -/* */ -/* 2. DBG_WARNNING and DBG_SERIOUS are used for unusual or error cases, */ -/* which help us to debug SW or HW. */ -/* */ -/* */ -/* */ -/* Never used in a call to ODM_RT_TRACE()! */ -/* */ -#define ODM_DBG_OFF 1 - -/* */ -/* Fatal bug. */ -/* For example, Tx/Rx/IO locked up, OS hangs, memory access violation, */ -/* resource allocation failed, unexpected HW behavior, HW BUG and so on. */ -/* */ -#define ODM_DBG_SERIOUS 2 - -/* */ -/* Abnormal, rare, or unexpected cases. */ -/* For example, */ -/* IRP/Packet/OID canceled, */ -/* device suprisely unremoved and so on. */ -/* */ -#define ODM_DBG_WARNING 3 - -/* */ -/* Normal case with useful information about current SW or HW state. */ -/* For example, Tx/Rx descriptor to fill, Tx/Rx descriptor completed status, */ -/* SW protocol state change, dynamic mechanism state change and so on. */ -/* */ -#define ODM_DBG_LOUD 4 - -/* */ -/* Normal case with detail execution flow or information. */ -/* */ -#define ODM_DBG_TRACE 5 - -/* */ -/* Define the tracing components */ -/* */ -/* */ -/* BB Functions */ -#define ODM_COMP_DIG BIT0 -#define ODM_COMP_RA_MASK BIT1 -#define ODM_COMP_DYNAMIC_TXPWR BIT2 -#define ODM_COMP_FA_CNT BIT3 -#define ODM_COMP_RSSI_MONITOR BIT4 -#define ODM_COMP_CCK_PD BIT5 -#define ODM_COMP_ANT_DIV BIT6 -#define ODM_COMP_PWR_SAVE BIT7 -#define ODM_COMP_PWR_TRAIN BIT8 -#define ODM_COMP_RATE_ADAPTIVE BIT9 -#define ODM_COMP_PATH_DIV BIT10 -#define ODM_COMP_PSD BIT11 -#define ODM_COMP_DYNAMIC_PRICCA BIT12 -#define ODM_COMP_RXHP BIT13 -#define ODM_COMP_MP BIT14 -#define ODM_COMP_CFO_TRACKING BIT15 -/* MAC Functions */ -#define ODM_COMP_EDCA_TURBO BIT16 -#define ODM_COMP_EARLY_MODE BIT17 -/* RF Functions */ -#define ODM_COMP_TX_PWR_TRACK BIT24 -#define ODM_COMP_RX_GAIN_TRACK BIT25 -#define ODM_COMP_CALIBRATION BIT26 -/* Common Functions */ -#define ODM_COMP_COMMON BIT30 -#define ODM_COMP_INIT BIT31 - -/*------------------------Export Marco Definition---------------------------*/ - #define DbgPrint printk - #define RT_PRINTK(fmt, args...)\ - DbgPrint("%s(): " fmt, __func__, ## args) - #define RT_DISP(dbgtype, dbgflag, printstr) - -#ifndef ASSERT - #define ASSERT(expr) -#endif - -#if DBG -#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt)\ - do {\ - if (\ - (comp & pDM_Odm->DebugComponents) &&\ - (level <= pDM_Odm->DebugLevel ||\ - level == ODM_DBG_SERIOUS)\ - ) {\ - RT_PRINTK fmt;\ - } \ - } while (0) - -#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt)\ - do {\ - if (\ - (comp & pDM_Odm->DebugComponents) &&\ - (level <= pDM_Odm->DebugLevel)\ - ) {\ - RT_PRINTK fmt;\ - } \ - } while (0) - -#define ODM_RT_ASSERT(pDM_Odm, expr, fmt)\ - do {\ - if (!expr) {\ - DbgPrint("Assertion failed! %s at ......\n", #expr);\ - DbgPrint(\ - " ......%s,%s, line =%d\n",\ - __FILE__,\ - __func__,\ - __LINE__\ - );\ - RT_PRINTK fmt;\ - ASSERT(false);\ - } \ - } while (0) -#define ODM_dbg_trace(str) { DbgPrint("%s:%s\n", __func__, str); } - -#define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr)\ - do {\ - if (\ - (comp & pDM_Odm->DebugComponents) &&\ - (level <= pDM_Odm->DebugLevel)\ - ) {\ - int __i;\ - u8 *__ptr = (u8 *)ptr;\ - DbgPrint("[ODM] ");\ - DbgPrint(title_str);\ - DbgPrint(" ");\ - for (__i = 0; __i < 6; __i++)\ - DbgPrint("%02X%s", __ptr[__i], (__i == 5) ? "" : "-");\ - DbgPrint("\n");\ - } \ - } while (0) -#else -#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt) no_printk fmt -#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt) no_printk fmt -#define ODM_RT_ASSERT(pDM_Odm, expr, fmt) no_printk fmt -#define ODM_dbg_enter() do {} while (0) -#define ODM_dbg_exit() do {} while (0) -#define ODM_dbg_trace(str) no_printk("%s", str) -#define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr) \ - no_printk("%s %p", title_str, ptr) -#endif - -void ODM_InitDebugSetting(struct dm_odm_t *pDM_Odm); - -#endif /* __ODM_DBG_H__ */ diff --git a/drivers/staging/rtl8723bs/hal/odm_precomp.h b/drivers/staging/rtl8723bs/hal/odm_precomp.h index d48d681472d5..5041c9535e9a 100644 --- a/drivers/staging/rtl8723bs/hal/odm_precomp.h +++ b/drivers/staging/rtl8723bs/hal/odm_precomp.h @@ -27,11 +27,9 @@ #include "odm.h" #include "odm_HWConfig.h" -#include "odm_debug.h" #include "odm_RegDefine11N.h" #include "odm_EdcaTurboCheck.h" #include "odm_DIG.h" -#include "odm_PathDiv.h" #include "odm_DynamicBBPowerSaving.h" #include "odm_DynamicTxPower.h" #include "odm_CfoTracking.h" diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c index 2451875ab3c0..2b7077bb52df 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c @@ -114,14 +114,13 @@ static void ConstructBeacon(struct adapter *padapter, u8 *pframe, u32 *pLength) struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network); - u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; pwlanhdr = (struct ieee80211_hdr *)pframe; fctrl = &(pwlanhdr->frame_control); *(fctrl) = 0; - memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); + eth_broadcast_addr(pwlanhdr->addr1); memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); memcpy(pwlanhdr->addr3, get_my_bssid(cur_network), ETH_ALEN); @@ -309,9 +308,6 @@ static void rtl8723b_set_FwRsvdPage_cmd(struct adapter *padapter, struct rsvdpag SET_8723B_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(u1H2CRsvdPageParm, rsvdpageloc->LocQosNull); SET_8723B_H2CCMD_RSVDPAGE_LOC_BT_QOS_NULL_DATA(u1H2CRsvdPageParm, rsvdpageloc->LocBTQosNull); - print_hex_dump_debug(DRIVER_PREFIX ": u1H2CRsvdPageParm:", DUMP_PREFIX_NONE, - 16, 1, u1H2CRsvdPageParm, H2C_RSVDPAGE_LOC_LEN, false); - FillH2CCmd8723B(padapter, H2C_8723B_RSVD_PAGE, H2C_RSVDPAGE_LOC_LEN, u1H2CRsvdPageParm); } @@ -329,9 +325,6 @@ void rtl8723b_set_FwMediaStatusRpt_cmd(struct adapter *padapter, u8 mstatus, u8 SET_8723B_H2CCMD_MSRRPT_PARM_MACID(u1H2CMediaStatusRptParm, macid); SET_8723B_H2CCMD_MSRRPT_PARM_MACID_END(u1H2CMediaStatusRptParm, macid_end); - print_hex_dump_debug(DRIVER_PREFIX ": u1H2CMediaStatusRptParm:", DUMP_PREFIX_NONE, - 16, 1, u1H2CMediaStatusRptParm, H2C_MEDIA_STATUS_RPT_LEN, false); - FillH2CCmd8723B(padapter, H2C_8723B_MEDIA_STATUS_RPT, H2C_MEDIA_STATUS_RPT_LEN, u1H2CMediaStatusRptParm); } @@ -348,9 +341,6 @@ void rtl8723b_set_FwMacIdConfig_cmd(struct adapter *padapter, u8 mac_id, u8 raid SET_8723B_H2CCMD_MACID_CFG_RATE_MASK2(u1H2CMacIdConfigParm, (u8)((mask & 0x00ff0000) >> 16)); SET_8723B_H2CCMD_MACID_CFG_RATE_MASK3(u1H2CMacIdConfigParm, (u8)((mask & 0xff000000) >> 24)); - print_hex_dump_debug(DRIVER_PREFIX ": u1H2CMacIdConfigParm:", DUMP_PREFIX_NONE, - 16, 1, u1H2CMacIdConfigParm, H2C_MACID_CFG_LEN, false); - FillH2CCmd8723B(padapter, H2C_8723B_MACID_CFG, H2C_MACID_CFG_LEN, u1H2CMacIdConfigParm); } @@ -365,9 +355,6 @@ void rtl8723b_set_rssi_cmd(struct adapter *padapter, u8 *param) SET_8723B_H2CCMD_RSSI_SETTING_RSSI(u1H2CRssiSettingParm, rssi); SET_8723B_H2CCMD_RSSI_SETTING_ULDL_STATE(u1H2CRssiSettingParm, uldl_state); - print_hex_dump_debug(DRIVER_PREFIX ": u1H2CRssiSettingParm:", DUMP_PREFIX_NONE, - 16, 1, u1H2CRssiSettingParm, H2C_RSSI_SETTING_LEN, false); - FillH2CCmd8723B(padapter, H2C_8723B_RSSI_SETTING, H2C_RSSI_SETTING_LEN, u1H2CRssiSettingParm); } @@ -465,9 +452,6 @@ void rtl8723b_set_FwPwrMode_cmd(struct adapter *padapter, u8 psmode) hal_btcoex_RecordPwrMode(padapter, u1H2CPwrModeParm, H2C_PWRMODE_LEN); - print_hex_dump_debug(DRIVER_PREFIX ": u1H2CPwrModeParm:", DUMP_PREFIX_NONE, - 16, 1, u1H2CPwrModeParm, H2C_PWRMODE_LEN, false); - FillH2CCmd8723B(padapter, H2C_8723B_SET_PWR_MODE, H2C_PWRMODE_LEN, u1H2CPwrModeParm); } @@ -485,9 +469,6 @@ void rtl8723b_set_FwPsTuneParam_cmd(struct adapter *padapter) SET_8723B_H2CCMD_PSTUNE_PARM_ADOPT(u1H2CPsTuneParm, 1); SET_8723B_H2CCMD_PSTUNE_PARM_DTIM_PERIOD(u1H2CPsTuneParm, dtim_period); - print_hex_dump_debug(DRIVER_PREFIX ": u1H2CPsTuneParm:", DUMP_PREFIX_NONE, - 16, 1, u1H2CPsTuneParm, H2C_PSTUNEPARAM_LEN, false); - FillH2CCmd8723B(padapter, H2C_8723B_PS_TUNING_PARA, H2C_PSTUNEPARAM_LEN, u1H2CPsTuneParm); } diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_dm.c b/drivers/staging/rtl8723bs/hal/rtl8723b_dm.c index 23be025ceb5b..5840a5241fde 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_dm.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_dm.c @@ -109,7 +109,6 @@ static void Update_ODM_ComInfo_8723b(struct adapter *Adapter) ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_CHNL, &(pHalData->CurrentChannel)); ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_NET_CLOSED, &(Adapter->net_closed)); ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_MP_MODE, &zero); - ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_BAND, &(pHalData->CurrentBandType)); ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_FORCED_IGI_LB, &(pHalData->u1ForcedIgiLb)); ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_FORCED_RATE, &(pHalData->ForcedDataRate)); diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c index 082448557b53..059d3050acc6 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c @@ -122,7 +122,6 @@ static int _WriteFW(struct adapter *padapter, void *buffer, u32 size) u8 *bufferPtr = buffer; pageNums = size / MAX_DLFW_PAGE_SIZE; - /* RT_ASSERT((pageNums <= 4), ("Page numbers should not greater then 4\n")); */ remainSize = size % MAX_DLFW_PAGE_SIZE; for (page = 0; page < pageNums; page++) { @@ -1149,10 +1148,8 @@ static u16 hal_EfuseGetCurrentSize_BT(struct adapter *padapter, u8 bPseudoTest) retU2 = ((bank-1)*EFUSE_BT_REAL_BANK_CONTENT_LEN)+efuse_addr; if (bPseudoTest) { pEfuseHal->fakeBTEfuseUsedBytes = retU2; - /* RT_DISP(FEEPROM, EFUSE_PG, ("Hal_EfuseGetCurrentSize_BT92C(), already use %u bytes\n", pEfuseHal->fakeBTEfuseUsedBytes)); */ } else { pEfuseHal->BTEfuseUsedBytes = retU2; - /* RT_DISP(FEEPROM, EFUSE_PG, ("Hal_EfuseGetCurrentSize_BT92C(), already use %u bytes\n", pEfuseHal->BTEfuseUsedBytes)); */ } return retU2; @@ -2512,15 +2509,8 @@ u8 BWMapping_8723B(struct adapter *Adapter, struct pkt_attrib *pattrib) u8 BWSettingOfDesc = 0; struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); - if (pHalData->CurrentChannelBW == CHANNEL_WIDTH_80) { - if (pattrib->bwmode == CHANNEL_WIDTH_80) - BWSettingOfDesc = 2; - else if (pattrib->bwmode == CHANNEL_WIDTH_40) - BWSettingOfDesc = 1; - else - BWSettingOfDesc = 0; - } else if (pHalData->CurrentChannelBW == CHANNEL_WIDTH_40) { - if ((pattrib->bwmode == CHANNEL_WIDTH_40) || (pattrib->bwmode == CHANNEL_WIDTH_80)) + if (pHalData->CurrentChannelBW == CHANNEL_WIDTH_40) { + if (pattrib->bwmode == CHANNEL_WIDTH_40) BWSettingOfDesc = 1; else BWSettingOfDesc = 0; @@ -2538,38 +2528,20 @@ u8 SCMapping_8723B(struct adapter *Adapter, struct pkt_attrib *pattrib) u8 SCSettingOfDesc = 0; struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); - if (pHalData->CurrentChannelBW == CHANNEL_WIDTH_80) { - if (pattrib->bwmode == CHANNEL_WIDTH_80) { - SCSettingOfDesc = VHT_DATA_SC_DONOT_CARE; - } else if (pattrib->bwmode == CHANNEL_WIDTH_40) { - if (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) - SCSettingOfDesc = VHT_DATA_SC_40_LOWER_OF_80MHZ; - else if (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER) - SCSettingOfDesc = VHT_DATA_SC_40_UPPER_OF_80MHZ; - } else { - if ((pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) && (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER)) - SCSettingOfDesc = VHT_DATA_SC_20_LOWEST_OF_80MHZ; - else if ((pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER) && (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER)) - SCSettingOfDesc = VHT_DATA_SC_20_LOWER_OF_80MHZ; - else if ((pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) && (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER)) - SCSettingOfDesc = VHT_DATA_SC_20_UPPER_OF_80MHZ; - else if ((pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER) && (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER)) - SCSettingOfDesc = VHT_DATA_SC_20_UPPERST_OF_80MHZ; - } - } else if (pHalData->CurrentChannelBW == CHANNEL_WIDTH_40) { + if (pHalData->CurrentChannelBW == CHANNEL_WIDTH_40) { if (pattrib->bwmode == CHANNEL_WIDTH_40) { - SCSettingOfDesc = VHT_DATA_SC_DONOT_CARE; + SCSettingOfDesc = HT_DATA_SC_DONOT_CARE; } else if (pattrib->bwmode == CHANNEL_WIDTH_20) { if (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER) { - SCSettingOfDesc = VHT_DATA_SC_20_UPPER_OF_80MHZ; + SCSettingOfDesc = HT_DATA_SC_20_UPPER_OF_40MHZ; } else if (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) { - SCSettingOfDesc = VHT_DATA_SC_20_LOWER_OF_80MHZ; + SCSettingOfDesc = HT_DATA_SC_20_LOWER_OF_40MHZ; } else { - SCSettingOfDesc = VHT_DATA_SC_DONOT_CARE; + SCSettingOfDesc = HT_DATA_SC_DONOT_CARE; } } } else { - SCSettingOfDesc = VHT_DATA_SC_DONOT_CARE; + SCSettingOfDesc = HT_DATA_SC_DONOT_CARE; } return SCSettingOfDesc; @@ -3315,9 +3287,6 @@ void C2HPacketHandler_8723B(struct adapter *padapter, u8 *pbuffer, u16 length) C2hEvent.CmdLen = length-2; tmpBuf = pbuffer+2; - print_hex_dump_debug(DRIVER_PREFIX ": C2HPacketHandler_8723B(): Command Content:\n", - DUMP_PREFIX_NONE, 16, 1, tmpBuf, C2hEvent.CmdLen, false); - process_c2h_event(padapter, &C2hEvent, tmpBuf); /* c2h_handler_8723b(padapter,&C2hEvent); */ } @@ -3898,27 +3867,19 @@ u8 GetHalDefVar8723B(struct adapter *padapter, enum hal_def_variable variable, v { u8 mac_id = *(u8 *)pval; u32 cmd; - u32 ra_info1, ra_info2; - u32 rate_mask1, rate_mask2; - u8 curr_tx_rate, curr_tx_sgi, hight_rate, lowest_rate; cmd = 0x40000100 | mac_id; rtw_write32(padapter, REG_HMEBOX_DBG_2_8723B, cmd); msleep(10); - ra_info1 = rtw_read32(padapter, 0x2F0); - curr_tx_rate = ra_info1&0x7F; - curr_tx_sgi = (ra_info1>>7)&0x01; + rtw_read32(padapter, 0x2F0); // info 1 cmd = 0x40000400 | mac_id; rtw_write32(padapter, REG_HMEBOX_DBG_2_8723B, cmd); msleep(10); - ra_info1 = rtw_read32(padapter, 0x2F0); - ra_info2 = rtw_read32(padapter, 0x2F4); - rate_mask1 = rtw_read32(padapter, 0x2F8); - rate_mask2 = rtw_read32(padapter, 0x2FC); - hight_rate = ra_info2&0xFF; - lowest_rate = (ra_info2>>8) & 0xFF; - + rtw_read32(padapter, 0x2F0); // info 1 + rtw_read32(padapter, 0x2F4); // info 2 + rtw_read32(padapter, 0x2F8); // rate mask 1 + rtw_read32(padapter, 0x2FC); // rate mask 2 } break; diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c index f43abf9b0d22..6e524034f388 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c @@ -38,7 +38,7 @@ static u32 phy_CalculateBitShift(u32 BitMask) /** - * PHY_QueryBBReg - Read "specific bits" from BB register. + * PHY_QueryBBReg_8723B - Read "specific bits" from BB register. * @Adapter: * @RegAddr: The target address to be readback * @BitMask: The target bit position in the target address @@ -53,10 +53,6 @@ u32 PHY_QueryBBReg_8723B(struct adapter *Adapter, u32 RegAddr, u32 BitMask) { u32 OriginalValue, BitShift; -#if (DISABLE_BB_RF == 1) - return 0; -#endif - OriginalValue = rtw_read32(Adapter, RegAddr); BitShift = phy_CalculateBitShift(BitMask); @@ -66,7 +62,7 @@ u32 PHY_QueryBBReg_8723B(struct adapter *Adapter, u32 RegAddr, u32 BitMask) /** - * PHY_SetBBReg - Write "Specific bits" to BB register (page 8~). + * PHY_SetBBReg_8723B - Write "Specific bits" to BB register (page 8~). * @Adapter: * @RegAddr: The target address to be modified * @BitMask: The target bit position in the target address @@ -88,10 +84,6 @@ void PHY_SetBBReg_8723B( /* u16 BBWaitCounter = 0; */ u32 OriginalValue, BitShift; -#if (DISABLE_BB_RF == 1) - return; -#endif - if (BitMask != bMaskDWord) { /* if not "double word" write */ OriginalValue = rtw_read32(Adapter, RegAddr); BitShift = phy_CalculateBitShift(BitMask); @@ -231,10 +223,10 @@ static void phy_RFSerialWrite_8723B( /** - * PHY_QueryRFReg - Query "Specific bits" to RF register (page 8~). + * PHY_QueryRFReg_8723B - Query "Specific bits" to RF register (page 8~). * @Adapter: * @eRFPath: Radio path of A/B/C/D - * @RegAdd: The target address to be read + * @RegAddr: The target address to be read * @BitMask: The target bit position in the target address * to be read * @@ -252,10 +244,6 @@ u32 PHY_QueryRFReg_8723B( { u32 Original_Value, BitShift; -#if (DISABLE_BB_RF == 1) - return 0; -#endif - Original_Value = phy_RFSerialRead_8723B(Adapter, eRFPath, RegAddr); BitShift = phy_CalculateBitShift(BitMask); @@ -263,7 +251,7 @@ u32 PHY_QueryRFReg_8723B( } /** - * PHY_SetRFReg - Write "Specific bits" to RF register (page 8~). + * PHY_SetRFReg_8723B - Write "Specific bits" to RF register (page 8~). * @Adapter: * @eRFPath: Radio path of A/B/C/D * @RegAddr: The target address to be modified @@ -285,10 +273,6 @@ void PHY_SetRFReg_8723B( { u32 Original_Value, BitShift; -#if (DISABLE_BB_RF == 1) - return; -#endif - /* RF data is 12 bits only */ if (BitMask != bRFRegOffsetMask) { Original_Value = phy_RFSerialRead_8723B(Adapter, eRFPath, RegAddr); @@ -562,15 +546,13 @@ u8 PHY_GetTxPowerIndex( { struct hal_com_data *pHalData = GET_HAL_DATA(padapter); s8 txPower = 0, powerDiffByRate = 0, limit = 0; - bool bIn24G = false; - txPower = (s8) PHY_GetTxPowerIndexBase(padapter, RFPath, Rate, BandWidth, Channel, &bIn24G); - powerDiffByRate = PHY_GetTxPowerByRate(padapter, BAND_ON_2_4G, ODM_RF_PATH_A, RF_1TX, Rate); + txPower = (s8) PHY_GetTxPowerIndexBase(padapter, RFPath, Rate, BandWidth, Channel); + powerDiffByRate = PHY_GetTxPowerByRate(padapter, ODM_RF_PATH_A, RF_1TX, Rate); limit = phy_get_tx_pwr_lmt( padapter, padapter->registrypriv.RegPwrTblSel, - (u8)(!bIn24G), pHalData->CurrentChannelBW, RFPath, Rate, @@ -625,11 +607,6 @@ static void phy_SetRegBW_8723B( rtw_write16(Adapter, REG_TRXPTCL_CTL_8723B, (u2tmp & 0xFEFF)); /* BIT 7 = 1, BIT 8 = 0 */ break; - case CHANNEL_WIDTH_80: - u2tmp = RegRfMod_BW | BIT8; - rtw_write16(Adapter, REG_TRXPTCL_CTL_8723B, (u2tmp & 0xFF7F)); /* BIT 7 = 0, BIT 8 = 1 */ - break; - default: break; } @@ -640,37 +617,11 @@ static u8 phy_GetSecondaryChnl_8723B(struct adapter *Adapter) u8 SCSettingOf40 = 0, SCSettingOf20 = 0; struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); - if (pHalData->CurrentChannelBW == CHANNEL_WIDTH_80) { - if (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) - SCSettingOf40 = VHT_DATA_SC_40_LOWER_OF_80MHZ; - else if (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER) - SCSettingOf40 = VHT_DATA_SC_40_UPPER_OF_80MHZ; - - if ( - (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) && - (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) - ) - SCSettingOf20 = VHT_DATA_SC_20_LOWEST_OF_80MHZ; - else if ( - (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER) && - (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) - ) - SCSettingOf20 = VHT_DATA_SC_20_LOWER_OF_80MHZ; - else if ( - (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) && - (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER) - ) - SCSettingOf20 = VHT_DATA_SC_20_UPPER_OF_80MHZ; - else if ( - (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER) && - (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER) - ) - SCSettingOf20 = VHT_DATA_SC_20_UPPERST_OF_80MHZ; - } else if (pHalData->CurrentChannelBW == CHANNEL_WIDTH_40) { + if (pHalData->CurrentChannelBW == CHANNEL_WIDTH_40) { if (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER) - SCSettingOf20 = VHT_DATA_SC_20_UPPER_OF_80MHZ; + SCSettingOf20 = HT_DATA_SC_20_UPPER_OF_40MHZ; else if (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) - SCSettingOf20 = VHT_DATA_SC_20_LOWER_OF_80MHZ; + SCSettingOf20 = HT_DATA_SC_20_LOWER_OF_40MHZ; } return (SCSettingOf40 << 4) | SCSettingOf20; diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c index 7c2680b6508c..ad803ffc0696 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c @@ -108,7 +108,7 @@ static void update_recvframe_phyinfo(union recv_frame *precvframe, !pattrib->icv_err && !pattrib->crc_err && ether_addr_equal(rx_bssid, my_bssid)); - rx_ra = get_ra(wlanhdr); + rx_ra = rtl8723bs_get_ra(wlanhdr); my_hwaddr = myid(&padapter->eeprompriv); pkt_info.to_self = pkt_info.bssid_match && ether_addr_equal(rx_ra, my_hwaddr); diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c index bd95e62fb053..a05d43b716ee 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c @@ -178,7 +178,7 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv struct hw_xmit *hwxmits, *phwxmit; u8 idx, hwentry; struct tx_servq *ptxservq; - struct list_head *sta_plist, *sta_phead, *frame_plist, *frame_phead; + struct list_head *sta_plist, *sta_phead, *frame_plist, *frame_phead, *tmp; struct xmit_frame *pxmitframe; struct __queue *pframe_queue; struct xmit_buf *pxmitbuf; @@ -223,12 +223,11 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv spin_lock_bh(&pxmitpriv->lock); sta_phead = get_list_head(phwxmit->sta_queue); - sta_plist = get_next(sta_phead); /* because stop_sta_xmit may delete sta_plist at any time */ /* so we should add lock here, or while loop can not exit */ - while (sta_phead != sta_plist) { - ptxservq = container_of(sta_plist, struct tx_servq, tx_pending); - sta_plist = get_next(sta_plist); + list_for_each_safe(sta_plist, tmp, sta_phead) { + ptxservq = list_entry(sta_plist, struct tx_servq, + tx_pending); pframe_queue = &ptxservq->sta_pending; diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c index abd90026a8c7..a07a6dacec42 100644 --- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c +++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c @@ -4,8 +4,6 @@ * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. * ******************************************************************************/ -#define _SDIO_HALINIT_C_ - #include <drv_types.h> #include <rtw_debug.h> #include <rtl8723b_hal.h> @@ -228,7 +226,6 @@ static void _InitNormalChipOneOutEpPriority(struct adapter *Adapter) value = QUEUE_NORMAL; break; default: - /* RT_ASSERT(false, ("Shall not reach here!\n")); */ break; } @@ -262,7 +259,6 @@ static void _InitNormalChipTwoOutEpPriority(struct adapter *Adapter) valueLow = QUEUE_NORMAL; break; default: - /* RT_ASSERT(false, ("Shall not reach here!\n")); */ break; } @@ -327,7 +323,6 @@ static void _InitQueuePriority(struct adapter *Adapter) _InitNormalChipThreeOutEpPriority(Adapter); break; default: - /* RT_ASSERT(false, ("Shall not reach here!\n")); */ break; } @@ -517,9 +512,6 @@ static void _InitOperationMode(struct adapter *padapter) case WIRELESS_MODE_B: regBwOpMode = BW_OPMODE_20MHZ; break; - case WIRELESS_MODE_A: -/* RT_ASSERT(false, ("Error wireless a mode\n")); */ - break; case WIRELESS_MODE_G: regBwOpMode = BW_OPMODE_20MHZ; break; @@ -531,10 +523,6 @@ static void _InitOperationMode(struct adapter *padapter) /* CCK rate will be filtered out only when associated AP does not support it. */ regBwOpMode = BW_OPMODE_20MHZ; break; - case WIRELESS_MODE_N_5G: -/* RT_ASSERT(false, ("Error wireless mode")); */ - regBwOpMode = BW_OPMODE_5G; - break; default: /* for MacOSX compiler warning. */ break; @@ -567,11 +555,6 @@ static void _InitRFType(struct adapter *padapter) { struct hal_com_data *pHalData = GET_HAL_DATA(padapter); -#if DISABLE_BB_RF - pHalData->rf_chip = RF_PSEUDO_11N; - return; -#endif - pHalData->rf_chip = RF_6052; pHalData->rf_type = RF_1T1R; @@ -695,29 +678,23 @@ static u32 rtl8723bs_hal_init(struct adapter *padapter) /* <Roger_Notes> Current Channel will be updated again later. */ pHalData->CurrentChannel = 6; -#if (HAL_MAC_ENABLE == 1) ret = PHY_MACConfig8723B(padapter); if (ret != _SUCCESS) return ret; -#endif /* */ /* d. Initialize BB related configurations. */ /* */ -#if (HAL_BB_ENABLE == 1) ret = PHY_BBConfig8723B(padapter); if (ret != _SUCCESS) return ret; -#endif /* If RF is on, we need to init RF. Otherwise, skip the procedure. */ /* We need to follow SU method to change the RF cfg.txt. Default disable RF TX/RX mode. */ /* if (pHalData->eRFPowerState == eRfOn) */ { -#if (HAL_RF_ENABLE == 1) ret = PHY_RFConfig8723B(padapter); if (ret != _SUCCESS) return ret; -#endif } /* */ @@ -798,8 +775,6 @@ static u32 rtl8723bs_hal_init(struct adapter *padapter) rtl8723b_InitHalDm(padapter); - /* DbgPrint("pHalData->DefaultTxPwrDbm = %d\n", pHalData->DefaultTxPwrDbm); */ - /* */ /* Update current Tx FIFO page status. */ /* */ @@ -878,10 +853,9 @@ static void CardDisableRTL8723BSdio(struct adapter *padapter) { u8 u1bTmp; u8 bMacPwrCtrlOn; - u8 ret = _FAIL; /* Run LPS WL RFOFF flow */ - ret = HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_enter_lps_flow); + HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_enter_lps_flow); /* ==== Reset digital sequence ====== */ @@ -909,9 +883,8 @@ static void CardDisableRTL8723BSdio(struct adapter *padapter) /* ==== Reset digital sequence end ====== */ bMacPwrCtrlOn = false; /* Disable CMD53 R/W */ - ret = false; rtw_hal_set_hwreg(padapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn); - ret = HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_card_disable_flow); + HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_card_disable_flow); } static u32 rtl8723bs_hal_deinit(struct adapter *padapter) @@ -1046,11 +1019,7 @@ static void _ReadRFType(struct adapter *Adapter) { struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); -#if DISABLE_BB_RF - pHalData->rf_chip = RF_PSEUDO_11N; -#else pHalData->rf_chip = RF_6052; -#endif } diff --git a/drivers/staging/rtl8723bs/hal/sdio_ops.c b/drivers/staging/rtl8723bs/hal/sdio_ops.c index a31694525bc1..2dd251ce177e 100644 --- a/drivers/staging/rtl8723bs/hal/sdio_ops.c +++ b/drivers/staging/rtl8723bs/hal/sdio_ops.c @@ -4,8 +4,6 @@ * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. * *******************************************************************************/ -#define _SDIO_OPS_C_ - #include <drv_types.h> #include <rtw_debug.h> #include <rtl8723b_hal.h> @@ -160,7 +158,7 @@ static u32 sdio_read32(struct intf_hdl *intfhdl, u32 addr) u32 ftaddr; u8 shift; u32 val; - s32 err; + s32 __maybe_unused err; __le32 le_tmp; adapter = intfhdl->padapter; @@ -348,11 +346,6 @@ static s32 sdio_writeN(struct intf_hdl *intfhdl, u32 addr, u32 cnt, u8 *buf) return err; } -static u8 sdio_f0_read8(struct intf_hdl *intfhdl, u32 addr) -{ - return sd_f0_read8(intfhdl, addr, NULL); -} - static void sdio_read_mem( struct intf_hdl *intfhdl, u32 addr, @@ -360,10 +353,7 @@ static void sdio_read_mem( u8 *rmem ) { - s32 err; - - err = sdio_readN(intfhdl, addr, cnt, rmem); - /* TODO: Report error is err not zero */ + sdio_readN(intfhdl, addr, cnt, rmem); } static void sdio_write_mem( @@ -486,8 +476,6 @@ void sdio_set_intf_ops(struct adapter *adapter, struct _io_ops *ops) ops->_writeN = &sdio_writeN; ops->_write_mem = &sdio_write_mem; ops->_write_port = &sdio_write_port; - - ops->_sd_f0_read8 = sdio_f0_read8; } /* |