1 /*
2  * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022-2023 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_tgt_api.h
22  *
23  * TDLS south bound interface declaration
24  */
25 
26 #ifndef _WLAN_TDLS_TGT_API_H_
27 #define _WLAN_TDLS_TGT_API_H_
28 #include <wlan_tdls_public_structs.h>
29 #include "wlan_tdls_main.h"
30 
31 /**
32  * tgt_tdls_set_fw_state() - invoke lmac tdls update fw
33  * @psoc: soc object
34  * @tdls_param: update tdls state parameters
35  *
36  * Return: QDF_STATUS
37  */
38 QDF_STATUS tgt_tdls_set_fw_state(struct wlan_objmgr_psoc *psoc,
39 				 struct tdls_info *tdls_param);
40 
41 /**
42  * tgt_tdls_set_peer_state() - invoke lmac tdls update peer state
43  * @psoc: soc object
44  * @peer_param: update tdls peer parameters
45  *
46  * Return: QDF_STATUS
47  */
48 QDF_STATUS tgt_tdls_set_peer_state(struct wlan_objmgr_psoc *psoc,
49 				   struct tdls_peer_update_state *peer_param);
50 
51 /**
52  * tgt_tdls_set_offchan_mode() - invoke lmac tdls set off-channel mode
53  * @psoc: soc object
54  * @param: set tdls off channel parameters
55  *
56  * Return: QDF_STATUS
57  */
58 QDF_STATUS tgt_tdls_set_offchan_mode(struct wlan_objmgr_psoc *psoc,
59 				     struct tdls_channel_switch_params *param);
60 
61 /**
62  * tgt_tdls_send_mgmt_rsp() - process tdls mgmt response
63  * @pmsg: scheduler msg
64  *
65  * Return: QDF_STATUS
66  */
67 QDF_STATUS tgt_tdls_send_mgmt_rsp(struct scheduler_msg *pmsg);
68 
69 /**
70  * tgt_tdls_send_mgmt_tx_completion() -process tx completion message
71  * @pmsg: scheduler msg
72  *
73  * Return: QDF_STATUS
74  */
75 QDF_STATUS tgt_tdls_send_mgmt_tx_completion(struct scheduler_msg *pmsg);
76 
77 /**
78  * tgt_tdls_del_peer_rsp() - handle TDLS del peer response
79  * @pmsg: scheduler msg
80  *
81  * Return: QDF_STATUS
82  */
83 QDF_STATUS tgt_tdls_del_peer_rsp(struct scheduler_msg *pmsg);
84 
85 /**
86  * tgt_tdls_add_peer_rsp() - handle TDLS add peer response
87  * @pmsg: scheduler msg
88  *
89  * Return: QDF_STATUS
90  */
91 QDF_STATUS tgt_tdls_add_peer_rsp(struct scheduler_msg *pmsg);
92 
93 /**
94  * tgt_tdls_register_ev_handler() - invoke lmac register tdls event handler
95  * @psoc: soc object
96  *
97  * Return: QDF_STATUS_SUCCESS for success or error code.
98  */
99 QDF_STATUS tgt_tdls_register_ev_handler(struct wlan_objmgr_psoc *psoc);
100 
101 /**
102  * tgt_tdls_unregister_ev_handler() - invoke lmac unregister tdls event handler
103  * @psoc: soc object
104  *
105  * Return: QDF_STATUS_SUCCESS for success or error code.
106  */
107 QDF_STATUS tgt_tdls_unregister_ev_handler(struct wlan_objmgr_psoc *psoc);
108 
109 /**
110  * tgt_tdls_event_handler() - The callback registered to WMI for tdls events
111  * @psoc: psoc object
112  * @info: tdls event info
113  *
114  * The callback is registered by tgt as tdls rx ops handler.
115  *
116  * Return: 0 for success or err code.
117  */
118 QDF_STATUS
119 tgt_tdls_event_handler(struct wlan_objmgr_psoc *psoc,
120 		       struct tdls_event_info *info);
121 
122 /**
123  * tgt_tdls_mgmt_frame_rx_cb() - callback for rx mgmt frame
124  * @psoc: soc context
125  * @peer: peer context
126  * @buf: rx buffer
127  * @mgmt_rx_params: mgmt rx parameters
128  * @frm_type: frame type
129  *
130  * This function gets called from mgmt tx/rx component when rx mgmt
131  * received.
132  *
133  * Return: QDF_STATUS_SUCCESS
134  */
135 QDF_STATUS tgt_tdls_mgmt_frame_rx_cb(struct wlan_objmgr_psoc *psoc,
136 	struct wlan_objmgr_peer *peer, qdf_nbuf_t buf,
137 	struct mgmt_rx_event_params *mgmt_rx_params,
138 	enum mgmt_frame_type frm_type);
139 
140 /**
141  * tgt_tdls_peers_deleted_notification()- notification from legacy lim
142  * @psoc: soc object
143  * @session_id: session id
144  *
145  * This function called from legacy lim to notify tdls peer deletion
146  *
147  * Return: None
148  */
149 void tgt_tdls_peers_deleted_notification(struct wlan_objmgr_psoc *psoc,
150 					 uint32_t session_id);
151 
152 /**
153  * tgt_tdls_delete_all_peers_indication()- Indication to tdls component
154  * @psoc: soc object
155  * @session_id: session id
156  *
157  * This function called from legacy lim to tdls component to delete tdls peers.
158  *
159  * Return: None
160  */
161 void tgt_tdls_delete_all_peers_indication(struct wlan_objmgr_psoc *psoc,
162 					  uint32_t session_id);
163 
164 #endif
165