xref: /wlan-dirver/qca-wifi-host-cmn/target_if/init_deinit/inc/init_deinit_lmac.h (revision 4865edfd190c086bbe2c69aae12a8226f877b91e)
1 /*
2  * Copyright (c) 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 /**
20  * DOC: init_deinit_lmac.h
21  *
22  * Public APIs to get target_if info
23  */
24 
25 #ifndef _INIT_DEINIT_LMAC_H_
26 #define _INIT_DEINIT_LMAC_H_
27 
28 /**
29  * lmac_get_service_param() - get service param
30  * @psoc: pointer to psoc
31  *
32  * API to get service parameters
33  *
34  * Return: service parameter array pointer
35  */
36 uint32_t *lmac_get_service_param(struct wlan_objmgr_psoc *psoc);
37 
38 /**
39  * lmac_is_service_param_bit_enabled() - check service param bit enabled
40  * @service_param: Service bitmap array
41  * @bit_idx: Service bit index to be checked
42  *
43  * API to check service param bitmap
44  *
45  * Return: true, if service is enabled
46  *         false, if service is not enabled
47  */
48 bool lmac_is_service_param_bit_enabled(uint32_t *service_param,
49 					uint16_t bit_idx);
50 
51 /**
52  * lmac_get_dfs_offload() - get dfs offload
53  * @psoc: pointer to psoc
54  * @is_tgt_offload: boolean flag for offload enabled/disabled
55  *
56  * API to get dfs offload
57  *
58  * Return: SUCCESS, if API is invoked without any failures
59  */
60 QDF_STATUS lmac_get_dfs_offload(struct wlan_objmgr_psoc *psoc,
61 			bool *is_tgt_offload);
62 
63 /**
64  * lmac_get_tgt_res_cfg() - get target resource config
65  * @psoc: pointer to psoc
66  *
67  * API to get target resource config
68  *
69  * Return: target resource configuration
70  */
71 target_resource_config *lmac_get_tgt_res_cfg(struct wlan_objmgr_psoc *psoc);
72 
73 /**
74  * lmac_get_target_cap() - get target capability
75  * @psoc: pointer to psoc
76  *
77  * API to get target capability
78  *
79  * Return: target capability Information
80  */
81 struct wlan_psoc_target_capability_info *lmac_get_target_cap(
82 				struct wlan_objmgr_psoc *psoc);
83 
84 /**
85  * lmac_get_pdev_idx() - get pdev id
86  * @pdev: pointer to pdev
87  *
88  * API to get pdev id
89  *
90  * Return: pdev id
91  */
92 int32_t lmac_get_pdev_idx(struct wlan_objmgr_pdev *pdev);
93 
94 /**
95  * lmac_get_pdev_target_type() - check pdev target type
96  * @pdev: pointer to pdev
97  * @target_type: target type ptr, it is assigned with pdev target_type
98  *               target type stores the radio code
99  *
100  * API to check pdev target type
101  *
102  * Return: Success if found required target type else Failure
103  */
104 QDF_STATUS lmac_get_pdev_target_type(struct wlan_objmgr_pdev *pdev,
105 				uint32_t *target_type);
106 
107 /**
108  * lmac_get_tgt_type() - get target type
109  * @psoc: pointer to psoc
110  *
111  * API to get target type
112  *
113  * Return: target type (value to identify particular radio)
114  */
115 uint32_t lmac_get_tgt_type(struct wlan_objmgr_psoc *psoc);
116 
117 /**
118  * lmac_get_tgt_version() - get target version
119  * @psoc: pointer to psoc
120  *
121  * API to get target version
122  *
123  * Return: target version
124  */
125 uint32_t lmac_get_tgt_version(struct wlan_objmgr_psoc *psoc);
126 
127 /**
128  * lmac_get_tgt_revision() - get target revision
129  * @psoc: pointer to psoc
130  *
131  * API to get target revision
132  *
133  * Return: target revision
134  */
135 uint32_t lmac_get_tgt_revision(struct wlan_objmgr_psoc *psoc);
136 
137 /**
138  * lmac_is_target_ar900b() - checks the target type
139  * @psoc: pointer to psoc
140  *
141  * API to check target type
142  *
143  * Return: True on presence of required target type else false
144  */
145 bool lmac_is_target_ar900b(struct wlan_objmgr_psoc *psoc);
146 
147 /**
148  * lmac_get_wmi_hdl() - get wmi handle
149  * @psoc: pointer to psoc
150  *
151  * API to get wmi handle
152  *
153  * Return: wmi handler
154  */
155 struct common_wmi_handle *lmac_get_wmi_hdl(struct wlan_objmgr_psoc *psoc);
156 
157 /**
158  * lmac_get_wmi_unified_hdl() - get wmi handle
159  * @psoc: pointer to psoc
160  *
161  * API to get wmi handle
162  *
163  * Return: wmi handler
164  */
165 wmi_unified_t lmac_get_wmi_unified_hdl(struct wlan_objmgr_psoc *psoc);
166 
167 /**
168  * lmac_get_htc_hdl() - get htc handler
169  * @psoc: pointer to psoc
170  *
171  * API to get htc handle
172  *
173  * Return: htc handler
174  */
175 struct common_htc_handle *lmac_get_htc_hdl(struct wlan_objmgr_psoc *psoc);
176 
177 /**
178  * lmac_set_htc_hdl() - set htc handle
179  * @psoc: pointer to psoc
180  * @htc_hdl: HTC handle
181  *
182  * API to set htc handle
183  *
184  * Return: void
185  */
186 void lmac_set_htc_hdl(struct wlan_objmgr_psoc *psoc,
187 		struct common_htc_handle *htc_hdl);
188 
189 /**
190  * lmac_get_hif_hdl() - get hif handle
191  * @psoc: pointer to psoc
192  *
193  * API to get hif handle
194  *
195  * Return: hif handler
196  */
197 struct common_hif_handle *lmac_get_hif_hdl(struct wlan_objmgr_psoc *psoc);
198 
199 /**
200  * lmac_get_ol_hif_hdl() - get hif handle
201  * @psoc: pointer to psoc
202  *
203  * API to get hif handle
204  *
205  * Return: hif handler
206  */
207 struct hif_opaque_softc *lmac_get_ol_hif_hdl(struct wlan_objmgr_psoc *psoc);
208 
209 /**
210  * lmac_get_pdev_wmi_handle() - get pdev wmi handle
211  * @pdev: pointer to dev
212  *
213  * API to get wmi handle
214  *
215  * Return: wmi handle
216  */
217 struct common_wmi_handle *lmac_get_pdev_wmi_handle(
218 		struct wlan_objmgr_pdev *pdev);
219 
220 /**
221  * lmac_get_pdev_wmi_unified_handle() - get pdev wmi handle
222  * @pdev: pointer to dev
223  *
224  * API to get wmi handle
225  *
226  * Return: wmi handle
227  */
228 wmi_unified_t lmac_get_pdev_wmi_unified_handle(
229 		struct wlan_objmgr_pdev *pdev);
230 
231 /**
232  * lmac_get_psoc_feature_ptr() - get feature pointer
233  * @psoc: pointer to psoc
234  *
235  * API to get legacy pointer
236  *
237  * Return: feature pointer
238  */
239 void *lmac_get_psoc_feature_ptr(struct wlan_objmgr_psoc *psoc);
240 
241 /**
242  * lmac_get_pdev_feature_ptr() - get feature pointer
243  * @pdev: pointer to pdev
244  *
245  * API to get legacy pointer
246  *
247  * Return: pdev feature pointer
248  */
249 void *lmac_get_pdev_feature_ptr(struct wlan_objmgr_pdev *pdev);
250 
251 /**
252  * lmac_get_num_radios() - get number of radios
253  * @psoc: pointer to psoc
254  *
255  * API to get number of radios
256  *
257  * Return: number of radios
258  */
259 uint32_t lmac_get_num_radios(struct wlan_objmgr_psoc *psoc);
260 
261 #endif /* _INIT_DEINIT_LMAC_H_ */
262