cdp_txrx_sawf.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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
  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 _CDP_TXRX_SAWF_H_
  19. #define _CDP_TXRX_SAWF_H_
  20. static inline QDF_STATUS
  21. cdp_sawf_peer_svcid_map(ol_txrx_soc_handle soc,
  22. uint8_t *mac, uint8_t svc_id)
  23. {
  24. if (!soc || !soc->ops) {
  25. dp_cdp_debug("Invalid Instance");
  26. QDF_BUG(0);
  27. return QDF_STATUS_E_FAILURE;
  28. }
  29. if (!soc->ops->sawf_ops ||
  30. !soc->ops->sawf_ops->sawf_def_queues_map_req) {
  31. return QDF_STATUS_E_FAILURE;
  32. }
  33. return soc->ops->sawf_ops->sawf_def_queues_map_req(soc, mac, svc_id);
  34. }
  35. static inline QDF_STATUS
  36. cdp_sawf_peer_unmap(ol_txrx_soc_handle soc,
  37. uint8_t *mac, uint8_t svc_id)
  38. {
  39. if (!soc || !soc->ops) {
  40. dp_cdp_debug("Invalid Instance");
  41. QDF_BUG(0);
  42. return QDF_STATUS_E_FAILURE;
  43. }
  44. if (!soc->ops->sawf_ops ||
  45. !soc->ops->sawf_ops->sawf_def_queues_unmap_req) {
  46. return QDF_STATUS_E_FAILURE;
  47. }
  48. return soc->ops->sawf_ops->sawf_def_queues_unmap_req(soc, mac, svc_id);
  49. }
  50. static inline QDF_STATUS
  51. cdp_sawf_peer_get_map_conf(ol_txrx_soc_handle soc,
  52. uint8_t *mac)
  53. {
  54. if (!soc || !soc->ops) {
  55. dp_cdp_debug("Invalid Instance");
  56. QDF_BUG(0);
  57. return QDF_STATUS_E_FAILURE;
  58. }
  59. if (!soc->ops->sawf_ops ||
  60. !soc->ops->sawf_ops->sawf_def_queues_get_map_report) {
  61. return QDF_STATUS_E_FAILURE;
  62. }
  63. return soc->ops->sawf_ops->sawf_def_queues_get_map_report(soc, mac);
  64. }
  65. #ifdef CONFIG_SAWF
  66. /**
  67. * cdp_get_peer_sawf_delay_stats() - Call to get SAWF delay stats
  68. * @soc: soc handle
  69. * @svc_class_id: service class ID
  70. * @mac: peer mac addrees
  71. * @data: opaque pointer
  72. *
  73. * return: status Success/Failure
  74. */
  75. static inline QDF_STATUS
  76. cdp_get_peer_sawf_delay_stats(ol_txrx_soc_handle soc, uint32_t svc_id,
  77. uint8_t *mac, void *data)
  78. {
  79. if (!soc || !soc->ops) {
  80. dp_cdp_debug("Invalid Instance");
  81. QDF_BUG(0);
  82. return QDF_STATUS_E_FAILURE;
  83. }
  84. if (!soc->ops->sawf_ops ||
  85. !soc->ops->sawf_ops->txrx_get_peer_sawf_delay_stats)
  86. return QDF_STATUS_E_FAILURE;
  87. return soc->ops->sawf_ops->txrx_get_peer_sawf_delay_stats(soc, svc_id,
  88. mac, data);
  89. }
  90. /**
  91. * cdp_get_peer_sawf_tx_stats() - Call to get SAWF Tx stats
  92. * @soc: soc handle
  93. * @svc_class_id: service class ID
  94. * @mac: peer mac addrees
  95. * @data: opaque pointer
  96. *
  97. * return: status Success/Failure
  98. */
  99. static inline QDF_STATUS
  100. cdp_get_peer_sawf_tx_stats(ol_txrx_soc_handle soc, uint32_t svc_id,
  101. uint8_t *mac, void *data)
  102. {
  103. if (!soc || !soc->ops) {
  104. dp_cdp_debug("Invalid Instance");
  105. QDF_BUG(0);
  106. return QDF_STATUS_E_FAILURE;
  107. }
  108. if (!soc->ops->sawf_ops ||
  109. !soc->ops->sawf_ops->txrx_get_peer_sawf_tx_stats)
  110. return QDF_STATUS_E_FAILURE;
  111. return soc->ops->sawf_ops->txrx_get_peer_sawf_tx_stats(soc, svc_id,
  112. mac, data);
  113. }
  114. #else
  115. static inline QDF_STATUS
  116. cdp_get_peer_sawf_delay_stats(ol_txrx_soc_handle soc, uint32_t svc_id,
  117. uint8_t *mac, void *data)
  118. {
  119. return QDF_STATUS_E_FAILURE;
  120. }
  121. static inline QDF_STATUS
  122. cdp_get_peer_sawf_tx_stats(ol_txrx_soc_handle soc, uint32_t svc_id,
  123. uint8_t *mac, void *data)
  124. {
  125. return QDF_STATUS_E_FAILURE;
  126. }
  127. #endif
  128. #endif /* _CDP_TXRX_SAWF_H_ */