cdp_txrx_bus.h 3.3 KB

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