xref: /wlan-dirver/qca-wifi-host-cmn/hif/src/dispatcher/dummy.c (revision 6ecd284e5a94a1c96e26d571dd47419ac305990d)
1 /*
2  * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
3  *
4  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5  *
6  *
7  * Permission to use, copy, modify, and/or distribute this software for
8  * any purpose with or without fee is hereby granted, provided that the
9  * above copyright notice and this permission notice appear in all
10  * copies.
11  *
12  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19  * PERFORMANCE OF THIS SOFTWARE.
20  */
21 
22 /*
23  * This file was originally distributed by Qualcomm Atheros, Inc.
24  * under proprietary terms before Copyright ownership was assigned
25  * to the Linux Foundation.
26  */
27 
28 #include "qdf_types.h"
29 #include "dummy.h"
30 #include "hif_debug.h"
31 
32 /**
33  * hif_dummy_bus_prevent_linkdown() - prevent linkdown
34  * @hif_ctx: hif context
35  * @flag: weather to keep the bus alive or not
36  *
37  * Dummy function for busses and platforms that do not support
38  * link down.  This may need to be replaced with a wakelock.
39  */
40 void hif_dummy_bus_prevent_linkdown(struct hif_softc *scn, bool flag)
41 {
42 	HIF_DBG("wlan: %s pcie power collapse ignored",
43 			(flag ? "disable" : "enable"));
44 }
45 
46 /**
47  * hif_reset_soc(): reset soc
48  *
49  * this function resets soc
50  *
51  * @hif_ctx: HIF context
52  *
53  * Return: void
54  */
55 /* Function to reset SoC */
56 void hif_dummy_reset_soc(struct hif_softc *hif_ctx)
57 {
58 }
59 
60 /**
61  * hif_dummy_suspend() - suspend the bus
62  * @hif_ctx: hif context
63  *
64  * dummy for busses that don't need to suspend.
65  *
66  * Return: 0 for success and non-zero for failure
67  */
68 int hif_dummy_bus_suspend(struct hif_softc *hif_ctx)
69 {
70 	return 0;
71 }
72 
73 /**
74  * hif_dummy_resume() - hif resume API
75  *
76  * This function resumes the bus. but snoc doesn't need to resume.
77  * Therefore do nothing.
78  *
79  * Return: 0 for success and non-zero for failure
80  */
81 int hif_dummy_bus_resume(struct hif_softc *hif_ctx)
82 {
83 	return 0;
84 }
85 
86 /**
87  * hif_dummy_suspend_noirq() - suspend the bus
88  * @hif_ctx: hif context
89  *
90  * dummy for busses that don't need to syncronize
91  * with interrupt disable.
92  *
93  * Return: 0 for success and non-zero for failure
94  */
95 int hif_dummy_bus_suspend_noirq(struct hif_softc *hif_ctx)
96 {
97 	return 0;
98 }
99 
100 /**
101  * hif_dummy_resume_noirq() - resume the bus
102  * @hif_ctx: hif context
103  *
104  * dummy for busses that don't need to syncronize
105  * with interrupt disable.
106  *
107  * Return: 0 for success and non-zero for failure
108  */
109 int hif_dummy_bus_resume_noirq(struct hif_softc *hif_ctx)
110 {
111 	return 0;
112 }
113 
114 /**
115  * hif_dummy_target_sleep_state_adjust() - api to adjust state of target
116  * @scn: hif context
117  * @sleep_ok: allow or deny target to go to sleep
118  * @wait_for_it: ensure target has change
119  */
120 int hif_dummy_target_sleep_state_adjust(struct hif_softc *scn,
121 						bool sleep_ok, bool wait_for_it)
122 {
123 	return 0;
124 }
125 
126 /**
127  * hif_dummy_enable_power_management - dummy call
128  * hif_ctx: hif context
129  * is_packet_log_enabled: true if packet log is enabled
130  */
131 void hif_dummy_enable_power_management(struct hif_softc *hif_ctx,
132 				 bool is_packet_log_enabled)
133 {}
134 
135 /**
136  * hif_dummy_disable_power_management - dummy call
137  * hif_ctx: hif context
138  *
139  * Return: none
140  */
141 void hif_dummy_disable_power_management(struct hif_softc *hif_ctx)
142 {}
143 
144 /**
145  * hif_dummy_disable_isr - dummy call
146  * hif_ctx: hif context
147  *
148  * Return: none
149  */
150 void hif_dummy_disable_isr(struct hif_softc *scn)
151 {}
152 
153 /**
154  * hif_dummy_nointrs - dummy call
155  * hif_sc: hif context
156  *
157  * Return: none
158  */
159 void hif_dummy_nointrs(struct hif_softc *hif_sc)
160 {}
161 
162 /**
163  * hif_dummy_bus_configure - dummy call
164  * hif_ctx: hif context
165  *
166  * Return: 0 for sucess
167  */
168 int hif_dummy_bus_configure(struct hif_softc *hif_sc)
169 {
170 	return 0;
171 }
172 
173 /**
174  * hif_dummy_get_config_item - dummy call
175  * @hif_sc: hif context
176  * @opcode: configuration type
177  * @config: configuration value to set
178  * @config_len: configuration length
179  *
180  * Return: 0 for sucess
181  */
182 QDF_STATUS
183 hif_dummy_get_config_item(struct hif_softc *hif_sc,
184 		     int opcode, void *config, uint32_t config_len)
185 {
186 	return 0;
187 }
188 
189 /**
190  * hif_dummy_set_mailbox_swap - dummy call
191  * @hif_sc: hif context
192  *
193  * Return: None
194  */
195 void
196 hif_dummy_set_mailbox_swap(struct hif_softc *hif_sc)
197 {
198 }
199 
200 /**
201  * hif_dummy_claim_device - dummy call
202  * @hif_sc: hif context
203  *
204  * Return: None
205  */
206 void
207 hif_dummy_claim_device(struct hif_softc *hif_sc)
208 {
209 }
210 
211 /**
212  * hif_dummy_cancel_deferred_target_sleep - dummy call
213  * @hif_sc: hif context
214  *
215  * Return: None
216  */
217 void
218 hif_dummy_cancel_deferred_target_sleep(struct hif_softc *hif_sc)
219 {
220 }
221 
222 /**
223  * hif_dummy_irq_enable - dummy call
224  * hif_ctx: hif context
225  * @irq_id: irq id
226  *
227  * Return: none
228  */
229 void hif_dummy_irq_enable(struct hif_softc *hif_sc, int irq_id)
230 {}
231 
232 /**
233  * hif_dummy_grp_irq_enable - dummy call
234  * hif_ctx: hif context
235  * @irq_id: grp id
236  *
237  * Return: none
238  */
239 void hif_dummy_grp_irq_enable(struct hif_softc *hif_sc, uint32_t grp_id)
240 {}
241 
242 /**
243  * hif_dummy_irq_disable - dummy call
244  * hif_ctx: hif context
245  * @irq_id: irq id
246  *
247  * Return: none
248  */
249 void hif_dummy_irq_disable(struct hif_softc *hif_sc, int irq_id)
250 {}
251 
252 /**
253  * hif_dummy_grp_irq_disable- dummy call
254  * hif_ctx: hif context
255  * @grp_id: grp id
256  *
257  * Return: none
258  */
259 void hif_dummy_grp_irq_disable(struct hif_softc *hif_sc, uint32_t grp_id)
260 {}
261 
262 /**
263  * hif_dummy_grp_irq_configure - dummy call
264  * hif_ctx: hif context
265  *
266  * Return: none
267  */
268 int hif_dummy_grp_irq_configure(struct hif_softc *hif_sc,
269 				struct hif_exec_context *exec)
270 {
271     return 0;
272 }
273 
274 /**
275  * hif_dummy_dump_registers - dummy call
276  * hif_sc: hif context
277  *
278  * Return: 0 for success
279  */
280 int hif_dummy_dump_registers(struct hif_softc *hif_sc)
281 {
282 	return 0;
283 }
284 
285 /**
286  * hif_dummy_dump_target_memory - dummy call
287  * @hif_sc: hif context
288  * @ramdump_base: base
289  * @address: address
290  * @size: size
291  *
292  * Return: None
293  */
294 void hif_dummy_dump_target_memory(struct hif_softc *hif_sc, void *ramdump_base,
295 						uint32_t address, uint32_t size)
296 {
297 }
298 
299 /**
300  * hif_dummy_ipa_get_ce_resource - dummy call
301  * @scn: HIF context
302  * @ce_sr: copyengine source ring resource info
303  * @sr_ring_size: source ring size
304  * @reg_paddr: bus physical address
305  *
306  * Return: None
307  */
308 void hif_dummy_ipa_get_ce_resource(struct hif_softc *hif_sc,
309 				   qdf_shared_mem_t **ce_sr,
310 				   uint32_t *sr_ring_size,
311 				   qdf_dma_addr_t *reg_paddr)
312 {
313 }
314 
315 /**
316  * hif_dummy_mask_interrupt_call - dummy call
317  * @hif_sc: hif context
318  *
319  * Return: None
320  */
321 void
322 hif_dummy_mask_interrupt_call(struct hif_softc *hif_sc)
323 {
324 }
325 
326 /**
327  * hif_dummy_display_stats - dummy call
328  * hif_ctx: hif context
329  *
330  * Return: none
331  */
332 void hif_dummy_display_stats(struct hif_softc *hif_ctx)
333 {}
334 
335 /**
336  * hif_dummy_clear_stats - dummy call
337  * hif_ctx: hif context
338  *
339  * Return: none
340  */
341 void hif_dummy_clear_stats(struct hif_softc *hif_ctx)
342 {}
343 /**
344  * hif_dummy_set_bundle_mode() - dummy call
345  * @hif_sc: hif context
346  * @enabled: flag to enable/disable bundling
347  * @rx_bundle_cnt: bundle count to be used for RX
348  *
349  * Return: none
350  */
351 void hif_dummy_set_bundle_mode(struct hif_softc *hif_ctx,
352 					bool enabled, int rx_bundle_cnt)
353 {
354 }
355 
356 /**
357  * hif_dummy_bus_reset_resume() - dummy call
358  * @hif_sc: hif context
359  *
360  * Return: int 0 for success, non zero for failure
361  */
362 int hif_dummy_bus_reset_resume(struct hif_softc *hif_ctx)
363 {
364 	return 0;
365 }
366 
367 int hif_dummy_map_ce_to_irq(struct hif_softc *scn, int ce_id)
368 {
369 	HIF_ERROR("%s: hif_map_ce_to_irq is not implemented on this platform",
370 		  __func__);
371 	QDF_BUG(0);
372 	return -(1);
373 }
374 
375 int hif_dummy_addr_in_boundary(struct hif_softc *scn, uint32_t offset)
376 {
377 	return 0;
378 }
379 
380