xref: /wlan-driver/qca-wifi-host-cmn/umac/mlo_mgr/inc/wlan_mlo_mgr_main.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2021-2023 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 MLO manager containing init/deinit public api's
20*5113495bSYour Name  */
21*5113495bSYour Name #ifndef _WLAN_MLO_MGR_MAIN_H_
22*5113495bSYour Name #define _WLAN_MLO_MGR_MAIN_H_
23*5113495bSYour Name 
24*5113495bSYour Name #include <qdf_atomic.h>
25*5113495bSYour Name #include <wlan_objmgr_psoc_obj.h>
26*5113495bSYour Name #include <wlan_objmgr_pdev_obj.h>
27*5113495bSYour Name #include <wlan_objmgr_vdev_obj.h>
28*5113495bSYour Name 
29*5113495bSYour Name #ifdef WLAN_FEATURE_11BE_MLO
30*5113495bSYour Name #include <wlan_mlo_mgr_public_structs.h>
31*5113495bSYour Name 
32*5113495bSYour Name /**
33*5113495bSYour Name  * wlan_mlo_mgr_init() - Initialize the MLO data structures
34*5113495bSYour Name  *
35*5113495bSYour Name  * Return: QDF_STATUS
36*5113495bSYour Name  */
37*5113495bSYour Name QDF_STATUS wlan_mlo_mgr_init(void);
38*5113495bSYour Name 
39*5113495bSYour Name /**
40*5113495bSYour Name  * wlan_mlo_mgr_deinit() - De-init the MLO data structures
41*5113495bSYour Name  *
42*5113495bSYour Name  * Return: QDF_STATUS
43*5113495bSYour Name  */
44*5113495bSYour Name QDF_STATUS wlan_mlo_mgr_deinit(void);
45*5113495bSYour Name 
46*5113495bSYour Name /**
47*5113495bSYour Name  * wlan_mlo_mgr_vdev_created_notification() - mlo mgr vdev create handler
48*5113495bSYour Name  * @vdev: vdev object
49*5113495bSYour Name  * @arg_list: Argument list
50*5113495bSYour Name  *
51*5113495bSYour Name  * This function is called as part of vdev creation. This will initialize
52*5113495bSYour Name  * the MLO dev context if the interface type is ML.
53*5113495bSYour Name  *
54*5113495bSYour Name  * Return: QDF_STATUS
55*5113495bSYour Name  */
56*5113495bSYour Name QDF_STATUS wlan_mlo_mgr_vdev_created_notification(struct wlan_objmgr_vdev *vdev,
57*5113495bSYour Name 						  void *arg_list);
58*5113495bSYour Name 
59*5113495bSYour Name /**
60*5113495bSYour Name  * wlan_mlo_mgr_vdev_destroyed_notification() - mlo mgr vdev delete handler
61*5113495bSYour Name  * @vdev: vdev object
62*5113495bSYour Name  * @arg_list: Argument list
63*5113495bSYour Name  *
64*5113495bSYour Name  * This function is called as part of vdev delete. This will de-initialize
65*5113495bSYour Name  * the MLO dev context if the interface type is ML.
66*5113495bSYour Name  *
67*5113495bSYour Name  * Return: QDF_STATUS
68*5113495bSYour Name  */
69*5113495bSYour Name QDF_STATUS wlan_mlo_mgr_vdev_destroyed_notification(struct wlan_objmgr_vdev *vdev,
70*5113495bSYour Name 						    void *arg_list);
71*5113495bSYour Name 
72*5113495bSYour Name #ifdef WLAN_MLO_USE_SPINLOCK
73*5113495bSYour Name /**
74*5113495bSYour Name  * ml_link_lock_create - Create MLO link mutex/spinlock
75*5113495bSYour Name  * @mlo_ctx:  MLO manager global context
76*5113495bSYour Name  *
77*5113495bSYour Name  * Creates mutex/spinlock
78*5113495bSYour Name  *
79*5113495bSYour Name  * Return: void
80*5113495bSYour Name  */
81*5113495bSYour Name static inline
ml_link_lock_create(struct mlo_mgr_context * mlo_ctx)82*5113495bSYour Name void ml_link_lock_create(struct mlo_mgr_context *mlo_ctx)
83*5113495bSYour Name {
84*5113495bSYour Name 	qdf_spinlock_create(&mlo_ctx->ml_dev_list_lock);
85*5113495bSYour Name }
86*5113495bSYour Name 
87*5113495bSYour Name /**
88*5113495bSYour Name  * ml_link_lock_destroy - Destroy ml link mutex/spinlock
89*5113495bSYour Name  * @mlo_ctx:  MLO manager global context
90*5113495bSYour Name  *
91*5113495bSYour Name  * Destroy mutex/spinlock
92*5113495bSYour Name  *
93*5113495bSYour Name  * Return: void
94*5113495bSYour Name  */
95*5113495bSYour Name static inline void
ml_link_lock_destroy(struct mlo_mgr_context * mlo_ctx)96*5113495bSYour Name ml_link_lock_destroy(struct mlo_mgr_context *mlo_ctx)
97*5113495bSYour Name {
98*5113495bSYour Name 	qdf_spinlock_destroy(&mlo_ctx->ml_dev_list_lock);
99*5113495bSYour Name }
100*5113495bSYour Name 
101*5113495bSYour Name /**
102*5113495bSYour Name  * ml_link_lock_acquire - acquire ml link mutex/spinlock
103*5113495bSYour Name  * @mlo_ctx:  MLO manager global context
104*5113495bSYour Name  *
105*5113495bSYour Name  * acquire mutex/spinlock
106*5113495bSYour Name  *
107*5113495bSYour Name  * return: void
108*5113495bSYour Name  */
109*5113495bSYour Name static inline
ml_link_lock_acquire(struct mlo_mgr_context * mlo_ctx)110*5113495bSYour Name void ml_link_lock_acquire(struct mlo_mgr_context *mlo_ctx)
111*5113495bSYour Name {
112*5113495bSYour Name 	qdf_spin_lock_bh(&mlo_ctx->ml_dev_list_lock);
113*5113495bSYour Name }
114*5113495bSYour Name 
115*5113495bSYour Name /**
116*5113495bSYour Name  * ml_link_lock_release - release MLO dev mutex/spinlock
117*5113495bSYour Name  * @mlo_ctx:  MLO manager global context
118*5113495bSYour Name  *
119*5113495bSYour Name  * release mutex/spinlock
120*5113495bSYour Name  *
121*5113495bSYour Name  * return: void
122*5113495bSYour Name  */
123*5113495bSYour Name static inline
ml_link_lock_release(struct mlo_mgr_context * mlo_ctx)124*5113495bSYour Name void ml_link_lock_release(struct mlo_mgr_context *mlo_ctx)
125*5113495bSYour Name {
126*5113495bSYour Name 	qdf_spin_unlock_bh(&mlo_ctx->ml_dev_list_lock);
127*5113495bSYour Name }
128*5113495bSYour Name 
129*5113495bSYour Name /**
130*5113495bSYour Name  * mlo_dev_lock_create - Create MLO device mutex/spinlock
131*5113495bSYour Name  * @mldev:  ML device context
132*5113495bSYour Name  *
133*5113495bSYour Name  * Creates mutex/spinlock
134*5113495bSYour Name  *
135*5113495bSYour Name  * Return: void
136*5113495bSYour Name  */
137*5113495bSYour Name static inline void
mlo_dev_lock_create(struct wlan_mlo_dev_context * mldev)138*5113495bSYour Name mlo_dev_lock_create(struct wlan_mlo_dev_context *mldev)
139*5113495bSYour Name {
140*5113495bSYour Name 	qdf_spinlock_create(&mldev->mlo_dev_lock);
141*5113495bSYour Name }
142*5113495bSYour Name 
143*5113495bSYour Name /**
144*5113495bSYour Name  * mlo_dev_lock_destroy - Destroy CM SM mutex/spinlock
145*5113495bSYour Name  * @mldev:  ML device context
146*5113495bSYour Name  *
147*5113495bSYour Name  * Destroy mutex/spinlock
148*5113495bSYour Name  *
149*5113495bSYour Name  * Return: void
150*5113495bSYour Name  */
151*5113495bSYour Name static inline void
mlo_dev_lock_destroy(struct wlan_mlo_dev_context * mldev)152*5113495bSYour Name mlo_dev_lock_destroy(struct wlan_mlo_dev_context *mldev)
153*5113495bSYour Name {
154*5113495bSYour Name 	qdf_spinlock_destroy(&mldev->mlo_dev_lock);
155*5113495bSYour Name }
156*5113495bSYour Name 
157*5113495bSYour Name /**
158*5113495bSYour Name  * mlo_dev_lock_acquire - acquire CM SM mutex/spinlock
159*5113495bSYour Name  * @mldev:  ML device context
160*5113495bSYour Name  *
161*5113495bSYour Name  * acquire mutex/spinlock
162*5113495bSYour Name  *
163*5113495bSYour Name  * return: void
164*5113495bSYour Name  */
165*5113495bSYour Name static inline
mlo_dev_lock_acquire(struct wlan_mlo_dev_context * mldev)166*5113495bSYour Name void mlo_dev_lock_acquire(struct wlan_mlo_dev_context *mldev)
167*5113495bSYour Name {
168*5113495bSYour Name 	qdf_spin_lock_bh(&mldev->mlo_dev_lock);
169*5113495bSYour Name }
170*5113495bSYour Name 
171*5113495bSYour Name /**
172*5113495bSYour Name  * mlo_dev_lock_release - release MLO dev mutex/spinlock
173*5113495bSYour Name  * @mldev:  ML device context
174*5113495bSYour Name  *
175*5113495bSYour Name  * release mutex/spinlock
176*5113495bSYour Name  *
177*5113495bSYour Name  * return: void
178*5113495bSYour Name  */
179*5113495bSYour Name static inline
mlo_dev_lock_release(struct wlan_mlo_dev_context * mldev)180*5113495bSYour Name void mlo_dev_lock_release(struct wlan_mlo_dev_context *mldev)
181*5113495bSYour Name {
182*5113495bSYour Name 	qdf_spin_unlock_bh(&mldev->mlo_dev_lock);
183*5113495bSYour Name }
184*5113495bSYour Name 
185*5113495bSYour Name /**
186*5113495bSYour Name  * ml_aid_lock_create - Create MLO aid mutex/spinlock
187*5113495bSYour Name  * @mlo_ctx:  MLO manager global context
188*5113495bSYour Name  *
189*5113495bSYour Name  * Creates mutex/spinlock
190*5113495bSYour Name  *
191*5113495bSYour Name  * Return: void
192*5113495bSYour Name  */
193*5113495bSYour Name static inline
ml_aid_lock_create(struct mlo_mgr_context * mlo_ctx)194*5113495bSYour Name void ml_aid_lock_create(struct mlo_mgr_context *mlo_ctx)
195*5113495bSYour Name {
196*5113495bSYour Name 	qdf_spinlock_create(&mlo_ctx->aid_lock);
197*5113495bSYour Name }
198*5113495bSYour Name 
199*5113495bSYour Name /**
200*5113495bSYour Name  * ml_aid_lock_destroy - Destroy ml aid mutex/spinlock
201*5113495bSYour Name  * @mlo_ctx:  MLO manager global context
202*5113495bSYour Name  *
203*5113495bSYour Name  * Destroy mutex/spinlock
204*5113495bSYour Name  *
205*5113495bSYour Name  * Return: void
206*5113495bSYour Name  */
207*5113495bSYour Name static inline void
ml_aid_lock_destroy(struct mlo_mgr_context * mlo_ctx)208*5113495bSYour Name ml_aid_lock_destroy(struct mlo_mgr_context *mlo_ctx)
209*5113495bSYour Name {
210*5113495bSYour Name 	qdf_spinlock_destroy(&mlo_ctx->aid_lock);
211*5113495bSYour Name }
212*5113495bSYour Name 
213*5113495bSYour Name /**
214*5113495bSYour Name  * ml_aid_lock_acquire - acquire ml aid mutex/spinlock
215*5113495bSYour Name  * @mlo_ctx:  MLO manager global context
216*5113495bSYour Name  *
217*5113495bSYour Name  * acquire mutex/spinlock
218*5113495bSYour Name  *
219*5113495bSYour Name  * return: void
220*5113495bSYour Name  */
221*5113495bSYour Name static inline
ml_aid_lock_acquire(struct mlo_mgr_context * mlo_ctx)222*5113495bSYour Name void ml_aid_lock_acquire(struct mlo_mgr_context *mlo_ctx)
223*5113495bSYour Name {
224*5113495bSYour Name 	qdf_spin_lock_bh(&mlo_ctx->aid_lock);
225*5113495bSYour Name }
226*5113495bSYour Name 
227*5113495bSYour Name /**
228*5113495bSYour Name  * ml_aid_lock_release - release MLO aid mutex/spinlock
229*5113495bSYour Name  * @mlo_ctx:  MLO manager global context
230*5113495bSYour Name  *
231*5113495bSYour Name  * release mutex/spinlock
232*5113495bSYour Name  *
233*5113495bSYour Name  * return: void
234*5113495bSYour Name  */
235*5113495bSYour Name static inline
ml_aid_lock_release(struct mlo_mgr_context * mlo_ctx)236*5113495bSYour Name void ml_aid_lock_release(struct mlo_mgr_context *mlo_ctx)
237*5113495bSYour Name {
238*5113495bSYour Name 	qdf_spin_unlock_bh(&mlo_ctx->aid_lock);
239*5113495bSYour Name }
240*5113495bSYour Name 
241*5113495bSYour Name /**
242*5113495bSYour Name  * ml_peerid_lock_create - Create MLO peer mutex/spinlock
243*5113495bSYour Name  * @mlo_ctx:  MLO manager global context
244*5113495bSYour Name  *
245*5113495bSYour Name  * Creates mutex/spinlock
246*5113495bSYour Name  *
247*5113495bSYour Name  * Return: void
248*5113495bSYour Name  */
249*5113495bSYour Name static inline
ml_peerid_lock_create(struct mlo_mgr_context * mlo_ctx)250*5113495bSYour Name void ml_peerid_lock_create(struct mlo_mgr_context *mlo_ctx)
251*5113495bSYour Name {
252*5113495bSYour Name 	qdf_spinlock_create(&mlo_ctx->ml_peerid_lock);
253*5113495bSYour Name }
254*5113495bSYour Name 
255*5113495bSYour Name /**
256*5113495bSYour Name  * ml_peerid_lock_destroy - Destroy ml peerid mutex/spinlock
257*5113495bSYour Name  * @mlo_ctx:  MLO manager global context
258*5113495bSYour Name  *
259*5113495bSYour Name  * Destroy mutex/spinlock
260*5113495bSYour Name  *
261*5113495bSYour Name  * Return: void
262*5113495bSYour Name  */
263*5113495bSYour Name static inline void
ml_peerid_lock_destroy(struct mlo_mgr_context * mlo_ctx)264*5113495bSYour Name ml_peerid_lock_destroy(struct mlo_mgr_context *mlo_ctx)
265*5113495bSYour Name {
266*5113495bSYour Name 	qdf_spinlock_destroy(&mlo_ctx->ml_peerid_lock);
267*5113495bSYour Name }
268*5113495bSYour Name 
269*5113495bSYour Name /**
270*5113495bSYour Name  * ml_peerid_lock_acquire - acquire ml peerid mutex/spinlock
271*5113495bSYour Name  * @mlo_ctx:  MLO manager global context
272*5113495bSYour Name  *
273*5113495bSYour Name  * acquire mutex/spinlock
274*5113495bSYour Name  *
275*5113495bSYour Name  * return: void
276*5113495bSYour Name  */
277*5113495bSYour Name static inline
ml_peerid_lock_acquire(struct mlo_mgr_context * mlo_ctx)278*5113495bSYour Name void ml_peerid_lock_acquire(struct mlo_mgr_context *mlo_ctx)
279*5113495bSYour Name {
280*5113495bSYour Name 	qdf_spin_lock_bh(&mlo_ctx->ml_peerid_lock);
281*5113495bSYour Name }
282*5113495bSYour Name 
283*5113495bSYour Name /**
284*5113495bSYour Name  * ml_peerid_lock_release - release MLO peerid mutex/spinlock
285*5113495bSYour Name  * @mlo_ctx:  MLO manager global context
286*5113495bSYour Name  *
287*5113495bSYour Name  * release mutex/spinlock
288*5113495bSYour Name  *
289*5113495bSYour Name  * return: void
290*5113495bSYour Name  */
291*5113495bSYour Name static inline
ml_peerid_lock_release(struct mlo_mgr_context * mlo_ctx)292*5113495bSYour Name void ml_peerid_lock_release(struct mlo_mgr_context *mlo_ctx)
293*5113495bSYour Name {
294*5113495bSYour Name 	qdf_spin_unlock_bh(&mlo_ctx->ml_peerid_lock);
295*5113495bSYour Name }
296*5113495bSYour Name 
297*5113495bSYour Name /**
298*5113495bSYour Name  * mlo_peer_lock_create - Create MLO peer mutex/spinlock
299*5113495bSYour Name  * @mlpeer:  ML peer
300*5113495bSYour Name  *
301*5113495bSYour Name  * Creates mutex/spinlock
302*5113495bSYour Name  *
303*5113495bSYour Name  * Return: void
304*5113495bSYour Name  */
305*5113495bSYour Name static inline void
mlo_peer_lock_create(struct wlan_mlo_peer_context * mlpeer)306*5113495bSYour Name mlo_peer_lock_create(struct wlan_mlo_peer_context *mlpeer)
307*5113495bSYour Name {
308*5113495bSYour Name 	qdf_spinlock_create(&mlpeer->mlo_peer_lock);
309*5113495bSYour Name }
310*5113495bSYour Name 
311*5113495bSYour Name /**
312*5113495bSYour Name  * mlo_peer_lock_destroy - Destroy MLO peer mutex/spinlock
313*5113495bSYour Name  * @mlpeer:  ML peer
314*5113495bSYour Name  *
315*5113495bSYour Name  * Destroy mutex/spinlock
316*5113495bSYour Name  *
317*5113495bSYour Name  * Return: void
318*5113495bSYour Name  */
319*5113495bSYour Name static inline void
mlo_peer_lock_destroy(struct wlan_mlo_peer_context * mlpeer)320*5113495bSYour Name mlo_peer_lock_destroy(struct wlan_mlo_peer_context *mlpeer)
321*5113495bSYour Name {
322*5113495bSYour Name 	qdf_spinlock_destroy(&mlpeer->mlo_peer_lock);
323*5113495bSYour Name }
324*5113495bSYour Name 
325*5113495bSYour Name /**
326*5113495bSYour Name  * mlo_peer_lock_acquire - acquire mlo peer mutex/spinlock
327*5113495bSYour Name  * @mlpeer:  MLO peer context
328*5113495bSYour Name  *
329*5113495bSYour Name  * acquire mutex/spinlock
330*5113495bSYour Name  *
331*5113495bSYour Name  * return: void
332*5113495bSYour Name  */
333*5113495bSYour Name static inline
mlo_peer_lock_acquire(struct wlan_mlo_peer_context * mlpeer)334*5113495bSYour Name void mlo_peer_lock_acquire(struct wlan_mlo_peer_context *mlpeer)
335*5113495bSYour Name {
336*5113495bSYour Name 	qdf_spin_lock_bh(&mlpeer->mlo_peer_lock);
337*5113495bSYour Name }
338*5113495bSYour Name 
339*5113495bSYour Name /**
340*5113495bSYour Name  * mlo_peer_lock_release - release MLO peer mutex/spinlock
341*5113495bSYour Name  * @mlpeer:  MLO peer context
342*5113495bSYour Name  *
343*5113495bSYour Name  * release mutex/spinlock
344*5113495bSYour Name  *
345*5113495bSYour Name  * return: void
346*5113495bSYour Name  */
347*5113495bSYour Name static inline
mlo_peer_lock_release(struct wlan_mlo_peer_context * mlpeer)348*5113495bSYour Name void mlo_peer_lock_release(struct wlan_mlo_peer_context *mlpeer)
349*5113495bSYour Name {
350*5113495bSYour Name 	qdf_spin_unlock_bh(&mlpeer->mlo_peer_lock);
351*5113495bSYour Name }
352*5113495bSYour Name 
353*5113495bSYour Name /**
354*5113495bSYour Name  * ml_peerlist_lock_create - Create MLO peer list mutex/spinlock
355*5113495bSYour Name  * @ml_peerlist:  ML peer list context
356*5113495bSYour Name  *
357*5113495bSYour Name  * Creates mutex/spinlock
358*5113495bSYour Name  *
359*5113495bSYour Name  * Return: void
360*5113495bSYour Name  */
361*5113495bSYour Name static inline void
ml_peerlist_lock_create(struct wlan_mlo_peer_list * ml_peerlist)362*5113495bSYour Name ml_peerlist_lock_create(struct wlan_mlo_peer_list *ml_peerlist)
363*5113495bSYour Name {
364*5113495bSYour Name 	qdf_spinlock_create(&ml_peerlist->peer_list_lock);
365*5113495bSYour Name }
366*5113495bSYour Name 
367*5113495bSYour Name /**
368*5113495bSYour Name  * ml_peerlist_lock_destroy - Destroy MLO peer list mutex/spinlock
369*5113495bSYour Name  * @ml_peerlist:  ML peer list context
370*5113495bSYour Name  *
371*5113495bSYour Name  * Destroy mutex/spinlock
372*5113495bSYour Name  *
373*5113495bSYour Name  * Return: void
374*5113495bSYour Name  */
375*5113495bSYour Name static inline void
ml_peerlist_lock_destroy(struct wlan_mlo_peer_list * ml_peerlist)376*5113495bSYour Name ml_peerlist_lock_destroy(struct wlan_mlo_peer_list *ml_peerlist)
377*5113495bSYour Name {
378*5113495bSYour Name 	qdf_spinlock_destroy(&ml_peerlist->peer_list_lock);
379*5113495bSYour Name }
380*5113495bSYour Name 
381*5113495bSYour Name /**
382*5113495bSYour Name  * ml_peerlist_lock_acquire - acquire ML peer list mutex/spinlock
383*5113495bSYour Name  * @ml_peerlist:  ML peer list context
384*5113495bSYour Name  *
385*5113495bSYour Name  * acquire mutex/spinlock
386*5113495bSYour Name  *
387*5113495bSYour Name  * return: void
388*5113495bSYour Name  */
389*5113495bSYour Name static inline
ml_peerlist_lock_acquire(struct wlan_mlo_peer_list * ml_peerlist)390*5113495bSYour Name void ml_peerlist_lock_acquire(struct wlan_mlo_peer_list *ml_peerlist)
391*5113495bSYour Name {
392*5113495bSYour Name 	qdf_spin_lock_bh(&ml_peerlist->peer_list_lock);
393*5113495bSYour Name }
394*5113495bSYour Name 
395*5113495bSYour Name /**
396*5113495bSYour Name  * ml_peerlist_lock_release - release ML peer list mutex/spinlock
397*5113495bSYour Name  * @ml_peerlist:  ML peer list context
398*5113495bSYour Name  *
399*5113495bSYour Name  * release mutex/spinlock
400*5113495bSYour Name  *
401*5113495bSYour Name  * return: void
402*5113495bSYour Name  */
403*5113495bSYour Name static inline
ml_peerlist_lock_release(struct wlan_mlo_peer_list * ml_peerlist)404*5113495bSYour Name void ml_peerlist_lock_release(struct wlan_mlo_peer_list *ml_peerlist)
405*5113495bSYour Name {
406*5113495bSYour Name 	qdf_spin_unlock_bh(&ml_peerlist->peer_list_lock);
407*5113495bSYour Name }
408*5113495bSYour Name 
409*5113495bSYour Name /**
410*5113495bSYour Name  * copied_conn_req_lock_create - Create original connect req mutex/spinlock
411*5113495bSYour Name  * @sta_ctx:  MLO STA related information
412*5113495bSYour Name  *
413*5113495bSYour Name  * Create mutex/spinlock
414*5113495bSYour Name  *
415*5113495bSYour Name  * return: void
416*5113495bSYour Name  */
417*5113495bSYour Name static inline
copied_conn_req_lock_create(struct wlan_mlo_sta * sta_ctx)418*5113495bSYour Name void copied_conn_req_lock_create(struct wlan_mlo_sta *sta_ctx)
419*5113495bSYour Name {
420*5113495bSYour Name 	qdf_spinlock_create(&sta_ctx->copied_conn_req_lock);
421*5113495bSYour Name }
422*5113495bSYour Name 
423*5113495bSYour Name /**
424*5113495bSYour Name  * copied_conn_req_lock_destroy - Destroy original connect req mutex/spinlock
425*5113495bSYour Name  * @sta_ctx:  MLO STA related information
426*5113495bSYour Name  *
427*5113495bSYour Name  * Destroy mutex/spinlock
428*5113495bSYour Name  *
429*5113495bSYour Name  * return: void
430*5113495bSYour Name  */
431*5113495bSYour Name static inline
copied_conn_req_lock_destroy(struct wlan_mlo_sta * sta_ctx)432*5113495bSYour Name void copied_conn_req_lock_destroy(struct wlan_mlo_sta *sta_ctx)
433*5113495bSYour Name {
434*5113495bSYour Name 	qdf_spinlock_destroy(&sta_ctx->copied_conn_req_lock);
435*5113495bSYour Name }
436*5113495bSYour Name 
437*5113495bSYour Name /**
438*5113495bSYour Name  * copied_conn_req_lock_acquire - Acquire original connect req mutex/spinlock
439*5113495bSYour Name  * @sta_ctx:  MLO STA related information
440*5113495bSYour Name  *
441*5113495bSYour Name  * Acquire mutex/spinlock
442*5113495bSYour Name  *
443*5113495bSYour Name  * return: void
444*5113495bSYour Name  */
445*5113495bSYour Name static inline
copied_conn_req_lock_acquire(struct wlan_mlo_sta * sta_ctx)446*5113495bSYour Name void copied_conn_req_lock_acquire(struct wlan_mlo_sta *sta_ctx)
447*5113495bSYour Name {
448*5113495bSYour Name 	qdf_spin_lock_bh(&sta_ctx->copied_conn_req_lock);
449*5113495bSYour Name }
450*5113495bSYour Name 
451*5113495bSYour Name /**
452*5113495bSYour Name  * copied_conn_req_lock_release - Release original connect req mutex/spinlock
453*5113495bSYour Name  * @sta_ctx:  MLO STA related information
454*5113495bSYour Name  *
455*5113495bSYour Name  * Release mutex/spinlock
456*5113495bSYour Name  *
457*5113495bSYour Name  * return: void
458*5113495bSYour Name  */
459*5113495bSYour Name static inline
copied_conn_req_lock_release(struct wlan_mlo_sta * sta_ctx)460*5113495bSYour Name void copied_conn_req_lock_release(struct wlan_mlo_sta *sta_ctx)
461*5113495bSYour Name {
462*5113495bSYour Name 	qdf_spin_unlock_bh(&sta_ctx->copied_conn_req_lock);
463*5113495bSYour Name }
464*5113495bSYour Name 
465*5113495bSYour Name /**
466*5113495bSYour Name  * tsf_recalculation_lock_create - Create TSF recalculation mutex/spinlock
467*5113495bSYour Name  * @mldev:  ML device context
468*5113495bSYour Name  *
469*5113495bSYour Name  * Creates mutex/spinlock
470*5113495bSYour Name  *
471*5113495bSYour Name  * Return: void
472*5113495bSYour Name  */
473*5113495bSYour Name static inline void
tsf_recalculation_lock_create(struct wlan_mlo_dev_context * mldev)474*5113495bSYour Name tsf_recalculation_lock_create(struct wlan_mlo_dev_context *mldev)
475*5113495bSYour Name {
476*5113495bSYour Name 	qdf_spinlock_create(&mldev->tsf_recalculation_lock);
477*5113495bSYour Name }
478*5113495bSYour Name 
479*5113495bSYour Name /**
480*5113495bSYour Name  * tsf_recalculation_lock_destroy - Destroy TSF recalculation mutex/spinlock
481*5113495bSYour Name  * @mldev:  ML device context
482*5113495bSYour Name  *
483*5113495bSYour Name  * Destroy mutex/spinlock
484*5113495bSYour Name  *
485*5113495bSYour Name  * Return: void
486*5113495bSYour Name  */
487*5113495bSYour Name static inline void
tsf_recalculation_lock_destroy(struct wlan_mlo_dev_context * mldev)488*5113495bSYour Name tsf_recalculation_lock_destroy(struct wlan_mlo_dev_context *mldev)
489*5113495bSYour Name {
490*5113495bSYour Name 	qdf_spinlock_destroy(&mldev->tsf_recalculation_lock);
491*5113495bSYour Name }
492*5113495bSYour Name 
493*5113495bSYour Name /**
494*5113495bSYour Name  * tsf_recalculation_lock_acquire - Acquire TSF recalculation mutex/spinlock
495*5113495bSYour Name  * @mldev:  ML device context
496*5113495bSYour Name  *
497*5113495bSYour Name  * Acquire mutex/spinlock
498*5113495bSYour Name  *
499*5113495bSYour Name  * return: void
500*5113495bSYour Name  */
501*5113495bSYour Name static inline
tsf_recalculation_lock_acquire(struct wlan_mlo_dev_context * mldev)502*5113495bSYour Name void tsf_recalculation_lock_acquire(struct wlan_mlo_dev_context *mldev)
503*5113495bSYour Name {
504*5113495bSYour Name 	qdf_spin_lock_bh(&mldev->tsf_recalculation_lock);
505*5113495bSYour Name }
506*5113495bSYour Name 
507*5113495bSYour Name /**
508*5113495bSYour Name  * tsf_recalculation_lock_release - Release TSF recalculation mutex/spinlock
509*5113495bSYour Name  * @mldev:  ML device context
510*5113495bSYour Name  *
511*5113495bSYour Name  * release mutex/spinlock
512*5113495bSYour Name  *
513*5113495bSYour Name  * return: void
514*5113495bSYour Name  */
515*5113495bSYour Name static inline
tsf_recalculation_lock_release(struct wlan_mlo_dev_context * mldev)516*5113495bSYour Name void tsf_recalculation_lock_release(struct wlan_mlo_dev_context *mldev)
517*5113495bSYour Name {
518*5113495bSYour Name 	qdf_spin_unlock_bh(&mldev->tsf_recalculation_lock);
519*5113495bSYour Name }
520*5113495bSYour Name 
521*5113495bSYour Name /**
522*5113495bSYour Name  * mlo_ap_lock_create - Create MLO AP mutex/spinlock
523*5113495bSYour Name  * @ap_ctx:  ML device AP context
524*5113495bSYour Name  *
525*5113495bSYour Name  * Creates mutex/spinlock
526*5113495bSYour Name  *
527*5113495bSYour Name  * Return: void
528*5113495bSYour Name  */
529*5113495bSYour Name static inline
mlo_ap_lock_create(struct wlan_mlo_ap * ap_ctx)530*5113495bSYour Name void mlo_ap_lock_create(struct wlan_mlo_ap *ap_ctx)
531*5113495bSYour Name {
532*5113495bSYour Name 	qdf_spinlock_create(&ap_ctx->mlo_ap_lock);
533*5113495bSYour Name }
534*5113495bSYour Name 
535*5113495bSYour Name /**
536*5113495bSYour Name  * mlo_ap_lock_destroy - Destroy MLO AP mutex/spinlock
537*5113495bSYour Name  * @ap_ctx:  ML device AP context
538*5113495bSYour Name  *
539*5113495bSYour Name  * Destroy mutex/spinlock
540*5113495bSYour Name  *
541*5113495bSYour Name  * Return: void
542*5113495bSYour Name  */
543*5113495bSYour Name static inline
mlo_ap_lock_destroy(struct wlan_mlo_ap * ap_ctx)544*5113495bSYour Name void mlo_ap_lock_destroy(struct wlan_mlo_ap *ap_ctx)
545*5113495bSYour Name {
546*5113495bSYour Name 	qdf_spinlock_destroy(&ap_ctx->mlo_ap_lock);
547*5113495bSYour Name }
548*5113495bSYour Name 
549*5113495bSYour Name /**
550*5113495bSYour Name  * mlo_ap_lock_acquire - Acquire MLO AP mutex/spinlock
551*5113495bSYour Name  * @ap_ctx:  ML device AP context
552*5113495bSYour Name  *
553*5113495bSYour Name  * acquire mutex/spinlock
554*5113495bSYour Name  *
555*5113495bSYour Name  * return: void
556*5113495bSYour Name  */
557*5113495bSYour Name static inline
mlo_ap_lock_acquire(struct wlan_mlo_ap * ap_ctx)558*5113495bSYour Name void mlo_ap_lock_acquire(struct wlan_mlo_ap *ap_ctx)
559*5113495bSYour Name {
560*5113495bSYour Name 	qdf_spin_lock_bh(&ap_ctx->mlo_ap_lock);
561*5113495bSYour Name }
562*5113495bSYour Name 
563*5113495bSYour Name /**
564*5113495bSYour Name  * mlo_ap_lock_release - Release MLO AP mutex/spinlock
565*5113495bSYour Name  * @ap_ctx:  ML device AP context
566*5113495bSYour Name  *
567*5113495bSYour Name  * release mutex/spinlock
568*5113495bSYour Name  *
569*5113495bSYour Name  * return: void
570*5113495bSYour Name  */
571*5113495bSYour Name static inline
mlo_ap_lock_release(struct wlan_mlo_ap * ap_ctx)572*5113495bSYour Name void mlo_ap_lock_release(struct wlan_mlo_ap *ap_ctx)
573*5113495bSYour Name {
574*5113495bSYour Name 	qdf_spin_unlock_bh(&ap_ctx->mlo_ap_lock);
575*5113495bSYour Name }
576*5113495bSYour Name #else /* WLAN_MLO_USE_SPINLOCK */
577*5113495bSYour Name static inline
ml_link_lock_create(struct mlo_mgr_context * mlo_ctx)578*5113495bSYour Name void ml_link_lock_create(struct mlo_mgr_context *mlo_ctx)
579*5113495bSYour Name {
580*5113495bSYour Name 	qdf_mutex_create(&mlo_ctx->ml_dev_list_lock);
581*5113495bSYour Name }
582*5113495bSYour Name 
583*5113495bSYour Name static inline void
ml_link_lock_destroy(struct mlo_mgr_context * mlo_ctx)584*5113495bSYour Name ml_link_lock_destroy(struct mlo_mgr_context *mlo_ctx)
585*5113495bSYour Name {
586*5113495bSYour Name 	qdf_mutex_destroy(&mlo_ctx->ml_dev_list_lock);
587*5113495bSYour Name }
588*5113495bSYour Name 
589*5113495bSYour Name static inline
ml_link_lock_acquire(struct mlo_mgr_context * mlo_ctx)590*5113495bSYour Name void ml_link_lock_acquire(struct mlo_mgr_context *mlo_ctx)
591*5113495bSYour Name {
592*5113495bSYour Name 	qdf_mutex_acquire(&mlo_ctx->ml_dev_list_lock);
593*5113495bSYour Name }
594*5113495bSYour Name 
595*5113495bSYour Name static inline
ml_link_lock_release(struct mlo_mgr_context * mlo_ctx)596*5113495bSYour Name void ml_link_lock_release(struct mlo_mgr_context *mlo_ctx)
597*5113495bSYour Name {
598*5113495bSYour Name 	qdf_mutex_release(&mlo_ctx->ml_dev_list_lock);
599*5113495bSYour Name }
600*5113495bSYour Name 
601*5113495bSYour Name static inline
mlo_dev_lock_create(struct wlan_mlo_dev_context * mldev)602*5113495bSYour Name void mlo_dev_lock_create(struct wlan_mlo_dev_context *mldev)
603*5113495bSYour Name {
604*5113495bSYour Name 	qdf_mutex_create(&mldev->mlo_dev_lock);
605*5113495bSYour Name }
606*5113495bSYour Name 
607*5113495bSYour Name static inline
mlo_dev_lock_destroy(struct wlan_mlo_dev_context * mldev)608*5113495bSYour Name void mlo_dev_lock_destroy(struct wlan_mlo_dev_context *mldev)
609*5113495bSYour Name {
610*5113495bSYour Name 	qdf_mutex_destroy(&mldev->mlo_dev_lock);
611*5113495bSYour Name }
612*5113495bSYour Name 
mlo_dev_lock_acquire(struct wlan_mlo_dev_context * mldev)613*5113495bSYour Name static inline void mlo_dev_lock_acquire(struct wlan_mlo_dev_context *mldev)
614*5113495bSYour Name {
615*5113495bSYour Name 	qdf_mutex_acquire(&mldev->mlo_dev_lock);
616*5113495bSYour Name }
617*5113495bSYour Name 
mlo_dev_lock_release(struct wlan_mlo_dev_context * mldev)618*5113495bSYour Name static inline void mlo_dev_lock_release(struct wlan_mlo_dev_context *mldev)
619*5113495bSYour Name {
620*5113495bSYour Name 	qdf_mutex_release(&mldev->mlo_dev_lock);
621*5113495bSYour Name }
622*5113495bSYour Name 
623*5113495bSYour Name static inline
ml_aid_lock_create(struct mlo_mgr_context * mlo_ctx)624*5113495bSYour Name void ml_aid_lock_create(struct mlo_mgr_context *mlo_ctx)
625*5113495bSYour Name {
626*5113495bSYour Name 	qdf_mutex_create(&mlo_ctx->aid_lock);
627*5113495bSYour Name }
628*5113495bSYour Name 
629*5113495bSYour Name static inline void
ml_aid_lock_destroy(struct mlo_mgr_context * mlo_ctx)630*5113495bSYour Name ml_aid_lock_destroy(struct mlo_mgr_context *mlo_ctx)
631*5113495bSYour Name {
632*5113495bSYour Name 	qdf_mutex_destroy(&mlo_ctx->aid_lock);
633*5113495bSYour Name }
634*5113495bSYour Name 
635*5113495bSYour Name static inline
ml_aid_lock_acquire(struct mlo_mgr_context * mlo_ctx)636*5113495bSYour Name void ml_aid_lock_acquire(struct mlo_mgr_context *mlo_ctx)
637*5113495bSYour Name {
638*5113495bSYour Name 	qdf_mutex_acquire(&mlo_ctx->aid_lock);
639*5113495bSYour Name }
640*5113495bSYour Name 
641*5113495bSYour Name static inline
ml_aid_lock_release(struct mlo_mgr_context * mlo_ctx)642*5113495bSYour Name void ml_aid_lock_release(struct mlo_mgr_context *mlo_ctx)
643*5113495bSYour Name {
644*5113495bSYour Name 	qdf_mutex_release(&mlo_ctx->aid_lock);
645*5113495bSYour Name }
646*5113495bSYour Name 
647*5113495bSYour Name static inline
ml_peerid_lock_create(struct mlo_mgr_context * mlo_ctx)648*5113495bSYour Name void ml_peerid_lock_create(struct mlo_mgr_context *mlo_ctx)
649*5113495bSYour Name {
650*5113495bSYour Name 	qdf_mutex_create(&mlo_ctx->ml_peerid_lock);
651*5113495bSYour Name }
652*5113495bSYour Name 
653*5113495bSYour Name static inline void
ml_peerid_lock_destroy(struct mlo_mgr_context * mlo_ctx)654*5113495bSYour Name ml_peerid_lock_destroy(struct mlo_mgr_context *mlo_ctx)
655*5113495bSYour Name {
656*5113495bSYour Name 	qdf_mutex_destroy(&mlo_ctx->ml_peerid_lock);
657*5113495bSYour Name }
658*5113495bSYour Name 
659*5113495bSYour Name static inline
ml_peerid_lock_acquire(struct mlo_mgr_context * mlo_ctx)660*5113495bSYour Name void ml_peerid_lock_acquire(struct mlo_mgr_context *mlo_ctx)
661*5113495bSYour Name {
662*5113495bSYour Name 	qdf_mutex_acquire(&mlo_ctx->ml_peerid_lock);
663*5113495bSYour Name }
664*5113495bSYour Name 
665*5113495bSYour Name static inline
ml_peerid_lock_release(struct mlo_mgr_context * mlo_ctx)666*5113495bSYour Name void ml_peerid_lock_release(struct mlo_mgr_context *mlo_ctx)
667*5113495bSYour Name {
668*5113495bSYour Name 	qdf_mutex_release(&mlo_ctx->ml_peerid_lock);
669*5113495bSYour Name }
670*5113495bSYour Name 
671*5113495bSYour Name static inline void
mlo_peer_lock_create(struct wlan_mlo_peer_context * mlpeer)672*5113495bSYour Name mlo_peer_lock_create(struct wlan_mlo_peer_context *mlpeer)
673*5113495bSYour Name {
674*5113495bSYour Name 	qdf_mutex_create(&mlpeer->mlo_peer_lock);
675*5113495bSYour Name }
676*5113495bSYour Name 
677*5113495bSYour Name static inline void
mlo_peer_lock_destroy(struct wlan_mlo_peer_context * mlpeer)678*5113495bSYour Name mlo_peer_lock_destroy(struct wlan_mlo_peer_context *mlpeer)
679*5113495bSYour Name {
680*5113495bSYour Name 	qdf_mutex_destroy(&mlpeer->mlo_peer_lock);
681*5113495bSYour Name }
682*5113495bSYour Name 
683*5113495bSYour Name static inline
mlo_peer_lock_acquire(struct wlan_mlo_peer_context * mlpeer)684*5113495bSYour Name void mlo_peer_lock_acquire(struct wlan_mlo_peer_context *mlpeer)
685*5113495bSYour Name {
686*5113495bSYour Name 	qdf_mutex_acquire(&mlpeer->mlo_peer_lock);
687*5113495bSYour Name }
688*5113495bSYour Name 
689*5113495bSYour Name static inline
mlo_peer_lock_release(struct wlan_mlo_peer_context * mlpeer)690*5113495bSYour Name void mlo_peer_lock_release(struct wlan_mlo_peer_context *mlpeer)
691*5113495bSYour Name {
692*5113495bSYour Name 	qdf_mutex_release(&mlpeer->mlo_peer_lock);
693*5113495bSYour Name }
694*5113495bSYour Name 
695*5113495bSYour Name static inline void
ml_peerlist_lock_create(struct wlan_mlo_peer_list * ml_peerlist)696*5113495bSYour Name ml_peerlist_lock_create(struct wlan_mlo_peer_list *ml_peerlist)
697*5113495bSYour Name {
698*5113495bSYour Name 	qdf_mutex_create(&ml_peerlist->peer_list_lock);
699*5113495bSYour Name }
700*5113495bSYour Name 
701*5113495bSYour Name static inline void
ml_peerlist_lock_destroy(struct wlan_mlo_peer_list * ml_peerlist)702*5113495bSYour Name ml_peerlist_lock_destroy(struct wlan_mlo_peer_list *ml_peerlist)
703*5113495bSYour Name {
704*5113495bSYour Name 	qdf_mutex_destroy(&ml_peerlist->peer_list_lock);
705*5113495bSYour Name }
706*5113495bSYour Name 
707*5113495bSYour Name static inline
ml_peerlist_lock_acquire(struct wlan_mlo_peer_list * ml_peerlist)708*5113495bSYour Name void ml_peerlist_lock_acquire(struct wlan_mlo_peer_list *ml_peerlist)
709*5113495bSYour Name {
710*5113495bSYour Name 	qdf_mutex_acquire(&ml_peerlist->peer_list_lock);
711*5113495bSYour Name }
712*5113495bSYour Name 
713*5113495bSYour Name static inline
ml_peerlist_lock_release(struct wlan_mlo_peer_list * ml_peerlist)714*5113495bSYour Name void ml_peerlist_lock_release(struct wlan_mlo_peer_list *ml_peerlist)
715*5113495bSYour Name {
716*5113495bSYour Name 	qdf_mutex_release(&ml_peerlist->peer_list_lock);
717*5113495bSYour Name }
718*5113495bSYour Name 
719*5113495bSYour Name static inline
copied_conn_req_lock_create(struct wlan_mlo_sta * sta_ctx)720*5113495bSYour Name void copied_conn_req_lock_create(struct wlan_mlo_sta *sta_ctx)
721*5113495bSYour Name {
722*5113495bSYour Name 	qdf_mutex_create(&sta_ctx->copied_conn_req_lock);
723*5113495bSYour Name }
724*5113495bSYour Name 
725*5113495bSYour Name static inline
copied_conn_req_lock_destroy(struct wlan_mlo_sta * sta_ctx)726*5113495bSYour Name void copied_conn_req_lock_destroy(struct wlan_mlo_sta *sta_ctx)
727*5113495bSYour Name {
728*5113495bSYour Name 	qdf_mutex_destroy(&sta_ctx->copied_conn_req_lock);
729*5113495bSYour Name }
730*5113495bSYour Name 
731*5113495bSYour Name static inline
copied_conn_req_lock_acquire(struct wlan_mlo_sta * sta_ctx)732*5113495bSYour Name void copied_conn_req_lock_acquire(struct wlan_mlo_sta *sta_ctx)
733*5113495bSYour Name {
734*5113495bSYour Name 	qdf_mutex_acquire(&sta_ctx->copied_conn_req_lock);
735*5113495bSYour Name }
736*5113495bSYour Name 
737*5113495bSYour Name static inline
copied_conn_req_lock_release(struct wlan_mlo_sta * sta_ctx)738*5113495bSYour Name void copied_conn_req_lock_release(struct wlan_mlo_sta *sta_ctx)
739*5113495bSYour Name {
740*5113495bSYour Name 	qdf_mutex_release(&sta_ctx->copied_conn_req_lock);
741*5113495bSYour Name }
742*5113495bSYour Name 
743*5113495bSYour Name /**
744*5113495bSYour Name  * tsf_recalculation_lock_create - Create TSF recalculation mutex/spinlock
745*5113495bSYour Name  * @mldev:  ML device context
746*5113495bSYour Name  *
747*5113495bSYour Name  * Creates mutex/spinlock
748*5113495bSYour Name  *
749*5113495bSYour Name  * Return: void
750*5113495bSYour Name  */
751*5113495bSYour Name static inline void
tsf_recalculation_lock_create(struct wlan_mlo_dev_context * mldev)752*5113495bSYour Name tsf_recalculation_lock_create(struct wlan_mlo_dev_context *mldev)
753*5113495bSYour Name {
754*5113495bSYour Name 	qdf_mutex_create(&mldev->tsf_recalculation_lock);
755*5113495bSYour Name }
756*5113495bSYour Name 
757*5113495bSYour Name /**
758*5113495bSYour Name  * tsf_recalculation_lock_destroy - Destroy TSF recalculation mutex/spinlock
759*5113495bSYour Name  * @mldev:  ML device context
760*5113495bSYour Name  *
761*5113495bSYour Name  * Destroy mutex/spinlock
762*5113495bSYour Name  *
763*5113495bSYour Name  * Return: void
764*5113495bSYour Name  */
765*5113495bSYour Name static inline void
tsf_recalculation_lock_destroy(struct wlan_mlo_dev_context * mldev)766*5113495bSYour Name tsf_recalculation_lock_destroy(struct wlan_mlo_dev_context *mldev)
767*5113495bSYour Name {
768*5113495bSYour Name 	qdf_mutex_destroy(&mldev->tsf_recalculation_lock);
769*5113495bSYour Name }
770*5113495bSYour Name 
771*5113495bSYour Name /**
772*5113495bSYour Name  * tsf_recalculation_lock_acquire - Acquire TSF recalculation mutex/spinlock
773*5113495bSYour Name  * @mldev:  ML device context
774*5113495bSYour Name  *
775*5113495bSYour Name  * Acquire mutex/spinlock
776*5113495bSYour Name  *
777*5113495bSYour Name  * return: void
778*5113495bSYour Name  */
779*5113495bSYour Name static inline
tsf_recalculation_lock_acquire(struct wlan_mlo_dev_context * mldev)780*5113495bSYour Name void tsf_recalculation_lock_acquire(struct wlan_mlo_dev_context *mldev)
781*5113495bSYour Name {
782*5113495bSYour Name 	qdf_mutex_acquire(&mldev->tsf_recalculation_lock);
783*5113495bSYour Name }
784*5113495bSYour Name 
785*5113495bSYour Name /**
786*5113495bSYour Name  * tsf_recalculation_lock_release - Release TSF recalculation mutex/spinlock
787*5113495bSYour Name  * @mldev:  ML device context
788*5113495bSYour Name  *
789*5113495bSYour Name  * release mutex/spinlock
790*5113495bSYour Name  *
791*5113495bSYour Name  * return: void
792*5113495bSYour Name  */
793*5113495bSYour Name static inline
tsf_recalculation_lock_release(struct wlan_mlo_dev_context * mldev)794*5113495bSYour Name void tsf_recalculation_lock_release(struct wlan_mlo_dev_context *mldev)
795*5113495bSYour Name {
796*5113495bSYour Name 	qdf_mutex_release(&mldev->tsf_recalculation_lock);
797*5113495bSYour Name }
798*5113495bSYour Name 
799*5113495bSYour Name static inline
mlo_ap_lock_create(struct wlan_mlo_ap * ap_ctx)800*5113495bSYour Name void mlo_ap_lock_create(struct wlan_mlo_ap *ap_ctx)
801*5113495bSYour Name {
802*5113495bSYour Name 	qdf_mutex_create(&ap_ctx->mlo_ap_lock);
803*5113495bSYour Name }
804*5113495bSYour Name 
805*5113495bSYour Name static inline
mlo_ap_lock_destroy(struct wlan_mlo_ap * ap_ctx)806*5113495bSYour Name void mlo_ap_lock_destroy(struct wlan_mlo_ap *ap_ctx)
807*5113495bSYour Name {
808*5113495bSYour Name 	qdf_mutex_destroy(&ap_ctx->mlo_ap_lock);
809*5113495bSYour Name }
810*5113495bSYour Name 
811*5113495bSYour Name static inline
mlo_ap_lock_acquire(struct wlan_mlo_ap * ap_ctx)812*5113495bSYour Name void mlo_ap_lock_acquire(struct wlan_mlo_ap *ap_ctx)
813*5113495bSYour Name {
814*5113495bSYour Name 	qdf_mutex_acquire(&ap_ctx->mlo_ap_lock);
815*5113495bSYour Name }
816*5113495bSYour Name 
817*5113495bSYour Name static inline
mlo_ap_lock_release(struct wlan_mlo_ap * ap_ctx)818*5113495bSYour Name void mlo_ap_lock_release(struct wlan_mlo_ap *ap_ctx)
819*5113495bSYour Name {
820*5113495bSYour Name 	qdf_mutex_release(&ap_ctx->mlo_ap_lock);
821*5113495bSYour Name }
822*5113495bSYour Name #endif /* WLAN_MLO_USE_SPINLOCK */
823*5113495bSYour Name 
824*5113495bSYour Name /**
825*5113495bSYour Name  * wlan_mlo_mgr_psoc_enable() - MLO psoc enable handler
826*5113495bSYour Name  * @psoc: psoc pointer
827*5113495bSYour Name  *
828*5113495bSYour Name  * API to execute operations on psoc enable
829*5113495bSYour Name  *
830*5113495bSYour Name  * Return: QDF_STATUS
831*5113495bSYour Name  */
832*5113495bSYour Name QDF_STATUS wlan_mlo_mgr_psoc_enable(struct wlan_objmgr_psoc *psoc);
833*5113495bSYour Name 
834*5113495bSYour Name /**
835*5113495bSYour Name  * wlan_mlo_mgr_psoc_disable() - MLO psoc disable handler
836*5113495bSYour Name  * @psoc: psoc pointer
837*5113495bSYour Name  *
838*5113495bSYour Name  * API to execute operations on psoc disable
839*5113495bSYour Name  *
840*5113495bSYour Name  * Return: QDF_STATUS
841*5113495bSYour Name  */
842*5113495bSYour Name QDF_STATUS wlan_mlo_mgr_psoc_disable(struct wlan_objmgr_psoc *psoc);
843*5113495bSYour Name 
844*5113495bSYour Name /**
845*5113495bSYour Name  * wlan_mlo_mgr_update_mld_addr() - Update MLD MAC address
846*5113495bSYour Name  * @old_mac: Old MLD MAC address
847*5113495bSYour Name  * @new_mac: New MLD MAC address
848*5113495bSYour Name  *
849*5113495bSYour Name  * API to update MLD MAC address once ML dev context is created.
850*5113495bSYour Name  *
851*5113495bSYour Name  * Return: QDF_STATUS
852*5113495bSYour Name  */
853*5113495bSYour Name QDF_STATUS wlan_mlo_mgr_update_mld_addr(struct qdf_mac_addr *old_mac,
854*5113495bSYour Name 					struct qdf_mac_addr *new_mac);
855*5113495bSYour Name 
856*5113495bSYour Name /**
857*5113495bSYour Name  * wlan_mlo_is_mld_ctx_exist() - check whether MLD exist with MLD MAC address
858*5113495bSYour Name  * @mldaddr: MLD MAC address
859*5113495bSYour Name  *
860*5113495bSYour Name  * API to check whether MLD is present with MLD MAC address.
861*5113495bSYour Name  *
862*5113495bSYour Name  * Return: true, if it is present
863*5113495bSYour Name  *         false, if it is not present
864*5113495bSYour Name  */
865*5113495bSYour Name bool wlan_mlo_is_mld_ctx_exist(struct qdf_mac_addr *mldaddr);
866*5113495bSYour Name 
867*5113495bSYour Name /**
868*5113495bSYour Name  * wlan_mlo_get_sta_mld_ctx_count() - Get number of sta mld device context
869*5113495bSYour Name  *
870*5113495bSYour Name  * API to get number of sta mld device context
871*5113495bSYour Name  *
872*5113495bSYour Name  * Return: number of sta mld device context
873*5113495bSYour Name  */
874*5113495bSYour Name uint8_t wlan_mlo_get_sta_mld_ctx_count(void);
875*5113495bSYour Name 
876*5113495bSYour Name /**
877*5113495bSYour Name  * wlan_mlo_get_mld_ctx_by_mldaddr() - Get mld device context using mld
878*5113495bSYour Name  *                                     MAC address
879*5113495bSYour Name  *
880*5113495bSYour Name  * @mldaddr: MAC address of the MLD device
881*5113495bSYour Name  *
882*5113495bSYour Name  * API to get mld device context using the mld mac address
883*5113495bSYour Name  *
884*5113495bSYour Name  * Return: Pointer to mlo device context
885*5113495bSYour Name  */
886*5113495bSYour Name struct wlan_mlo_dev_context
887*5113495bSYour Name *wlan_mlo_get_mld_ctx_by_mldaddr(struct qdf_mac_addr *mldaddr);
888*5113495bSYour Name 
889*5113495bSYour Name /**
890*5113495bSYour Name  * wlan_mlo_list_peek_head() - Returns the head of linked list
891*5113495bSYour Name  *
892*5113495bSYour Name  * @ml_list: Pointer to the list of MLDs
893*5113495bSYour Name  *
894*5113495bSYour Name  * API to retrieve the head from the list of active MLDs
895*5113495bSYour Name  *
896*5113495bSYour Name  * Return: Pointer to mlo device context
897*5113495bSYour Name  */
898*5113495bSYour Name struct wlan_mlo_dev_context *wlan_mlo_list_peek_head(qdf_list_t *ml_list);
899*5113495bSYour Name 
900*5113495bSYour Name /**
901*5113495bSYour Name  * wlan_mlo_get_next_mld_ctx() - Return next mlo dev node from the list
902*5113495bSYour Name  *
903*5113495bSYour Name  * @ml_list:  Pointer to the list of MLDs
904*5113495bSYour Name  * @mld_cur: Pointer to the current mlo dev node
905*5113495bSYour Name  *
906*5113495bSYour Name  * API to retrieve the next node from the list of active MLDs
907*5113495bSYour Name  *
908*5113495bSYour Name  * Return: Pointer to mlo device context
909*5113495bSYour Name  */
910*5113495bSYour Name struct wlan_mlo_dev_context *wlan_mlo_get_next_mld_ctx(qdf_list_t *ml_list,
911*5113495bSYour Name 					struct wlan_mlo_dev_context *mld_cur);
912*5113495bSYour Name 
913*5113495bSYour Name /**
914*5113495bSYour Name  * wlan_mlo_check_valid_config() - Check vap config is valid for mld
915*5113495bSYour Name  *
916*5113495bSYour Name  * @ml_dev: Pointer to structure of mlo device context
917*5113495bSYour Name  * @pdev: Reference pdev to check against MLD list
918*5113495bSYour Name  * @opmode: Operating mode of vdev (SAP/STA etc..)
919*5113495bSYour Name  *
920*5113495bSYour Name  * API to check if vaps config is valid
921*5113495bSYour Name  *
922*5113495bSYour Name  * Return: QDF_STATUS
923*5113495bSYour Name  */
924*5113495bSYour Name QDF_STATUS wlan_mlo_check_valid_config(struct wlan_mlo_dev_context *ml_dev,
925*5113495bSYour Name 				       struct wlan_objmgr_pdev *pdev,
926*5113495bSYour Name 				       enum QDF_OPMODE opmode);
927*5113495bSYour Name 
928*5113495bSYour Name /**
929*5113495bSYour Name  * mlo_mgr_ml_peer_exist_on_diff_ml_ctx() - Check if MAC address matches any
930*5113495bSYour Name  * MLD address
931*5113495bSYour Name  * @peer_addr: Address to search for a match
932*5113495bSYour Name  * @peer_vdev_id: vdev ID of peer
933*5113495bSYour Name  *
934*5113495bSYour Name  * The API iterates through all the ML dev ctx in the global MLO
935*5113495bSYour Name  * manager to check if MAC address pointed by @peer_addr matches
936*5113495bSYour Name  * the MLD address of any ML dev context or its ML peers.
937*5113495bSYour Name  * If @peer_vdev_id is a valid pointer address, then API returns
938*5113495bSYour Name  * true only if the matching MAC address is not part of the same
939*5113495bSYour Name  * ML dev context.
940*5113495bSYour Name  *
941*5113495bSYour Name  * Return: True if a matching entity is found else false.
942*5113495bSYour Name  */
943*5113495bSYour Name bool mlo_mgr_ml_peer_exist_on_diff_ml_ctx(uint8_t *peer_addr,
944*5113495bSYour Name 					  uint8_t *peer_vdev_id);
945*5113495bSYour Name 
946*5113495bSYour Name /**
947*5113495bSYour Name  * wlan_mlo_update_action_frame_from_user() - Change MAC address in WLAN frame
948*5113495bSYour Name  * received from userspace.
949*5113495bSYour Name  * @vdev: VDEV objmgr pointer.
950*5113495bSYour Name  * @frame: Pointer to start of WLAN MAC frame.
951*5113495bSYour Name  * @frame_len: Length of the frame.
952*5113495bSYour Name  *
953*5113495bSYour Name  * The API will translate MLD address in the SA, DA, BSSID for the action
954*5113495bSYour Name  * frames received from userspace with link address to send over the air.
955*5113495bSYour Name  * The API will not modify if the frame is a Public Action category frame and
956*5113495bSYour Name  * for VDEV other then STA mode.
957*5113495bSYour Name  *
958*5113495bSYour Name  * Return: void
959*5113495bSYour Name  */
960*5113495bSYour Name void wlan_mlo_update_action_frame_from_user(struct wlan_objmgr_vdev *vdev,
961*5113495bSYour Name 					    uint8_t *frame,
962*5113495bSYour Name 					    uint32_t frame_len);
963*5113495bSYour Name 
964*5113495bSYour Name /**
965*5113495bSYour Name  * wlan_mlo_update_action_frame_to_user() - Change MAC address in WLAN frame
966*5113495bSYour Name  * received over the air.
967*5113495bSYour Name  * @vdev: VDEV objmgr pointer.
968*5113495bSYour Name  * @frame: Pointer to start of WLAN MAC frame.
969*5113495bSYour Name  * @frame_len: Length of the frame.
970*5113495bSYour Name  *
971*5113495bSYour Name  * The API will translate link address in the SA, DA, BSSID for the action
972*5113495bSYour Name  * frames received over the air with MLD address to send to userspace.
973*5113495bSYour Name  * The API will not modify if the frame is a Public Action category frame and
974*5113495bSYour Name  * for VDEV other then STA mode.
975*5113495bSYour Name  *
976*5113495bSYour Name  * Return: void
977*5113495bSYour Name  */
978*5113495bSYour Name void wlan_mlo_update_action_frame_to_user(struct wlan_objmgr_vdev *vdev,
979*5113495bSYour Name 					  uint8_t *frame,
980*5113495bSYour Name 					  uint32_t frame_len);
981*5113495bSYour Name 
982*5113495bSYour Name /**
983*5113495bSYour Name  * wlan_mlo_mgr_mld_vdev_attach() - Attach VDEV to MLD
984*5113495bSYour Name  * @vdev: VDEV object
985*5113495bSYour Name  * @mld_addr: MLD address of MLD, where this VDEV should be attached
986*5113495bSYour Name  *
987*5113495bSYour Name  * API to set MLD MAC address and  Attaches VDEV to existing MLD.
988*5113495bSYour Name  *
989*5113495bSYour Name  * Return: QDF_STATUS
990*5113495bSYour Name  */
991*5113495bSYour Name QDF_STATUS wlan_mlo_mgr_mld_vdev_attach(struct wlan_objmgr_vdev *vdev,
992*5113495bSYour Name 					struct qdf_mac_addr *mld_addr);
993*5113495bSYour Name 
994*5113495bSYour Name /**
995*5113495bSYour Name  * wlan_mlo_mgr_mld_vdev_detach() - Detach VDEV from MLD
996*5113495bSYour Name  * @vdev: VDEV object
997*5113495bSYour Name  *
998*5113495bSYour Name  * API to reset MLD MAC address and  Detaches VDEV from its MLD.
999*5113495bSYour Name  *
1000*5113495bSYour Name  * Return: QDF_STATUS
1001*5113495bSYour Name  */
1002*5113495bSYour Name QDF_STATUS wlan_mlo_mgr_mld_vdev_detach(struct wlan_objmgr_vdev *vdev);
1003*5113495bSYour Name 
1004*5113495bSYour Name #ifdef WLAN_MLO_MULTI_CHIP
1005*5113495bSYour Name /**
1006*5113495bSYour Name  * mlo_mgr_is_mld_has_active_link() - Check if any MLD has active link
1007*5113495bSYour Name  *
1008*5113495bSYour Name  * @is_active: Buffer indicating links are active or not
1009*5113495bSYour Name  *
1010*5113495bSYour Name  * The API iterates through all the ML dev ctx in the global MLO
1011*5113495bSYour Name  * manager to check if there is atleast one active link present in
1012*5113495bSYour Name  * any of the MLDs
1013*5113495bSYour Name  *
1014*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS if link information is retrieved
1015*5113495bSYour Name  *         successfully else QDF_STATUS_E*.
1016*5113495bSYour Name  */
1017*5113495bSYour Name QDF_STATUS mlo_mgr_is_mld_has_active_link(bool *is_active);
1018*5113495bSYour Name 
1019*5113495bSYour Name #ifdef WLAN_WSI_STATS_SUPPORT
1020*5113495bSYour Name /**
1021*5113495bSYour Name  * mlo_wsi_link_info_update_soc() - Update PSOC group in WSI stats
1022*5113495bSYour Name  * @psoc: PSOC object
1023*5113495bSYour Name  * @grp_id: Group ID
1024*5113495bSYour Name  *
1025*5113495bSYour Name  * API to update PSOC group id in WSI statas.
1026*5113495bSYour Name  *
1027*5113495bSYour Name  * Return: void
1028*5113495bSYour Name  */
1029*5113495bSYour Name void mlo_wsi_link_info_update_soc(struct wlan_objmgr_psoc *psoc,
1030*5113495bSYour Name 				  uint8_t grp_id);
1031*5113495bSYour Name #else
mlo_wsi_link_info_update_soc(struct wlan_objmgr_psoc * psoc,uint8_t grp_id)1032*5113495bSYour Name static void mlo_wsi_link_info_update_soc(struct wlan_objmgr_psoc *psoc,
1033*5113495bSYour Name 					 uint8_t grp_id)
1034*5113495bSYour Name {
1035*5113495bSYour Name }
1036*5113495bSYour Name #endif
1037*5113495bSYour Name #else
1038*5113495bSYour Name static inline
mlo_mgr_is_mld_has_active_link(bool * is_active)1039*5113495bSYour Name QDF_STATUS mlo_mgr_is_mld_has_active_link(bool *is_active)
1040*5113495bSYour Name {
1041*5113495bSYour Name 	return QDF_STATUS_E_FAILURE;
1042*5113495bSYour Name }
1043*5113495bSYour Name #endif
1044*5113495bSYour Name 
1045*5113495bSYour Name #else
wlan_mlo_mgr_init(void)1046*5113495bSYour Name static inline QDF_STATUS wlan_mlo_mgr_init(void)
1047*5113495bSYour Name {
1048*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1049*5113495bSYour Name }
1050*5113495bSYour Name 
wlan_mlo_mgr_deinit(void)1051*5113495bSYour Name static inline QDF_STATUS wlan_mlo_mgr_deinit(void)
1052*5113495bSYour Name {
1053*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1054*5113495bSYour Name }
1055*5113495bSYour Name 
1056*5113495bSYour Name static inline QDF_STATUS
wlan_mlo_mgr_update_mld_addr(struct qdf_mac_addr * old_mac,struct qdf_mac_addr * new_mac)1057*5113495bSYour Name wlan_mlo_mgr_update_mld_addr(struct qdf_mac_addr *old_mac,
1058*5113495bSYour Name 			     struct qdf_mac_addr *new_mac)
1059*5113495bSYour Name {
1060*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1061*5113495bSYour Name }
1062*5113495bSYour Name 
1063*5113495bSYour Name static inline
mlo_mgr_ml_peer_exist_on_diff_ml_ctx(uint8_t * peer_addr,uint8_t * peer_vdev_id)1064*5113495bSYour Name bool mlo_mgr_ml_peer_exist_on_diff_ml_ctx(uint8_t *peer_addr,
1065*5113495bSYour Name 					  uint8_t *peer_vdev_id)
1066*5113495bSYour Name {
1067*5113495bSYour Name 	return false;
1068*5113495bSYour Name }
1069*5113495bSYour Name 
1070*5113495bSYour Name static inline
wlan_mlo_update_action_frame_from_user(struct wlan_objmgr_vdev * vdev,uint8_t * frame,uint32_t frame_len)1071*5113495bSYour Name void wlan_mlo_update_action_frame_from_user(struct wlan_objmgr_vdev *vdev,
1072*5113495bSYour Name 					    uint8_t *frame,
1073*5113495bSYour Name 					    uint32_t frame_len)
1074*5113495bSYour Name {
1075*5113495bSYour Name }
1076*5113495bSYour Name 
1077*5113495bSYour Name static inline
wlan_mlo_update_action_frame_to_user(struct wlan_objmgr_vdev * vdev,uint8_t * frame,uint32_t frame_len)1078*5113495bSYour Name void wlan_mlo_update_action_frame_to_user(struct wlan_objmgr_vdev *vdev,
1079*5113495bSYour Name 					  uint8_t *frame,
1080*5113495bSYour Name 					  uint32_t frame_len)
1081*5113495bSYour Name {
1082*5113495bSYour Name }
1083*5113495bSYour Name 
1084*5113495bSYour Name static inline
wlan_mlo_get_sta_mld_ctx_count(void)1085*5113495bSYour Name uint8_t wlan_mlo_get_sta_mld_ctx_count(void)
1086*5113495bSYour Name {
1087*5113495bSYour Name 	return 0;
1088*5113495bSYour Name }
1089*5113495bSYour Name 
1090*5113495bSYour Name static inline
wlan_mlo_mgr_mld_vdev_attach(struct wlan_objmgr_vdev * vdev,struct qdf_mac_addr * mld_addr)1091*5113495bSYour Name QDF_STATUS wlan_mlo_mgr_mld_vdev_attach(struct wlan_objmgr_vdev *vdev,
1092*5113495bSYour Name 					struct qdf_mac_addr *mld_addr)
1093*5113495bSYour Name {
1094*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1095*5113495bSYour Name }
1096*5113495bSYour Name 
1097*5113495bSYour Name static inline
wlan_mlo_mgr_mld_vdev_detach(struct wlan_objmgr_vdev * vdev)1098*5113495bSYour Name QDF_STATUS wlan_mlo_mgr_mld_vdev_detach(struct wlan_objmgr_vdev *vdev)
1099*5113495bSYour Name {
1100*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1101*5113495bSYour Name }
1102*5113495bSYour Name 
1103*5113495bSYour Name #endif
1104*5113495bSYour Name #endif
1105