提交 e332e2a2 编写于 作者: P Ping-Ke Shih 提交者: Kalle Valo

rtlwifi: Correct power save capability while init mac80211

Since the driver itself will enter power saving mode dynamically
according to the traffic, we set hw capability SUPPORTS_PS and
SUPPORTS_DYNAMIC_PS in case of fwctrl_lps.

The process IEEE80211_CONF_CHANGE_PS in op_config is used by
SW-LPS only, so we add constraints to avoid errors.
Signed-off-by: NPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: Nvincent_fann <vincent_fann@realtek.com>
Signed-off-by: Nshaofu <shaofu@realtek.com>
Signed-off-by: NLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: NYan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 f95d95a7
......@@ -405,6 +405,10 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw)
ieee80211_hw_set(hw, SUPPORTS_PS);
ieee80211_hw_set(hw, PS_NULLFUNC_STACK);
}
if (rtlpriv->psc.fwctrl_lps) {
ieee80211_hw_set(hw, SUPPORTS_PS);
ieee80211_hw_set(hw, SUPPORTS_DYNAMIC_PS);
}
hw->wiphy->interface_modes =
BIT(NL80211_IFTYPE_AP) |
BIT(NL80211_IFTYPE_STATION) |
......
......@@ -629,7 +629,8 @@ static int rtl_op_config(struct ieee80211_hw *hw, u32 changed)
}
/*For LPS */
if (changed & IEEE80211_CONF_CHANGE_PS) {
if ((changed & IEEE80211_CONF_CHANGE_PS) &&
rtlpriv->psc.swctrl_lps && !rtlpriv->psc.fwctrl_lps) {
cancel_delayed_work(&rtlpriv->works.ps_work);
cancel_delayed_work(&rtlpriv->works.ps_rfon_wq);
if (conf->flags & IEEE80211_CONF_PS) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册