wlan_mlo_t2lm.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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_parse_t2lm_action_frame() - API to parse T2LM action frame
  56. * @t2lm: Pointer to T2LM structure
  57. * @action_frm: Pointer to action frame
  58. * @category: T2LM action frame category
  59. *
  60. * Return: 0 - success, else failure
  61. */
  62. int wlan_mlo_parse_t2lm_action_frame(
  63. struct wlan_t2lm_onging_negotiation_info *t2lm,
  64. struct wlan_action_frame *action_frm,
  65. enum wlan_t2lm_category category);
  66. /**
  67. * wlan_mlo_add_t2lm_action_frame() - API to add T2LM action frame
  68. * @frm: Pointer to a frame to add T2LM IE
  69. * @args: T2LM action frame related info
  70. * @buf: Pointer to T2LM IE values
  71. * @category: T2LM action frame category
  72. *
  73. * Return: Pointer to the updated frame buffer
  74. */
  75. uint8_t *wlan_mlo_add_t2lm_action_frame(
  76. uint8_t *frm, struct wlan_action_frame_args *args,
  77. uint8_t *buf, enum wlan_t2lm_category category);
  78. /**
  79. * wlan_mlo_parse_bcn_prbresp_t2lm_ie() - API to parse the T2LM IE from beacon/
  80. * probe response frame
  81. * @t2lm_ctx: T2LM context
  82. * @ie: Pointer to T2LM IE
  83. *
  84. * Return: QDF_STATUS
  85. */
  86. QDF_STATUS wlan_mlo_parse_bcn_prbresp_t2lm_ie(
  87. struct wlan_t2lm_context *t2lm_ctx, uint8_t *ie);
  88. /**
  89. * wlan_mlo_add_t2lm_info_ie() - Add T2LM IE for UL/DL/Bidirection
  90. * @frm: Pointer to buffer
  91. * @t2lm: Pointer to t2lm mapping structure
  92. *
  93. * Return: Updated frame pointer
  94. */
  95. uint8_t *wlan_mlo_add_t2lm_info_ie(uint8_t *frm, struct wlan_t2lm_info *t2lm);
  96. #else
  97. static inline QDF_STATUS wlan_mlo_parse_t2lm_ie(
  98. struct wlan_t2lm_onging_negotiation_info *t2lm, uint8_t *ie)
  99. {
  100. return QDF_STATUS_E_FAILURE;
  101. }
  102. static inline
  103. int8_t *wlan_mlo_add_t2lm_ie(uint8_t *frm,
  104. struct wlan_t2lm_onging_negotiation_info *t2lm)
  105. {
  106. return frm;
  107. }
  108. static inline
  109. int wlan_mlo_parse_t2lm_action_frame(
  110. struct wlan_t2lm_onging_negotiation_info *t2lm,
  111. struct wlan_action_frame *action_frm,
  112. enum wlan_t2lm_category category)
  113. {
  114. return 0;
  115. }
  116. static inline
  117. uint8_t *wlan_mlo_add_t2lm_action_frame(
  118. uint8_t *frm, struct wlan_action_frame_args *args,
  119. uint8_t *buf, enum wlan_t2lm_category category)
  120. {
  121. return frm;
  122. }
  123. static inline
  124. QDF_STATUS wlan_mlo_parse_bcn_prbresp_t2lm_ie(
  125. struct wlan_t2lm_context *t2lm_ctx, uint8_t *ie)
  126. {
  127. return QDF_STATUS_E_FAILURE;
  128. }
  129. static inline
  130. uint8_t *wlan_mlo_add_t2lm_info_ie(uint8_t *frm, struct wlan_t2lm_info *t2lm)
  131. {
  132. return frm;
  133. }
  134. #endif /* WLAN_FEATURE_11BE */
  135. #endif /* _WLAN_MLO_T2LM_H_ */