rtl8723ds: Clean up some Coverity and Smatch warnings

The includes turning CONGIG_MP_INCLUDED off.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger
2023-01-31 11:52:34 -06:00
parent a638cc8639
commit 1a8f8b1557
28 changed files with 3426 additions and 3607 deletions
+2 -2
View File
@@ -1413,7 +1413,7 @@ phy_PathA_IQK_8192C(
// delay x ms
RTPRINT(FINIT, INIT_IQK, ("Delay %d ms for One shot, path A LOK & IQK.\n", IQK_DELAY_TIME));
PlatformStallExecution(IQK_DELAY_TIME*1000);
rtw_udelay_os(IQK_DELAY_TIME*1000);
// Check failed
regEAC = PHY_QueryBBReg(pAdapter, rRx_Power_After_IQK_A_2, bMaskDWord);
@@ -1460,7 +1460,7 @@ phy_PathB_IQK_8192C(
// delay x ms
RTPRINT(FINIT, INIT_IQK, ("Delay %d ms for One shot, path B LOK & IQK.\n", IQK_DELAY_TIME));
PlatformStallExecution(IQK_DELAY_TIME*1000);
rtw_udelay_os(IQK_DELAY_TIME*1000);
// Check failed
regEAC = PHY_QueryBBReg(pAdapter, rRx_Power_After_IQK_A_2, bMaskDWord);
+3264 -3273
View File
File diff suppressed because it is too large Load Diff
+42 -116
View File
@@ -605,7 +605,6 @@ phydm_BB_Debug_Info(
value32 = ODM_GetBBReg(pDM_Odm, 0xf2c , bMaskDWord); /*HT SIG*/
if (RX_HT == 1) {
HMCSS = (u1Byte)(value32 & 0x7F);
HRX_BW = (u1Byte)(value32 & 0x80);
HLength = (u2Byte)((value32 >> 8) & 0xffff);
@@ -1740,7 +1739,7 @@ phydm_cmd_parser(
u4Byte used = 0;
u1Byte id = 0;
int var1[10] = {0};
int i, input_idx = 0, phydm_ary_size;
int i, input_idx = 0, phydm_ary_size = 0;
char help[] = "-h";
if (flag == 0) {
@@ -1802,12 +1801,10 @@ phydm_cmd_parser(
case PHYDM_RA:
for (i = 0; i < 5; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
/*PHYDM_SNPRINTF((output + used, out_len - used, "new SET, RA_var[%d]= (( %d ))\n", i , var1[i]));*/
input_idx++;
}
/*PHYDM_SNPRINTF((output + used, out_len - used, "new SET, RA_var[%d]= (( %d ))\n", i , var1[i]));*/
input_idx++;
}
if (input_idx >= 1) {
@@ -1825,12 +1822,10 @@ phydm_cmd_parser(
case PHYDM_ANTDIV:
for (i = 0; i < 5; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_HEX, &var1[i]);
PHYDM_SSCANF(input[i + 1], DCMD_HEX, &var1[i]);
/*PHYDM_SNPRINTF((output+used, out_len-used, "new SET, PATHDIV_var[%d]= (( %d ))\n", i , var1[i]));*/
input_idx++;
}
/*PHYDM_SNPRINTF((output+used, out_len-used, "new SET, PATHDIV_var[%d]= (( %d ))\n", i , var1[i]));*/
input_idx++;
}
if (input_idx >= 1) {
@@ -1845,12 +1840,10 @@ phydm_cmd_parser(
case PHYDM_PATHDIV:
for (i = 0; i < 5; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_HEX, &var1[i]);
PHYDM_SSCANF(input[i + 1], DCMD_HEX, &var1[i]);
/*PHYDM_SNPRINTF((output+used, out_len-used, "new SET, PATHDIV_var[%d]= (( %d ))\n", i , var1[i]));*/
input_idx++;
}
/*PHYDM_SNPRINTF((output+used, out_len-used, "new SET, PATHDIV_var[%d]= (( %d ))\n", i , var1[i]));*/
input_idx++;
}
if (input_idx >= 1) {
@@ -1865,12 +1858,10 @@ phydm_cmd_parser(
case PHYDM_DEBUG:
for (i = 0; i < 5; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
/*PHYDM_SNPRINTF((output+used, out_len-used, "new SET, Debug_var[%d]= (( %d ))\n", i , var1[i]));*/
input_idx++;
}
/*PHYDM_SNPRINTF((output+used, out_len-used, "new SET, Debug_var[%d]= (( %d ))\n", i , var1[i]));*/
input_idx++;
}
if (input_idx >= 1) {
@@ -1884,10 +1875,8 @@ phydm_cmd_parser(
case PHYDM_FW_DEBUG:
for (i = 0; i < 5; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
input_idx++;
}
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
input_idx++;
}
if (input_idx >= 1)
@@ -1898,12 +1887,10 @@ phydm_cmd_parser(
case PHYDM_SUPPORT_ABILITY:
for (i = 0; i < 5; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
/*PHYDM_SNPRINTF((output+used, out_len-used, "new SET, support ablity_var[%d]= (( %d ))\n", i , var1[i]));*/
input_idx++;
}
/*PHYDM_SNPRINTF((output+used, out_len-used, "new SET, support ablity_var[%d]= (( %d ))\n", i , var1[i]));*/
input_idx++;
}
if (input_idx >= 1) {
@@ -1916,10 +1903,8 @@ phydm_cmd_parser(
case PHYDM_SMART_ANT:
for (i = 0; i < 5; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_HEX, &var1[i]);
input_idx++;
}
PHYDM_SSCANF(input[i + 1], DCMD_HEX, &var1[i]);
input_idx++;
}
if (input_idx >= 1) {
@@ -1939,10 +1924,8 @@ phydm_cmd_parser(
BOOLEAN bEnableDbgMode;
u1Byte central_ch, primary_ch_idx, bandwidth;
for (i = 0; i < 4; i++) {
if (input[i + 1])
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
}
for (i = 0; i < 4; i++)
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
bEnableDbgMode = (BOOLEAN)var1[0];
central_ch = (u1Byte) var1[1];
@@ -1979,10 +1962,8 @@ phydm_cmd_parser(
BOOLEAN bEnableDbgMode;
for (i = 0; i < 5; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_HEX, &var1[i]);
input_idx++;
}
PHYDM_SSCANF(input[i + 1], DCMD_HEX, &var1[i]);
input_idx++;
}
if ((strcmp(input[1], help) == 0)) {
@@ -2007,8 +1988,7 @@ phydm_cmd_parser(
case PHYDM_TRX_PATH:
for (i = 0; i < 4; i++) {
if (input[i + 1])
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
}
#if (RTL8822B_SUPPORT == 1 || RTL8197F_SUPPORT == 1)
if (pDM_Odm->SupportICType & (ODM_RTL8822B|ODM_RTL8197F)) {
@@ -2045,10 +2025,8 @@ phydm_cmd_parser(
u4Byte DbgPort, TriggerTime_mu_sec;
u1Byte sampling_rate = 0;
for (i = 0; i < 6; i++) {
if (input[i + 1])
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
}
for (i = 0; i < 6; i++)
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
bEnableLaMode = (BOOLEAN)var1[0];
DbgPrint("echo cmd input_num = %d\n", input_num);
@@ -2073,22 +2051,8 @@ phydm_cmd_parser(
bTriggerEdge = (BOOLEAN) var1[7];
sampling_rate = var1[8] & 0x7;
#if 1
TriggerTime_unit_num = phydm_la_mode_mac_setting(pDM_Odm, TriggerTime_mu_sec);
phydm_la_mode_bb_setting(pDM_Odm, DbgPort, bTriggerEdge, sampling_rate);
#else
if (pDM_Odm->SupportICType & ODM_IC_11AC_SERIES) {
ODM_SetBBReg(pDM_Odm, 0x198C , BIT2|BIT1|BIT0, 7); /*disable dbg clk gating*/
ODM_SetBBReg(pDM_Odm, 0x8FC, bMaskDWord, DbgPort);
ODM_SetBBReg(pDM_Odm, 0x95C , BIT31, bTriggerEdge); /*0: posedge, 1: negedge*/
ODM_SetBBReg(pDM_Odm, 0x95c, 0xe0, sampling_rate);
} else {
ODM_SetBBReg(pDM_Odm, 0x908, bMaskDWord, DbgPort);
ODM_SetBBReg(pDM_Odm, 0x9A0 , BIT31, bTriggerEdge); /*0: posedge, 1: negedge*/
ODM_SetBBReg(pDM_Odm, 0x9A0, 0xe0, sampling_rate);
}
#endif
pDM_Odm->ADCSmp_dbg_port = DbgPort;
pDM_Odm->ADCSmp_trigger_edge = bTriggerEdge;
pDM_Odm->ADCsmp_smp_rate = sampling_rate;
@@ -2114,18 +2078,14 @@ phydm_cmd_parser(
{
u1Byte type = 0;
if (input[1]) {
PHYDM_SSCANF(input[1], DCMD_DECIMAL, &var1[0]);
type = (u1Byte)var1[0];
}
PHYDM_SSCANF(input[1], DCMD_DECIMAL, &var1[0]);
type = (u1Byte)var1[0];
if (type == 0)
phydm_DumpBbReg(pDM_Odm, &used, output, &out_len);
else if (type == 1)
phydm_DumpAllReg(pDM_Odm, &used, output, &out_len);
}
break;
case PHYDM_MU_MIMO:
#if (RTL8822B_SUPPORT == 1)
@@ -2236,12 +2196,9 @@ phydm_cmd_parser(
break;
case PHYDM_NBI_EN:
for (i = 0; i < 5; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
input_idx++;
}
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
input_idx++;
}
if (input_idx >= 1) {
@@ -2249,17 +2206,11 @@ phydm_cmd_parser(
phydm_api_debug(pDM_Odm, PHYDM_API_NBI, (u4Byte *)var1, &used, output, &out_len);
/**/
}
break;
case PHYDM_CSI_MASK_EN:
for (i = 0; i < 5; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
input_idx++;
}
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
input_idx++;
}
if (input_idx >= 1) {
@@ -2277,10 +2228,8 @@ phydm_cmd_parser(
u4Byte var[6] = {0};
for (i = 0; i < 6; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_HEX, &var[i]);
input_idx++;
}
PHYDM_SSCANF(input[i + 1], DCMD_HEX, &var[i]);
input_idx++;
}
if (input_idx >= 1)
@@ -2352,7 +2301,6 @@ phydm_cmd_parser(
phydm_NHMsetting(pDM_Odm, SET_NHM_SETTING);
for(i = 0; i <= 10; i ++) {
if (i == 5) {
PHYDM_SNPRINTF((output + used, out_len - used, "\r\n NHM_th[%d] = 0x%x, echo_IGI = 0x%x", i, CCX_INFO->NHM_th[i], CCX_INFO->echo_IGI));
}
@@ -2364,12 +2312,10 @@ phydm_cmd_parser(
//4 4. Trigger NHM
phydm_NHMtrigger(pDM_Odm);
}
/*Get NHM results*/
else if (var1[0] == 3) {
IGI = (u1Byte)ODM_GetBBReg(pDM_Odm, 0xC50, bMaskByte0);
PHYDM_SNPRINTF((output + used, out_len - used, "\r\n Cur_IGI = 0x%x", IGI));
@@ -2380,7 +2326,6 @@ phydm_cmd_parser(
phydm_NHMsetting(pDM_Odm, RESTORE_NHM_SETTING);
for(i = 0; i <= 11; i++) {
if (i == 5)
PHYDM_SNPRINTF((output + used, out_len - used, "\r\n nhm_result[%d] = %d, echo_IGI = 0x%x", i, CCX_INFO->NHM_result[i], CCX_INFO->echo_IGI));
else if (i == 11)
@@ -2453,7 +2398,7 @@ phydm_cmd_parser(
phydm_BB_Debug_Info(pDM_Odm, &used, output, &out_len);
if (pDM_Odm->SupportICType & ODM_RTL8822B && input[1]) {
if (pDM_Odm->SupportICType & ODM_RTL8822B) {
PHYDM_SSCANF(input[1], DCMD_DECIMAL, &var1[0]);
ODM_SetBBReg(pDM_Odm, 0x1988, 0x003fff00, var1[0]);
value32 = ODM_GetBBReg(pDM_Odm, 0xf84, bMaskDWord);
@@ -2487,15 +2432,10 @@ phydm_cmd_parser(
#endif
}
break;
case PHYDM_PAUSE_DIG_EN:
for (i = 0; i < 5; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_HEX, &var1[i]);
input_idx++;
}
PHYDM_SSCANF(input[i + 1], DCMD_HEX, &var1[i]);
input_idx++;
}
if (input_idx >= 1) {
@@ -2508,16 +2448,11 @@ phydm_cmd_parser(
} else
PHYDM_SNPRINTF((output + used, out_len - used, "echo (1:pause, 2resume) (IGI_value)\n"));
}
break;
case PHYDM_H2C:
for (i = 0; i < 8; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_HEX, &var1[i]);
input_idx++;
}
PHYDM_SSCANF(input[i + 1], DCMD_HEX, &var1[i]);
input_idx++;
}
if (input_idx >= 1)
@@ -2525,14 +2460,10 @@ phydm_cmd_parser(
break;
case PHYDM_ANT_SWITCH:
for (i = 0; i < 8; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
input_idx++;
}
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
input_idx++;
}
if (input_idx >= 1) {
@@ -2543,18 +2474,13 @@ phydm_cmd_parser(
PHYDM_SNPRINTF((output + used, out_len - used, "Not Support IC"));
#endif
}
break;
default:
PHYDM_SNPRINTF((output + used, out_len - used, "SET, unknown command!\n"));
break;
}
}
VOID
phydm_la_mode_bb_setting(
IN PVOID pDM_VOID,
+2 -10
View File
@@ -805,16 +805,8 @@ odm_DIGInit(
pDM_DigTable->pause_cckpd_level = 0;
#endif
if(pDM_Odm->BoardType & (ODM_BOARD_EXT_PA|ODM_BOARD_EXT_LNA))
{
pDM_DigTable->rx_gain_range_max = DM_DIG_MAX_NIC;
pDM_DigTable->rx_gain_range_min = DM_DIG_MIN_NIC;
}
else
{
pDM_DigTable->rx_gain_range_max = DM_DIG_MAX_NIC;
pDM_DigTable->rx_gain_range_min = DM_DIG_MIN_NIC;
}
pDM_DigTable->rx_gain_range_max = DM_DIG_MAX_NIC;
pDM_DigTable->rx_gain_range_min = DM_DIG_MIN_NIC;
#if (RTL8822B_SUPPORT == 1 || RTL8197F_SUPPORT == 1)
pDM_DigTable->enableAdjustBigJump = 1;
+10 -27
View File
@@ -256,7 +256,7 @@ ODM_TxPwrTrackSetPwr_8723D(
TxRate = (u1Byte) pMgntInfo->ForcedDataRate;
}
#endif
#elif (DM_ODM_SUPPORT_TYPE & (ODM_CE))
#elif (DM_ODM_SUPPORT_TYPE & (ODM_CE) && MP_DRIVER == 1)
if (pDM_Odm->mp_mode == TRUE) { /*CE MP*/
PMPT_CONTEXT pMptCtx = &(Adapter->mppriv.MptCtx);
@@ -691,7 +691,7 @@ GetDeltaSwingTable_8723D(
TxRate = MptToMgntRate(pMptCtx->MptRateIndex);
#endif
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE && MP_DRIVER == 1)
PMPT_CONTEXT pMptCtx = &(Adapter->mppriv.MptCtx);
TxRate = MptToMgntRate(pMptCtx->MptRateIndex);
@@ -1937,7 +1937,7 @@ _PHY_PathADDAOn_8723D(
#endif
pathOn = isPathAOn ? 0x03c00016 : 0x03c00016;
pathOn = 0x03c00016;
if (FALSE == is2T) {
pathOn = 0x03c00016;
@@ -3150,6 +3150,7 @@ PHY_IQCalibrate_8723D(
/*Check & wait if BT is doing IQK*/
#ifdef CONFIG_MP_INCLUDED
if (pDM_Odm->mp_mode == FALSE) {
#if MP_DRIVER != 1
SetFwWiFiCalibrationCmd_8723D(pAdapter, 1);
@@ -3158,7 +3159,7 @@ PHY_IQCalibrate_8723D(
count = 0;
u1bTmp = PlatformEFIORead1Byte(pAdapter, 0x1e6);
while (u1bTmp != 0x1 && count < 1000) {
PlatformStallExecution(10);
rtw_udelay_os(10);
u1bTmp = PlatformEFIORead1Byte(pAdapter, 0x1e6);
count++;
}
@@ -3169,13 +3170,13 @@ PHY_IQCalibrate_8723D(
u1bTmp = PlatformEFIORead1Byte(pAdapter, 0x1e7);
while ((!(u1bTmp&BIT0)) && count < 6000) {
PlatformStallExecution(50);
rtw_udelay_os(50);
u1bTmp = PlatformEFIORead1Byte(pAdapter, 0x1e7);
count++;
}
#endif
}
#endif
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK:Start!!!\n"));
ODM_AcquireSpinLock(pDM_Odm, RT_IQK_SPINLOCK);
@@ -3359,6 +3360,7 @@ PHY_IQCalibrate_8723D(
_PHY_SaveADDARegisters_8723D(pDM_Odm, IQK_BB_REG_92C, pDM_Odm->RFCalibrateInfo.IQK_BB_backup_recover, IQK_BB_REG_NUM);
#endif
#ifdef CONFIG_MP_INCLUDED
if (pDM_Odm->mp_mode == FALSE) {
#if MP_DRIVER != 1
SetFwWiFiCalibrationCmd_8723D(pAdapter, 0);
@@ -3367,7 +3369,7 @@ PHY_IQCalibrate_8723D(
count = 0;
u1bTmp = PlatformEFIORead1Byte(pAdapter, 0x1e6);
while (u1bTmp != 0 && count < 1000) {
PlatformStallExecution(10);
rtw_udelay_os(10);
u1bTmp = PlatformEFIORead1Byte(pAdapter, 0x1e6);
count++;
}
@@ -3377,6 +3379,7 @@ PHY_IQCalibrate_8723D(
}
#endif
}
#endif
ODM_AcquireSpinLock(pDM_Odm, RT_IQK_SPINLOCK);
pDM_Odm->RFCalibrateInfo.bIQKInProgress = FALSE;
@@ -3476,27 +3479,7 @@ PHY_APCalibrate_8723D(
PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc;
#endif
#endif
#if DISABLE_BB_RF
return;
#endif
return;
#if (DM_ODM_SUPPORT_TYPE == ODM_CE)
if (!(pDM_Odm->SupportAbility & ODM_RF_CALIBRATION)) {
return;
}
#endif
#if FOR_BRAZIL_PRETEST != 1
if (pDM_Odm->RFCalibrateInfo.bAPKdone)
#endif
return;
#if !(DM_ODM_SUPPORT_TYPE & ODM_AP)
phy_APCalibrate_8723D(pAdapter, delta, FALSE);
#else
phy_APCalibrate_8723D(pDM_Odm, delta, FALSE);
#endif
}
static VOID phy_SetRFPathSwitch_8723D(