wow.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* SPDX-License-Identifier: BSD-3-Clause-Clear */
  2. /*
  3. * Copyright (c) 2020 The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef ATH12K_WOW_H
  7. #define ATH12K_WOW_H
  8. #define ATH12K_WOW_RETRY_NUM 10
  9. #define ATH12K_WOW_RETRY_WAIT_MS 200
  10. #define ATH12K_WOW_PATTERNS 22
  11. struct ath12k_wow {
  12. u32 max_num_patterns;
  13. struct completion wakeup_completed;
  14. struct wiphy_wowlan_support wowlan_support;
  15. };
  16. struct ath12k_pkt_pattern {
  17. u8 pattern[WOW_MAX_PATTERN_SIZE];
  18. u8 bytemask[WOW_MAX_PATTERN_SIZE];
  19. int pattern_len;
  20. int pkt_offset;
  21. };
  22. struct rfc1042_hdr {
  23. u8 llc_dsap;
  24. u8 llc_ssap;
  25. u8 llc_ctrl;
  26. u8 snap_oui[3];
  27. __be16 eth_type;
  28. } __packed;
  29. #ifdef CONFIG_PM
  30. int ath12k_wow_init(struct ath12k *ar);
  31. int ath12k_wow_op_suspend(struct ieee80211_hw *hw,
  32. struct cfg80211_wowlan *wowlan);
  33. int ath12k_wow_op_resume(struct ieee80211_hw *hw);
  34. void ath12k_wow_op_set_wakeup(struct ieee80211_hw *hw, bool enabled);
  35. int ath12k_wow_enable(struct ath12k *ar);
  36. int ath12k_wow_wakeup(struct ath12k *ar);
  37. #else
  38. static inline int ath12k_wow_init(struct ath12k *ar)
  39. {
  40. return 0;
  41. }
  42. static inline int ath12k_wow_enable(struct ath12k *ar)
  43. {
  44. return 0;
  45. }
  46. static inline int ath12k_wow_wakeup(struct ath12k *ar)
  47. {
  48. return 0;
  49. }
  50. #endif /* CONFIG_PM */
  51. #endif /* ATH12K_WOW_H */