1 /*
2  * Copyright (c) 2018-2019 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_tgt_res_cfg() - get target resource config
30  * @psoc: pointer to psoc
31  *
32  * API to get target resource config
33  *
34  * Return: target resource configuration
35  */
36 target_resource_config *lmac_get_tgt_res_cfg(struct wlan_objmgr_psoc *psoc);
37 
38 /**
39  * lmac_get_target_cap() - get target capability
40  * @psoc: pointer to psoc
41  *
42  * API to get target capability
43  *
44  * Return: target capability Information
45  */
46 struct wlan_psoc_target_capability_info *lmac_get_target_cap(
47 				struct wlan_objmgr_psoc *psoc);
48 
49 /**
50  * lmac_get_pdev_idx() - get pdev id
51  * @pdev: pointer to pdev
52  *
53  * API to get pdev id
54  *
55  * Return: pdev id
56  */
57 int32_t lmac_get_pdev_idx(struct wlan_objmgr_pdev *pdev);
58 
59 /**
60  * lmac_get_pdev_target_type() - check pdev target type
61  * @pdev: pointer to pdev
62  * @target_type: target type ptr, it is assigned with pdev target_type
63  *               target type stores the radio code
64  *
65  * API to check pdev target type
66  *
67  * Return: Success if found required target type else Failure
68  */
69 QDF_STATUS lmac_get_pdev_target_type(struct wlan_objmgr_pdev *pdev,
70 				uint32_t *target_type);
71 
72 /**
73  * lmac_get_tgt_type() - get target type
74  * @psoc: pointer to psoc
75  *
76  * API to get target type
77  *
78  * Return: target type (value to identify particular radio)
79  */
80 uint32_t lmac_get_tgt_type(struct wlan_objmgr_psoc *psoc);
81 
82 /**
83  * lmac_get_tgt_version() - get target version
84  * @psoc: pointer to psoc
85  *
86  * API to get target version
87  *
88  * Return: target version
89  */
90 uint32_t lmac_get_tgt_version(struct wlan_objmgr_psoc *psoc);
91 
92 /**
93  * lmac_get_tgt_revision() - get target revision
94  * @psoc: pointer to psoc
95  *
96  * API to get target revision
97  *
98  * Return: target revision
99  */
100 uint32_t lmac_get_tgt_revision(struct wlan_objmgr_psoc *psoc);
101 
102 /**
103  * lmac_is_target_ar900b() - checks the target type
104  * @psoc: pointer to psoc
105  *
106  * API to check target type
107  *
108  * Return: True on presence of required target type else false
109  */
110 bool lmac_is_target_ar900b(struct wlan_objmgr_psoc *psoc);
111 
112 /**
113  * lmac_get_wmi_hdl() - get wmi handle
114  * @psoc: pointer to psoc
115  *
116  * API to get wmi handle
117  *
118  * Return: wmi handler
119  */
120 struct wmi_unified *lmac_get_wmi_hdl(struct wlan_objmgr_psoc *psoc);
121 
122 /**
123  * lmac_get_wmi_unified_hdl() - get wmi handle
124  * @psoc: pointer to psoc
125  *
126  * API to get wmi handle
127  *
128  * Return: wmi handler
129  */
130 wmi_unified_t lmac_get_wmi_unified_hdl(struct wlan_objmgr_psoc *psoc);
131 
132 /**
133  * lmac_get_htc_hdl() - get htc handler
134  * @psoc: pointer to psoc
135  *
136  * API to get htc handle
137  *
138  * Return: htc handler
139  */
140 HTC_HANDLE lmac_get_htc_hdl(struct wlan_objmgr_psoc *psoc);
141 
142 /**
143  * lmac_set_htc_hdl() - set htc handle
144  * @psoc: pointer to psoc
145  * @htc_hdl: HTC handle
146  *
147  * API to set htc handle
148  *
149  * Return: void
150  */
151 void lmac_set_htc_hdl(struct wlan_objmgr_psoc *psoc,
152 		      HTC_HANDLE htc_hdl);
153 
154 /**
155  * lmac_get_hif_hdl() - get hif handle
156  * @psoc: pointer to psoc
157  *
158  * API to get hif handle
159  *
160  * Return: hif handler
161  */
162 struct hif_opaque_softc *lmac_get_hif_hdl(struct wlan_objmgr_psoc *psoc);
163 
164 /**
165  * lmac_get_ol_hif_hdl() - get hif handle
166  * @psoc: pointer to psoc
167  *
168  * API to get hif handle
169  *
170  * Return: hif handler
171  */
172 struct hif_opaque_softc *lmac_get_ol_hif_hdl(struct wlan_objmgr_psoc *psoc);
173 
174 /**
175  * lmac_get_pdev_wmi_handle() - get pdev wmi handle
176  * @pdev: pointer to dev
177  *
178  * API to get wmi handle
179  *
180  * Return: wmi handle
181  */
182 struct wmi_unified *lmac_get_pdev_wmi_handle(
183 		struct wlan_objmgr_pdev *pdev);
184 
185 /**
186  * lmac_get_pdev_wmi_unified_handle() - get pdev wmi handle
187  * @pdev: pointer to dev
188  *
189  * API to get wmi handle
190  *
191  * Return: wmi handle
192  */
193 wmi_unified_t lmac_get_pdev_wmi_unified_handle(
194 		struct wlan_objmgr_pdev *pdev);
195 
196 /**
197  * lmac_get_psoc_feature_ptr() - get feature pointer
198  * @psoc: pointer to psoc
199  *
200  * API to get legacy pointer
201  *
202  * Return: feature pointer
203  */
204 void *lmac_get_psoc_feature_ptr(struct wlan_objmgr_psoc *psoc);
205 
206 /**
207  * lmac_get_pdev_feature_ptr() - get feature pointer
208  * @pdev: pointer to pdev
209  *
210  * API to get legacy pointer
211  *
212  * Return: pdev feature pointer
213  */
214 void *lmac_get_pdev_feature_ptr(struct wlan_objmgr_pdev *pdev);
215 
216 /**
217  * lmac_get_num_radios() - get number of radios
218  * @psoc: pointer to psoc
219  *
220  * API to get number of radios
221  *
222  * Return: number of radios
223  */
224 uint32_t lmac_get_num_radios(struct wlan_objmgr_psoc *psoc);
225 
226 /**
227  * lmac_get_preferred_hw_mode() - get preferred hw mode
228  * @psoc: pointer to psoc
229  *
230  * API to get the preferred hw mode
231  *
232  * Return: preferred how mode
233  */
234 enum wmi_host_hw_mode_config_type lmac_get_preferred_hw_mode(
235 				struct wlan_objmgr_psoc *psoc);
236 
237 #endif /* _INIT_DEINIT_LMAC_H_ */
238