提交 cbbfdd6c 编写于 作者: A Amitkumar Karwar 提交者: Kalle Valo

rsi: use appropriate interface for power save configuration

Power save request should be sent on station interface. Virtual
interface which is connected should be preferred. This patch
resolves device not entering power save problem in certain
situations
Signed-off-by: NAmitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: NSiva Rebbagondla <siva.rebbagondla@redpinesignals.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 8c1475bd
...@@ -614,7 +614,7 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw, ...@@ -614,7 +614,7 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw,
/* Power save parameters */ /* Power save parameters */
if (changed & IEEE80211_CONF_CHANGE_PS) { if (changed & IEEE80211_CONF_CHANGE_PS) {
struct ieee80211_vif *vif; struct ieee80211_vif *vif, *sta_vif = NULL;
unsigned long flags; unsigned long flags;
int i, set_ps = 1; int i, set_ps = 1;
...@@ -628,13 +628,17 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw, ...@@ -628,13 +628,17 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw,
set_ps = 0; set_ps = 0;
break; break;
} }
if ((vif->type == NL80211_IFTYPE_STATION ||
vif->type == NL80211_IFTYPE_P2P_CLIENT) &&
(!sta_vif || vif->bss_conf.assoc))
sta_vif = vif;
} }
if (set_ps) { if (set_ps && sta_vif) {
spin_lock_irqsave(&adapter->ps_lock, flags); spin_lock_irqsave(&adapter->ps_lock, flags);
if (conf->flags & IEEE80211_CONF_PS) if (conf->flags & IEEE80211_CONF_PS)
rsi_enable_ps(adapter, vif); rsi_enable_ps(adapter, sta_vif);
else else
rsi_disable_ps(adapter, vif); rsi_disable_ps(adapter, sta_vif);
spin_unlock_irqrestore(&adapter->ps_lock, flags); spin_unlock_irqrestore(&adapter->ps_lock, flags);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册