wmi_unified_11be_param.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. /*
  2. * Copyright (c) 2021, The Linux Foundation. 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 _WMI_UNIFIED_11BE_PARAM_H_
  17. #define _WMI_UNIFIED_11BE_PARAM_H_
  18. #ifdef WLAN_FEATURE_11BE_MLO
  19. #define MAX_LINK_IN_MLO 6
  20. /** struct wmi_mlo_setup_params - MLO setup command params
  21. * @mld_grp_id: Unique ID to FW for MLD group
  22. * @pdev_id: pdev id of radio on which this command is sent
  23. * @num_valid_hw_links: Num of valid links in partner_links array
  24. * @partner_links[MAX_LINK_IN_MLO]: Partner link IDs
  25. */
  26. struct wmi_mlo_setup_params {
  27. uint32_t mld_grp_id;
  28. uint32_t pdev_id;
  29. uint8_t num_valid_hw_links;
  30. uint32_t partner_links[MAX_LINK_IN_MLO];
  31. };
  32. /** struct wmi_mlo_ready_params - MLO ready command params
  33. * @pdev_id: pdev id of radio on which this command is sent
  34. */
  35. struct wmi_mlo_ready_params {
  36. uint32_t pdev_id;
  37. };
  38. /** enum wmi_mlo_teardown_reason - Reason code in WMI MLO teardown command
  39. * @WMI_MLO_TEARDOWN_REASON_DOWN: Wifi down
  40. * @WMI_MLO_TEARDOWN_REASON_SSR: Wifi Recovery
  41. */
  42. enum wmi_mlo_teardown_reason {
  43. WMI_MLO_TEARDOWN_REASON_DOWN,
  44. WMI_MLO_TEARDOWN_REASON_SSR,
  45. };
  46. /** struct wmi_mlo_teardown_params - MLO teardown command params
  47. * @pdev_id: pdev id of radio on which this command is sent
  48. * @reason: reason code from enum wmi_mlo_teardown_reason
  49. */
  50. struct wmi_mlo_teardown_params {
  51. uint32_t pdev_id;
  52. enum wmi_mlo_teardown_reason reason;
  53. };
  54. /** enum wmi_mlo_setup_status - Status code in WMI MLO setup completion event
  55. * @WMI_MLO_SETUP_STATUS_SUCCESS: Success
  56. * @WMI_MLO_SETUP_STATUS_FAILURE: Failure
  57. */
  58. enum wmi_mlo_setup_status {
  59. WMI_MLO_SETUP_STATUS_SUCCESS,
  60. WMI_MLO_SETUP_STATUS_FAILURE,
  61. };
  62. /** struct wmi_mlo_setup_complete_params - MLO setup complete event params
  63. * @pdev_id: pdev id of radio on which this event is received
  64. * @status: status code
  65. */
  66. struct wmi_mlo_setup_complete_params {
  67. uint32_t pdev_id;
  68. enum wmi_mlo_setup_status status;
  69. };
  70. /** enum wmi_mlo_teardown_status - Status code in WMI MLO teardown completion
  71. * event
  72. * @WMI_MLO_TEARDOWN_STATUS_SUCCESS: Success
  73. * @WMI_MLO_TEARDOWN_STATUS_FAILURE: Failure
  74. */
  75. enum wmi_mlo_teardown_status {
  76. WMI_MLO_TEARDOWN_STATUS_SUCCESS,
  77. WMI_MLO_TEARDOWN_STATUS_FAILURE,
  78. };
  79. /** struct wmi_mlo_teardown_cmpl_params - MLO setup teardown event params
  80. * @pdev_id: pdev id of radio on which this event is received
  81. * @status: Teardown status from enum wmi_mlo_teardown_status
  82. */
  83. struct wmi_mlo_teardown_cmpl_params {
  84. uint32_t pdev_id;
  85. enum wmi_mlo_teardown_status status;
  86. };
  87. /* maximum size of vdev bitmap array for MLO link set active command */
  88. #define WMI_MLO_VDEV_BITMAP_SZ 2
  89. /* maximum size of link number param array for MLO link set active command */
  90. #define WMI_MLO_LINK_NUM_SZ 2
  91. /**
  92. * enum wmi_mlo_link_force_mode: MLO link force modes
  93. * @WMI_MLO_LINK_FORCE_MODE_ACTIVE:
  94. * Force specific links active
  95. * @WMI_MLO_LINK_FORCE_MODE_INACTIVE:
  96. * Force specific links inactive
  97. * @WMI_MLO_LINK_FORCE_MODE_ACTIVE_NUM:
  98. * Force active a number of links, firmware to decide which links to inactive
  99. * @WMI_MLO_LINK_FORCE_MODE_INACTIVE_NUM:
  100. * Force inactive a number of links, firmware to decide which links to inactive
  101. * @WMI_MLO_LINK_FORCE_MODE_NO_FORCE:
  102. * Cancel the force operation of specific links, allow firmware to decide
  103. */
  104. enum wmi_mlo_link_force_mode {
  105. WMI_MLO_LINK_FORCE_MODE_ACTIVE = 1,
  106. WMI_MLO_LINK_FORCE_MODE_INACTIVE = 2,
  107. WMI_MLO_LINK_FORCE_MODE_ACTIVE_NUM = 3,
  108. WMI_MLO_LINK_FORCE_MODE_INACTIVE_NUM = 4,
  109. WMI_MLO_LINK_FORCE_MODE_NO_FORCE = 5,
  110. };
  111. /**
  112. * enum wmi_mlo_link_force_reason: MLO link force reasons
  113. * @WMI_MLO_LINK_FORCE_REASON_CONNECT:
  114. * Set force specific links because of new connection
  115. * @WMI_MLO_LINK_FORCE_REASON_DISCONNECT:
  116. * Set force specific links because of new dis-connection
  117. */
  118. enum wmi_mlo_link_force_reason {
  119. WMI_MLO_LINK_FORCE_REASON_CONNECT = 1,
  120. WMI_MLO_LINK_FORCE_REASON_DISCONNECT = 2,
  121. };
  122. /**
  123. * struct wmi_mlo_link_set_active_resp: MLO link set active response structure
  124. * @status: Return status, 0 for success, non-zero otherwise
  125. * @active_sz: size of current active vdev bitmap array
  126. * @active: current active vdev bitmap array
  127. * @inactive_sz: size of current inactive vdev bitmap array
  128. * @inactive: current inactive vdev bitmap array
  129. */
  130. struct wmi_mlo_link_set_active_resp {
  131. uint32_t status;
  132. uint32_t active_sz;
  133. uint32_t active[WMI_MLO_VDEV_BITMAP_SZ];
  134. uint32_t inactive_sz;
  135. uint32_t inactive[WMI_MLO_VDEV_BITMAP_SZ];
  136. };
  137. /**
  138. * struct wmi_mlo_link_num_param: MLO link set active number params
  139. * @num_of_link: number of links to active/inactive
  140. * @vdev_type: type of vdev
  141. * @vdev_subtype: subtype of vdev
  142. * @home_freq: home frequency of the link
  143. */
  144. struct wmi_mlo_link_num_param {
  145. uint32_t num_of_link;
  146. uint32_t vdev_type;
  147. uint32_t vdev_subtype;
  148. uint32_t home_freq;
  149. };
  150. /**
  151. * struct wmi_mlo_link_set_active_param: MLO link set active params
  152. * @force_mode: operation to take (enum wmi_mlo_link_force_mode)
  153. * @reason: reason for the operation (enum wmi_mlo_link_force_reason)
  154. * @entry_num: number of the valid entries for link_num/vdev_bitmap
  155. * @link_num: link number param array
  156. * It's present only when force_mode is WMI_MLO_LINK_FORCE_MODE_ACTIVE_NUM or
  157. * WMI_MLO_LINK_FORCE_MODE_INACTIVE_NUM
  158. * @vdev_bitmap: active/inactive vdev bitmap array
  159. * It's present only when force_mode is WMI_MLO_LINK_FORCE_MODE_ACTIVE,
  160. * WMI_MLO_LINK_FORCE_MODE_INACTIVE or WMI_MLO_LINK_FORCE_MODE_NO_FORCE.
  161. */
  162. struct wmi_mlo_link_set_active_param {
  163. uint32_t force_mode;
  164. uint32_t reason;
  165. uint32_t entry_num;
  166. union {
  167. struct wmi_mlo_link_num_param link_num[WMI_MLO_LINK_NUM_SZ];
  168. uint32_t vdev_bitmap[WMI_MLO_VDEV_BITMAP_SZ];
  169. };
  170. };
  171. #endif
  172. #endif