1*5113495bSYour Name /* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
2*5113495bSYour Name *
3*5113495bSYour Name * Permission to use, copy, modify, and/or distribute this software for any
4*5113495bSYour Name * purpose with or without fee is hereby granted, provided that the above
5*5113495bSYour Name * copyright notice and this permission notice appear in all copies.
6*5113495bSYour Name *
7*5113495bSYour Name * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8*5113495bSYour Name * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9*5113495bSYour Name * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10*5113495bSYour Name * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11*5113495bSYour Name * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12*5113495bSYour Name * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13*5113495bSYour Name * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14*5113495bSYour Name */
15*5113495bSYour Name
16*5113495bSYour Name /**
17*5113495bSYour Name * DOC: contains MLO manager public file containing setup/teardown functionality
18*5113495bSYour Name */
19*5113495bSYour Name
20*5113495bSYour Name #ifndef _WLAN_MLO_MGR_SETUP_H_
21*5113495bSYour Name #define _WLAN_MLO_MGR_SETUP_H_
22*5113495bSYour Name #ifdef WLAN_MLO_MULTI_CHIP
23*5113495bSYour Name
24*5113495bSYour Name /**
25*5113495bSYour Name * mlo_setup_init() - API to init setup info events
26*5113495bSYour Name * @total_grp: Total number of MLO groups
27*5113495bSYour Name *
28*5113495bSYour Name * Return: None
29*5113495bSYour Name */
30*5113495bSYour Name void mlo_setup_init(uint8_t total_grp);
31*5113495bSYour Name
32*5113495bSYour Name /**
33*5113495bSYour Name * mlo_setup_deinit() - API to deinit setup info events
34*5113495bSYour Name *
35*5113495bSYour Name * Return: None
36*5113495bSYour Name */
37*5113495bSYour Name void mlo_setup_deinit(void);
38*5113495bSYour Name
39*5113495bSYour Name /**
40*5113495bSYour Name * mlo_is_ml_soc() - API to check if psoc belongs to ML group
41*5113495bSYour Name * @psoc: Soc to be checked.
42*5113495bSYour Name * @grp_id: ID of the required mlo group
43*5113495bSYour Name *
44*5113495bSYour Name * Return: true if psoc found in ml soc_list, or else return false
45*5113495bSYour Name */
46*5113495bSYour Name bool mlo_is_ml_soc(struct wlan_objmgr_psoc *psoc, uint8_t grp_id);
47*5113495bSYour Name
48*5113495bSYour Name /**
49*5113495bSYour Name * mlo_check_start_stop_inprogress() - API to set ML group
50*5113495bSYour Name * start or stop in progress bit and return last value
51*5113495bSYour Name * @grp_id: ID of the required mlo group to be checked
52*5113495bSYour Name *
53*5113495bSYour Name * Return: true if mlo group is in start/stop, or else return false
54*5113495bSYour Name */
55*5113495bSYour Name bool mlo_check_start_stop_inprogress(uint8_t grp_id);
56*5113495bSYour Name
57*5113495bSYour Name /**
58*5113495bSYour Name * mlo_clear_start_stop_inprogress() - API to clear the value of ML group
59*5113495bSYour Name * start or stop in progress bit
60*5113495bSYour Name * @grp_id: ID of the required mlo group to be set
61*5113495bSYour Name *
62*5113495bSYour Name * Return: none
63*5113495bSYour Name */
64*5113495bSYour Name void mlo_clear_start_stop_inprogress(uint8_t grp_id);
65*5113495bSYour Name
66*5113495bSYour Name /**
67*5113495bSYour Name * mlo_get_soc_list() - API to get the list of SOCs participating in MLO
68*5113495bSYour Name * @soc_list: list where ML participating SOCs need to be populated
69*5113495bSYour Name * @grp_id: ID of the required mlo group
70*5113495bSYour Name * @tot_socs: Total number of socs, for which soc list is allocated
71*5113495bSYour Name * @curr: Flag to get the current psoc list or actual psoc list
72*5113495bSYour Name *
73*5113495bSYour Name * Return: None
74*5113495bSYour Name */
75*5113495bSYour Name void mlo_get_soc_list(struct wlan_objmgr_psoc **soc_list, uint8_t grp_id,
76*5113495bSYour Name uint8_t tot_socs, enum MLO_SOC_LIST curr);
77*5113495bSYour Name
78*5113495bSYour Name /**
79*5113495bSYour Name * mlo_setup_update_soc_id_list() - API to update the list of SOCs ids
80*5113495bSYour Name * participating in that MLO group
81*5113495bSYour Name * @grp_id: ID of the required mlo group
82*5113495bSYour Name * @soc_id_list: soc ids part of that MLO group
83*5113495bSYour Name *
84*5113495bSYour Name * Return: None
85*5113495bSYour Name */
86*5113495bSYour Name void mlo_setup_update_soc_id_list(uint8_t grp_id, uint8_t *soc_id_list);
87*5113495bSYour Name
88*5113495bSYour Name /**
89*5113495bSYour Name * mlo_psoc_get_grp_id() - API to get the MLO group id of the SoC
90*5113495bSYour Name * @psoc: Required psoc pointer
91*5113495bSYour Name * @grp_id: MLO Group id will be stored in here
92*5113495bSYour Name *
93*5113495bSYour Name * Return: bool: if valid group id true, else false
94*5113495bSYour Name */
95*5113495bSYour Name bool mlo_psoc_get_grp_id(struct wlan_objmgr_psoc *psoc, uint8_t *grp_id);
96*5113495bSYour Name
97*5113495bSYour Name /**
98*5113495bSYour Name * mlo_cleanup_asserted_soc_setup_info() - API to cleanup the mlo setup info of
99*5113495bSYour Name * asserted soc
100*5113495bSYour Name * @psoc: Soc to be cleaned up
101*5113495bSYour Name * @grp_id: ID of the required mlo group
102*5113495bSYour Name *
103*5113495bSYour Name * Return: None
104*5113495bSYour Name */
105*5113495bSYour Name void mlo_cleanup_asserted_soc_setup_info(struct wlan_objmgr_psoc *psoc,
106*5113495bSYour Name uint8_t grp_id);
107*5113495bSYour Name
108*5113495bSYour Name /**
109*5113495bSYour Name * mlo_setup_update_total_socs() - API to update total socs for mlo
110*5113495bSYour Name * @grp_id: ID of the required mlo group
111*5113495bSYour Name * @tot_socs: Total socs
112*5113495bSYour Name *
113*5113495bSYour Name * Return: None.
114*5113495bSYour Name */
115*5113495bSYour Name void mlo_setup_update_total_socs(uint8_t grp_id, uint8_t tot_socs);
116*5113495bSYour Name
117*5113495bSYour Name /**
118*5113495bSYour Name * mlo_setup_get_total_socs() - API to get total socs for mlo group
119*5113495bSYour Name * @grp_id: ID of the required mlo group
120*5113495bSYour Name *
121*5113495bSYour Name * Return: uint8_t, Number of total socs
122*5113495bSYour Name */
123*5113495bSYour Name uint8_t mlo_setup_get_total_socs(uint8_t grp_id);
124*5113495bSYour Name
125*5113495bSYour Name /**
126*5113495bSYour Name * mlo_setup_update_num_links() - API to update num links in soc for mlo
127*5113495bSYour Name * @psoc: soc object of SoC corresponding to num_link
128*5113495bSYour Name * @grp_id: ID of the required mlo group
129*5113495bSYour Name * @num_links: Number of links in that soc
130*5113495bSYour Name *
131*5113495bSYour Name * Return: None.
132*5113495bSYour Name */
133*5113495bSYour Name void mlo_setup_update_num_links(struct wlan_objmgr_psoc *psoc,
134*5113495bSYour Name uint8_t grp_id,
135*5113495bSYour Name uint8_t num_links);
136*5113495bSYour Name
137*5113495bSYour Name /**
138*5113495bSYour Name * mlo_setup_update_chip_info() - API to update mlo chip info
139*5113495bSYour Name * @psoc: soc to be checked
140*5113495bSYour Name * @chip_id: chip_id to update the info about
141*5113495bSYour Name * @adj_chip_id: adjacent chip ID's
142*5113495bSYour Name *
143*5113495bSYour Name * Return: None.
144*5113495bSYour Name */
145*5113495bSYour Name void mlo_setup_update_chip_info(struct wlan_objmgr_psoc *psoc, uint8_t chip_id,
146*5113495bSYour Name uint8_t *adj_chip_id);
147*5113495bSYour Name
148*5113495bSYour Name /**
149*5113495bSYour Name * mlo_chip_adjacent() - API to return if two chips are adjacent
150*5113495bSYour Name * @psoc_id_1: Psoc id 1
151*5113495bSYour Name * @psoc_id_2: Psoc id 2
152*5113495bSYour Name * @is_adjacent: Are the above 2 psocs adjacent or not
153*5113495bSYour Name * Return: QDF_STATUS: success / failure.
154*5113495bSYour Name */
155*5113495bSYour Name QDF_STATUS mlo_chip_adjacent(uint8_t psoc_id_1, uint8_t psoc_id_2,
156*5113495bSYour Name uint8_t *is_adjacent);
157*5113495bSYour Name
158*5113495bSYour Name /**
159*5113495bSYour Name * mlo_setup_update_soc_ready() - API to notify when FW init done
160*5113495bSYour Name * @psoc: soc object of SoC ready
161*5113495bSYour Name * @grp_id: ID of the required mlo group
162*5113495bSYour Name *
163*5113495bSYour Name * Return: None.
164*5113495bSYour Name */
165*5113495bSYour Name void mlo_setup_update_soc_ready(struct wlan_objmgr_psoc *psoc, uint8_t grp_id);
166*5113495bSYour Name
167*5113495bSYour Name /**
168*5113495bSYour Name * mlo_setup_link_ready() - API to notify link ready
169*5113495bSYour Name * @pdev: Pointer to pdev object
170*5113495bSYour Name * @grp_id: ID of the required mlo group
171*5113495bSYour Name *
172*5113495bSYour Name * Return: None.
173*5113495bSYour Name */
174*5113495bSYour Name void mlo_setup_link_ready(struct wlan_objmgr_pdev *pdev, uint8_t grp_id);
175*5113495bSYour Name
176*5113495bSYour Name /**
177*5113495bSYour Name * mlo_link_setup_complete() - API to notify setup complete
178*5113495bSYour Name * @pdev: Pointer to pdev object
179*5113495bSYour Name * @grp_id: ID of the required mlo group
180*5113495bSYour Name *
181*5113495bSYour Name * Return: None.
182*5113495bSYour Name */
183*5113495bSYour Name void mlo_link_setup_complete(struct wlan_objmgr_pdev *pdev, uint8_t grp_id);
184*5113495bSYour Name
185*5113495bSYour Name /**
186*5113495bSYour Name * mlo_link_teardown_complete() - API to notify teardown complete
187*5113495bSYour Name * @pdev: Pointer to pdev object
188*5113495bSYour Name * @grp_id: ID of the required mlo group
189*5113495bSYour Name *
190*5113495bSYour Name * Return: None.
191*5113495bSYour Name */
192*5113495bSYour Name void mlo_link_teardown_complete(struct wlan_objmgr_pdev *pdev, uint8_t grp_id);
193*5113495bSYour Name
194*5113495bSYour Name /**
195*5113495bSYour Name * mlo_setup_update_soc_down() - API to check and clear all links and bring
196*5113495bSYour Name * back to initial state for the particular soc
197*5113495bSYour Name *
198*5113495bSYour Name * @psoc: Pointer to psoc object
199*5113495bSYour Name * @grp_id: ID of the required mlo group
200*5113495bSYour Name *
201*5113495bSYour Name * Return: None.
202*5113495bSYour Name */
203*5113495bSYour Name void mlo_setup_update_soc_down(struct wlan_objmgr_psoc *psoc, uint8_t grp_id);
204*5113495bSYour Name
205*5113495bSYour Name /**
206*5113495bSYour Name * mlo_link_teardown_link() - API to trigger teardown
207*5113495bSYour Name * @psoc: Pointer to psoc object
208*5113495bSYour Name * @grp_id: ID of the required mlo group
209*5113495bSYour Name * @reason: Reason code for MLO tear down
210*5113495bSYour Name *
211*5113495bSYour Name * Return: QDF_STATUS - success / failure.
212*5113495bSYour Name */
213*5113495bSYour Name QDF_STATUS mlo_link_teardown_link(struct wlan_objmgr_psoc *psoc,
214*5113495bSYour Name uint8_t grp_id,
215*5113495bSYour Name uint32_t reason);
216*5113495bSYour Name
217*5113495bSYour Name /**
218*5113495bSYour Name * mlo_vdevs_check_single_soc() - API to check all the vaps in vdev list
219*5113495bSYour Name * belong to single soc or not
220*5113495bSYour Name * @wlan_vdev_list: List of all vdevs to check
221*5113495bSYour Name * @vdev_count: Number of vdevs in the list
222*5113495bSYour Name *
223*5113495bSYour Name * Return: bool: True if belongs to single soc else false
224*5113495bSYour Name */
225*5113495bSYour Name bool mlo_vdevs_check_single_soc(struct wlan_objmgr_vdev **wlan_vdev_list,
226*5113495bSYour Name uint8_t vdev_count);
227*5113495bSYour Name
228*5113495bSYour Name /**
229*5113495bSYour Name * mlo_check_all_pdev_state() - API to check all the pdev of the soc
230*5113495bSYour Name * are on the same expected state.
231*5113495bSYour Name *
232*5113495bSYour Name * @psoc: Pointer to psoc object
233*5113495bSYour Name * @grp_id: ID of the required mlo group
234*5113495bSYour Name * @state: Expected link state to be verified
235*5113495bSYour Name *
236*5113495bSYour Name * Return: QDF_STATUS: QDF_STATUS_SUCCESS if all belongs to same state
237*5113495bSYour Name */
238*5113495bSYour Name QDF_STATUS mlo_check_all_pdev_state(struct wlan_objmgr_psoc *psoc,
239*5113495bSYour Name uint8_t grp_id,
240*5113495bSYour Name enum MLO_LINK_STATE state);
241*5113495bSYour Name
242*5113495bSYour Name /**
243*5113495bSYour Name * mlo_update_wsi_stats_info_support() - API to update WSI stats info
244*5113495bSYour Name * support
245*5113495bSYour Name * @psoc: Pointer to psoc object
246*5113495bSYour Name * @wsi_stats_info_support: Indicates WSI stats info is to be enabled or not
247*5113495bSYour Name *
248*5113495bSYour Name * Return: None
249*5113495bSYour Name */
250*5113495bSYour Name void mlo_update_wsi_stats_info_support(struct wlan_objmgr_psoc *psoc,
251*5113495bSYour Name bool wsi_stats_info_support);
252*5113495bSYour Name
253*5113495bSYour Name /**
254*5113495bSYour Name * mlo_get_wsi_stats_info_support() - API to get whether WSI stats info
255*5113495bSYour Name * support
256*5113495bSYour Name * @psoc: Pointer to psoc object
257*5113495bSYour Name *
258*5113495bSYour Name * Return: 1 enable
259*5113495bSYour Name * 0 disable
260*5113495bSYour Name */
261*5113495bSYour Name uint8_t mlo_get_wsi_stats_info_support(struct wlan_objmgr_psoc *psoc);
262*5113495bSYour Name
263*5113495bSYour Name /**
264*5113495bSYour Name * mlo_update_tsf_sync_support() - API to update TSF sync support per MLO
265*5113495bSYour Name * group.
266*5113495bSYour Name *
267*5113495bSYour Name * @psoc: Pointer to psoc object
268*5113495bSYour Name * @tsf_sync_enab: Indicates TSF sync is to be enabled or not
269*5113495bSYour Name *
270*5113495bSYour Name * Return: None
271*5113495bSYour Name */
272*5113495bSYour Name void mlo_update_tsf_sync_support(struct wlan_objmgr_psoc *psoc,
273*5113495bSYour Name bool tsf_sync_enab);
274*5113495bSYour Name
275*5113495bSYour Name /**
276*5113495bSYour Name * mlo_pdev_derive_bridge_link_pdevs() - API to get the list of pdevs
277*5113495bSYour Name * for creating bridge vdevs.
278*5113495bSYour Name *
279*5113495bSYour Name * @pdev: pdev of the mlo group
280*5113495bSYour Name * @pdev_list: list where pdevs for creating bridge vdevs need to be populated
281*5113495bSYour Name *
282*5113495bSYour Name * Return: true if success otherwise false.
283*5113495bSYour Name */
284*5113495bSYour Name bool mlo_pdev_derive_bridge_link_pdevs(struct wlan_objmgr_pdev *pdev,
285*5113495bSYour Name struct wlan_objmgr_pdev **pdev_list);
286*5113495bSYour Name #else
mlo_setup_init(uint8_t total_grp)287*5113495bSYour Name static inline void mlo_setup_init(uint8_t total_grp)
288*5113495bSYour Name {
289*5113495bSYour Name }
290*5113495bSYour Name
mlo_setup_deinit(void)291*5113495bSYour Name static inline void mlo_setup_deinit(void)
292*5113495bSYour Name {
293*5113495bSYour Name }
294*5113495bSYour Name
295*5113495bSYour Name static inline bool
mlo_vdevs_check_single_soc(struct wlan_objmgr_vdev ** wlan_vdev_list,uint8_t vdev_count)296*5113495bSYour Name mlo_vdevs_check_single_soc(struct wlan_objmgr_vdev **wlan_vdev_list,
297*5113495bSYour Name uint8_t vdev_count)
298*5113495bSYour Name {
299*5113495bSYour Name return true;
300*5113495bSYour Name }
301*5113495bSYour Name
302*5113495bSYour Name static inline
mlo_check_all_pdev_state(struct wlan_objmgr_psoc * psoc,uint32_t state)303*5113495bSYour Name QDF_STATUS mlo_check_all_pdev_state(struct wlan_objmgr_psoc *psoc,
304*5113495bSYour Name uint32_t state)
305*5113495bSYour Name {
306*5113495bSYour Name return QDF_STATUS_SUCCESS;
307*5113495bSYour Name }
308*5113495bSYour Name
309*5113495bSYour Name static inline
mlo_psoc_get_grp_id(struct wlan_objmgr_psoc * psoc,uint8_t * grp_id)310*5113495bSYour Name bool mlo_psoc_get_grp_id(struct wlan_objmgr_psoc *psoc, uint8_t *grp_id)
311*5113495bSYour Name {
312*5113495bSYour Name return 0;
313*5113495bSYour Name }
314*5113495bSYour Name
315*5113495bSYour Name static inline
init_deinit_pdev_wsi_stats_info_support(struct wlan_objmgr_psoc * psoc,bool wsi_stats_info_support)316*5113495bSYour Name void init_deinit_pdev_wsi_stats_info_support(struct wlan_objmgr_psoc *psoc,
317*5113495bSYour Name bool wsi_stats_info_support)
318*5113495bSYour Name {
319*5113495bSYour Name }
320*5113495bSYour Name
321*5113495bSYour Name static inline
mlo_update_tsf_sync_support(struct wlan_objmgr_psoc * psoc,bool tsf_sync_enab)322*5113495bSYour Name void mlo_update_tsf_sync_support(struct wlan_objmgr_psoc *psoc,
323*5113495bSYour Name bool tsf_sync_enab)
324*5113495bSYour Name {
325*5113495bSYour Name }
326*5113495bSYour Name #endif /* WLAN_MLO_MULTI_CHIP */
327*5113495bSYour Name #endif /* _WLAN_MLO_MGR_SETUP_H_ */
328