cdp_txrx_ppe.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /*
  2. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef _CDP_TXRX_PPE_H_
  17. #define _CDP_TXRX_PPE_H_
  18. /**
  19. * cdp_ppesds_entry_attach() - attach the ppe vp interface.
  20. * @soc: data path soc handle
  21. * @vdev_id: vdev id
  22. * @vpai: PPE VP opaque
  23. * @ppe_vp_num: Allocated VP Port number
  24. *
  25. * return: qdf_status where vp entry got allocated or not.
  26. */
  27. static inline
  28. QDF_STATUS cdp_ppesds_entry_attach(struct cdp_soc_t *soc, uint8_t vdev_id,
  29. void *vpai, int32_t *ppe_vp_num)
  30. {
  31. if (!soc || !soc->ops || !soc->ops->ppe_ops) {
  32. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  33. "%s invalid instance", __func__);
  34. return QDF_STATUS_E_INVAL;
  35. }
  36. if (soc->ops->ppe_ops->ppeds_entry_attach) {
  37. return soc->ops->ppe_ops->ppeds_entry_attach(soc, vdev_id,
  38. vpai, ppe_vp_num);
  39. }
  40. return QDF_STATUS_E_NOSUPPORT;
  41. }
  42. /**
  43. * cdp_ppesds_entry_detach() - Detach the PPE VP interface.
  44. * @soc: data path soc handle
  45. * @vdev_id: vdev ID
  46. *
  47. * return: void
  48. */
  49. static inline
  50. void cdp_ppesds_entry_detach(struct cdp_soc_t *soc, uint8_t vdev_id)
  51. {
  52. if (!soc || !soc->ops || !soc->ops->ppe_ops) {
  53. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  54. "%s invalid instance", __func__);
  55. return;
  56. }
  57. if (soc->ops->ppe_ops->ppeds_entry_detach) {
  58. return soc->ops->ppe_ops->ppeds_entry_detach
  59. (soc, vdev_id);
  60. }
  61. }
  62. /**
  63. * cdp_ppesds_set_int_pri2tid() - Set the INT_PRI to TID
  64. * @soc: data path soc handle
  65. * @pri2tid: PRI2TID table
  66. *
  67. * return: void
  68. */
  69. static inline
  70. void cdp_ppesds_set_int_pri2tid(struct cdp_soc_t *soc,
  71. uint8_t *pri2tid)
  72. {
  73. if (!soc || !soc->ops || !soc->ops->ppe_ops) {
  74. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  75. "%s invalid instance", __func__);
  76. return;
  77. }
  78. if (soc->ops->ppe_ops->ppeds_set_int_pri2tid) {
  79. return soc->ops->ppe_ops->ppeds_set_int_pri2tid
  80. (soc, pri2tid);
  81. }
  82. }
  83. /**
  84. * cdp_ppesds_update_int_pri2tid() - Update the INT_PRI to TID
  85. * @soc: data path soc handle
  86. * @pri: Priority index
  87. * @tid: TID mapped to the input priority
  88. *
  89. * return: void
  90. */
  91. static inline
  92. void cdp_ppesds_update_int_pri2tid(struct cdp_soc_t *soc,
  93. uint8_t pri, uint8_t tid)
  94. {
  95. if (!soc || !soc->ops || !soc->ops->ppe_ops) {
  96. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  97. "%s invalid instance", __func__);
  98. }
  99. if (soc->ops->ppe_ops->ppeds_update_int_pri2tid) {
  100. return soc->ops->ppe_ops->ppeds_update_int_pri2tid
  101. (soc, pri, tid);
  102. }
  103. }
  104. /**
  105. * cdp_ppesds_entry_dump() - Dump the PPE VP entries
  106. * @soc: data path soc handle
  107. *
  108. * return: void
  109. */
  110. static inline
  111. void cdp_ppesds_entry_dump(struct cdp_soc_t *soc)
  112. {
  113. if (!soc || !soc->ops || !soc->ops->ppe_ops) {
  114. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  115. "%s invalid instance", __func__);
  116. return;
  117. }
  118. if (soc->ops->ppe_ops->ppeds_entry_dump)
  119. soc->ops->ppe_ops->ppeds_entry_dump(soc);
  120. }
  121. /**
  122. * cdp_ppesds_enable_pri2tid() - Enable PPE VP PRI2TID table
  123. * @soc: data path soc handle
  124. * @vdev_id: vdev id
  125. * @val: Boolean value to enable/disable
  126. *
  127. * return: QDF_STATUS
  128. */
  129. static inline
  130. QDF_STATUS cdp_ppesds_enable_pri2tid(struct cdp_soc_t *soc,
  131. uint8_t vdev_id, bool val)
  132. {
  133. if (!soc || !soc->ops || !soc->ops->ppe_ops) {
  134. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  135. "%s invalid instance", __func__);
  136. return QDF_STATUS_E_INVAL;
  137. }
  138. if (soc->ops->ppe_ops->ppeds_enable_pri2tid) {
  139. return soc->ops->ppe_ops->ppeds_enable_pri2tid(soc,
  140. vdev_id, val);
  141. }
  142. return QDF_STATUS_E_NOSUPPORT;
  143. }
  144. #endif /* _CDP_TXRX_PPE_H_ */