1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 3 * Mac80211 power management interface for ST-Ericsson CW1200 mac80211 drivers 4 * 5 * Copyright (c) 2011, ST-Ericsson 6 * Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no> 7 */ 8 9 #ifndef PM_H_INCLUDED 10 #define PM_H_INCLUDED 11 12 /* ******************************************************************** */ 13 /* mac80211 API */ 14 15 /* extern */ struct cw1200_common; 16 /* private */ struct cw1200_suspend_state; 17 18 struct cw1200_pm_state { 19 struct cw1200_suspend_state *suspend_state; 20 struct timer_list stay_awake; 21 struct platform_device *pm_dev; 22 spinlock_t lock; /* Protect access */ 23 }; 24 25 #ifdef CONFIG_PM 26 int cw1200_pm_init(struct cw1200_pm_state *pm, 27 struct cw1200_common *priv); 28 void cw1200_pm_deinit(struct cw1200_pm_state *pm); 29 int cw1200_wow_suspend(struct ieee80211_hw *hw, 30 struct cfg80211_wowlan *wowlan); 31 int cw1200_can_suspend(struct cw1200_common *priv); 32 int cw1200_wow_resume(struct ieee80211_hw *hw); 33 void cw1200_pm_stay_awake(struct cw1200_pm_state *pm, 34 unsigned long tmo); 35 #else cw1200_pm_stay_awake(struct cw1200_pm_state * pm,unsigned long tmo)36static inline void cw1200_pm_stay_awake(struct cw1200_pm_state *pm, 37 unsigned long tmo) 38 { 39 } cw1200_can_suspend(struct cw1200_common * priv)40static inline int cw1200_can_suspend(struct cw1200_common *priv) 41 { 42 return 0; 43 } 44 #endif 45 #endif 46