xref: /wlan-driver/qcacld-3.0/core/sme/inc/wlan_ps_wow_diag.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #ifndef _WLAN_PS_WOW_DIAG_H_
20 #define _WLAN_PS_WOW_DIAG_H_
21 
22 #include "host_diag_core_event.h"
23 #include "host_diag_core_log.h"
24 
25 #ifdef FEATURE_WLAN_DIAG_SUPPORT
26 
27 typedef enum {
28 	WLAN_BMPS_ENTER_REQ = 0,
29 	WLAN_UAPSD_START_REQ = 1,
30 	WLAN_UAPSD_STOP_REQ = 2,
31 	WLAN_ENTER_STANDBY_REQ = 3,
32 	WLAN_ENTER_DEEP_SLEEP_REQ = 4,
33 	WLAN_START_BMPS_AUTO_TIMER_REQ = 5,
34 	WLAN_STOP_BMPS_AUTO_TIMER_REQ = 6,
35 	WLAN_ENTER_FULL_POWER_REQ = 7,
36 	WLAN_PMC_CURRENT_STATE = 8,
37 	WLAN_PS_MODE_ENABLE_REQ = 9,
38 	WLAN_PS_MODE_DISABLE_REQ = 10,
39 	WLAN_WINMOB_D_POWER_STATE = 11,
40 	WLAN_BMPS_DTIM_PERIOD = 12,
41 	WLAN_BMPS_FINAL_LI = 13,
42 	WLAN_BMPS_SET_CONFIG = 14,
43 
44 } wlan_ps_evt_subtype_t;
45 
46 /* maps directly to eRequestFullPowerReason */
47 typedef enum {
48 	/* PE received a MAX_MISSED_BEACON_IND */
49 	WLAN_MISSED_BEACON_IND_RCVD,
50 	/* PE received a SIR_HAL_BMPS_STATUS_IND */
51 	WLAN_BMPS_STATUS_IND_RCVD,
52 	/* BMPS mode was disabled by HDD in SME */
53 	WLAN_BMPS_MODE_DISABLED,
54 	/* Link has been disconnected requested by HDD */
55 	WLAN_LINK_DISCONNECTED_BY_HDD,
56 	/* Disconnect due to linklost or requested by peer */
57 	WLAN_LINK_DISCONNECTED_BY_OTHER,
58 	/* HDD request full power for some reason */
59 	WLAN_FULL_PWR_NEEDED_BY_HDD,
60 	/* BAP request full power for BT_AMP */
61 	WLAN_FULL_PWR_NEEDED_BY_BAP,
62 	/* CSR requests full power */
63 	WLAN_FULL_PWR_NEEDED_BY_CSR,
64 	/* QOS requests full power */
65 	WLAN_FULL_PWR_NEEDED_BY_QOS,
66 	/* No specific reason. General reason code */
67 	WLAN_REASON_OTHER
68 } wlan_ps_full_power_request_reason_t;
69 
70 /* maps directly to ePmcState */
71 typedef enum {
72 	WLAN_PMC_STOPPED,       /* PMC is stopped */
73 	WLAN_PMC_FULL_POWER,    /* full power */
74 	WLAN_PMC_LOW_POWER,     /* low power */
75 	WLAN_PMC_REQUEST_BMPS,  /* requesting BMPS */
76 	WLAN_PMC_BMPS,          /* in BMPS */
77 	WLAN_PMC_REQUEST_FULL_POWER,    /* requesting full power */
78 	WLAN_PMC_REQUEST_START_UAPSD,   /* requesting Start UAPSD */
79 	WLAN_PMC_REQUEST_STOP_UAPSD,    /* requesting Stop UAPSD */
80 	WLAN_PMC_UAPSD,                 /* in UAPSD */
81 	WLAN_PMC_REQUEST_STANDBY,       /* requesting standby mode */
82 	WLAN_PMC_STANDBY,               /* in standby mode */
83 	WLAN_PMC_REQUEST_ENTER_WOWL,    /* requesting enter WOWL */
84 	WLAN_PMC_REQUEST_EXIT_WOWL,     /* requesting exit WOWL */
85 	WLAN_PMC_WOWL                   /* Chip in WOWL mode */
86 } wlan_ps_pmc_current_state_t;
87 
88 /* maps directly to ePmcPowerSavingMode */
89 typedef enum {
90 	WLAN_IDLE_MODE_POWER_SAVE,      /* Idle Mode Power Save (IMPS) */
91 	WLAN_BEACON_MODE_POWER_SAVE,    /* Beacon Mode Power Save (BMPS) */
92 	WLAN_SPATIAL_MULTIPLEX_POWER_SAVE, /* Spatial Multiplexing Power Save */
93 	WLAN_UAPSD_MODE_POWER_SAVE,     /* Unscheduled Auto PS Delivery Mode */
94 	WLAN_STANDBY_MODE_POWER_SAVE,   /* Standby Power Save Mode */
95 	WLAN_WOWL_MODE_POWER_SAVE       /* Wake-on-Wireless Power Save Mode */
96 } wlan_ps_enable_disable_ps_mode_t;
97 
98 typedef enum {
99 	WLAN_D0,
100 	WLAN_D1,
101 	WLAN_D2,
102 	WLAN_D3,
103 	WLAN_D4
104 } wlan_ps_winmob_d_power_state_t;
105 
106 typedef enum {
107 	WLAN_WOW_ENTER_REQ = 0,
108 	WLAN_WOW_EXIT_REQ = 1,
109 	WLAN_WOW_DEL_PTRN_REQ = 2,
110 	WLAN_WOW_WAKEUP = 3
111 } wlan_ps_wow_evt_subtype_t;
112 
113 typedef enum {
114 	WLAN_WOW_TYPE_NONE,
115 	WLAN_WOW_TYPE_MAGIC_PKT_ONLY,
116 	WLAN_WOW_TYPE_PTRN_BYTE_MATCH_ONLY,
117 	WLAN_WOW_TYPE_MAGIC_PKT_PTRN_BYTE_MATCH,
118 } wlan_ps_wow_type_t;
119 
120 typedef enum {
121 	WLAN_WOW_MAGIC_PKT_MATCH,
122 	WLAN_WOW_PTRN_BYTE_MATCH
123 } wlan_ps_wos_wakeup_cause_t;
124 
125 #endif /* FEATURE_WLAN_DIAG_SUPPORT */
126 
127 #endif /* _WLAN_PS_WOW_DIAG_H_ */
128