xref: /wlan-dirver/qca-wifi-host-cmn/target_if/init_deinit/inc/service_ready_util.h (revision 3149adf58a329e17232a4c0e58d460d025edd55a)
1 /*
2  * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 /**
19  * DOC: service_ready_util.h
20  *
21  * Public APIs to access (ext)service ready data from psoc object
22  */
23 #ifndef _SERVICE_READY_UTIL_H_
24 #define _SERVICE_READY_UTIL_H_
25 
26 #include "wlan_objmgr_psoc_obj.h"
27 #include "service_ready_param.h"
28 #include "target_if.h"
29 
30 /**
31  * init_deinit_chainmask_table_alloc()
32  *	- allocate chainmask table capability list.
33  * @service_ext_param: pointer to server ext param.
34  *
35  * Allocates capability list based on num_valid_chainmasks for that table.
36  *
37  * Return: QDF Status.
38  */
39 QDF_STATUS init_deinit_chainmask_table_alloc(
40 		struct wlan_psoc_host_service_ext_param *service_ext_param);
41 
42 /**
43  * init_deinit_chainmask_table_free()
44  *	-free chainmask table capability list.
45  * @service_ext_param: pointer to server ext param.
46  *
47  * free capability list based on num_valid_chainmasks for that table.
48  *
49  * Return: QDF Status.
50  */
51 QDF_STATUS init_deinit_chainmask_table_free(
52 		struct wlan_psoc_host_service_ext_param *service_ext_param);
53 
54 /**
55  * init_deinit_populate_service_bitmap() - populate service bitmap
56  * @wmi_handle: wmi handle
57  * @event: event buffer received from FW
58  * @service_bitmap: service bitmap information
59  *
60  * API to populate service bit map
61  *
62  * Return: zero on successful population of service bitmap or failure flag
63  */
64 int init_deinit_populate_service_bitmap(void *wmi_handle, uint8_t *event,
65 				      uint32_t *service_bitmap);
66 
67 /**
68  * init_deinit_populate_fw_version_cmd() - populate FW version
69  * @wmi_handle: wmi handle
70  * @event: event buffer received from FW
71  *
72  * API to populate FW version
73  *
74  * Return: zero on successful population of fw_version command or failure flag
75  */
76 int init_deinit_populate_fw_version_cmd(void *wmi_handle, uint8_t *event);
77 
78 /**
79  * init_deinit_populate_target_cap() - populate target cap
80  * @wmi_handle: wmi handle
81  * @event: event buffer received from FW
82  * @cap: target capability info object
83  *
84  * API to populate target cap
85  *
86  * Return: zero on successful population of target cap or failure flag
87  */
88 int init_deinit_populate_target_cap(void *wmi_handle, uint8_t *event,
89 			       struct wlan_psoc_target_capability_info *cap);
90 
91 /**
92  * init_deinit_populate_service_ready_ext_param() - populate service ready ext
93  *                                                  parameter
94  * @handle: WMI handle pointer
95  * @evt: event buffer received from FW
96  * @param: service ext param object
97  *
98  * API to populate service ready ext param
99  *
100  * Return: zero on successful parsing of service ready ext parameter or failure
101  */
102 int init_deinit_populate_service_ready_ext_param(void *handle, uint8_t *evt,
103 			struct wlan_psoc_host_service_ext_param *param);
104 
105 /**
106  * init_deinit_populate_chainmask_tables() - populate chainmaks tables
107  * @handle: WMI handle pointer
108  * @evt: event buffer received from FW
109  * @param: chainmaks_table object
110  *
111  * API to populate chainmaks tables
112  *
113  * Return: zero on successful parsing of chainmaks tables or failure flag
114  */
115 int init_deinit_populate_chainmask_tables(void *handle, uint8_t *evt,
116 		struct wlan_psoc_host_chainmask_table *param);
117 
118 /**
119  * init_deinit_populate_mac_phy_capability() - populate mac phy capability
120  * @handle: WMI handle pointer
121  * @evt: event buffer received from FW
122  * @hw_cap: hw_mode_caps object
123  * @info: tgt_info object
124  *
125  * API to populate mac phy capability
126  *
127  * Return: zero on successful population of mac physical capability or failure
128  */
129 int init_deinit_populate_mac_phy_capability(void *handle, uint8_t *evt,
130 	struct wlan_psoc_host_hw_mode_caps *hw_cap, struct tgt_info *info);
131 
132 /**
133  * init_deinit_populate_hw_mode_capability() - populate hw mode capability
134  * @wmi_handle: WMI handle pointer
135  * @event: event buffer received from FW
136  * @tgt_hdl: target_psoc_info object
137  *
138  * API to populate hw mode capability
139  *
140  * Return: zero on successful parsing of hw mode capability or failure
141  */
142 int init_deinit_populate_hw_mode_capability(void *wmi_handle,
143 		uint8_t *event, struct target_psoc_info *tgt_hdl);
144 
145 /**
146  * init_deinit_populate_dbr_ring_cap() - populate dbr ring capability
147  * @psoc: PSOC object
148  * @handle: WMI handle pointer
149  * @event: event buffer received from FW
150  * @info: tgt_info object
151  *
152  * API to populate dbr ring capability
153  *
154  * Return: zero on successful parsing of dbr ring capability or failure
155  */
156 int init_deinit_populate_dbr_ring_cap(struct wlan_objmgr_psoc *psoc,
157 				void *handle, uint8_t *event,
158 				struct tgt_info *info);
159 
160 /**
161  * init_deinit_populate_phy_reg_cap() - populate phy reg capability
162  * @psoc: PSOC object
163  * @wmi_handle: WMI handle pointer
164  * @event: event buffer received from FW
165  * @info: tgt_info object
166  * @service_ready: service ready determiner
167  *
168  * API to populate phy reg capability
169  *
170  * Return: zero on successful parsing of physical reg capability or failure flag
171  */
172 int init_deinit_populate_phy_reg_cap(struct wlan_objmgr_psoc *psoc,
173 				void *wmi_handle, uint8_t *event,
174 				struct tgt_info *info, bool service_ready);
175 
176 /**
177  * init_deinit_validate_160_80p80_fw_caps() - validate 160 80p80 fw caps
178  * @psoc: PSOC object
179  * @tgt_info: target_psoc_info object
180  *
181  * API to validate 160 80p80 fw caps
182  *
183  * Return: SUCCESS on successful validation of 160 80p80 forward caps or Failure
184  */
185 QDF_STATUS init_deinit_validate_160_80p80_fw_caps(
186 		 struct wlan_objmgr_psoc *psoc,
187 		 struct target_psoc_info *tgt_info);
188 
189 /**
190  * init_deinit_chainmask_config() - config chainmask
191  * @psoc: PSOC object
192  * @tgt_info: target_psoc_info object
193  *
194  * API to config chainmask
195  *
196  * Return: none
197  */
198 void init_deinit_chainmask_config(
199 		 struct wlan_objmgr_psoc *psoc,
200 		 struct target_psoc_info *tgt_info);
201 
202 /**
203  * init_deinit_is_service_ext_msg() - check service ext message
204  * @psoc: PSOC object
205  * @tgt_info: target_psoc_info object
206  *
207  * API to check whether service ext message is enabled
208  *
209  * Return: SUCCESS on successful check of service_ext message or Failure
210  */
211 QDF_STATUS init_deinit_is_service_ext_msg(
212 		 struct wlan_objmgr_psoc *psoc,
213 		 struct target_psoc_info *tgt_info);
214 /**
215  * init_deinit_is_preferred_hw_mode_supported() - check support of preferred
216  *                                                hw mode
217  * @psoc: PSOC object
218  * @tgt_info: target_psoc_info object
219  *
220  * API to check whether preferred hardware mode is enabled
221  *
222  * Return: True on support of preferred hardware support or False
223  */
224 bool init_deinit_is_preferred_hw_mode_supported(
225 		 struct wlan_objmgr_psoc *psoc,
226 		 struct target_psoc_info *tgt_info);
227 
228 /**
229  * init_deinit_wakeup_host_wait() - wakeup host wait
230  * @psoc: PSOC object
231  * @tgt_info: target_psoc_info object
232  *
233  * API to wakeup FW ready wait queue
234  *
235  * Return: None
236  */
237 void init_deinit_wakeup_host_wait(
238 		 struct wlan_objmgr_psoc *psoc,
239 		 struct target_psoc_info *tgt_info);
240 
241 #endif /* _SERVICE_READY_UTIL_H_*/
242