dp_mlo.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 __DP_MLO_H
  17. #define __DP_MLO_H
  18. #include <dp_types.h>
  19. #include <dp_be.h>
  20. /* Max number of chips that can participate in MLO */
  21. #define DP_MAX_MLO_CHIPS 3
  22. /*
  23. * dp_mlo_ctxt
  24. *
  25. * @ctrl_ctxt: opaque handle of cp mlo mgr
  26. * @ml_soc_list: list of socs which are mlo enabled. This also maintains
  27. * mlo_chip_id to dp_soc mapping
  28. * @ml_soc_list_lock: lock to protect ml_soc_list
  29. * @ml_peer_hash: peer hash table for ML peers
  30. * Associated peer with this MAC address)
  31. * @ml_peer_hash_lock: lock to protect ml_peer_hash
  32. */
  33. struct dp_mlo_ctxt {
  34. struct cdp_ctrl_mlo_mgr *ctrl_ctxt;
  35. struct dp_soc *ml_soc_list[DP_MAX_MLO_CHIPS];
  36. qdf_spinlock_t ml_soc_list_lock;
  37. struct {
  38. uint32_t mask;
  39. uint32_t idx_bits;
  40. TAILQ_HEAD(, dp_peer) * bins;
  41. } ml_peer_hash;
  42. qdf_spinlock_t ml_peer_hash_lock;
  43. };
  44. /**
  45. * dp_mlo_ctx_to_cdp() - typecast dp mlo context to CDP context
  46. * @mlo_ctxt: DP MLO context
  47. *
  48. * Return: struct cdp_mlo_ctxt pointer
  49. */
  50. static inline
  51. struct cdp_mlo_ctxt *dp_mlo_ctx_to_cdp(struct dp_mlo_ctxt *mlo_ctxt)
  52. {
  53. return (struct cdp_mlo_ctxt *)mlo_ctxt;
  54. }
  55. /**
  56. * cdp_mlo_ctx_to_dp() - typecast cdp_soc_t to
  57. * dp soc handle
  58. * @psoc: CDP psoc handle
  59. *
  60. * Return: struct dp_soc pointer
  61. */
  62. static inline
  63. struct dp_mlo_ctxt *cdp_mlo_ctx_to_dp(struct cdp_mlo_ctxt *mlo_ctxt)
  64. {
  65. return (struct dp_mlo_ctxt *)mlo_ctxt;
  66. }
  67. #endif /* __DP_MLO_H */