summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/iwlwifi/iwl-trans.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-03-05 23:24:35 +0400
committerJohn W. Linville <linville@tuxdriver.com>2012-03-07 00:16:12 +0400
commit2dd4f9f731f593a52a3fdca20bb32a78d917baf7 (patch)
tree85da9965d4384031e466690de2ad8828491e6085 /drivers/net/wireless/iwlwifi/iwl-trans.h
parentce9e80af4f2c5dffb0df470538573d473c91d540 (diff)
downloadlinux-2dd4f9f731f593a52a3fdca20bb32a78d917baf7.tar.xz
iwlwifi: clean up (wowlan) suspend flow
In the WoWLAN suspend flow, instead of accessing registers directly, ask the transport to do the required setup at the end of suspend. If the transport doesn't implement this, don't tell the stack we support WoWLAN. When the device suspends w/o WoWLAN, mac80211 will have stopped it already, which has already called iwl_apm_stop() via stop_hw(). Thus, it isn't necessary to call it again in pcie_suspend and we can simply do nothing there. This unifies the regular and WoWLAN suspend. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-trans.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index e2f21cfc2cd4..83f04c9d77e5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -210,6 +210,9 @@ struct iwl_host_cmd {
* @wake_any_queue: wake all the queues of a specfic context IWL_RXON_CTX_*
* @stop_device:stops the whole device (embedded CPU put to reset)
* May sleep
+ * @wowlan_suspend: put the device into the correct mode for WoWLAN during
+ * suspend. This is optional, if not implemented WoWLAN will not be
+ * supported. This callback may sleep.
* @send_cmd:send a host command
* May sleep only if CMD_SYNC is set
* @tx: send an skb
@@ -247,6 +250,8 @@ struct iwl_trans_ops {
void (*fw_alive)(struct iwl_trans *trans);
void (*stop_device)(struct iwl_trans *trans);
+ void (*wowlan_suspend)(struct iwl_trans *trans);
+
void (*wake_any_queue)(struct iwl_trans *trans,
enum iwl_rxon_context_id ctx,
const char *msg);
@@ -396,6 +401,12 @@ static inline void iwl_trans_stop_device(struct iwl_trans *trans)
trans->state = IWL_TRANS_NO_FW;
}
+static inline void iwl_trans_wowlan_suspend(struct iwl_trans *trans)
+{
+ might_sleep();
+ trans->ops->wowlan_suspend(trans);
+}
+
static inline void iwl_trans_wake_any_queue(struct iwl_trans *trans,
enum iwl_rxon_context_id ctx,
const char *msg)