wlan_mlo_t2lm.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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. /**
  17. * DOC: contains T2LM APIs
  18. */
  19. #ifndef _WLAN_MLO_T2LM_H_
  20. #define _WLAN_MLO_T2LM_H_
  21. #include <wlan_cmn_ieee80211.h>
  22. #ifdef WLAN_FEATURE_11BE
  23. #define t2lm_alert(format, args...) \
  24. QDF_TRACE_FATAL(QDF_MODULE_ID_T2LM, format, ## args)
  25. #define t2lm_err(format, args...) \
  26. QDF_TRACE_ERROR(QDF_MODULE_ID_T2LM, format, ## args)
  27. #define t2lm_warn(format, args...) \
  28. QDF_TRACE_WARN(QDF_MODULE_ID_T2LM, format, ## args)
  29. #define t2lm_info(format, args...) \
  30. QDF_TRACE_INFO(QDF_MODULE_ID_T2LM, format, ## args)
  31. #define t2lm_debug(format, args...) \
  32. QDF_TRACE_DEBUG(QDF_MODULE_ID_T2LM, format, ## args)
  33. #define t2lm_rl_debug(format, args...) \
  34. QDF_TRACE_DEBUG_RL(QDF_MODULE_ID_T2LM, format, ## args)
  35. #define WLAN_T2LM_MAX_NUM_LINKS 16
  36. /**
  37. * wlan_mlo_parse_t2lm_ie() - API to parse the T2LM IE
  38. * @t2lm: Pointer to T2LM structure
  39. * @ie: Pointer to T2LM IE
  40. *
  41. * Return: QDF_STATUS
  42. */
  43. QDF_STATUS wlan_mlo_parse_t2lm_ie(
  44. struct wlan_t2lm_onging_negotiation_info *t2lm, uint8_t *ie);
  45. /**
  46. * wlan_mlo_add_t2lm_ie() - API to add TID-to-link mapping IE
  47. * @frm: Pointer to buffer
  48. * @t2lm: Pointer to t2lm mapping structure
  49. *
  50. * Return: Updated frame pointer
  51. */
  52. uint8_t *wlan_mlo_add_t2lm_ie(uint8_t *frm,
  53. struct wlan_t2lm_onging_negotiation_info *t2lm);
  54. /**
  55. * wlan_mlo_vdev_tid_to_link_map_event() - API to process the revceived T2LM
  56. * event.
  57. * @psoc: psoc object
  58. * @event: Pointer to received T2LM info
  59. *
  60. * Return: QDF_STATUS
  61. */
  62. QDF_STATUS wlan_mlo_vdev_tid_to_link_map_event(
  63. struct wlan_objmgr_psoc *psoc,
  64. struct mlo_vdev_host_tid_to_link_map_resp *event);
  65. /**
  66. * wlan_mlo_parse_t2lm_action_frame() - API to parse T2LM action frame
  67. * @t2lm: Pointer to T2LM structure
  68. * @action_frm: Pointer to action frame
  69. * @category: T2LM action frame category
  70. *
  71. * Return: 0 - success, else failure
  72. */
  73. int wlan_mlo_parse_t2lm_action_frame(
  74. struct wlan_t2lm_onging_negotiation_info *t2lm,
  75. struct wlan_action_frame *action_frm,
  76. enum wlan_t2lm_category category);
  77. /**
  78. * wlan_mlo_add_t2lm_action_frame() - API to add T2LM action frame
  79. * @frm: Pointer to a frame to add T2LM IE
  80. * @args: T2LM action frame related info
  81. * @buf: Pointer to T2LM IE values
  82. * @category: T2LM action frame category
  83. *
  84. * Return: Pointer to the updated frame buffer
  85. */
  86. uint8_t *wlan_mlo_add_t2lm_action_frame(
  87. uint8_t *frm, struct wlan_action_frame_args *args,
  88. uint8_t *buf, enum wlan_t2lm_category category);
  89. /**
  90. * wlan_mlo_parse_bcn_prbresp_t2lm_ie() - API to parse the T2LM IE from beacon/
  91. * probe response frame
  92. * @t2lm_ctx: T2LM context
  93. * @ie: Pointer to T2LM IE
  94. *
  95. * Return: QDF_STATUS
  96. */
  97. QDF_STATUS wlan_mlo_parse_bcn_prbresp_t2lm_ie(
  98. struct wlan_t2lm_context *t2lm_ctx, uint8_t *ie);
  99. /**
  100. * wlan_mlo_add_t2lm_info_ie() - Add T2LM IE for UL/DL/Bidirection
  101. * @frm: Pointer to buffer
  102. * @t2lm: Pointer to t2lm mapping structure
  103. *
  104. * Return: Updated frame pointer
  105. */
  106. uint8_t *wlan_mlo_add_t2lm_info_ie(uint8_t *frm, struct wlan_t2lm_info *t2lm);
  107. #else
  108. static inline QDF_STATUS wlan_mlo_parse_t2lm_ie(
  109. struct wlan_t2lm_onging_negotiation_info *t2lm, uint8_t *ie)
  110. {
  111. return QDF_STATUS_E_FAILURE;
  112. }
  113. static inline
  114. int8_t *wlan_mlo_add_t2lm_ie(uint8_t *frm,
  115. struct wlan_t2lm_onging_negotiation_info *t2lm)
  116. {
  117. return frm;
  118. }
  119. static inline
  120. int wlan_mlo_parse_t2lm_action_frame(
  121. struct wlan_t2lm_onging_negotiation_info *t2lm,
  122. struct wlan_action_frame *action_frm,
  123. enum wlan_t2lm_category category)
  124. {
  125. return 0;
  126. }
  127. static inline
  128. uint8_t *wlan_mlo_add_t2lm_action_frame(
  129. uint8_t *frm, struct wlan_action_frame_args *args,
  130. uint8_t *buf, enum wlan_t2lm_category category)
  131. {
  132. return frm;
  133. }
  134. static inline
  135. QDF_STATUS wlan_mlo_parse_bcn_prbresp_t2lm_ie(
  136. struct wlan_t2lm_context *t2lm_ctx, uint8_t *ie)
  137. {
  138. return QDF_STATUS_E_FAILURE;
  139. }
  140. static inline
  141. uint8_t *wlan_mlo_add_t2lm_info_ie(uint8_t *frm, struct wlan_t2lm_info *t2lm)
  142. {
  143. return frm;
  144. }
  145. #endif /* WLAN_FEATURE_11BE */
  146. #endif /* _WLAN_MLO_T2LM_H_ */