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