xref: /wlan-driver/qcacld-3.0/components/tdls/core/src/wlan_tdls_cmds_process.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /**
21  * DOC: wlan_tdls_cmds_process.h
22  *
23  * TDLS north bound commands include file
24  */
25 
26 #ifndef _WLAN_TDLS_CMDS_PROCESS_H_
27 #define _WLAN_TDLS_CMDS_PROCESS_H_
28 
29 #define TDLS_IS_SETUP_ACTION(action) \
30 	((TDLS_SETUP_REQUEST <= action) && \
31 	(TDLS_SETUP_CONFIRM >= action))
32 
33 /**
34  * tdls_process_add_peer() - add TDLS peer
35  * @req: TDLS add peer request
36  *
37  * Return: QDF_STATUS_SUCCESS if success; other value if failed
38  */
39 QDF_STATUS tdls_process_add_peer(struct tdls_add_peer_request *req);
40 
41 /**
42  * tdls_process_del_peer() - del TDLS peer
43  * @req: TDLS del peer request
44  *
45  * Return: QDF_STATUS_SUCCESS if success; other value if failed
46  */
47 QDF_STATUS tdls_process_del_peer(struct tdls_oper_request *req);
48 
49 /**
50  * tdls_process_enable_link() - enable TDLS link
51  * @req: TDLS enable link request
52  *
53  * Return: QDF_STATUS_SUCCESS if success; other value if failed
54  */
55 QDF_STATUS tdls_process_enable_link(struct tdls_oper_request *req);
56 
57 /**
58  * tdls_process_setup_peer() - process configure an externally
59  *                                    controllable TDLS peer
60  * @req: TDLS configure force peer request
61  *
62  * Return: QDF_STATUS_SUCCESS if success; other values if failed
63  */
64 QDF_STATUS tdls_process_setup_peer(struct tdls_oper_request *req);
65 
66 /**
67  * tdls_process_remove_force_peer() - process remove an externally controllable
68  *                                    TDLS peer
69  * @req: TDLS operation request
70  *
71  * Return: QDF_STATUS_SUCCESS if success; other values if failed
72  */
73 QDF_STATUS tdls_process_remove_force_peer(struct tdls_oper_request *req);
74 
75 /**
76  * tdls_process_update_peer() - update TDLS peer
77  * @req: TDLS update peer request
78  *
79  * Return: QDF_STATUS_SUCCESS if success; other value if failed
80  */
81 QDF_STATUS tdls_process_update_peer(struct tdls_update_peer_request *req);
82 
83 /**
84  * tdls_process_antenna_switch() - handle TDLS antenna switch
85  * @req: TDLS antenna switch request
86  *
87  * Rely on callback to indicate the antenna switch state to caller.
88  *
89  * Return: QDF_STATUS_SUCCESS if success; other value if failed.
90  */
91 QDF_STATUS tdls_process_antenna_switch(struct tdls_antenna_switch_request *req);
92 
93 /**
94  * tdls_antenna_switch_flush_callback() - flush TDLS antenna switch request
95  * @msg: scheduler message contains tdls antenna switch event
96  *
97  * This function call is invoked when scheduler thread is going down
98  *
99  * Return: QDF_STATUS
100  */
101 QDF_STATUS tdls_antenna_switch_flush_callback(struct scheduler_msg *msg);
102 
103 /**
104  * tdls_pe_del_peer() - send TDLS delete peer request to PE
105  * @req: TDLS delete peer request
106  *
107  * Return: QDF status
108  */
109 QDF_STATUS tdls_pe_del_peer(struct tdls_del_peer_request *req);
110 
111 /**
112  * tdls_process_add_peer_rsp() - handle response for add or update TDLS peer
113  * @rsp: TDLS add peer response
114  *
115  * Return: QDF status
116  */
117 QDF_STATUS tdls_process_add_peer_rsp(struct tdls_add_sta_rsp *rsp);
118 
119 /**
120  * tdls_reset_nss() - reset tdls nss parameters
121  * @tdls_soc: TDLS soc object
122  * @action_code: action code
123  *
124  * Return: None
125  */
126 void tdls_reset_nss(struct tdls_soc_priv_obj *tdls_soc,
127 				  uint8_t action_code);
128 
129 /**
130  * tdls_release_serialization_command() - TDLS wrapper to
131  * releases serialization command.
132  * @vdev: Object manager vdev
133  * @type: command to release.
134  *
135  * Return: None
136  */
137 
138 void
139 tdls_release_serialization_command(struct wlan_objmgr_vdev *vdev,
140 				   enum wlan_serialization_cmd_type type);
141 
142 /**
143  * tdls_get_connected_peer_count_from_vdev() -  Get TDLS connected peer count
144  * @vdev: Pointer to vdev obj
145  *
146  * Return: Connected peer count
147  */
148 uint16_t tdls_get_connected_peer_count_from_vdev(struct wlan_objmgr_vdev *vdev);
149 
150 /**
151  * tdls_set_cap() - set TDLS capability type
152  * @tdls_vdev: tdls vdev object
153  * @mac: peer mac address
154  * @cap: TDLS capability type
155  *
156  * Return: 0 if successful or negative errno otherwise
157  */
158 int tdls_set_cap(struct tdls_vdev_priv_obj *tdls_vdev, const uint8_t *mac,
159 			  enum tdls_peer_capab cap);
160 
161 /**
162  * tdls_process_send_mgmt_rsp() - handle response for send mgmt
163  * @rsp: TDLS send mgmt response
164  *
165  * Return: QDF_STATUS_SUCCESS for success; other values if failed
166  */
167 QDF_STATUS tdls_process_send_mgmt_rsp(struct tdls_send_mgmt_rsp *rsp);
168 
169 /**
170  * tdls_send_mgmt_tx_completion() - process tx completion
171  * @tx_complete: TDLS mgmt completion info
172  *
173  * Return: QDF_STATUS_SUCCESS for success; other values if failed
174  */
175 QDF_STATUS tdls_send_mgmt_tx_completion(
176 			struct tdls_mgmt_tx_completion_ind *tx_complete);
177 
178 /**
179  * tdls_process_del_peer_rsp() - handle response for delete TDLS peer
180  * @rsp: TDLS delete peer response
181  *
182  * Return: QDF status
183  */
184 QDF_STATUS tdls_process_del_peer_rsp(struct tdls_del_sta_rsp *rsp);
185 
186 /**
187  * tdls_process_should_discover() - handle tdls should_discover event
188  * @vdev: vdev object
189  * @evt: event info
190  *
191  * Return: QDF_STATUS
192  */
193 QDF_STATUS tdls_process_should_discover(struct wlan_objmgr_vdev *vdev,
194 					struct tdls_event_info *evt);
195 
196 /**
197  * tdls_process_should_teardown() - handle tdls should_teardown event
198  * @vdev: vdev object
199  * @evt: event info
200  *
201  * Return: QDF_STATUS
202  */
203 QDF_STATUS tdls_process_should_teardown(struct wlan_objmgr_vdev *vdev,
204 					struct tdls_event_info *evt);
205 
206 /**
207  * tdls_process_connection_tracker_notify() -handle tdls connect tracker notify
208  * @vdev: vdev object
209  * @evt: event info
210  *
211  * Return: QDF_STATUS
212  */
213 QDF_STATUS tdls_process_connection_tracker_notify(struct wlan_objmgr_vdev *vdev,
214 						  struct tdls_event_info *evt);
215 
216 /**
217  * tdls_validate_mgmt_request() - validate mgmt request
218  * @tdls_mgmt_req: action frame request
219  *
220  * Return: 0 for success or -EINVAL otherwise
221  */
222 int tdls_validate_mgmt_request(struct tdls_action_frame_request *tdls_mgmt_req);
223 
224 /**
225  * tdls_set_responder() - Set/clear TDLS peer's responder role
226  * @set_req: set responder request
227  *
228  * Return: 0 for success or -EINVAL otherwise
229  */
230 int tdls_set_responder(struct tdls_set_responder_req *set_req);
231 
232 /**
233  * tdls_decrement_peer_count() - decrement connected TDLS peer counter
234  * @vdev: vdev obj mgr
235  * @soc_obj: TDLS soc object
236  *
237  * Used in scheduler thread context, no lock needed.
238  *
239  * Return: None.
240  */
241 void tdls_decrement_peer_count(struct wlan_objmgr_vdev *vdev,
242 			       struct tdls_soc_priv_obj *soc_obj);
243 
244 /**
245  * wlan_tdls_offchan_parms_callback() - Callback to release ref count
246  * @vdev: vdev object
247  *
248  * Return: none
249  */
250 void wlan_tdls_offchan_parms_callback(struct wlan_objmgr_vdev *vdev);
251 
252 /**
253  * tdls_process_set_offchannel() - Handle set offchannel request for TDLS
254  * @req: TDLS set offchannel request
255  *
256  * Return: int status
257  */
258 int tdls_process_set_offchannel(struct tdls_set_offchannel *req);
259 
260 /**
261  * tdls_process_set_offchan_mode() - Handle set offchan mode request for TDLS
262  * @req: TDLS set offchannel mode request
263  *
264  * Return: int status
265  */
266 int tdls_process_set_offchan_mode(struct tdls_set_offchanmode *req);
267 
268 /**
269  * tdls_process_set_secoffchanneloffset() - Handle set sec offchannel
270  * offset request for TDLS
271  * @req: TDLS set secoffchannel offchannel request
272  *
273  * Return: int status
274  */
275 int tdls_process_set_secoffchanneloffset(
276 		struct tdls_set_secoffchanneloffset *req);
277 
278 #endif
279