pm.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Mac80211 power management interface for ST-Ericsson CW1200 mac80211 drivers
  3. *
  4. * Copyright (c) 2011, ST-Ericsson
  5. * Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef PM_H_INCLUDED
  12. #define PM_H_INCLUDED
  13. /* ******************************************************************** */
  14. /* mac80211 API */
  15. /* extern */ struct cw1200_common;
  16. /* private */ struct cw1200_suspend_state;
  17. struct cw1200_pm_state {
  18. struct cw1200_suspend_state *suspend_state;
  19. struct timer_list stay_awake;
  20. struct platform_device *pm_dev;
  21. spinlock_t lock; /* Protect access */
  22. };
  23. #ifdef CONFIG_PM
  24. int cw1200_pm_init(struct cw1200_pm_state *pm,
  25. struct cw1200_common *priv);
  26. void cw1200_pm_deinit(struct cw1200_pm_state *pm);
  27. int cw1200_wow_suspend(struct ieee80211_hw *hw,
  28. struct cfg80211_wowlan *wowlan);
  29. int cw1200_can_suspend(struct cw1200_common *priv);
  30. int cw1200_wow_resume(struct ieee80211_hw *hw);
  31. void cw1200_pm_stay_awake(struct cw1200_pm_state *pm,
  32. unsigned long tmo);
  33. #else
  34. static inline void cw1200_pm_stay_awake(struct cw1200_pm_state *pm,
  35. unsigned long tmo)
  36. {
  37. }
  38. static inline int cw1200_can_suspend(struct cw1200_common *priv)
  39. {
  40. return 0;
  41. }
  42. #endif
  43. #endif