xref: /wlan-driver/qca-wifi-host-cmn/umac/twt/core/src/wlan_twt_common.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
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_bcast_req_support() - get bcast requestor 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_bcast_req_support(struct wlan_objmgr_psoc *psoc,
43 					bool *val);
44 
45 /**
46  * wlan_twt_tgt_caps_get_nudge_enabled() - get nudge enabled
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_nudge_enabled(struct wlan_objmgr_psoc *psoc,
54 				    bool *val);
55 
56 /**
57  * wlan_twt_tgt_caps_get_all_twt_enabled() - get all twt 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_all_twt_enabled(struct wlan_objmgr_psoc *psoc,
65 				      bool *val);
66 
67 /**
68  * wlan_twt_tgt_caps_get_stats_enabled() - get twt stats 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_stats_enabled(struct wlan_objmgr_psoc *psoc,
76 				    bool *val);
77 
78 /**
79  * wlan_twt_tgt_caps_get_ack_supported() - get twt ack supported
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_ack_supported(struct wlan_objmgr_psoc *psoc,
87 				    bool *val);
88 
89 /**
90  * wlan_twt_check_all_twt_support() - Check if all TWT sessions capability is
91  * supported or not
92  * @psoc: Pointer to psoc object
93  * @dialog_id: dialod id
94  *
95  * Return: QDF Status
96  */
97 QDF_STATUS wlan_twt_check_all_twt_support(struct wlan_objmgr_psoc *psoc,
98 					  uint32_t dialog_id);
99 
100 /**
101  * wlan_twt_requestor_disable() - twt requestor disable
102  * @psoc: psoc handle
103  * @req: twt disable request structure
104  * @context: context
105  *
106  * return: QDF_STATUS
107  */
108 QDF_STATUS
109 wlan_twt_requestor_disable(struct wlan_objmgr_psoc *psoc,
110 			   struct twt_disable_param *req,
111 			   void *context);
112 
113 /**
114  * wlan_twt_responder_disable() - twt responder disable
115  * @psoc: psoc handle
116  * @req: twt disable request structure
117  * @context: context
118  *
119  * return: QDF_STATUS
120  */
121 QDF_STATUS
122 wlan_twt_responder_disable(struct wlan_objmgr_psoc *psoc,
123 			   struct twt_disable_param *req,
124 			   void *context);
125 
126 /**
127  * wlan_twt_requestor_enable() - twt requestor enable
128  * @psoc: psoc handle
129  * @req: twt enable request structure
130  * @context: context
131  *
132  * return: QDF_STATUS
133  */
134 QDF_STATUS
135 wlan_twt_requestor_enable(struct wlan_objmgr_psoc *psoc,
136 			  struct twt_enable_param *req,
137 			  void *context);
138 
139 /**
140  * wlan_twt_responder_enable() - twt responder enable
141  * @psoc: psoc handle
142  * @req: twt enable request structure
143  * @context: context
144  *
145  * return: QDF_STATUS
146  */
147 QDF_STATUS
148 wlan_twt_responder_enable(struct wlan_objmgr_psoc *psoc,
149 			  struct twt_enable_param *req,
150 			  void *context);
151 
152 /**
153  * wlan_twt_set_peer_capabilities() - set twt peer capabilities
154  * @psoc: psoc handle
155  * @peer_mac: peer mac address
156  * @peer_cap: TWT peer capability bitmap. Refer enum
157  * wlan_twt_capabilities for representation.
158  *
159  * return: QDF_STATUS
160  */
161 QDF_STATUS
162 wlan_twt_set_peer_capabilities(struct wlan_objmgr_psoc *psoc,
163 			       struct qdf_mac_addr *peer_mac,
164 			       uint8_t peer_cap);
165 
166 /**
167  * wlan_twt_get_peer_capabilities() - get twt peer capabilities
168  * @psoc: psoc handle
169  * @peer_mac: peer mac address
170  * @peer_cap: Pointer to output variable to hold TWT peer capability bitmap.
171  * Refer enum wlan_twt_capabilities for representation.
172  *
173  * return: QDF_STATUS
174  */
175 QDF_STATUS
176 wlan_twt_get_peer_capabilities(struct wlan_objmgr_psoc *psoc,
177 			       struct qdf_mac_addr *peer_mac,
178 			       uint8_t *peer_cap);
179 
180 /**
181  * wlan_twt_enable_event_handler() - twt enable handler
182  * @psoc: psoc handle
183  * @event: twt enable event structure
184  *
185  * return: QDF_STATUS
186  */
187 QDF_STATUS
188 wlan_twt_enable_event_handler(struct wlan_objmgr_psoc *psoc,
189 			      struct twt_enable_complete_event_param *event);
190 
191 /**
192  * wlan_twt_disable_event_handler() - twt disable handler
193  * @psoc: psoc handle
194  * @event: twt disable event structure
195  *
196  * return: QDF_STATUS
197  */
198 QDF_STATUS
199 wlan_twt_disable_event_handler(struct wlan_objmgr_psoc *psoc,
200 			       struct twt_disable_complete_event_param *event);
201 
202 /**
203  * wlan_twt_tgt_caps_get_restricted_support() - Get tgt restricted-twt
204  *                                              support caps
205  * @psoc: psoc handle
206  * @val: pointer to get caps enabled/disabled
207  *
208  * return: QDF_STATUS
209  */
210 QDF_STATUS
211 wlan_twt_tgt_caps_get_restricted_support(struct wlan_objmgr_psoc *psoc,
212 					 bool *val);
213