dummy.c 8.0 KB

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