Commit f933c226 authored by Philipp Hortmann's avatar Philipp Hortmann Committed by Greg Kroah-Hartman

staging: rtl8192e: Remove function rtl92e_is_legal_rf_path

Remove function rtl92e_is_legal_rf_path that will always return 1. Reason
is that the eRFPath is always 0 for RF90_PATH_A or 1 for RF90_PATH_B but
never 2 or 3. In most usage cases this is easy to see but for the
following functions that use rtl92e_is_legal_rf_path it is more
difficult:
rtl92e_set_rf_reg and rtl92e_get_rf_reg are used in:
rtl92e_set_bandwidth (eRFPath only for 0 and 1)
rtl92e_config_rf (eRFPath only for 0 and 1)
_rtl92e_phy_switch_channel_step (eRFPath only for 0 and 1)
_rtl92e_dm_check_tx_power_tracking_thermal (eRFPath only for 0)
rtl92e_check_bb_and_rf is used in:
rtl92e_config_rf (eRFPath only for 0 and 1)
_rtl92e_bb_config_para_file (eRFPath only for 0)
rtl92e_config_rf_path is used in:
rtl92e_config_rf (eRFPath only for 0 and 1)
Remove dead code.
Signed-off-by: default avatarPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/b801f1f9ff3c58aedab4e3e07b2ec0a816fdf5d9.1678740713.git.philipp.g.hortmann@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7c4b9278
...@@ -22,9 +22,6 @@ void rtl92e_set_bandwidth(struct net_device *dev, ...@@ -22,9 +22,6 @@ void rtl92e_set_bandwidth(struct net_device *dev,
} }
for (eRFPath = 0; eRFPath < priv->num_total_rf_path; eRFPath++) { for (eRFPath = 0; eRFPath < priv->num_total_rf_path; eRFPath++) {
if (!rtl92e_is_legal_rf_path(dev, eRFPath))
continue;
switch (bandwidth) { switch (bandwidth) {
case HT_CHANNEL_WIDTH_20: case HT_CHANNEL_WIDTH_20:
rtl92e_set_rf_reg(dev, (enum rf90_radio_path)eRFPath, rtl92e_set_rf_reg(dev, (enum rf90_radio_path)eRFPath,
...@@ -67,9 +64,6 @@ bool rtl92e_config_rf(struct net_device *dev) ...@@ -67,9 +64,6 @@ bool rtl92e_config_rf(struct net_device *dev)
for (eRFPath = (enum rf90_radio_path)RF90_PATH_A; for (eRFPath = (enum rf90_radio_path)RF90_PATH_A;
eRFPath < priv->num_total_rf_path; eRFPath++) { eRFPath < priv->num_total_rf_path; eRFPath++) {
if (!rtl92e_is_legal_rf_path(dev, eRFPath))
continue;
pPhyReg = &priv->phy_reg_def[eRFPath]; pPhyReg = &priv->phy_reg_def[eRFPath];
switch (eRFPath) { switch (eRFPath) {
......
...@@ -1515,8 +1515,6 @@ static void _rtl92e_process_phyinfo(struct r8192_priv *priv, u8 *buffer, ...@@ -1515,8 +1515,6 @@ static void _rtl92e_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
if (!prev_st->bIsCCK && prev_st->bPacketToSelf) { if (!prev_st->bIsCCK && prev_st->bPacketToSelf) {
for (rfpath = RF90_PATH_A; rfpath < priv->num_total_rf_path; rfpath++) { for (rfpath = RF90_PATH_A; rfpath < priv->num_total_rf_path; rfpath++) {
if (!rtl92e_is_legal_rf_path(priv->rtllib->dev, rfpath))
continue;
if (priv->stats.rx_rssi_percentage[rfpath] == 0) { if (priv->stats.rx_rssi_percentage[rfpath] == 0) {
priv->stats.rx_rssi_percentage[rfpath] = priv->stats.rx_rssi_percentage[rfpath] =
prev_st->RxMIMOSignalStrength[rfpath]; prev_st->RxMIMOSignalStrength[rfpath];
......
...@@ -47,20 +47,6 @@ static u32 _rtl92e_calculate_bit_shift(u32 dwBitMask) ...@@ -47,20 +47,6 @@ static u32 _rtl92e_calculate_bit_shift(u32 dwBitMask)
return ffs(dwBitMask) - 1; return ffs(dwBitMask) - 1;
} }
u8 rtl92e_is_legal_rf_path(struct net_device *dev, u32 eRFPath)
{
u8 ret = 1;
struct r8192_priv *priv = rtllib_priv(dev);
if (priv->rf_type == RF_1T2R) {
if (eRFPath == RF90_PATH_A || eRFPath == RF90_PATH_B)
ret = 1;
else if (eRFPath == RF90_PATH_C || eRFPath == RF90_PATH_D)
ret = 0;
}
return ret;
}
void rtl92e_set_bb_reg(struct net_device *dev, u32 dwRegAddr, u32 dwBitMask, void rtl92e_set_bb_reg(struct net_device *dev, u32 dwRegAddr, u32 dwBitMask,
u32 dwData) u32 dwData)
{ {
...@@ -196,8 +182,6 @@ void rtl92e_set_rf_reg(struct net_device *dev, enum rf90_radio_path eRFPath, ...@@ -196,8 +182,6 @@ void rtl92e_set_rf_reg(struct net_device *dev, enum rf90_radio_path eRFPath,
struct r8192_priv *priv = rtllib_priv(dev); struct r8192_priv *priv = rtllib_priv(dev);
u32 Original_Value, BitShift, New_Value; u32 Original_Value, BitShift, New_Value;
if (!rtl92e_is_legal_rf_path(dev, eRFPath))
return;
if (priv->rtllib->rf_power_state != rf_on && !priv->being_init_adapter) if (priv->rtllib->rf_power_state != rf_on && !priv->being_init_adapter)
return; return;
...@@ -233,8 +217,6 @@ u32 rtl92e_get_rf_reg(struct net_device *dev, enum rf90_radio_path eRFPath, ...@@ -233,8 +217,6 @@ u32 rtl92e_get_rf_reg(struct net_device *dev, enum rf90_radio_path eRFPath,
u32 Original_Value, Readback_Value, BitShift; u32 Original_Value, Readback_Value, BitShift;
struct r8192_priv *priv = rtllib_priv(dev); struct r8192_priv *priv = rtllib_priv(dev);
if (!rtl92e_is_legal_rf_path(dev, eRFPath))
return 0;
if (priv->rtllib->rf_power_state != rf_on && !priv->being_init_adapter) if (priv->rtllib->rf_power_state != rf_on && !priv->being_init_adapter)
return 0; return 0;
mutex_lock(&priv->rf_mutex); mutex_lock(&priv->rf_mutex);
......
...@@ -49,7 +49,6 @@ enum rf90_radio_path { ...@@ -49,7 +49,6 @@ enum rf90_radio_path {
#define bMaskLWord 0x0000ffff #define bMaskLWord 0x0000ffff
#define bMaskDWord 0xffffffff #define bMaskDWord 0xffffffff
u8 rtl92e_is_legal_rf_path(struct net_device *dev, u32 eRFPath);
void rtl92e_set_bb_reg(struct net_device *dev, u32 dwRegAddr, void rtl92e_set_bb_reg(struct net_device *dev, u32 dwRegAddr,
u32 dwBitMask, u32 dwData); u32 dwBitMask, u32 dwData);
u32 rtl92e_get_bb_reg(struct net_device *dev, u32 dwRegAddr, u32 dwBitMask); u32 rtl92e_get_bb_reg(struct net_device *dev, u32 dwRegAddr, u32 dwBitMask);
......
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