1 /*
2 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. 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 /**
20 * DOC: wlan_twt_ucfg_ext_cfg.h
21 * This file provides TWT ucfg cfg param related apis.
22 */
23 #ifndef _WLAN_TWT_UCFG_EXT_CFG_H_
24 #define _WLAN_TWT_UCFG_EXT_CFG_H_
25
26 #include <wlan_objmgr_psoc_obj.h>
27 #include <wlan_twt_public_structs.h>
28
29 #if defined(WLAN_SUPPORT_TWT) && defined(WLAN_TWT_CONV_SUPPORTED)
30 /**
31 * ucfg_twt_cfg_get_requestor() - get TWT requestor
32 * @psoc: Pointer to global PSOC object
33 * @val: pointer to output variable
34 *
35 * Return: QDF_STATUS_SUCCESS
36 */
37 QDF_STATUS ucfg_twt_cfg_get_requestor(struct wlan_objmgr_psoc *psoc, bool *val);
38
39 /**
40 * ucfg_twt_cfg_get_responder() - get TWT responder
41 * @psoc: Pointer to global PSOC object
42 * @val: pointer to output variable
43 *
44 * Return: QDF_STATUS_SUCCESS
45 */
46 QDF_STATUS ucfg_twt_cfg_get_responder(struct wlan_objmgr_psoc *psoc, bool *val);
47
48 /**
49 * ucfg_twt_cfg_get_congestion_timeout() - Get TWT congestion timeout
50 * @psoc: Pointer to global psoc object
51 * @val: pointer to output variable
52 *
53 * Return: QDF_STATUS_SUCCESS
54 */
55 QDF_STATUS
56 ucfg_twt_cfg_get_congestion_timeout(struct wlan_objmgr_psoc *psoc,
57 uint32_t *val);
58
59 /**
60 * ucfg_twt_cfg_set_congestion_timeout() - Set TWT congestion timeout
61 * @psoc: Pointer to global psoc object
62 * @val: congestion timeout
63 *
64 * Return: QDF_STATUS_SUCCESS
65 */
66 QDF_STATUS
67 ucfg_twt_cfg_set_congestion_timeout(struct wlan_objmgr_psoc *psoc,
68 uint32_t val);
69
70 /**
71 * ucfg_twt_cfg_get_24ghz_enabled() - Get TWT 24ghz enabled
72 * @psoc: Pointer to global psoc object
73 * @val: pointer to output variable
74 *
75 * Return: QDF_STATUS_SUCCESS
76 */
77 QDF_STATUS
78 ucfg_twt_cfg_get_24ghz_enabled(struct wlan_objmgr_psoc *psoc, bool *val);
79
80 /**
81 * ucfg_twt_cfg_get_bcast_requestor() - Get TWT broadcast requestor
82 * @psoc: Pointer to global psoc object
83 * @val: pointer to output variable
84 *
85 * Return: QDF_STATUS_SUCCESS
86 */
87 QDF_STATUS
88 ucfg_twt_cfg_get_bcast_requestor(struct wlan_objmgr_psoc *psoc, bool *val);
89
90 /**
91 * ucfg_twt_cfg_get_bcast_responder() - Get TWT broadcast requestor
92 * @psoc: Pointer to global psoc object
93 * @val: pointer to output variable
94 *
95 * Return: QDF_STATUS_SUCCESS
96 */
97 QDF_STATUS
98 ucfg_twt_cfg_get_bcast_responder(struct wlan_objmgr_psoc *psoc, bool *val);
99
100 /**
101 * ucfg_twt_cfg_get_rtwt_requestor() - Get restricted TWT requestor
102 * @psoc: Pointer to global psoc object
103 * @val: pointer to output variable
104 *
105 * Return: QDF_STATUS_SUCCESS
106 */
107 QDF_STATUS
108 ucfg_twt_cfg_get_rtwt_requestor(struct wlan_objmgr_psoc *psoc, bool *val);
109
110 /**
111 * ucfg_twt_cfg_get_flex_sched() - Get TWT flex scheduling
112 * @psoc: Pointer to global psoc object
113 * @val: pointer to output variable
114 *
115 * Return: QDF_STATUS_SUCCESS
116 */
117 QDF_STATUS
118 ucfg_twt_cfg_get_flex_sched(struct wlan_objmgr_psoc *psoc, bool *val);
119
120 #else
121 static inline
ucfg_twt_cfg_get_requestor(struct wlan_objmgr_psoc * psoc,bool * val)122 QDF_STATUS ucfg_twt_cfg_get_requestor(struct wlan_objmgr_psoc *psoc, bool *val)
123 {
124 *val = false;
125 return QDF_STATUS_SUCCESS;
126 }
127
128 static inline
ucfg_twt_cfg_get_responder(struct wlan_objmgr_psoc * psoc,bool * val)129 QDF_STATUS ucfg_twt_cfg_get_responder(struct wlan_objmgr_psoc *psoc, bool *val)
130 {
131 *val = false;
132 return QDF_STATUS_SUCCESS;
133 }
134
135 static inline
ucfg_twt_cfg_get_congestion_timeout(struct wlan_objmgr_psoc * psoc,uint32_t * val)136 QDF_STATUS ucfg_twt_cfg_get_congestion_timeout(struct wlan_objmgr_psoc *psoc,
137 uint32_t *val)
138 {
139 *val = 0;
140 return QDF_STATUS_SUCCESS;
141 }
142
143 static inline
ucfg_twt_cfg_set_congestion_timeout(struct wlan_objmgr_psoc * psoc,uint32_t val)144 QDF_STATUS ucfg_twt_cfg_set_congestion_timeout(struct wlan_objmgr_psoc *psoc,
145 uint32_t val)
146 {
147 return QDF_STATUS_SUCCESS;
148 }
149
150 static inline QDF_STATUS
ucfg_twt_cfg_get_24ghz_enabled(struct wlan_objmgr_psoc * psoc,bool * val)151 ucfg_twt_cfg_get_24ghz_enabled(struct wlan_objmgr_psoc *psoc, bool *val)
152 {
153 *val = false;
154 return QDF_STATUS_SUCCESS;
155 }
156
157 static inline QDF_STATUS
ucfg_twt_cfg_get_bcast_requestor(struct wlan_objmgr_psoc * psoc,bool * val)158 ucfg_twt_cfg_get_bcast_requestor(struct wlan_objmgr_psoc *psoc, bool *val)
159 {
160 *val = false;
161 return QDF_STATUS_SUCCESS;
162 }
163
164 static inline QDF_STATUS
ucfg_twt_cfg_get_bcast_responder(struct wlan_objmgr_psoc * psoc,bool * val)165 ucfg_twt_cfg_get_bcast_responder(struct wlan_objmgr_psoc *psoc, bool *val)
166 {
167 *val = false;
168 return QDF_STATUS_SUCCESS;
169 }
170
171 static inline QDF_STATUS
ucfg_twt_cfg_get_rtwt_requestor(struct wlan_objmgr_psoc * psoc,bool * val)172 ucfg_twt_cfg_get_rtwt_requestor(struct wlan_objmgr_psoc *psoc, bool *val)
173 {
174 *val = false;
175 return QDF_STATUS_SUCCESS;
176 }
177
178 static inline QDF_STATUS
ucfg_twt_cfg_get_flex_sched(struct wlan_objmgr_psoc * psoc,bool * val)179 ucfg_twt_cfg_get_flex_sched(struct wlan_objmgr_psoc *psoc, bool *val)
180 {
181 *val = false;
182 return QDF_STATUS_SUCCESS;
183 }
184 #endif /* WLAN_TWT_CONV_SUPPORTED */
185 #endif /* _WLAN_TWT_UCFG_EXT_CFG_H_ */
186