diff options
author | Amitkumar Karwar <amit.karwar@redpinesignals.com> | 2018-04-10 20:34:13 +0530 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2018-04-24 20:25:02 +0300 |
commit | cbbfdd6c700f7c840df73199fac0c77a31b6d944 (patch) | |
tree | fbb36fcbfb64292fdb73dd850fbde94132c78d73 | |
parent | 8c1475bdfc3ae3b5ee46d7c026be5e4409e05ea2 (diff) | |
download | linux-cbbfdd6c700f7c840df73199fac0c77a31b6d944.tar.bz2 |
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: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r-- | drivers/net/wireless/rsi/rsi_91x_mac80211.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c index 5edc3a9d8eeb..77aa3bb357a0 100644 --- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c +++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c @@ -614,7 +614,7 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw, /* Power save parameters */ if (changed & IEEE80211_CONF_CHANGE_PS) { - struct ieee80211_vif *vif; + struct ieee80211_vif *vif, *sta_vif = NULL; unsigned long flags; int i, set_ps = 1; @@ -628,13 +628,17 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw, set_ps = 0; 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); if (conf->flags & IEEE80211_CONF_PS) - rsi_enable_ps(adapter, vif); + rsi_enable_ps(adapter, sta_vif); else - rsi_disable_ps(adapter, vif); + rsi_disable_ps(adapter, sta_vif); spin_unlock_irqrestore(&adapter->ps_lock, flags); } } |