xref: /wlan-dirver/qca-wifi-host-cmn/umac/twt/core/src/wlan_twt_common.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 any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 /**
18  *  DOC: wlan_twt_common.h
19  */
20 #include <wlan_twt_api.h>
21 #include <wlan_objmgr_psoc_obj.h>
22 #include <wlan_twt_public_structs.h>
23 
24 /**
25  * wlan_twt_tgt_caps_get_responder() - twt get responder
26  * @psoc: psoc handle
27  * @val: pointer to the output variable
28  *
29  * return: QDF_STATUS
30  */
31 QDF_STATUS
32 wlan_twt_tgt_caps_get_responder(struct wlan_objmgr_psoc *psoc, bool *val);
33 
34 /**
35  * wlan_twt_tgt_caps_get_legacy_bcast_support() - get legacy bcast support
36  * @psoc: psoc handle
37  * @val: pointer to the output variable
38  *
39  * return: QDF_STATUS
40  */
41 QDF_STATUS
42 wlan_twt_tgt_caps_get_legacy_bcast_support(struct wlan_objmgr_psoc *psoc,
43 					   bool *val);
44 
45 /**
46  * wlan_twt_tgt_caps_get_bcast_req_support() - get bcast requestor support
47  * @psoc: psoc handle
48  * @val: pointer to the output variable
49  *
50  * return: QDF_STATUS
51  */
52 QDF_STATUS
53 wlan_twt_tgt_caps_get_bcast_req_support(struct wlan_objmgr_psoc *psoc,
54 					bool *val);
55 
56 /**
57  * wlan_twt_tgt_caps_get_nudge_enabled() - get nudge enabled
58  * @psoc: psoc handle
59  * @val: pointer to the output variable
60  *
61  * return: QDF_STATUS
62  */
63 QDF_STATUS
64 wlan_twt_tgt_caps_get_nudge_enabled(struct wlan_objmgr_psoc *psoc,
65 				    bool *val);
66 
67 /**
68  * wlan_twt_tgt_caps_get_all_twt_enabled() - get all twt enabled
69  * @psoc: psoc handle
70  * @val: pointer to the output variable
71  *
72  * return: QDF_STATUS
73  */
74 QDF_STATUS
75 wlan_twt_tgt_caps_get_all_twt_enabled(struct wlan_objmgr_psoc *psoc,
76 				      bool *val);
77 
78 /**
79  * wlan_twt_tgt_caps_get_stats_enabled() - get twt stats enabled
80  * @psoc: psoc handle
81  * @val: pointer to the output variable
82  *
83  * return: QDF_STATUS
84  */
85 QDF_STATUS
86 wlan_twt_tgt_caps_get_stats_enabled(struct wlan_objmgr_psoc *psoc,
87 				    bool *val);
88 
89 /**
90  * wlan_twt_tgt_caps_get_ack_supported() - get twt ack supported
91  * @psoc: psoc handle
92  * @val: pointer to the output variable
93  *
94  * return: QDF_STATUS
95  */
96 QDF_STATUS
97 wlan_twt_tgt_caps_get_ack_supported(struct wlan_objmgr_psoc *psoc,
98 				    bool *val);
99 
100 /**
101  * wlan_twt_check_all_twt_support() - Check if all TWT sessions capability is
102  * supported or not
103  * @psoc: Pointer to psoc object
104  * @dialog_id: dialod id
105  *
106  * Return: QDF Status
107  */
108 QDF_STATUS wlan_twt_check_all_twt_support(struct wlan_objmgr_psoc *psoc,
109 					  uint32_t dialog_id);
110 
111 /**
112  * wlan_twt_requestor_disable() - twt requestor disable
113  * @psoc: psoc handle
114  * @req: twt disable request structure
115  * @context: context
116  *
117  * return: QDF_STATUS
118  */
119 QDF_STATUS
120 wlan_twt_requestor_disable(struct wlan_objmgr_psoc *psoc,
121 			   struct twt_disable_param *req,
122 			   void *context);
123 
124 /**
125  * wlan_twt_responder_disable() - twt responder disable
126  * @psoc: psoc handle
127  * @req: twt disable request structure
128  * @context: context
129  *
130  * return: QDF_STATUS
131  */
132 QDF_STATUS
133 wlan_twt_responder_disable(struct wlan_objmgr_psoc *psoc,
134 			   struct twt_disable_param *req,
135 			   void *context);
136 
137 /**
138  * wlan_twt_requestor_enable() - twt requestor enable
139  * @psoc: psoc handle
140  * @req: twt enable request structure
141  * @context: context
142  *
143  * return: QDF_STATUS
144  */
145 QDF_STATUS
146 wlan_twt_requestor_enable(struct wlan_objmgr_psoc *psoc,
147 			  struct twt_enable_param *req,
148 			  void *context);
149 
150 /**
151  * wlan_twt_responder_enable() - twt responder enable
152  * @psoc: psoc handle
153  * @req: twt enable request structure
154  * @context: context
155  *
156  * return: QDF_STATUS
157  */
158 QDF_STATUS
159 wlan_twt_responder_enable(struct wlan_objmgr_psoc *psoc,
160 			  struct twt_enable_param *req,
161 			  void *context);
162 
163 /**
164  * wlan_twt_set_peer_capabilities() - set twt peer capabilities
165  * @psoc: psoc handle
166  * @peer_mac: peer mac address
167  * @peer_cap: TWT peer capability bitmap. Refer enum
168  * wlan_twt_capabilities for representation.
169  *
170  * return: QDF_STATUS
171  */
172 QDF_STATUS
173 wlan_twt_set_peer_capabilities(struct wlan_objmgr_psoc *psoc,
174 			       struct qdf_mac_addr *peer_mac,
175 			       uint8_t peer_cap);
176 
177 /**
178  * wlan_twt_get_peer_capabilities() - get twt peer capabilities
179  * @psoc: psoc handle
180  * @peer_mac: peer mac address
181  * @peer_cap: Pointer to output variable to hold TWT peer capability bitmap.
182  * Refer enum wlan_twt_capabilities for representation.
183  *
184  * return: QDF_STATUS
185  */
186 QDF_STATUS
187 wlan_twt_get_peer_capabilities(struct wlan_objmgr_psoc *psoc,
188 			       struct qdf_mac_addr *peer_mac,
189 			       uint8_t *peer_cap);
190 
191 /**
192  * wlan_twt_enable_event_handler() - twt enable handler
193  * @psoc: psoc handle
194  * @event: twt enable event structure
195  *
196  * return: QDF_STATUS
197  */
198 QDF_STATUS
199 wlan_twt_enable_event_handler(struct wlan_objmgr_psoc *psoc,
200 			      struct twt_enable_complete_event_param *event);
201 
202 /**
203  * wlan_twt_disable_event_handler() - twt disable handler
204  * @psoc: psoc handle
205  * @event: twt disable event structure
206  *
207  * return: QDF_STATUS
208  */
209 QDF_STATUS
210 wlan_twt_disable_event_handler(struct wlan_objmgr_psoc *psoc,
211 			       struct twt_disable_complete_event_param *event);
212