Commit 76ed2edd authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

iwlwifi: properly handle device_set_wakeup_enable

This is intended to be set whenever wakeup will be
needed upon suspend, not only when suspending, so
use the new callbacks to set it then.
Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ff110c8f
...@@ -417,8 +417,6 @@ int iwlagn_mac_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) ...@@ -417,8 +417,6 @@ int iwlagn_mac_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
if (ret) if (ret)
goto error; goto error;
device_set_wakeup_enable(priv->trans->dev, true);
iwl_trans_wowlan_suspend(priv->trans); iwl_trans_wowlan_suspend(priv->trans);
goto out; goto out;
...@@ -485,8 +483,6 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw) ...@@ -485,8 +483,6 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw)
priv->wowlan = false; priv->wowlan = false;
device_set_wakeup_enable(priv->trans->dev, false);
iwlagn_prepare_restart(priv); iwlagn_prepare_restart(priv);
memset((void *)&ctx->active, 0, sizeof(ctx->active)); memset((void *)&ctx->active, 0, sizeof(ctx->active));
...@@ -501,6 +497,12 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw) ...@@ -501,6 +497,12 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw)
return 1; return 1;
} }
static void iwlagn_mac_set_wakeup(struct ieee80211_hw *hw, bool enabled)
{
struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
device_set_wakeup_enable(priv->trans->dev, enabled);
}
#endif #endif
void iwlagn_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) void iwlagn_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
...@@ -1581,6 +1583,7 @@ struct ieee80211_ops iwlagn_hw_ops = { ...@@ -1581,6 +1583,7 @@ struct ieee80211_ops iwlagn_hw_ops = {
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
.suspend = iwlagn_mac_suspend, .suspend = iwlagn_mac_suspend,
.resume = iwlagn_mac_resume, .resume = iwlagn_mac_resume,
.set_wakeup = iwlagn_mac_set_wakeup,
#endif #endif
.add_interface = iwlagn_mac_add_interface, .add_interface = iwlagn_mac_add_interface,
.remove_interface = iwlagn_mac_remove_interface, .remove_interface = iwlagn_mac_remove_interface,
......
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