wlan_mlo_epcs.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. /**
  27. * enum wlan_epcs_category - epcs category
  28. *
  29. * @WLAN_EPCS_CATEGORY_NONE: none
  30. * @WLAN_EPCS_CATEGORY_REQUEST: EPCS request
  31. * @WLAN_EPCS_CATEGORY_RESPONSE: EPCS response
  32. * @WLAN_EPCS_CATEGORY_TEARDOWN: EPCS teardown
  33. * @WLAN_EPCS_CATEGORY_INVALID: Invalid
  34. */
  35. enum wlan_epcs_category {
  36. WLAN_EPCS_CATEGORY_NONE = 0,
  37. WLAN_EPCS_CATEGORY_REQUEST = 3,
  38. WLAN_EPCS_CATEGORY_RESPONSE = 4,
  39. WLAN_EPCS_CATEGORY_TEARDOWN = 5,
  40. WLAN_EPCS_CATEGORY_INVALID,
  41. };
  42. /**
  43. * struct wlan_epcs_info - EPCS information of frame
  44. * @cat: frame category
  45. * @dialog_token: dialog token
  46. * @status: status
  47. */
  48. struct wlan_epcs_info {
  49. enum wlan_epcs_category cat;
  50. uint8_t dialog_token;
  51. uint8_t status;
  52. };
  53. /**
  54. * struct wlan_mlo_peer_epcs_policy - Peer EPCS information
  55. * @enable: EPCS enable status
  56. * @self_gen_dialog_token: selfgenerated dialog token
  57. * @status: status
  58. */
  59. struct wlan_mlo_peer_epcs_policy {
  60. uint8_t enable;
  61. uint8_t self_gen_dialog_token;
  62. uint8_t status;
  63. };
  64. /**
  65. * struct wlan_epcs_context - EPCS context if MLD
  66. */
  67. struct wlan_epcs_context {
  68. };
  69. /**
  70. * struct epcs_frm - EPCS action frame format
  71. * @category: category
  72. * @protected_eht_action: Protected EHT Action
  73. * @dialog_token: Dialog Token
  74. * @status_code: Status Code
  75. * @req: Request frame
  76. * @resp: Response frame
  77. * @bytes: Priority Access Multi-Link element bytes
  78. */
  79. struct epcs_frm {
  80. uint8_t category;
  81. uint8_t protected_eht_action;
  82. uint8_t dialog_token;
  83. union {
  84. struct {
  85. uint8_t bytes[0];
  86. } req;
  87. struct {
  88. uint8_t status_code;
  89. uint8_t bytes[0];
  90. } resp;
  91. };
  92. };
  93. #define epcs_alert(format, args...) \
  94. QDF_TRACE_FATAL(QDF_MODULE_ID_EPCS, format, ## args)
  95. #define epcs_err(format, args...) \
  96. QDF_TRACE_ERROR(QDF_MODULE_ID_EPCS, format, ## args)
  97. #define epcs_warn(format, args...) \
  98. QDF_TRACE_WARN(QDF_MODULE_ID_EPCS, format, ## args)
  99. #define epcs_info(format, args...) \
  100. QDF_TRACE_INFO(QDF_MODULE_ID_EPCS, format, ## args)
  101. #define epcs_debug(format, args...) \
  102. QDF_TRACE_DEBUG(QDF_MODULE_ID_EPCS, format, ## args)
  103. #define epcs_rl_debug(format, args...) \
  104. QDF_TRACE_DEBUG_RL(QDF_MODULE_ID_EPCS, format, ## args)
  105. /**
  106. * wlan_mlo_add_epcs_action_frame() - API to add EPCS action frame
  107. * @frm: Pointer to a frame to add EPCS information
  108. * @args: EPCS action frame related info
  109. * @buf: Pointer to EPCS IE values
  110. *
  111. * Return: Pointer to the updated frame buffer
  112. */
  113. uint8_t *wlan_mlo_add_epcs_action_frame(uint8_t *frm,
  114. struct wlan_action_frame_args *args,
  115. uint8_t *buf);
  116. /**
  117. * wlan_mlo_parse_epcs_action_frame() - API to parse EPCS action frame
  118. * @epcs: Pointer to EPCS information
  119. * @action_frm: EPCS action frame
  120. * @frm_len: frame length
  121. *
  122. * Return: QDF_STATUS
  123. */
  124. QDF_STATUS
  125. wlan_mlo_parse_epcs_action_frame(struct wlan_epcs_info *epcs,
  126. struct wlan_action_frame *action_frm,
  127. uint32_t frm_len);
  128. #endif /* _WLAN_MLO_EPCS_H_ */