xref: /linux/drivers/net/wireless/ath/ath12k/wow.h (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
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 
7 #ifndef ATH12K_WOW_H
8 #define ATH12K_WOW_H
9 
10 #define ATH12K_WOW_RETRY_NUM		10
11 #define ATH12K_WOW_RETRY_WAIT_MS	200
12 #define ATH12K_WOW_PATTERNS		22
13 
14 struct ath12k_wow {
15 	u32 max_num_patterns;
16 	struct completion wakeup_completed;
17 	struct wiphy_wowlan_support wowlan_support;
18 };
19 
20 struct ath12k_pkt_pattern {
21 	u8 pattern[WOW_MAX_PATTERN_SIZE];
22 	u8 bytemask[WOW_MAX_PATTERN_SIZE];
23 	int pattern_len;
24 	int pkt_offset;
25 };
26 
27 struct rfc1042_hdr {
28 	u8 llc_dsap;
29 	u8 llc_ssap;
30 	u8 llc_ctrl;
31 	u8 snap_oui[3];
32 	__be16 eth_type;
33 } __packed;
34 
35 #ifdef CONFIG_PM
36 
37 int ath12k_wow_init(struct ath12k *ar);
38 int ath12k_wow_op_suspend(struct ieee80211_hw *hw,
39 			  struct cfg80211_wowlan *wowlan);
40 int ath12k_wow_op_resume(struct ieee80211_hw *hw);
41 void ath12k_wow_op_set_wakeup(struct ieee80211_hw *hw, bool enabled);
42 int ath12k_wow_enable(struct ath12k *ar);
43 int ath12k_wow_wakeup(struct ath12k *ar);
44 
45 #else
46 
47 static inline int ath12k_wow_init(struct ath12k *ar)
48 {
49 	return 0;
50 }
51 
52 static inline int ath12k_wow_enable(struct ath12k *ar)
53 {
54 	return 0;
55 }
56 
57 static inline int ath12k_wow_wakeup(struct ath12k *ar)
58 {
59 	return 0;
60 }
61 #endif /* CONFIG_PM */
62 #endif /* ATH12K_WOW_H */
63