Commit 73f9b257 authored by Siva Rebbagondla's avatar Siva Rebbagondla Committed by Kalle Valo

rsi: resolve power save issue after S4 resume

We are redownloading the firmware after S4 restore and observed in
stress test that mac80211 sometimes gives power save request after
resume which causes the firmware in bad state. mac_ops_resumed flag
is added to skip that request until initialisation is done and Keeping
power save state is NONE.
Signed-off-by: default avatarSiva Rebbagondla <siva.rebbagondla@redpinesignals.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent a63762d0
......@@ -239,6 +239,7 @@ static int rsi_mac80211_hw_scan_start(struct ieee80211_hw *hw,
struct ieee80211_bss_conf *bss = &vif->bss_conf;
rsi_dbg(INFO_ZONE, "***** Hardware scan start *****\n");
common->mac_ops_resumed = false;
if (common->fsm_state != FSM_MAC_INIT_DONE)
return -ENODEV;
......@@ -370,6 +371,10 @@ static void rsi_mac80211_tx(struct ieee80211_hw *hw,
{
struct rsi_hw *adapter = hw->priv;
struct rsi_common *common = adapter->priv;
struct ieee80211_hdr *wlh = (struct ieee80211_hdr *)skb->data;
if (ieee80211_is_auth(wlh->frame_control))
common->mac_ops_resumed = false;
rsi_core_xmit(common, skb);
}
......@@ -677,7 +682,8 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw,
}
/* Power save parameters */
if (changed & IEEE80211_CONF_CHANGE_PS) {
if ((changed & IEEE80211_CONF_CHANGE_PS) &&
!common->mac_ops_resumed) {
struct ieee80211_vif *vif, *sta_vif = NULL;
unsigned long flags;
int i, set_ps = 1;
......@@ -1939,6 +1945,7 @@ static int rsi_mac80211_resume(struct ieee80211_hw *hw)
rsi_dbg(INFO_ZONE, "%s: mac80211 resume\n", __func__);
if (common->hibernate_resume) {
common->mac_ops_resumed = true;
/* Device need a complete restart of all MAC operations.
* returning 1 will serve this purpose.
*/
......
......@@ -1396,6 +1396,7 @@ static int rsi_restore(struct device *dev)
common->iface_down = true;
adapter->sc_nvifs = 0;
adapter->ps_state = PS_NONE;
common->wow_flags = 0;
common->iface_down = false;
......
......@@ -311,6 +311,7 @@ struct rsi_common {
struct cfg80211_scan_request *hwscan;
struct rsi_bgscan_params bgscan;
u8 bgscan_en;
u8 mac_ops_resumed;
};
struct eepromrw_info {
......
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