1 /*
2  * Copyright (c) 2015-2019, 2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #if !defined(__SME_POWER_SAVE_H)
21 #define __SME_POWER_SAVE_H
22 #include "qdf_lock.h"
23 #include "qdf_trace.h"
24 #include "qdf_mem.h"
25 #include "qdf_types.h"
26 #include "ani_system_defs.h"
27 #include "sir_api.h"
28 
29 /*
30  * Auto Ps Entry User default timeout value, used instead of negative timeouts
31  * from user space - 5000ms
32  */
33 #define AUTO_PS_ENTRY_USER_TIMER_DEFAULT_VALUE 5000
34 #define AUTO_PS_ENTRY_TIMER_DEFAULT_VALUE 1000
35 #define AUTO_PS_DEFER_TIMEOUT_MS 1500
36 
37 #ifdef QCA_WIFI_EMULATION
38 /*
39  * Auto Ps timeout for emulation targets.
40  */
41 #define AUTO_PS_EMULATION_TIMEOUT 11
42 #endif
43 
44 /**
45  * struct ps_global_info - global struct for Power save information
46  * @ps_params: maintain power save state and USAPD params
47  * @remain_in_power_active_till_dhcp: remain in Power active till DHCP completes
48  */
49 struct ps_global_info {
50 	struct ps_params ps_params[WLAN_MAX_VDEVS];
51 };
52 
53 /**
54  * enum sme_ps_cmd: power save message to send WMA
55  * @SME_PS_ENABLE: For power save enable.
56  * @SME_PS_DISABLE: for Power save disable.
57  * @SME_PS_UAPSD_ENABLE; for UAPSD enable.
58  * @SME_PS_UAPSD_DISABLE: for UAPSD disable.
59  * @SME_PS_WOWL_ENTER: for WOWL Enter.
60  * @SME_PS_WOWL_EXIT: for WOWL Exit.
61  * @SME_PS_WOWL_ADD_BCAST_PTRN: Add bcst WOWL pattern.
62  * @SME_PS_WOWL_DEL_BCAST_PTRN: Del Bcsr Wowl Pattern.
63  */
64 enum sme_ps_cmd {
65 	SME_PS_ENABLE = 0,
66 	SME_PS_DISABLE,
67 	SME_PS_UAPSD_ENABLE,
68 	SME_PS_UAPSD_DISABLE,
69 	SME_PS_WOWL_ENTER,
70 	SME_PS_WOWL_EXIT,
71 	SME_PS_WOWL_ADD_BCAST_PTRN,
72 	SME_PS_WOWL_DEL_BCAST_PTRN,
73 };
74 
75 #endif
76