dp_li.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /*
  2. * Copyright (c) 2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 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. #ifndef __DP_LI_H
  20. #define __DP_LI_H
  21. #include <dp_types.h>
  22. #include <dp_mon.h>
  23. #include <hal_li_tx.h>
  24. #include <hal_li_rx.h>
  25. #include <qdf_pkt_add_timestamp.h>
  26. /* WBM2SW ring id for rx release */
  27. #define WBM2SW_REL_ERR_RING_NUM 3
  28. /**
  29. * struct dp_soc_li - Extended DP soc for LI targets
  30. * @soc: dp soc structure
  31. */
  32. struct dp_soc_li {
  33. struct dp_soc soc;
  34. };
  35. /**
  36. * struct dp_pdev_li - Extended DP pdev for LI targets
  37. * @pdev: dp_pdev structure
  38. */
  39. struct dp_pdev_li {
  40. struct dp_pdev pdev;
  41. };
  42. /**
  43. * struct dp_vdev_li - Extended DP vdev for LI targets
  44. * @vdev: dp_vdev structure
  45. */
  46. struct dp_vdev_li {
  47. struct dp_vdev vdev;
  48. };
  49. /**
  50. * struct dp_peer_li - Extended DP peer for LI targets
  51. * @peer: dp_peer structure
  52. */
  53. struct dp_peer_li {
  54. struct dp_peer peer;
  55. };
  56. /**
  57. * struct dp_mon_soc_li - Extended DP mon soc for LI targets
  58. * @mon_soc: dp_mon_soc structure
  59. */
  60. struct dp_mon_soc_li {
  61. struct dp_mon_soc mon_soc;
  62. };
  63. /**
  64. * struct dp_mon_pdev_li - Extended DP mon pdev for LI targets
  65. * @mon_pdev: dp_mon_pdev structure
  66. */
  67. struct dp_mon_pdev_li {
  68. struct dp_mon_pdev mon_pdev;
  69. };
  70. /**
  71. * dp_get_soc_context_size_LI() - get context size for dp_soc_li
  72. *
  73. * Return: value in bytes for LI specific soc structure
  74. */
  75. qdf_size_t dp_get_soc_context_size_li(void);
  76. /**
  77. * dp_initialize_arch_ops_li() - initialize LI specific arch ops
  78. * @arch_ops: arch ops pointer
  79. *
  80. * Return: none
  81. */
  82. void dp_initialize_arch_ops_li(struct dp_arch_ops *arch_ops);
  83. /**
  84. * dp_get_context_size_li() - get LI specific size for peer/vdev/pdev/soc
  85. * @arch_ops: arch ops pointer
  86. *
  87. * Return: size in bytes for the context_type
  88. */
  89. qdf_size_t dp_get_context_size_li(enum dp_context_type context_type);
  90. /**
  91. * dp_mon_get_context_size_li() - get LI specific size for mon pdev/soc
  92. * @arch_ops: arch ops pointer
  93. *
  94. * Return: size in bytes for the context_type
  95. */
  96. qdf_size_t dp_mon_get_context_size_li(enum dp_context_type context_type);
  97. #ifdef CONFIG_DP_PKT_ADD_TIMESTAMP
  98. /**
  99. * dp_pkt_add_timestamp() - add timestamp in data payload
  100. *
  101. * @vdev: dp vdev
  102. * @index: index to decide offset in payload
  103. * @time: timestamp to add in data payload
  104. * @nbuf: network buffer
  105. *
  106. * Return: none
  107. */
  108. void dp_pkt_add_timestamp(struct dp_vdev *vdev,
  109. enum qdf_pkt_timestamp_index index, uint64_t time,
  110. qdf_nbuf_t nbuf);
  111. /**
  112. * dp_pkt_get_timestamp() - get current system time
  113. *
  114. * @time: return current system time
  115. *
  116. * Return: none
  117. */
  118. void dp_pkt_get_timestamp(uint64_t *time);
  119. #else
  120. #define dp_pkt_add_timestamp(vdev, index, time, nbuf)
  121. static inline
  122. void dp_pkt_get_timestamp(uint64_t *time)
  123. {
  124. }
  125. #endif
  126. #endif