cdp_txrx_ppe.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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->ppeds_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->ppeds_ops->ppeds_entry_attach)
  37. return soc->ops->ppeds_ops->ppeds_entry_attach(soc, vdev_id,
  38. vpai,
  39. ppe_vp_num);
  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->ppeds_ops) {
  53. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  54. "%s invalid instance", __func__);
  55. return;
  56. }
  57. if (soc->ops->ppeds_ops->ppeds_entry_detach)
  58. return soc->ops->ppeds_ops->ppeds_entry_detach(soc, vdev_id);
  59. }
  60. /**
  61. * cdp_ppesds_set_int_pri2tid() - Set the INT_PRI to TID
  62. * @soc: data path soc handle
  63. * @pri2tid: PRI2TID table
  64. *
  65. * return: void
  66. */
  67. static inline
  68. void cdp_ppesds_set_int_pri2tid(struct cdp_soc_t *soc,
  69. uint8_t *pri2tid)
  70. {
  71. if (!soc || !soc->ops || !soc->ops->ppeds_ops) {
  72. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  73. "%s invalid instance", __func__);
  74. return;
  75. }
  76. if (soc->ops->ppeds_ops->ppeds_set_int_pri2tid)
  77. return soc->ops->ppeds_ops->ppeds_set_int_pri2tid(soc, pri2tid);
  78. }
  79. /**
  80. * cdp_ppesds_update_int_pri2tid() - Update the INT_PRI to TID
  81. * @soc: data path soc handle
  82. * @pri: Priority index
  83. * @tid: TID mapped to the input priority
  84. *
  85. * return: void
  86. */
  87. static inline
  88. void cdp_ppesds_update_int_pri2tid(struct cdp_soc_t *soc,
  89. uint8_t pri, uint8_t tid)
  90. {
  91. if (!soc || !soc->ops || !soc->ops->ppeds_ops) {
  92. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  93. "%s invalid instance", __func__);
  94. }
  95. if (soc->ops->ppeds_ops->ppeds_update_int_pri2tid)
  96. return soc->ops->ppeds_ops->ppeds_update_int_pri2tid(soc, pri,
  97. tid);
  98. }
  99. /**
  100. * cdp_ppesds_entry_dump() - Dump the PPE VP entries
  101. * @soc: data path soc handle
  102. *
  103. * return: void
  104. */
  105. static inline
  106. void cdp_ppesds_entry_dump(struct cdp_soc_t *soc)
  107. {
  108. if (!soc || !soc->ops || !soc->ops->ppeds_ops) {
  109. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  110. "%s invalid instance", __func__);
  111. return;
  112. }
  113. if (soc->ops->ppeds_ops->ppeds_entry_dump)
  114. soc->ops->ppeds_ops->ppeds_entry_dump(soc);
  115. }
  116. /**
  117. * cdp_ppesds_enable_pri2tid() - Enable PPE VP PRI2TID table
  118. * @soc: data path soc handle
  119. * @vdev_id: vdev id
  120. * @val: Boolean value to enable/disable
  121. *
  122. * return: QDF_STATUS
  123. */
  124. static inline
  125. QDF_STATUS cdp_ppesds_enable_pri2tid(struct cdp_soc_t *soc,
  126. uint8_t vdev_id, bool val)
  127. {
  128. if (!soc || !soc->ops || !soc->ops->ppeds_ops) {
  129. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  130. "%s invalid instance", __func__);
  131. return QDF_STATUS_E_INVAL;
  132. }
  133. if (soc->ops->ppeds_ops->ppeds_enable_pri2tid)
  134. return soc->ops->ppeds_ops->ppeds_enable_pri2tid(soc, vdev_id,
  135. val);
  136. return QDF_STATUS_E_NOSUPPORT;
  137. }
  138. #endif /* _CDP_TXRX_PPE_H_ */