Commit 8c0c8b66 authored by Hans de Goede's avatar Hans de Goede Committed by Greg Kroah-Hartman

staging: rtl8723bs: Remove phy_Config*With*ParaFile() calls

The rtl8723bs driver tries to load various parameters from disk,
circumventing the standard firmware loader mechanism and using DIY
code for this.

No devices which run the mainline kernel ship with these files and even
if these files were present then they still would not be loaded without
additional module parameters. To be precise the following 3 conditions
must all 3 be true for on disk parameters to be used:

1) The rtw_load_phy_file modparam must contain the mask for the type, this
   defaults to(LOAD_BB_PG_PARA_FILE | LOAD_RF_TXPWR_LMT_PARA_FILE) so with
   the default settings this condition is only true for:
   phy_ConfigBBWithPgParaFile()
   PHY_ConfigRFWithPowerLimitTableParaFile(); and
2) rtw_phy_file_path modparam must be set to say "/lib/firmware/"; and
3) Store a /lib/firmware/rtl8723b/XXX file in the expected format.

In practice all 3 being true never happens, so the
phy_Config*With*ParaFile() calls are nops, remove them.

The actual code implementing them will be removed in a separate patch.

Note the ODM_ConfigRFWithHeaderFile() and ODM_ConfigBBWithHeaderFile()
functions always return HAL_STATUS_SUCCESS, this patch makes use of this
to simplify the new code without the phy_Config*With*ParaFile() calls.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20191009123223.163241-1-hdegoede@redhat.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 348c5974
...@@ -362,24 +362,10 @@ void PHY_SetRFReg_8723B( ...@@ -362,24 +362,10 @@ void PHY_SetRFReg_8723B(
*/ */
s32 PHY_MACConfig8723B(struct adapter *Adapter) s32 PHY_MACConfig8723B(struct adapter *Adapter)
{ {
int rtStatus = _SUCCESS;
struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
s8 *pszMACRegFile;
s8 sz8723MACRegFile[] = RTL8723B_PHY_MACREG;
pszMACRegFile = sz8723MACRegFile;
/* */
/* Config MAC */
/* */
rtStatus = phy_ConfigMACWithParaFile(Adapter, pszMACRegFile);
if (rtStatus == _FAIL) {
ODM_ReadAndConfig_MP_8723B_MAC_REG(&pHalData->odmpriv);
rtStatus = _SUCCESS;
}
return rtStatus; ODM_ReadAndConfig_MP_8723B_MAC_REG(&pHalData->odmpriv);
return _SUCCESS;
} }
/** /**
...@@ -427,17 +413,6 @@ static void phy_InitBBRFRegisterDefinition(struct adapter *Adapter) ...@@ -427,17 +413,6 @@ static void phy_InitBBRFRegisterDefinition(struct adapter *Adapter)
static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter) static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
{ {
struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
int rtStatus = _SUCCESS;
u8 sz8723BBRegFile[] = RTL8723B_PHY_REG;
u8 sz8723AGCTableFile[] = RTL8723B_AGC_TAB;
u8 sz8723BBBRegPgFile[] = RTL8723B_PHY_REG_PG;
u8 sz8723BRFTxPwrLmtFile[] = RTL8723B_TXPWR_LMT;
u8 *pszBBRegFile = NULL, *pszAGCTableFile = NULL, *pszBBRegPgFile = NULL, *pszRFTxPwrLmtFile = NULL;
pszBBRegFile = sz8723BBRegFile;
pszAGCTableFile = sz8723AGCTableFile;
pszBBRegPgFile = sz8723BBBRegPgFile;
pszRFTxPwrLmtFile = sz8723BRFTxPwrLmtFile;
/* Read Tx Power Limit File */ /* Read Tx Power Limit File */
PHY_InitTxPowerLimit(Adapter); PHY_InitTxPowerLimit(Adapter);
...@@ -445,30 +420,14 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter) ...@@ -445,30 +420,14 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
Adapter->registrypriv.RegEnableTxPowerLimit == 1 || Adapter->registrypriv.RegEnableTxPowerLimit == 1 ||
(Adapter->registrypriv.RegEnableTxPowerLimit == 2 && pHalData->EEPROMRegulatory == 1) (Adapter->registrypriv.RegEnableTxPowerLimit == 2 && pHalData->EEPROMRegulatory == 1)
) { ) {
if (PHY_ConfigRFWithPowerLimitTableParaFile(Adapter, pszRFTxPwrLmtFile) == _FAIL) { ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv,
if (HAL_STATUS_SUCCESS != ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv, CONFIG_RF_TXPWR_LMT, (ODM_RF_RADIO_PATH_E)0)) CONFIG_RF_TXPWR_LMT, 0);
rtStatus = _FAIL;
}
if (rtStatus != _SUCCESS) {
DBG_871X("%s():Read Tx power limit fail\n", __func__);
goto phy_BB8190_Config_ParaFile_Fail;
}
} }
/* */ /* */
/* 1. Read PHY_REG.TXT BB INIT!! */ /* 1. Read PHY_REG.TXT BB INIT!! */
/* */ /* */
if (phy_ConfigBBWithParaFile(Adapter, pszBBRegFile, CONFIG_BB_PHY_REG) == ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG);
_FAIL) {
if (HAL_STATUS_SUCCESS != ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG))
rtStatus = _FAIL;
}
if (rtStatus != _SUCCESS) {
DBG_8192C("%s():Write BB Reg Fail!!", __func__);
goto phy_BB8190_Config_ParaFile_Fail;
}
/* If EEPROM or EFUSE autoload OK, We must config by PHY_REG_PG.txt */ /* If EEPROM or EFUSE autoload OK, We must config by PHY_REG_PG.txt */
PHY_InitTxPowerByRate(Adapter); PHY_InitTxPowerByRate(Adapter);
...@@ -476,11 +435,8 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter) ...@@ -476,11 +435,8 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
Adapter->registrypriv.RegEnableTxPowerByRate == 1 || Adapter->registrypriv.RegEnableTxPowerByRate == 1 ||
(Adapter->registrypriv.RegEnableTxPowerByRate == 2 && pHalData->EEPROMRegulatory != 2) (Adapter->registrypriv.RegEnableTxPowerByRate == 2 && pHalData->EEPROMRegulatory != 2)
) { ) {
if (phy_ConfigBBWithPgParaFile(Adapter, pszBBRegPgFile) == ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv,
_FAIL) { CONFIG_BB_PHY_REG_PG);
if (HAL_STATUS_SUCCESS != ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG_PG))
rtStatus = _FAIL;
}
if (pHalData->odmpriv.PhyRegPgValueType == PHY_REG_PG_EXACT_VALUE) if (pHalData->odmpriv.PhyRegPgValueType == PHY_REG_PG_EXACT_VALUE)
PHY_TxPowerByRateConfiguration(Adapter); PHY_TxPowerByRateConfiguration(Adapter);
...@@ -490,29 +446,14 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter) ...@@ -490,29 +446,14 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
(Adapter->registrypriv.RegEnableTxPowerLimit == 2 && pHalData->EEPROMRegulatory == 1) (Adapter->registrypriv.RegEnableTxPowerLimit == 2 && pHalData->EEPROMRegulatory == 1)
) )
PHY_ConvertTxPowerLimitToPowerIndex(Adapter); PHY_ConvertTxPowerLimitToPowerIndex(Adapter);
if (rtStatus != _SUCCESS) {
DBG_8192C("%s():BB_PG Reg Fail!!\n", __func__);
}
} }
/* */ /* */
/* 2. Read BB AGC table Initialization */ /* 2. Read BB AGC table Initialization */
/* */ /* */
if (phy_ConfigBBWithParaFile(Adapter, pszAGCTableFile, ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_AGC_TAB);
CONFIG_BB_AGC_TAB) == _FAIL) {
if (HAL_STATUS_SUCCESS != ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_AGC_TAB))
rtStatus = _FAIL;
}
if (rtStatus != _SUCCESS) {
DBG_8192C("%s():AGC Table Fail\n", __func__);
goto phy_BB8190_Config_ParaFile_Fail;
}
phy_BB8190_Config_ParaFile_Fail:
return rtStatus; return _SUCCESS;
} }
......
...@@ -85,19 +85,8 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter) ...@@ -85,19 +85,8 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
u32 u4RegValue = 0; u32 u4RegValue = 0;
u8 eRFPath; u8 eRFPath;
struct bb_register_def *pPhyReg; struct bb_register_def *pPhyReg;
int rtStatus = _SUCCESS;
struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
static char sz8723RadioAFile[] = RTL8723B_PHY_RADIO_A;
static char sz8723RadioBFile[] = RTL8723B_PHY_RADIO_B;
static s8 sz8723BTxPwrTrackFile[] = RTL8723B_TXPWR_TRACK;
char *pszRadioAFile, *pszRadioBFile, *pszTxPwrTrackFile;
pszRadioAFile = sz8723RadioAFile;
pszRadioBFile = sz8723RadioBFile;
pszTxPwrTrackFile = sz8723BTxPwrTrackFile;
/* 3----------------------------------------------------------------- */ /* 3----------------------------------------------------------------- */
/* 3 <2> Initialize RF */ /* 3 <2> Initialize RF */
/* 3----------------------------------------------------------------- */ /* 3----------------------------------------------------------------- */
...@@ -136,21 +125,11 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter) ...@@ -136,21 +125,11 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
/*----Initialize RF fom connfiguration file----*/ /*----Initialize RF fom connfiguration file----*/
switch (eRFPath) { switch (eRFPath) {
case RF_PATH_A: case RF_PATH_A:
if (PHY_ConfigRFWithParaFile(Adapter, pszRadioAFile,
eRFPath) == _FAIL) {
if (HAL_STATUS_FAILURE == ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv, CONFIG_RF_RADIO, (ODM_RF_RADIO_PATH_E)eRFPath))
rtStatus = _FAIL;
}
break;
case RF_PATH_B: case RF_PATH_B:
if (PHY_ConfigRFWithParaFile(Adapter, pszRadioBFile, ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv,
eRFPath) == _FAIL) { CONFIG_RF_RADIO, eRFPath);
if (HAL_STATUS_FAILURE == ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv, CONFIG_RF_RADIO, (ODM_RF_RADIO_PATH_E)eRFPath))
rtStatus = _FAIL;
}
break; break;
case RF_PATH_C: case RF_PATH_C:
break;
case RF_PATH_D: case RF_PATH_D:
break; break;
} }
...@@ -166,28 +145,16 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter) ...@@ -166,28 +145,16 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
PHY_SetBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV << 16, u4RegValue); PHY_SetBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV << 16, u4RegValue);
break; break;
} }
if (rtStatus != _SUCCESS) {
/* RT_TRACE(COMP_FPGA, DBG_LOUD, ("phy_RF6052_Config_ParaFile():Radio[%d] Fail!!", eRFPath)); */
goto phy_RF6052_Config_ParaFile_Fail;
}
} }
/* 3 ----------------------------------------------------------------- */ /* 3 ----------------------------------------------------------------- */
/* 3 Configuration of Tx Power Tracking */ /* 3 Configuration of Tx Power Tracking */
/* 3 ----------------------------------------------------------------- */ /* 3 ----------------------------------------------------------------- */
if (PHY_ConfigRFWithTxPwrTrackParaFile(Adapter, pszTxPwrTrackFile) == ODM_ConfigRFWithTxPwrTrackHeaderFile(&pHalData->odmpriv);
_FAIL) {
ODM_ConfigRFWithTxPwrTrackHeaderFile(&pHalData->odmpriv);
}
/* RT_TRACE(COMP_INIT, DBG_LOUD, ("<---phy_RF6052_Config_ParaFile()\n")); */ /* RT_TRACE(COMP_INIT, DBG_LOUD, ("<---phy_RF6052_Config_ParaFile()\n")); */
return rtStatus; return _SUCCESS;
phy_RF6052_Config_ParaFile_Fail:
return rtStatus;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment