wlan_mlo_epcs.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. /*
  2. * Copyright (c) 2023 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 EPCS APIs
  18. */
  19. #ifndef _WLAN_MLO_EPCS_H_
  20. #define _WLAN_MLO_EPCS_H_
  21. #include <wlan_cmn_ieee80211.h>
  22. #include <wlan_mlo_mgr_public_structs.h>
  23. #ifdef WMI_AP_SUPPORT
  24. #include <wlan_cmn.h>
  25. #endif
  26. struct wlan_mlo_peer_context;
  27. /**
  28. * enum wlan_epcs_category - epcs category
  29. *
  30. * @WLAN_EPCS_CATEGORY_NONE: none
  31. * @WLAN_EPCS_CATEGORY_REQUEST: EPCS request
  32. * @WLAN_EPCS_CATEGORY_RESPONSE: EPCS response
  33. * @WLAN_EPCS_CATEGORY_TEARDOWN: EPCS teardown
  34. * @WLAN_EPCS_CATEGORY_INVALID: Invalid
  35. */
  36. enum wlan_epcs_category {
  37. WLAN_EPCS_CATEGORY_NONE = 0,
  38. WLAN_EPCS_CATEGORY_REQUEST = 3,
  39. WLAN_EPCS_CATEGORY_RESPONSE = 4,
  40. WLAN_EPCS_CATEGORY_TEARDOWN = 5,
  41. WLAN_EPCS_CATEGORY_INVALID,
  42. };
  43. /**
  44. * struct wlan_epcs_info - EPCS information of frame
  45. * @cat: frame category
  46. * @dialog_token: dialog token
  47. * @status: status
  48. */
  49. struct wlan_epcs_info {
  50. enum wlan_epcs_category cat;
  51. uint8_t dialog_token;
  52. uint16_t status;
  53. };
  54. /**
  55. * enum peer_epcs_state - epcs stat of peer
  56. * @EPCS_DOWN: EPCS state down
  57. * @EPCS_ENABLE: EPCS state enabled
  58. */
  59. enum peer_epcs_state {
  60. EPCS_DOWN,
  61. EPCS_ENABLE
  62. };
  63. /**
  64. * struct wlan_mlo_peer_epcs_info - Peer EPCS information
  65. * @state: EPCS state of peer
  66. * @self_gen_dialog_token: selfgenerated dialog token
  67. */
  68. struct wlan_mlo_peer_epcs_info {
  69. enum peer_epcs_state state;
  70. uint8_t self_gen_dialog_token;
  71. };
  72. /**
  73. * struct wlan_epcs_context - EPCS context if MLD
  74. */
  75. struct wlan_epcs_context {
  76. };
  77. /**
  78. * struct epcs_frm - EPCS action frame format
  79. * @category: category
  80. * @protected_eht_action: Protected EHT Action
  81. * @dialog_token: Dialog Token
  82. * @status_code: Status Code
  83. * @req: Request frame
  84. * @resp: Response frame
  85. * @bytes: Priority Access Multi-Link element bytes
  86. */
  87. struct epcs_frm {
  88. uint8_t category;
  89. uint8_t protected_eht_action;
  90. uint8_t dialog_token;
  91. union {
  92. struct {
  93. uint8_t bytes[0];
  94. } req;
  95. struct {
  96. uint8_t status_code[2];
  97. uint8_t bytes[0];
  98. } resp;
  99. };
  100. };
  101. #define epcs_alert(format, args...) \
  102. QDF_TRACE_FATAL(QDF_MODULE_ID_EPCS, format, ## args)
  103. #define epcs_err(format, args...) \
  104. QDF_TRACE_ERROR(QDF_MODULE_ID_EPCS, format, ## args)
  105. #define epcs_warn(format, args...) \
  106. QDF_TRACE_WARN(QDF_MODULE_ID_EPCS, format, ## args)
  107. #define epcs_info(format, args...) \
  108. QDF_TRACE_INFO(QDF_MODULE_ID_EPCS, format, ## args)
  109. #define epcs_debug(format, args...) \
  110. QDF_TRACE_DEBUG(QDF_MODULE_ID_EPCS, format, ## args)
  111. #define epcs_rl_debug(format, args...) \
  112. QDF_TRACE_DEBUG_RL(QDF_MODULE_ID_EPCS, format, ## args)
  113. /**
  114. * wlan_mlo_add_epcs_action_frame() - API to add EPCS action frame
  115. * @frm: Pointer to a frame to add EPCS information
  116. * @args: EPCS action frame related info
  117. * @buf: Pointer to EPCS IE values
  118. *
  119. * Return: Pointer to the updated frame buffer
  120. */
  121. uint8_t *wlan_mlo_add_epcs_action_frame(uint8_t *frm,
  122. struct wlan_action_frame_args *args,
  123. uint8_t *buf);
  124. /**
  125. * wlan_mlo_parse_epcs_action_frame() - API to parse EPCS action frame
  126. * @epcs: Pointer to EPCS information
  127. * @action_frm: EPCS action frame
  128. * @frm_len: frame length
  129. *
  130. * Return: QDF_STATUS
  131. */
  132. QDF_STATUS
  133. wlan_mlo_parse_epcs_action_frame(struct wlan_epcs_info *epcs,
  134. struct wlan_action_frame *action_frm,
  135. uint32_t frm_len);
  136. /**
  137. * wlan_mlo_peer_rcv_cmd() - API to process EPCS command
  138. * @ml_peer: Pointer to ML peer received
  139. * @epcs: Pointer to EPCS information
  140. * @updparam: pointer to fill update parameters
  141. *
  142. * Return: QDF_STATUS
  143. */
  144. QDF_STATUS
  145. wlan_mlo_peer_rcv_cmd(struct wlan_mlo_peer_context *ml_peer,
  146. struct wlan_epcs_info *epcs,
  147. bool *updparam);
  148. /**
  149. * wlan_mlo_peer_rcv_action_frame() - API to process EPCS frame receive event
  150. * @ml_peer: Pointer to ML peer received
  151. * @epcs: Pointer to EPCS information
  152. * @respond: pointer to fill response required or not
  153. * @updparam: pointer to fill update parameters
  154. *
  155. * Return: QDF_STATUS
  156. */
  157. QDF_STATUS
  158. wlan_mlo_peer_rcv_action_frame(struct wlan_mlo_peer_context *ml_peer,
  159. struct wlan_epcs_info *epcs,
  160. bool *respond,
  161. bool *updparam);
  162. #endif /* _WLAN_MLO_EPCS_H_ */