dp_rh.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /*
  2. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. 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. #ifndef __DP_RH_H
  19. #define __DP_RH_H
  20. #include <dp_types.h>
  21. #include <dp_mon.h>
  22. #include <dp_htt.h>
  23. #include <hal_rh_tx.h>
  24. #include <hal_rh_rx.h>
  25. #include <qdf_pkt_add_timestamp.h>
  26. #include "dp_rh_tx.h"
  27. /**
  28. * struct dp_soc_rh - Extended DP soc for RH targets
  29. * @soc: dp soc structure
  30. * @tcl_desc_pool: A pool of TCL descriptors that are allocated for RH targets
  31. * @tx_endpoint: HTC endpoint ID for TX
  32. */
  33. struct dp_soc_rh {
  34. struct dp_soc soc;
  35. struct dp_tx_tcl_desc_pool_s tcl_desc_pool[MAX_TXDESC_POOLS];
  36. HTC_ENDPOINT_ID tx_endpoint;
  37. };
  38. /**
  39. * struct dp_tx_ep_info_rh - TX endpoint info
  40. * @tx_endpoint: HTC endpoint ID for TX
  41. * @ce_tx_hdl: CE TX handle for enqueueing TX commands
  42. * @download_len: Length of the packet that gets downloaded over CE
  43. */
  44. struct dp_tx_ep_info_rh {
  45. HTC_ENDPOINT_ID tx_endpoint;
  46. struct CE_handle *ce_tx_hdl;
  47. uint32_t download_len;
  48. };
  49. /**
  50. * struct dp_pdev_rh - Extended DP pdev for RH targets
  51. * @pdev: dp_pdev structure
  52. * @tx_ep_info: TX endpoint info
  53. */
  54. struct dp_pdev_rh {
  55. struct dp_pdev pdev;
  56. struct dp_tx_ep_info_rh tx_ep_info;
  57. };
  58. /**
  59. * struct dp_vdev_rh - Extended DP vdev for RH targets
  60. * @vdev: dp_vdev structure
  61. */
  62. struct dp_vdev_rh {
  63. struct dp_vdev vdev;
  64. };
  65. /**
  66. * struct dp_peer_rh - Extended DP peer for RH targets
  67. * @peer: dp_peer structure
  68. */
  69. struct dp_peer_rh {
  70. struct dp_peer peer;
  71. };
  72. /**
  73. * struct dp_mon_soc_rh - Extended DP mon soc for RH targets
  74. * @mon_soc: dp_mon_soc structure
  75. */
  76. struct dp_mon_soc_rh {
  77. struct dp_mon_soc mon_soc;
  78. };
  79. /**
  80. * struct dp_mon_pdev_rh - Extended DP mon pdev for RH targets
  81. * @mon_pdev: dp_mon_pdev structure
  82. */
  83. struct dp_mon_pdev_rh {
  84. struct dp_mon_pdev mon_pdev;
  85. };
  86. /**
  87. * dp_get_soc_context_size_rh() - get context size for dp_soc_rh
  88. *
  89. * Return: value in bytes for RH specific soc structure
  90. */
  91. qdf_size_t dp_get_soc_context_size_rh(void);
  92. /**
  93. * dp_initialize_arch_ops_rh() - initialize RH specific arch ops
  94. * @arch_ops: arch ops pointer
  95. *
  96. * Return: none
  97. */
  98. void dp_initialize_arch_ops_rh(struct dp_arch_ops *arch_ops);
  99. /**
  100. * dp_get_context_size_rh() - get RH specific size for peer/vdev/pdev/soc
  101. * @context_type: Context type to get size
  102. *
  103. * Return: size in bytes for the context_type
  104. */
  105. qdf_size_t dp_get_context_size_rh(enum dp_context_type context_type);
  106. /**
  107. * dp_mon_get_context_size_rh() - get RH specific size for mon pdev/soc
  108. * @context_type: Mon context type to get size
  109. *
  110. * Return: size in bytes for the context_type
  111. */
  112. qdf_size_t dp_mon_get_context_size_rh(enum dp_context_type context_type);
  113. /**
  114. * dp_get_rh_pdev_from_dp_pdev() - get dp_pdev_rh from dp_pdev
  115. * @pdev: dp_pdev pointer
  116. *
  117. * Return: dp_pdev_rh pointer
  118. */
  119. static inline
  120. struct dp_pdev_rh *dp_get_rh_pdev_from_dp_pdev(struct dp_pdev *pdev)
  121. {
  122. return (struct dp_pdev_rh *)pdev;
  123. }
  124. /**
  125. * dp_get_rh_soc_from_dp_soc() - get dp_soc_rh from dp_soc
  126. * @soc: dp_soc pointer
  127. *
  128. * Return: dp_soc_rh pointer
  129. */
  130. static inline struct dp_soc_rh *dp_get_rh_soc_from_dp_soc(struct dp_soc *soc)
  131. {
  132. return (struct dp_soc_rh *)soc;
  133. }
  134. #endif