summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath10k/hif.h
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2013-07-16 09:38:54 +0200
committerKalle Valo <kvalo@qca.qualcomm.com>2013-07-30 18:01:19 +0300
commit8cd13cad1caf94ba66f626a94887b795fe23f939 (patch)
tree3722595fa51fd93fde9fa21d3633c1a49aeb7e00 /drivers/net/wireless/ath/ath10k/hif.h
parent64d151d47030d0d73d82bb6fa7bfe1e29385ed43 (diff)
downloadlwn-8cd13cad1caf94ba66f626a94887b795fe23f939.tar.gz
lwn-8cd13cad1caf94ba66f626a94887b795fe23f939.zip
ath10k: decouple suspend code
Split up fw-related and hw-related suspension code. Although we don't advertise WoW support to mac80211 yet it's useful to keep the code in suspend/resume hooks. At this point there's no need to keep pci pm ops. In case of WoW mac80211 calls ath10k_suspend() which should take care of entering low-power mode. In case WoW is not available mac80211 will go through regular interface teradown and use start/stop. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/hif.h')
-rw-r--r--drivers/net/wireless/ath/ath10k/hif.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath10k/hif.h b/drivers/net/wireless/ath/ath10k/hif.h
index 00d29402fa1d..dcdea68bcc0a 100644
--- a/drivers/net/wireless/ath/ath10k/hif.h
+++ b/drivers/net/wireless/ath/ath10k/hif.h
@@ -80,6 +80,9 @@ struct ath10k_hif_ops {
/* Power down the device and free up resources. stop() must be called
* before this if start() was called earlier */
void (*power_down)(struct ath10k *ar);
+
+ int (*suspend)(struct ath10k *ar);
+ int (*resume)(struct ath10k *ar);
};
@@ -154,4 +157,20 @@ static inline void ath10k_hif_power_down(struct ath10k *ar)
ar->hif.ops->power_down(ar);
}
+static inline int ath10k_hif_suspend(struct ath10k *ar)
+{
+ if (!ar->hif.ops->suspend)
+ return -EOPNOTSUPP;
+
+ return ar->hif.ops->suspend(ar);
+}
+
+static inline int ath10k_hif_resume(struct ath10k *ar)
+{
+ if (!ar->hif.ops->resume)
+ return -EOPNOTSUPP;
+
+ return ar->hif.ops->resume(ar);
+}
+
#endif /* _HIF_H_ */