cdp_txrx_mlo.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /*
  2. * Copyright (c) 2021-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_MLO_H_
  17. #define _CDP_TXRX_MLO_H_
  18. #include "cdp_txrx_ops.h"
  19. struct cdp_mlo_ctxt;
  20. /**
  21. * cdp_ctrl_mlo_mgr - opaque handle for mlo manager context
  22. */
  23. struct cdp_ctrl_mlo_mgr;
  24. struct
  25. cdp_mlo_ctxt *dp_mlo_ctxt_attach_wifi3(struct cdp_ctrl_mlo_mgr *ctrl_ctxt);
  26. void dp_mlo_ctxt_detach_wifi3(struct cdp_mlo_ctxt *ml_ctxt);
  27. static inline
  28. struct cdp_mlo_ctxt *cdp_mlo_ctxt_attach(struct cdp_ctrl_mlo_mgr *ctrl_ctxt)
  29. {
  30. return dp_mlo_ctxt_attach_wifi3(ctrl_ctxt);
  31. }
  32. static inline
  33. void cdp_mlo_ctxt_detach(struct cdp_mlo_ctxt *ml_ctxt)
  34. {
  35. dp_mlo_ctxt_detach_wifi3(ml_ctxt);
  36. }
  37. static inline void cdp_soc_mlo_soc_setup(ol_txrx_soc_handle soc,
  38. struct cdp_mlo_ctxt *mlo_ctx)
  39. {
  40. if (!soc || !soc->ops) {
  41. QDF_BUG(0);
  42. return;
  43. }
  44. if (!soc->ops->mlo_ops ||
  45. !soc->ops->mlo_ops->mlo_soc_setup)
  46. return;
  47. soc->ops->mlo_ops->mlo_soc_setup(soc, mlo_ctx);
  48. }
  49. static inline void cdp_soc_mlo_soc_teardown(ol_txrx_soc_handle soc,
  50. struct cdp_mlo_ctxt *mlo_ctx)
  51. {
  52. if (!soc || !soc->ops) {
  53. QDF_BUG(0);
  54. return;
  55. }
  56. if (!soc->ops->mlo_ops ||
  57. !soc->ops->mlo_ops->mlo_soc_teardown)
  58. return;
  59. soc->ops->mlo_ops->mlo_soc_teardown(soc, mlo_ctx);
  60. }
  61. /*
  62. * cdp_update_mlo_ptnr_list - Add vdev to MLO partner list
  63. * @soc: soc handle
  64. * @vdev_ids: list of partner vdevs
  65. * @num_vdevs: number of items in list
  66. * @vdev_id: caller's vdev id
  67. *
  68. * return: QDF_STATUS
  69. */
  70. static inline QDF_STATUS
  71. cdp_update_mlo_ptnr_list(ol_txrx_soc_handle soc, int8_t vdev_ids[],
  72. uint8_t num_vdevs, uint8_t vdev_id)
  73. {
  74. if (!soc || !soc->ops || !soc->ops->mlo_ops)
  75. return QDF_STATUS_E_INVAL;
  76. if (soc->ops->mlo_ops->update_mlo_ptnr_list)
  77. return soc->ops->mlo_ops->update_mlo_ptnr_list(soc, vdev_ids,
  78. num_vdevs, vdev_id);
  79. return QDF_STATUS_SUCCESS;
  80. }
  81. static inline void cdp_mlo_setup_complete(ol_txrx_soc_handle soc,
  82. struct cdp_mlo_ctxt *mlo_ctx)
  83. {
  84. if (!soc || !soc->ops) {
  85. QDF_BUG(0);
  86. return;
  87. }
  88. if (!soc->ops->mlo_ops ||
  89. !soc->ops->mlo_ops->mlo_setup_complete)
  90. return;
  91. soc->ops->mlo_ops->mlo_setup_complete(mlo_ctx);
  92. }
  93. /*
  94. * cdp_mlo_update_delta_tsf2 - Update delta_tsf2
  95. * @soc: soc handle
  96. * @pdev_id: pdev id
  97. * @delta_tsf2: delta_tsf2
  98. *
  99. * return: none
  100. */
  101. static inline void cdp_mlo_update_delta_tsf2(ol_txrx_soc_handle soc,
  102. uint8_t pdev_id,
  103. uint64_t delta_tsf2)
  104. {
  105. if (!soc || !soc->ops) {
  106. QDF_BUG(0);
  107. return;
  108. }
  109. if (!soc->ops->mlo_ops ||
  110. !soc->ops->mlo_ops->mlo_update_delta_tsf2)
  111. return;
  112. soc->ops->mlo_ops->mlo_update_delta_tsf2(soc, pdev_id, delta_tsf2);
  113. }
  114. /*
  115. * cdp_mlo_update_delta_tqm - Update delta_tqm
  116. * @soc: soc handle
  117. * @delta_tqm: delta_tqm
  118. *
  119. * return: none
  120. */
  121. static inline void cdp_mlo_update_delta_tqm(ol_txrx_soc_handle soc,
  122. uint64_t delta_tqm)
  123. {
  124. if (!soc || !soc->ops) {
  125. QDF_BUG(0);
  126. return;
  127. }
  128. if (!soc->ops->mlo_ops ||
  129. !soc->ops->mlo_ops->mlo_update_delta_tqm)
  130. return;
  131. soc->ops->mlo_ops->mlo_update_delta_tqm(soc, delta_tqm);
  132. }
  133. #endif /*_CDP_TXRX_MLO_H_*/