cdp_txrx_mlo.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * Copyright (c) 2021 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. #endif /*_CDP_TXRX_MLO_H_*/