xref: /wlan-dirver/qca-wifi-host-cmn/umac/mlo_mgr/inc/wlan_mlo_mgr_setup.h (revision d0c05845839e5f2ba5a8dcebe0cd3e4cd4e8dfcf)
1 /* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
2  *
3  * Permission to use, copy, modify, and/or distribute this software for any
4  * purpose with or without fee is hereby granted, provided that the above
5  * copyright notice and this permission notice appear in all copies.
6  *
7  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14  */
15 
16 /*
17  * DOC: contains MLO manager public file containing setup/teardown functionality
18  */
19 
20 #ifndef _WLAN_MLO_MGR_SETUP_H_
21 #define _WLAN_MLO_MGR_SETUP_H_
22 #ifdef WLAN_MLO_MULTI_CHIP
23 /**
24  * mlo_setup_init() - API to init setup info events
25  *
26  * Return: None
27  */
28 void mlo_setup_init(void);
29 
30 /**
31  * mlo_setup_deinit() - API to deinit setup info events
32  *
33  * Return: None
34  */
35 void mlo_setup_deinit(void);
36 
37 /**
38  * mlo_is_ml_soc() - API to check if psoc belongs to ML group
39  * @psoc: Soc to be checked.
40  *
41  * Return: true if psoc found in ml soc_list, or else return false
42  */
43 bool mlo_is_ml_soc(struct wlan_objmgr_psoc *psoc);
44 
45 /**
46  * mlo_get_soc_list() - API to get the list of SOCs participating in MLO
47  * @soc_list: list where ML participating SOCs need to be populated
48  *
49  * Return: None
50  */
51 void mlo_get_soc_list(struct wlan_objmgr_psoc **soc_list);
52 
53 /**
54  * mlo_cleanup_asserted_soc_setup_info() - API to cleanup the mlo setup info of
55  * asserted soc
56  * @psoc: Soc to be cleaned up
57  *
58  * Return: None
59  */
60 void mlo_cleanup_asserted_soc_setup_info(struct wlan_objmgr_psoc *psoc);
61 
62 /**
63  * mlo_setup_update_total_socs() - API to update total socs for mlo
64  * @tot_socs: Total socs
65  *
66  * Return: None.
67  */
68 void mlo_setup_update_total_socs(uint8_t tot_socs);
69 
70 /**
71  * mlo_setup_update_num_links() - API to update num links in soc for mlo
72  * @soc_id: soc object of SoC corresponding to num_link
73  * @num_links: Number of links in that soc
74  *
75  * Return: None.
76  */
77 void mlo_setup_update_num_links(struct wlan_objmgr_psoc *psoc,
78 				uint8_t num_links);
79 
80 /**
81  * mlo_setup_update_soc_ready() - API to notify when FW init done
82  * @psoc: soc object of SoC ready
83  *
84  * Return: None.
85  */
86 void mlo_setup_update_soc_ready(struct wlan_objmgr_psoc *psoc);
87 
88 /**
89  * mlo_setup_link_ready() - API to notify link ready
90  * @pdev: Pointer to pdev object
91  *
92  * Return: None.
93  */
94 void mlo_setup_link_ready(struct wlan_objmgr_pdev *pdev);
95 
96 /**
97  * mlo_link_setup_complete() - API to notify setup complete
98  * @pdev: Pointer to pdev object
99  *
100  * Return: None.
101  */
102 void mlo_link_setup_complete(struct wlan_objmgr_pdev *pdev);
103 
104 /**
105  * mlo_link_teardown_complete() - API to notify teardown complete
106  * @pdev: Pointer to pdev object
107  *
108  * Return: None.
109  */
110 void mlo_link_teardown_complete(struct wlan_objmgr_pdev *pdev);
111 
112 /**
113  * mlo_setup_update_soc_down() - API to check and clear all links and bring
114  *                               back to initial state for the particular soc
115  *
116  * @pdev: Pointer to pdev object
117  *
118  * Return: None.
119  */
120 void mlo_setup_update_soc_down(struct wlan_objmgr_psoc *psoc);
121 
122 /**
123  * mlo_link_teardown_link() - API to trigger teardown
124  * @psoc: Pointer to psoc object
125  * @reason: Reason code for MLO tear down
126  *
127  * Return: QDF_STATUS - success / failure.
128  */
129 QDF_STATUS mlo_link_teardown_link(struct wlan_objmgr_psoc *psoc,
130 				  uint32_t reason);
131 
132 /**
133  * mlo_vdevs_check_single_soc() - API to check all the vaps in vdev list
134  *                                belong to single soc or not
135  * @wlan_vdev_list: List of all vdevs to check
136  * @vdev_count: Number of vdevs in the list
137  *
138  * Return: bool: True if belongs to single soc else false
139  */
140 bool mlo_vdevs_check_single_soc(struct wlan_objmgr_vdev **wlan_vdev_list,
141 				uint8_t vdev_count);
142 
143 /**
144  * mlo_check_all_pdev_state() - API to check all the pdev of the soc
145  *                              are on the same expected state.
146  *
147  * @psoc: Pointer to psoc object
148  * @state: Expected link state to be verified
149  *
150  * Return: QDF_STATUS: QDF_STATUS_SUCCESS if all belongs to same state
151  */
152 QDF_STATUS mlo_check_all_pdev_state(struct wlan_objmgr_psoc *psoc,
153 				    enum MLO_LINK_STATE state);
154 #else
155 static inline void mlo_setup_init(void)
156 {
157 }
158 
159 static inline void mlo_setup_deinit(void)
160 {
161 }
162 
163 static inline bool
164 mlo_vdevs_check_single_soc(struct wlan_objmgr_vdev **wlan_vdev_list,
165 			   uint8_t vdev_count)
166 {
167 	return true;
168 }
169 
170 static inline
171 QDF_STATUS mlo_check_all_pdev_state(struct wlan_objmgr_psoc *psoc,
172 				    uint32_t state)
173 {
174 	return QDF_STATUS_SUCCESS;
175 }
176 #endif /* WLAN_MLO_MULTI_CHIP */
177 #endif /* _WLAN_MLO_MGR_SETUP_H_ */
178