xref: /wlan-driver/qcacld-3.0/components/tdls/dispatcher/inc/wlan_tdls_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2020, The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for any
6*5113495bSYour Name  * purpose with or without fee is hereby granted, provided that the above
7*5113495bSYour Name  * copyright notice and this permission notice appear in all copies.
8*5113495bSYour Name  *
9*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10*5113495bSYour Name  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11*5113495bSYour Name  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12*5113495bSYour Name  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13*5113495bSYour Name  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14*5113495bSYour Name  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15*5113495bSYour Name  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16*5113495bSYour Name  */
17*5113495bSYour Name 
18*5113495bSYour Name /*
19*5113495bSYour Name  * DOC: contains tdls link teardown declarations
20*5113495bSYour Name  */
21*5113495bSYour Name  #ifndef _WLAN_TDLS_API_H_
22*5113495bSYour Name  #define _WLAN_TDLS_API_H_
23*5113495bSYour Name 
24*5113495bSYour Name #include "wlan_objmgr_psoc_obj.h"
25*5113495bSYour Name #include "wlan_objmgr_pdev_obj.h"
26*5113495bSYour Name #include "wlan_objmgr_vdev_obj.h"
27*5113495bSYour Name 
28*5113495bSYour Name #ifdef FEATURE_WLAN_TDLS
29*5113495bSYour Name #ifdef WLAN_FEATURE_11BE_MLO
30*5113495bSYour Name /**
31*5113495bSYour Name  * wlan_tdls_is_fw_11be_mlo_capable() - Get TDLS 11be mlo capab
32*5113495bSYour Name  * @psoc: psoc context
33*5113495bSYour Name  *
34*5113495bSYour Name  * Return: True if 11be mlo capable
35*5113495bSYour Name  */
36*5113495bSYour Name bool wlan_tdls_is_fw_11be_mlo_capable(struct wlan_objmgr_psoc *psoc);
37*5113495bSYour Name #else
38*5113495bSYour Name static inline
wlan_tdls_is_fw_11be_mlo_capable(struct wlan_objmgr_psoc * psoc)39*5113495bSYour Name bool wlan_tdls_is_fw_11be_mlo_capable(struct wlan_objmgr_psoc *psoc)
40*5113495bSYour Name {
41*5113495bSYour Name 	return false;
42*5113495bSYour Name }
43*5113495bSYour Name #endif
44*5113495bSYour Name #ifdef FEATURE_SET
45*5113495bSYour Name /**
46*5113495bSYour Name  * wlan_tdls_get_features_info() - Get tdls features info
47*5113495bSYour Name  * @psoc: psoc context
48*5113495bSYour Name  * @tdls_feature_set: TDLS feature set info structure
49*5113495bSYour Name  *
50*5113495bSYour Name  * Return: None
51*5113495bSYour Name  */
52*5113495bSYour Name 
53*5113495bSYour Name void wlan_tdls_get_features_info(struct wlan_objmgr_psoc *psoc,
54*5113495bSYour Name 				 struct wlan_tdls_features *tdls_feature_set);
55*5113495bSYour Name #endif
56*5113495bSYour Name 
57*5113495bSYour Name /**
58*5113495bSYour Name  * wlan_tdls_teardown_links() - notify TDLS module to teardown all TDLS links
59*5113495bSYour Name  * @psoc: psoc object
60*5113495bSYour Name  *
61*5113495bSYour Name  * Return: QDF_STATUS
62*5113495bSYour Name  */
63*5113495bSYour Name QDF_STATUS wlan_tdls_teardown_links(struct wlan_objmgr_psoc *psoc);
64*5113495bSYour Name 
65*5113495bSYour Name /**
66*5113495bSYour Name  * wlan_tdls_check_and_teardown_links_sync() - teardown all the TDLS links
67*5113495bSYour Name  * @psoc: psoc object
68*5113495bSYour Name  * @vdev: Vdev object pointer
69*5113495bSYour Name  *
70*5113495bSYour Name  * Return: None
71*5113495bSYour Name  */
72*5113495bSYour Name void wlan_tdls_check_and_teardown_links_sync(struct wlan_objmgr_psoc *psoc,
73*5113495bSYour Name 					     struct wlan_objmgr_vdev *vdev);
74*5113495bSYour Name 
75*5113495bSYour Name /**
76*5113495bSYour Name  * wlan_tdls_notify_sta_disconnect() - notify sta disconnect
77*5113495bSYour Name  * @vdev_id: pointer to soc object
78*5113495bSYour Name  * @lfr_roam: indicate, whether disconnect due to lfr roam
79*5113495bSYour Name  * @user_disconnect: disconnect from user space
80*5113495bSYour Name  * @vdev: vdev object manager
81*5113495bSYour Name  *
82*5113495bSYour Name  * Notify sta disconnect event to TDLS component
83*5113495bSYour Name  *
84*5113495bSYour Name  * Return: QDF_STATUS
85*5113495bSYour Name  */
86*5113495bSYour Name void wlan_tdls_notify_sta_disconnect(uint8_t vdev_id,
87*5113495bSYour Name 				     bool lfr_roam, bool user_disconnect,
88*5113495bSYour Name 				     struct wlan_objmgr_vdev *vdev);
89*5113495bSYour Name 
90*5113495bSYour Name /**
91*5113495bSYour Name  * wlan_tdls_notify_sta_connect() - notify sta connect to TDLS
92*5113495bSYour Name  * @vdev_id: pointer to soc object
93*5113495bSYour Name  * @tdls_chan_swit_prohibited: indicates channel switch capability
94*5113495bSYour Name  * @tdls_prohibited: indicates tdls allowed or not
95*5113495bSYour Name  * @vdev: vdev object manager
96*5113495bSYour Name  *
97*5113495bSYour Name  * Notify sta connect event to TDLS component
98*5113495bSYour Name  *
99*5113495bSYour Name  * Return: None
100*5113495bSYour Name  */
101*5113495bSYour Name void
102*5113495bSYour Name wlan_tdls_notify_sta_connect(uint8_t vdev_id,
103*5113495bSYour Name 			     bool tdls_chan_swit_prohibited,
104*5113495bSYour Name 			     bool tdls_prohibited,
105*5113495bSYour Name 			     struct wlan_objmgr_vdev *vdev);
106*5113495bSYour Name 
107*5113495bSYour Name /**
108*5113495bSYour Name  * wlan_is_tdls_session_present() - Get TDLS session status
109*5113495bSYour Name  * @vdev: vdev pointer
110*5113495bSYour Name  *
111*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS if success; other value if failed
112*5113495bSYour Name  */
113*5113495bSYour Name QDF_STATUS
114*5113495bSYour Name wlan_is_tdls_session_present(struct wlan_objmgr_vdev *vdev);
115*5113495bSYour Name 
116*5113495bSYour Name /**
117*5113495bSYour Name  * wlan_tdls_update_tx_pkt_cnt() - update tx pkt count
118*5113495bSYour Name  * @vdev: tdls vdev object
119*5113495bSYour Name  * @mac_addr: peer mac address
120*5113495bSYour Name  *
121*5113495bSYour Name  * Return: None
122*5113495bSYour Name  */
123*5113495bSYour Name void wlan_tdls_update_tx_pkt_cnt(struct wlan_objmgr_vdev *vdev,
124*5113495bSYour Name 				 struct qdf_mac_addr *mac_addr);
125*5113495bSYour Name 
126*5113495bSYour Name /**
127*5113495bSYour Name  * wlan_tdls_update_rx_pkt_cnt() - update rx pkt count
128*5113495bSYour Name  * @vdev: tdls vdev object
129*5113495bSYour Name  * @mac_addr: peer mac address
130*5113495bSYour Name  * @dest_mac_addr: dest mac address
131*5113495bSYour Name  *
132*5113495bSYour Name  * Return: None
133*5113495bSYour Name  */
134*5113495bSYour Name void wlan_tdls_update_rx_pkt_cnt(struct wlan_objmgr_vdev *vdev,
135*5113495bSYour Name 				 struct qdf_mac_addr *mac_addr,
136*5113495bSYour Name 				 struct qdf_mac_addr *dest_mac_addr);
137*5113495bSYour Name /**
138*5113495bSYour Name  * wlan_tdls_notify_start_bss_failure() - Notify TDLS module on start bss
139*5113495bSYour Name  * failure
140*5113495bSYour Name  * @psoc: Pointer to PSOC object
141*5113495bSYour Name  *
142*5113495bSYour Name  * Return: None
143*5113495bSYour Name  */
144*5113495bSYour Name void wlan_tdls_notify_start_bss_failure(struct wlan_objmgr_psoc *psoc);
145*5113495bSYour Name 
146*5113495bSYour Name /**
147*5113495bSYour Name  * wlan_tdls_notify_start_bss() - Notify TDLS module on start bss
148*5113495bSYour Name  * @psoc: Pointer to PSOC object
149*5113495bSYour Name  * @vdev: Vdev object pointer
150*5113495bSYour Name  *
151*5113495bSYour Name  * Return: None
152*5113495bSYour Name  */
153*5113495bSYour Name void wlan_tdls_notify_start_bss(struct wlan_objmgr_psoc *psoc,
154*5113495bSYour Name 				struct wlan_objmgr_vdev *vdev);
155*5113495bSYour Name 
156*5113495bSYour Name #ifdef WLAN_FEATURE_TDLS_CONCURRENCIES
157*5113495bSYour Name /**
158*5113495bSYour Name  * wlan_tdls_notify_channel_switch_complete() - Notify TDLS module about the
159*5113495bSYour Name  * channel switch completion
160*5113495bSYour Name  * @psoc: Pointer to PSOC object
161*5113495bSYour Name  * @vdev_id: vdev id
162*5113495bSYour Name  *
163*5113495bSYour Name  * Return: None
164*5113495bSYour Name  */
165*5113495bSYour Name void wlan_tdls_notify_channel_switch_complete(struct wlan_objmgr_psoc *psoc,
166*5113495bSYour Name 					      uint8_t vdev_id);
167*5113495bSYour Name 
168*5113495bSYour Name /**
169*5113495bSYour Name  * wlan_tdls_notify_channel_switch_start() - Process channel switch start
170*5113495bSYour Name  * for SAP/P2P GO vdev. For STA vdev, TDLS teardown happens, so explicit
171*5113495bSYour Name  * disable off channel is not required.
172*5113495bSYour Name  * @psoc: Pointer to PSOC object
173*5113495bSYour Name  * @vdev: Pointer to current vdev on which CSA is triggered
174*5113495bSYour Name  *
175*5113495bSYour Name  * Return: None
176*5113495bSYour Name  */
177*5113495bSYour Name void wlan_tdls_notify_channel_switch_start(struct wlan_objmgr_psoc *psoc,
178*5113495bSYour Name 					   struct wlan_objmgr_vdev *vdev);
179*5113495bSYour Name 
180*5113495bSYour Name /**
181*5113495bSYour Name  * wlan_tdls_handle_p2p_client_connect() - Handle P2P Client connect start
182*5113495bSYour Name  * @psoc: Pointer to PSOC object
183*5113495bSYour Name  * @vdev: Pointer to P2P client vdev
184*5113495bSYour Name  *
185*5113495bSYour Name  * Return: None
186*5113495bSYour Name  */
187*5113495bSYour Name void wlan_tdls_handle_p2p_client_connect(struct wlan_objmgr_psoc *psoc,
188*5113495bSYour Name 					 struct wlan_objmgr_vdev *vdev);
189*5113495bSYour Name #else
190*5113495bSYour Name static inline
wlan_tdls_notify_channel_switch_complete(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id)191*5113495bSYour Name void wlan_tdls_notify_channel_switch_complete(struct wlan_objmgr_psoc *psoc,
192*5113495bSYour Name 					      uint8_t vdev_id)
193*5113495bSYour Name {}
194*5113495bSYour Name 
195*5113495bSYour Name static inline
wlan_tdls_notify_channel_switch_start(struct wlan_objmgr_psoc * psoc,struct wlan_objmgr_vdev * vdev)196*5113495bSYour Name void wlan_tdls_notify_channel_switch_start(struct wlan_objmgr_psoc *psoc,
197*5113495bSYour Name 					   struct wlan_objmgr_vdev *vdev)
198*5113495bSYour Name {}
199*5113495bSYour Name 
200*5113495bSYour Name static inline
wlan_tdls_handle_p2p_client_connect(struct wlan_objmgr_psoc * psoc,struct wlan_objmgr_vdev * vdev)201*5113495bSYour Name void wlan_tdls_handle_p2p_client_connect(struct wlan_objmgr_psoc *psoc,
202*5113495bSYour Name 					 struct wlan_objmgr_vdev *vdev)
203*5113495bSYour Name {}
204*5113495bSYour Name #endif /* WLAN_FEATURE_TDLS_CONCURRENCIES */
205*5113495bSYour Name 
206*5113495bSYour Name /**
207*5113495bSYour Name  * wlan_tdls_increment_discovery_attempts() - Increment TDLS peer discovery
208*5113495bSYour Name  * attempts
209*5113495bSYour Name  * @psoc: Pointer to PSOC object
210*5113495bSYour Name  * @vdev_id: Vdev id
211*5113495bSYour Name  * @peer_addr: Peer mac address
212*5113495bSYour Name  *
213*5113495bSYour Name  * Return: None
214*5113495bSYour Name  */
215*5113495bSYour Name void wlan_tdls_increment_discovery_attempts(struct wlan_objmgr_psoc *psoc,
216*5113495bSYour Name 					    uint8_t vdev_id,
217*5113495bSYour Name 					    uint8_t *peer_addr);
218*5113495bSYour Name #else
219*5113495bSYour Name 
220*5113495bSYour Name #ifdef FEATURE_SET
221*5113495bSYour Name static inline
wlan_tdls_get_features_info(struct wlan_objmgr_psoc * psoc,struct wlan_tdls_features * tdls_feature_set)222*5113495bSYour Name void wlan_tdls_get_features_info(struct wlan_objmgr_psoc *psoc,
223*5113495bSYour Name 				 struct wlan_tdls_features *tdls_feature_set)
224*5113495bSYour Name {
225*5113495bSYour Name }
226*5113495bSYour Name #endif
227*5113495bSYour Name 
228*5113495bSYour Name static inline
wlan_tdls_is_fw_11be_mlo_capable(struct wlan_objmgr_psoc * psoc)229*5113495bSYour Name bool wlan_tdls_is_fw_11be_mlo_capable(struct wlan_objmgr_psoc *psoc)
230*5113495bSYour Name {
231*5113495bSYour Name 	return false;
232*5113495bSYour Name }
233*5113495bSYour Name 
wlan_tdls_teardown_links(struct wlan_objmgr_psoc * psoc)234*5113495bSYour Name static inline QDF_STATUS wlan_tdls_teardown_links(struct wlan_objmgr_psoc *psoc)
235*5113495bSYour Name {
236*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
237*5113495bSYour Name }
238*5113495bSYour Name 
239*5113495bSYour Name static inline void
wlan_tdls_check_and_teardown_links_sync(struct wlan_objmgr_psoc * psoc,struct wlan_objmgr_vdev * vdev)240*5113495bSYour Name wlan_tdls_check_and_teardown_links_sync(struct wlan_objmgr_psoc *psoc,
241*5113495bSYour Name 					struct wlan_objmgr_vdev *vdev)
242*5113495bSYour Name {}
243*5113495bSYour Name 
244*5113495bSYour Name static inline
wlan_tdls_notify_sta_disconnect(uint8_t vdev_id,bool lfr_roam,bool user_disconnect,struct wlan_objmgr_vdev * vdev)245*5113495bSYour Name void wlan_tdls_notify_sta_disconnect(uint8_t vdev_id,
246*5113495bSYour Name 				     bool lfr_roam, bool user_disconnect,
247*5113495bSYour Name 				     struct wlan_objmgr_vdev *vdev)
248*5113495bSYour Name {}
249*5113495bSYour Name 
250*5113495bSYour Name static inline void
wlan_tdls_notify_sta_connect(uint8_t vdev_id,bool tdls_chan_swit_prohibited,bool tdls_prohibited,struct wlan_objmgr_vdev * vdev)251*5113495bSYour Name wlan_tdls_notify_sta_connect(uint8_t vdev_id,
252*5113495bSYour Name 			     bool tdls_chan_swit_prohibited,
253*5113495bSYour Name 			     bool tdls_prohibited,
254*5113495bSYour Name 			     struct wlan_objmgr_vdev *vdev) {}
255*5113495bSYour Name 
256*5113495bSYour Name static inline void
wlan_tdls_update_tx_pkt_cnt(struct wlan_objmgr_vdev * vdev,struct qdf_mac_addr * mac_addr)257*5113495bSYour Name wlan_tdls_update_tx_pkt_cnt(struct wlan_objmgr_vdev *vdev,
258*5113495bSYour Name 			    struct qdf_mac_addr *mac_addr)
259*5113495bSYour Name {
260*5113495bSYour Name }
261*5113495bSYour Name 
262*5113495bSYour Name static inline
wlan_tdls_update_rx_pkt_cnt(struct wlan_objmgr_vdev * vdev,struct qdf_mac_addr * mac_addr,struct qdf_mac_addr * dest_mac_addr)263*5113495bSYour Name void wlan_tdls_update_rx_pkt_cnt(struct wlan_objmgr_vdev *vdev,
264*5113495bSYour Name 				 struct qdf_mac_addr *mac_addr,
265*5113495bSYour Name 				 struct qdf_mac_addr *dest_mac_addr)
266*5113495bSYour Name {
267*5113495bSYour Name }
268*5113495bSYour Name 
269*5113495bSYour Name static inline
wlan_tdls_notify_start_bss(struct wlan_objmgr_psoc * psoc,struct wlan_objmgr_vdev * vdev)270*5113495bSYour Name void wlan_tdls_notify_start_bss(struct wlan_objmgr_psoc *psoc,
271*5113495bSYour Name 				struct wlan_objmgr_vdev *vdev)
272*5113495bSYour Name {}
273*5113495bSYour Name 
274*5113495bSYour Name static inline
wlan_tdls_notify_channel_switch_complete(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id)275*5113495bSYour Name void wlan_tdls_notify_channel_switch_complete(struct wlan_objmgr_psoc *psoc,
276*5113495bSYour Name 					      uint8_t vdev_id)
277*5113495bSYour Name {}
278*5113495bSYour Name 
279*5113495bSYour Name static inline
wlan_tdls_notify_channel_switch_start(struct wlan_objmgr_psoc * psoc,struct wlan_objmgr_vdev * vdev)280*5113495bSYour Name void wlan_tdls_notify_channel_switch_start(struct wlan_objmgr_psoc *psoc,
281*5113495bSYour Name 					   struct wlan_objmgr_vdev *vdev)
282*5113495bSYour Name {}
283*5113495bSYour Name 
284*5113495bSYour Name static inline
wlan_tdls_handle_p2p_client_connect(struct wlan_objmgr_psoc * psoc,struct wlan_objmgr_vdev * vdev)285*5113495bSYour Name void wlan_tdls_handle_p2p_client_connect(struct wlan_objmgr_psoc *psoc,
286*5113495bSYour Name 					 struct wlan_objmgr_vdev *vdev)
287*5113495bSYour Name {}
288*5113495bSYour Name 
289*5113495bSYour Name static inline
wlan_tdls_notify_start_bss_failure(struct wlan_objmgr_psoc * psoc)290*5113495bSYour Name void wlan_tdls_notify_start_bss_failure(struct wlan_objmgr_psoc *psoc)
291*5113495bSYour Name {}
292*5113495bSYour Name 
293*5113495bSYour Name static inline
wlan_tdls_increment_discovery_attempts(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,uint8_t * peer_addr)294*5113495bSYour Name void wlan_tdls_increment_discovery_attempts(struct wlan_objmgr_psoc *psoc,
295*5113495bSYour Name 					    uint8_t vdev_id,
296*5113495bSYour Name 					    uint8_t *peer_addr)
297*5113495bSYour Name {}
298*5113495bSYour Name #endif
299*5113495bSYour Name #endif
300