cdp_txrx_bus.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*
  2. * Copyright (c) 2016-2017, 2019-2020 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2023 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. /**
  20. * DOC: cdp_txrx_bus.h
  21. * Define the host data path bus related functions
  22. */
  23. #ifndef _CDP_TXRX_BUS_H_
  24. #define _CDP_TXRX_BUS_H_
  25. /**
  26. * cdp_bus_suspend() - suspend bus
  27. * @soc: data path soc handle
  28. * @pdev_id: id of dp pdev handle
  29. *
  30. * suspend bus
  31. *
  32. * return QDF_STATUS_SUCCESS suspend is not implemented or suspend done
  33. */
  34. static inline QDF_STATUS cdp_bus_suspend(ol_txrx_soc_handle soc,
  35. uint8_t pdev_id)
  36. {
  37. if (!soc || !soc->ops || !soc->ops->bus_ops) {
  38. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  39. "%s invalid instance", __func__);
  40. return QDF_STATUS_E_INVAL;
  41. }
  42. if (soc->ops->bus_ops->bus_suspend)
  43. return soc->ops->bus_ops->bus_suspend(soc, pdev_id);
  44. return QDF_STATUS_E_NOSUPPORT;
  45. }
  46. /**
  47. * cdp_bus_resume() - resume bus
  48. * @soc: data path soc handle
  49. * @pdev_id: id of dp pdev handle
  50. *
  51. * resume bus
  52. *
  53. * return QDF_STATUS_SUCCESS resume is not implemented or suspend done
  54. */
  55. static inline QDF_STATUS cdp_bus_resume(ol_txrx_soc_handle soc,
  56. uint8_t pdev_id)
  57. {
  58. if (!soc || !soc->ops || !soc->ops->bus_ops) {
  59. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  60. "%s invalid instance", __func__);
  61. return QDF_STATUS_E_INVAL;
  62. }
  63. if (soc->ops->bus_ops->bus_resume)
  64. return soc->ops->bus_ops->bus_resume(soc, pdev_id);
  65. return QDF_STATUS_E_NOSUPPORT;
  66. }
  67. /**
  68. * cdp_process_wow_ack_rsp() - Process wow ack response
  69. * @soc: data path soc handle
  70. * @pdev_id: id of dp pdev handle
  71. *
  72. * Do any required data path operations for target wow ack
  73. * suspend response.
  74. *
  75. * Return: None
  76. */
  77. static inline void cdp_process_wow_ack_rsp(ol_txrx_soc_handle soc,
  78. uint8_t pdev_id)
  79. {
  80. if (!soc || !soc->ops || !soc->ops->bus_ops) {
  81. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  82. "%s invalid instance", __func__);
  83. return;
  84. }
  85. if (soc->ops->bus_ops->process_wow_ack_rsp)
  86. return soc->ops->bus_ops->process_wow_ack_rsp(soc, pdev_id);
  87. }
  88. /**
  89. * cdp_process_target_suspend_req() - Process target suspend request
  90. * @soc: data path soc handle
  91. * @pdev_id: id of dp pdev handle
  92. *
  93. * Complete the datapath specific work before target suspend
  94. *
  95. * Return: None
  96. */
  97. static inline void cdp_process_target_suspend_req(ol_txrx_soc_handle soc,
  98. uint8_t pdev_id)
  99. {
  100. if (!soc || !soc->ops || !soc->ops->bus_ops) {
  101. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  102. "%s invalid instance", __func__);
  103. return;
  104. }
  105. if (soc->ops->bus_ops->process_target_suspend_req)
  106. return soc->ops->bus_ops->process_target_suspend_req(soc,
  107. pdev_id);
  108. }
  109. #endif /* _CDP_TXRX_BUS_H_ */