dummy.c 9.2 KB

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