rtlwifi: Add missing code to PWDB statics routine
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
e9b0784bb9
commit
d82403a9f4
|
@ -176,6 +176,7 @@ static void rtl_process_pwdb(struct ieee80211_hw *hw, struct rtl_stats *pstatus)
|
|||
struct rtl_sta_info *drv_priv = NULL;
|
||||
struct ieee80211_sta *sta = NULL;
|
||||
long undec_sm_pwdb;
|
||||
long undec_sm_cck;
|
||||
|
||||
rcu_read_lock();
|
||||
if (rtlpriv->mac80211.opmode != NL80211_IFTYPE_STATION)
|
||||
|
@ -185,12 +186,16 @@ static void rtl_process_pwdb(struct ieee80211_hw *hw, struct rtl_stats *pstatus)
|
|||
if (sta) {
|
||||
drv_priv = (struct rtl_sta_info *) sta->drv_priv;
|
||||
undec_sm_pwdb = drv_priv->rssi_stat.undec_sm_pwdb;
|
||||
undec_sm_cck = drv_priv->rssi_stat.undec_sm_cck;
|
||||
} else {
|
||||
undec_sm_pwdb = rtlpriv->dm.undec_sm_pwdb;
|
||||
undec_sm_cck = rtlpriv->dm.undec_sm_cck;
|
||||
}
|
||||
|
||||
if (undec_sm_pwdb < 0)
|
||||
undec_sm_pwdb = pstatus->rx_pwdb_all;
|
||||
if (undec_sm_cck < 0)
|
||||
undec_sm_cck = pstatus->rx_pwdb_all;
|
||||
if (pstatus->rx_pwdb_all > (u32) undec_sm_pwdb) {
|
||||
undec_sm_pwdb = (((undec_sm_pwdb) *
|
||||
(RX_SMOOTH_FACTOR - 1)) +
|
||||
|
@ -200,6 +205,15 @@ static void rtl_process_pwdb(struct ieee80211_hw *hw, struct rtl_stats *pstatus)
|
|||
undec_sm_pwdb = (((undec_sm_pwdb) * (RX_SMOOTH_FACTOR - 1)) +
|
||||
(pstatus->rx_pwdb_all)) / (RX_SMOOTH_FACTOR);
|
||||
}
|
||||
if (pstatus->rx_pwdb_all > (u32) undec_sm_cck) {
|
||||
undec_sm_cck = (((undec_sm_pwdb) *
|
||||
(RX_SMOOTH_FACTOR - 1)) +
|
||||
(pstatus->rx_pwdb_all)) / (RX_SMOOTH_FACTOR);
|
||||
undec_sm_cck = undec_sm_cck + 1;
|
||||
} else {
|
||||
undec_sm_pwdb = (((undec_sm_cck) * (RX_SMOOTH_FACTOR - 1)) +
|
||||
(pstatus->rx_pwdb_all)) / (RX_SMOOTH_FACTOR);
|
||||
}
|
||||
|
||||
if (sta) {
|
||||
drv_priv->rssi_stat.undec_sm_pwdb = undec_sm_pwdb;
|
||||
|
|
Loading…
Reference in a new issue