@@ -48,14 +48,9 @@ u8 rtl_evm_db_to_percentage(char value)
}
EXPORT_SYMBOL(rtl_evm_db_to_percentage);
-static long rtl_translate_todbm(struct ieee80211_hw *hw,
- u8 signal_strength_index)
+static long rtl_signalpower_todbm(u8 signal_strength_index)
{
- long signal_power;
-
- signal_power = (long)((signal_strength_index + 1) >> 1);
- signal_power -= 95;
- return signal_power;
+ return (long)((signal_strength_index + 1) >> 1) - 95;
}
long rtl_signal_scale_mapping(long currsig)
@@ -93,7 +88,7 @@ static void rtl_process_ui_rssi(struct ieee80211_hw *hw,
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_phy *rtlphy = &(rtlpriv->phy);
u8 rfpath;
- u32 last_rssi, tmpval;
+ u32 last_rssi;
if (!pstatus->packet_toself && !pstatus->packet_beacon)
return;
@@ -112,10 +107,9 @@ static void rtl_process_ui_rssi(struct ieee80211_hw *hw,
pstatus->signalstrength;
if (rtlpriv->stats.ui_rssi.index >= PHY_RSSI_SLID_WIN_MAX)
rtlpriv->stats.ui_rssi.index = 0;
- tmpval = rtlpriv->stats.ui_rssi.total_val /
- rtlpriv->stats.ui_rssi.total_num;
- rtlpriv->stats.signal_strength = rtl_translate_todbm(hw,
- (u8) tmpval);
+ rtlpriv->stats.signal_strength = rtl_signalpower_todbm(
+ (u8)rtlpriv->stats.ui_rssi.total_val /
+ rtlpriv->stats.ui_rssi.total_num);
pstatus->rssi = rtlpriv->stats.signal_strength;
if (pstatus->is_cck)
Signed-off-by: Priit Laes <plaes@plaes.org> --- drivers/net/wireless/rtlwifi/stats.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-)