Commit b459bc76 authored by wang yanqing's avatar wang yanqing Committed by Greg Kroah-Hartman

rtlwifi: Fix logic error in enter/exit power-save mode

commit 873ffe15 upstream.

In commit a269913c ("rtlwifi: Rework rtl_lps_leave() and
rtl_lps_enter() to use work queue"), the tests for enter/exit
power-save mode were inverted. With this change applied, the
wifi connection becomes much more stable.

Fixes: a269913c ("rtlwifi: Rework rtl_lps_leave() and rtl_lps_enter() to use work queue")
Signed-off-by: default avatarWang YanQing <udknight@gmail.com>
Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4f741c88
...@@ -1401,9 +1401,9 @@ void rtl_watchdog_wq_callback(void *data) ...@@ -1401,9 +1401,9 @@ void rtl_watchdog_wq_callback(void *data)
if (((rtlpriv->link_info.num_rx_inperiod + if (((rtlpriv->link_info.num_rx_inperiod +
rtlpriv->link_info.num_tx_inperiod) > 8) || rtlpriv->link_info.num_tx_inperiod) > 8) ||
(rtlpriv->link_info.num_rx_inperiod > 2)) (rtlpriv->link_info.num_rx_inperiod > 2))
rtlpriv->enter_ps = true;
else
rtlpriv->enter_ps = false; rtlpriv->enter_ps = false;
else
rtlpriv->enter_ps = true;
/* LeisurePS only work in infra mode. */ /* LeisurePS only work in infra mode. */
schedule_work(&rtlpriv->works.lps_change_work); schedule_work(&rtlpriv->works.lps_change_work);
......
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