xref: /wlan-dirver/qca-wifi-host-cmn/umac/twt/dispatcher/inc/wlan_twt_ucfg_api.h (revision 8cfe6b10058a04cafb17eed051f2ddf11bee8931)
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_api.h
21  * This file provides TWT ucfg apis.
22  */
23 #ifndef _WLAN_TWT_UCFG_API_H_
24 #define _WLAN_TWT_UCFG_API_H_
25 
26 #include <wlan_objmgr_psoc_obj.h>
27 #include <wlan_twt_public_structs.h>
28 
29 /**
30  * ucfg_twt_get_responder() - twt get responder
31  * @psoc: psoc handle
32  * @val: pointer to the output variable
33  *
34  * return: QDF_STATUS
35  */
36 QDF_STATUS
37 ucfg_twt_get_responder(struct wlan_objmgr_psoc *psoc, bool *val);
38 
39 /**
40  * ucfg_twt_get_legacy_bcast_twt_support() - get legacy bcast support
41  * @psoc: psoc handle
42  * @val: pointer to the output variable
43  *
44  * return: QDF_STATUS
45  */
46 QDF_STATUS
47 ucfg_twt_get_legacy_bcast_twt_support(struct wlan_objmgr_psoc *psoc,
48 				      bool *val);
49 
50 /**
51  * ucfg_twt_get_twt_nudge_enabled() - get twt nudge enabled
52  * @psoc: psoc handle
53  * @val: pointer to the output variable
54  *
55  * return: QDF_STATUS
56  */
57 QDF_STATUS
58 ucfg_twt_get_twt_nudge_enabled(struct wlan_objmgr_psoc *psoc,
59 			       bool *val);
60 
61 /**
62  * ucfg_twt_get_all_twt_enabled() - get all twt enabled
63  * @psoc: psoc handle
64  * @val: pointer to the output variable
65  *
66  * return: QDF_STATUS
67  */
68 QDF_STATUS
69 ucfg_twt_get_all_twt_enabled(struct wlan_objmgr_psoc *psoc,
70 			     bool *val);
71 
72 /**
73  * ucfg_twt_check_all_twt_support() - Check if all TWT sessions capability is
74  * supported or not
75  * @psoc: Pointer to psoc object
76  * @dialog_id: dialod id
77  *
78  * Return: QDF Status
79  */
80 QDF_STATUS
81 ucfg_twt_check_all_twt_support(struct wlan_objmgr_psoc *psoc,
82 			       uint32_t dialog_id);
83 
84 /**
85  * ucfg_twt_get_twt_stats_enabled() - get twt stats enabled
86  * @psoc: psoc handle
87  * @val: pointer to the output variable
88  *
89  * return: QDF_STATUS
90  */
91 QDF_STATUS
92 ucfg_twt_get_twt_stats_enabled(struct wlan_objmgr_psoc *psoc,
93 			       bool *val);
94 
95 /**
96  * ucfg_twt_get_twt_ack_supported() - get twt ack supported
97  * @psoc: psoc handle
98  * @val: pointer to the output variable
99  *
100  * return: QDF_STATUS
101  */
102 QDF_STATUS
103 ucfg_twt_get_twt_ack_supported(struct wlan_objmgr_psoc *psoc,
104 			       bool *val);
105 
106 /**
107  * ucfg_twt_requestor_disable() - twt requestor disable
108  * @psoc: psoc handle
109  * @req: twt disable request structure
110  * @context: context
111  *
112  * Following fields in request structure @twt_enable_param shall be
113  * filled by the user space/upper layer. if any field is not applicable
114  * then set it to 0.
115  *      pdev_id;
116  *      mbss_support;
117  *      default_slot_size;
118  *      congestion_thresh_setup;
119  *      congestion_thresh_teardown;
120  *      congestion_thresh_critical;
121  *      interference_thresh_teardown;
122  *      interference_thresh_setup;
123  *      min_no_sta_setup;
124  *      min_no_sta_teardown;
125  *      no_of_bcast_mcast_slots;
126  *      min_no_twt_slots;
127  *      max_no_sta_twt;
128  *      mode_check_interval;
129  *      add_sta_slot_interval;
130  *      remove_sta_slot_interval;
131  *      ext_conf_present;
132  *      b_twt_legacy_mbss_enable:1,
133  *      b_twt_ax_mbss_enable:1;
134  *
135  * Following fields in request structure @twt_enable_param shall be
136  * filled by the UMAC TWT Component itself
137  *      sta_cong_timer_ms;
138  *      twt_role;
139  *      twt_oper;
140  *      b_twt_enable;
141  *
142  * return: QDF_STATUS
143  */
144 QDF_STATUS
145 ucfg_twt_requestor_disable(struct wlan_objmgr_psoc *psoc,
146 			   struct twt_disable_param *req,
147 			   void *context);
148 
149 /**
150  * ucfg_twt_responder_disable() - twt responder disable
151  * @psoc: psoc handle
152  * @req: twt disable request structure
153  * @context: context
154  *
155  * Following fields in request structure @twt_enable_param shall be
156  * filled by the user space/upper layer. if any field is not applicable
157  * then set it to 0.
158  *      pdev_id;
159  *      mbss_support;
160  *      default_slot_size;
161  *      congestion_thresh_setup;
162  *      congestion_thresh_teardown;
163  *      congestion_thresh_critical;
164  *      interference_thresh_teardown;
165  *      interference_thresh_setup;
166  *      min_no_sta_setup;
167  *      min_no_sta_teardown;
168  *      no_of_bcast_mcast_slots;
169  *      min_no_twt_slots;
170  *      max_no_sta_twt;
171  *      mode_check_interval;
172  *      add_sta_slot_interval;
173  *      remove_sta_slot_interval;
174  *      ext_conf_present;
175  *      b_twt_legacy_mbss_enable:1,
176  *      b_twt_ax_mbss_enable:1;
177  *
178  * Following fields in request structure @twt_enable_param shall be
179  * filled by the UMAC TWT Component itself
180  *      sta_cong_timer_ms;
181  *      twt_role;
182  *      twt_oper;
183  *      b_twt_enable;
184  *
185  * return: QDF_STATUS
186  */
187 QDF_STATUS
188 ucfg_twt_responder_disable(struct wlan_objmgr_psoc *psoc,
189 			   struct twt_disable_param *req,
190 			   void *context);
191 
192 /**
193  * ucfg_twt_requestor_enable() - twt requestor enable
194  * @psoc: psoc handle
195  * @req: twt enable request structure
196  * @context: context
197  *
198  * Following fields in request structure @twt_enable_param shall be
199  * filled by the user space/upper layer. if any field is not applicable
200  * then set it to 0.
201  *      pdev_id;
202  *      mbss_support;
203  *      default_slot_size;
204  *      congestion_thresh_setup;
205  *      congestion_thresh_teardown;
206  *      congestion_thresh_critical;
207  *      interference_thresh_teardown;
208  *      interference_thresh_setup;
209  *      min_no_sta_setup;
210  *      min_no_sta_teardown;
211  *      no_of_bcast_mcast_slots;
212  *      min_no_twt_slots;
213  *      max_no_sta_twt;
214  *      mode_check_interval;
215  *      add_sta_slot_interval;
216  *      remove_sta_slot_interval;
217  *      ext_conf_present;
218  *      b_twt_legacy_mbss_enable:1,
219  *      b_twt_ax_mbss_enable:1;
220  *
221  * Following fields in request structure @twt_enable_param shall be
222  * filled by the UMAC TWT Component itself
223  *      sta_cong_timer_ms;
224  *      twt_role;
225  *      twt_oper;
226  *      b_twt_enable;
227  *
228  * return: QDF_STATUS
229  */
230 QDF_STATUS
231 ucfg_twt_requestor_enable(struct wlan_objmgr_psoc *psoc,
232 			  struct twt_enable_param *req,
233 			  void *context);
234 
235 /**
236  * ucfg_twt_responder_enable() - twt responder enable
237  * @psoc: psoc handle
238  * @req: twt enable request structure
239  * @context: context
240  *
241  * Following fields in request structure @twt_enable_param shall be
242  * filled by the user space/upper layer. if any field is not applicable
243  * then set it to 0.
244  *      pdev_id;
245  *      mbss_support;
246  *      default_slot_size;
247  *      congestion_thresh_setup;
248  *      congestion_thresh_teardown;
249  *      congestion_thresh_critical;
250  *      interference_thresh_teardown;
251  *      interference_thresh_setup;
252  *      min_no_sta_setup;
253  *      min_no_sta_teardown;
254  *      no_of_bcast_mcast_slots;
255  *      min_no_twt_slots;
256  *      max_no_sta_twt;
257  *      mode_check_interval;
258  *      add_sta_slot_interval;
259  *      remove_sta_slot_interval;
260  *      ext_conf_present;
261  *      b_twt_legacy_mbss_enable:1,
262  *      b_twt_ax_mbss_enable:1;
263  *
264  * Following fields in request structure @twt_enable_param shall be
265  * filled by the UMAC TWT Component itself
266  *      sta_cong_timer_ms;
267  *      twt_role;
268  *      twt_oper;
269  *      b_twt_enable;
270  *
271  * return: QDF_STATUS
272  */
273 QDF_STATUS
274 ucfg_twt_responder_enable(struct wlan_objmgr_psoc *psoc,
275 			  struct twt_enable_param *req,
276 			  void *context);
277 
278 /**
279  * ucfg_twt_set_peer_capabilities() - set twt peer capabilities
280  * @psoc: psoc handle
281  * @peer_mac: peer mac address
282  * @peer_cap: TWT peer capability bitmap. Refer enum
283  * wlan_twt_capabilities for representation.
284  *
285  * return: QDF_STATUS
286  */
287 QDF_STATUS
288 ucfg_twt_set_peer_capabilities(struct wlan_objmgr_psoc *psoc,
289 			       struct qdf_mac_addr *peer_mac,
290 			       uint8_t peer_cap);
291 
292 /**
293  * ucfg_twt_get_peer_capabilities() - get twt peer capabilities
294  * @psoc: psoc handle
295  * @peer_mac: peer mac address
296  * @peer_cap: Pointer to output variable to hold TWT peer capability bitmap.
297  * Refer enum wlan_twt_capabilities for representation.
298  *
299  * return: QDF_STATUS
300  */
301 QDF_STATUS
302 ucfg_twt_get_peer_capabilities(struct wlan_objmgr_psoc *psoc,
303 			       struct qdf_mac_addr *peer_mac,
304 			       uint8_t *peer_cap);
305 #endif /* _WLAN_TWT_UCFG_API_H_ */
306