coex_tx_status.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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. #ifndef _COEX_TX_STATUS_H_
  17. #define _COEX_TX_STATUS_H_
  18. #if !defined(__ASSEMBLER__)
  19. #endif
  20. #define NUM_OF_DWORDS_COEX_TX_STATUS 4
  21. #define NUM_OF_QWORDS_COEX_TX_STATUS 2
  22. struct coex_tx_status {
  23. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  24. uint32_t reserved_0a : 7, // [6:0]
  25. tx_bw : 3, // [9:7]
  26. tx_status_reason : 3, // [12:10]
  27. tx_wait_ack : 1, // [13:13]
  28. fes_tx_is_gen_frame : 1, // [14:14]
  29. sch_tx_burst_ongoing : 1, // [15:15]
  30. current_tx_duration : 16; // [31:16]
  31. uint32_t next_rx_active_time : 16, // [15:0]
  32. remaining_fes_time : 16; // [31:16]
  33. uint32_t tx_antenna_mask : 8, // [7:0]
  34. shared_ant_tx_pwr : 8, // [15:8]
  35. other_ant_tx_pwr : 8, // [23:16]
  36. reserved_2 : 8; // [31:24]
  37. uint32_t tlv64_padding : 32; // [31:0]
  38. #else
  39. uint32_t current_tx_duration : 16, // [31:16]
  40. sch_tx_burst_ongoing : 1, // [15:15]
  41. fes_tx_is_gen_frame : 1, // [14:14]
  42. tx_wait_ack : 1, // [13:13]
  43. tx_status_reason : 3, // [12:10]
  44. tx_bw : 3, // [9:7]
  45. reserved_0a : 7; // [6:0]
  46. uint32_t remaining_fes_time : 16, // [31:16]
  47. next_rx_active_time : 16; // [15:0]
  48. uint32_t reserved_2 : 8, // [31:24]
  49. other_ant_tx_pwr : 8, // [23:16]
  50. shared_ant_tx_pwr : 8, // [15:8]
  51. tx_antenna_mask : 8; // [7:0]
  52. uint32_t tlv64_padding : 32; // [31:0]
  53. #endif
  54. };
  55. /* Description RESERVED_0A
  56. <legal 0>
  57. */
  58. #define COEX_TX_STATUS_RESERVED_0A_OFFSET 0x0000000000000000
  59. #define COEX_TX_STATUS_RESERVED_0A_LSB 0
  60. #define COEX_TX_STATUS_RESERVED_0A_MSB 6
  61. #define COEX_TX_STATUS_RESERVED_0A_MASK 0x000000000000007f
  62. /* Description TX_BW
  63. The BW of the upcoming transmission.
  64. Note: Coex might have changed this from the original request.
  65. See coex related fields below
  66. <enum 0 20_mhz>20 Mhz BW
  67. <enum 1 40_mhz>40 Mhz BW
  68. <enum 2 80_mhz>80 Mhz BW
  69. <enum 3 160_mhz>160 Mhz BW
  70. <enum 4 320_mhz>320 Mhz BW
  71. <enum 5 240_mhz>240 Mhz BW
  72. */
  73. #define COEX_TX_STATUS_TX_BW_OFFSET 0x0000000000000000
  74. #define COEX_TX_STATUS_TX_BW_LSB 7
  75. #define COEX_TX_STATUS_TX_BW_MSB 9
  76. #define COEX_TX_STATUS_TX_BW_MASK 0x0000000000000380
  77. /* Description TX_STATUS_REASON
  78. <enum 0 FES_tx_start> TXPCU sends this status at the
  79. start of SCH initiated transmission (when the commands
  80. are given to the PHY). This includes the transmission of
  81. RTS and CTS
  82. Note that based on field 'Fes_tx_is_gen_frame' COEX can
  83. derive if this is a protection frame or regular PPDU.
  84. <enum 1 FES_tx_end> TXPCU sends this status at the end
  85. of SCH initiated transmission (when PHY TX has confirmed
  86. the transmit over the medium has finished)
  87. <enum 2 FES_end> TXPCU sends this status at the end
  88. of of the entire frame exchange sequence. This includes
  89. reception (or lack of..) of the ACK/BA/CTS frame
  90. TXPCU sends this FES after it has sent the TX_FES_STATUS
  91. TLV(s). This also sent in case of 11ax basic trigger response
  92. transmissions, when an ACK/BA is expected, and that got
  93. received.
  94. <enum 3 Response_tx_start> TXPCU sends this status at
  95. the start of Self gen initiated response transmission (when
  96. the commands are given to the PHY)
  97. <enum 4 Response_tx_end> TXPCU sends this status at
  98. the end of Self gen initiated response transmission (when
  99. PHY TX has confirmed the transmit over the medium has finished)
  100. <enum 5 No_tx_ongoing> TXPCU sends this TLV when forced
  101. by SW to do so. It is used to be able to get TXPCU and
  102. coex synchronized again in case of some error handling scenarios
  103. <legal 0-5>
  104. */
  105. #define COEX_TX_STATUS_TX_STATUS_REASON_OFFSET 0x0000000000000000
  106. #define COEX_TX_STATUS_TX_STATUS_REASON_LSB 10
  107. #define COEX_TX_STATUS_TX_STATUS_REASON_MSB 12
  108. #define COEX_TX_STATUS_TX_STATUS_REASON_MASK 0x0000000000001c00
  109. /* Description TX_WAIT_ACK
  110. Field can only be set for the 'FES_tx_end' scenario.
  111. TXPCU sets this bit to 1 when it is waiting for an ACK/BA
  112. or CTS Response.
  113. */
  114. #define COEX_TX_STATUS_TX_WAIT_ACK_OFFSET 0x0000000000000000
  115. #define COEX_TX_STATUS_TX_WAIT_ACK_LSB 13
  116. #define COEX_TX_STATUS_TX_WAIT_ACK_MSB 13
  117. #define COEX_TX_STATUS_TX_WAIT_ACK_MASK 0x0000000000002000
  118. /* Description FES_TX_IS_GEN_FRAME
  119. Field only valid in case tx_status_reason indicates FES_tx_start
  120. or FES_tx_end.
  121. Field is set to 1 if the frame transmitted is a self generated
  122. frame like RTS, CTS 2 self or NDP
  123. */
  124. #define COEX_TX_STATUS_FES_TX_IS_GEN_FRAME_OFFSET 0x0000000000000000
  125. #define COEX_TX_STATUS_FES_TX_IS_GEN_FRAME_LSB 14
  126. #define COEX_TX_STATUS_FES_TX_IS_GEN_FRAME_MSB 14
  127. #define COEX_TX_STATUS_FES_TX_IS_GEN_FRAME_MASK 0x0000000000004000
  128. /* Description SCH_TX_BURST_ONGOING
  129. The proposed change by HWSCH requires TXPCU to reflect
  130. TX_FES_SETUP.sch_tx_burst_ongoing field intoCOEX_TX_STATUS.sch_tx_burst_ongoing
  131. field, when tx_status_reason is FES_end.
  132. SCH will overwrite this bit (that is set it to 1), when
  133. TXPCU set the tx_status_reason to FES_end, and SCH determines
  134. that this FES is followed by other SIFS bursting based
  135. Scheduler commands.
  136. <legal all>
  137. */
  138. #define COEX_TX_STATUS_SCH_TX_BURST_ONGOING_OFFSET 0x0000000000000000
  139. #define COEX_TX_STATUS_SCH_TX_BURST_ONGOING_LSB 15
  140. #define COEX_TX_STATUS_SCH_TX_BURST_ONGOING_MSB 15
  141. #define COEX_TX_STATUS_SCH_TX_BURST_ONGOING_MASK 0x0000000000008000
  142. /* Description CURRENT_TX_DURATION
  143. In case of FES related transmission:
  144. TXPCU sends current transmission time at the beginning of
  145. transmission. This time covers the entire (PPDU) tx_frame.
  146. This field is only valid when 'tx_status_reason' is equal
  147. to FES_tx_start or Response_tx_start. In other scenarios
  148. it is set to 0
  149. In us units <legal all>
  150. */
  151. #define COEX_TX_STATUS_CURRENT_TX_DURATION_OFFSET 0x0000000000000000
  152. #define COEX_TX_STATUS_CURRENT_TX_DURATION_LSB 16
  153. #define COEX_TX_STATUS_CURRENT_TX_DURATION_MSB 31
  154. #define COEX_TX_STATUS_CURRENT_TX_DURATION_MASK 0x00000000ffff0000
  155. /* Description NEXT_RX_ACTIVE_TIME
  156. In case of FES transmission:
  157. The expected receive duration for ACK/CTS/BA frame after
  158. current transmission has finished. This field should be
  159. set at both the start and end of the transmission. When
  160. no frame reception is expected, this field is 0
  161. In case of Response transmission or Trigger Response transmission:
  162. The expected receive duration for upcoming reception. This
  163. field has the same value as the transmitted duration field.
  164. Note that for this scenario, there might be an other TX
  165. generated during this specified time. It is not known to
  166. this device what the transmitter is planning to do in the
  167. remainder of the TXOP. In other words, this value represents
  168. the best guess, but might not be fully accurate.
  169. In us units
  170. <legal all>
  171. */
  172. #define COEX_TX_STATUS_NEXT_RX_ACTIVE_TIME_OFFSET 0x0000000000000000
  173. #define COEX_TX_STATUS_NEXT_RX_ACTIVE_TIME_LSB 32
  174. #define COEX_TX_STATUS_NEXT_RX_ACTIVE_TIME_MSB 47
  175. #define COEX_TX_STATUS_NEXT_RX_ACTIVE_TIME_MASK 0x0000ffff00000000
  176. /* Description REMAINING_FES_TIME
  177. In case of FES transmission:
  178. TXPCU sends the remaining FES time it expects to occupy
  179. the media.
  180. At the 'FES_tx_start', this value is the current_tx_duration
  181. + value of inserted duration field.
  182. At the 'FES_tx_end', this value is equal to the duration
  183. field in the just transmitted frame.
  184. At the 'FES_end', this value is the remaining FES duration
  185. value. Note that this value should only be non zero in
  186. case of SIFS burting type of transmissions.
  187. In case of a FES failure, like reponse frame not received,
  188. this field is set to 0
  189. In case of Self Gen response transmission (includes Trigger
  190. response):
  191. At the 'Response_tx_start', this field has the same value
  192. as the Current_tx_duration + inserted duration field
  193. At the 'Response_tx_end', this field has the same value
  194. as the inserted duration field
  195. <legal all>
  196. */
  197. #define COEX_TX_STATUS_REMAINING_FES_TIME_OFFSET 0x0000000000000000
  198. #define COEX_TX_STATUS_REMAINING_FES_TIME_LSB 48
  199. #define COEX_TX_STATUS_REMAINING_FES_TIME_MSB 63
  200. #define COEX_TX_STATUS_REMAINING_FES_TIME_MASK 0xffff000000000000
  201. /* Description TX_ANTENNA_MASK
  202. The actual used antennas for this transmission
  203. For debug purpose only. PDG should not have modified the
  204. value given by the Coex.
  205. <legal all>
  206. */
  207. #define COEX_TX_STATUS_TX_ANTENNA_MASK_OFFSET 0x0000000000000008
  208. #define COEX_TX_STATUS_TX_ANTENNA_MASK_LSB 0
  209. #define COEX_TX_STATUS_TX_ANTENNA_MASK_MSB 7
  210. #define COEX_TX_STATUS_TX_ANTENNA_MASK_MASK 0x00000000000000ff
  211. /* Description SHARED_ANT_TX_PWR
  212. Actual tx power on the shared antenna
  213. TXPCU sends at the beginning of transmission when tx_frame
  214. is on.
  215. For debug purpose only. PDG should not have modified the
  216. value given by the Coex.
  217. Transmit Power in s6.2 format.
  218. In units of 0.25 dBm
  219. <legal all>
  220. */
  221. #define COEX_TX_STATUS_SHARED_ANT_TX_PWR_OFFSET 0x0000000000000008
  222. #define COEX_TX_STATUS_SHARED_ANT_TX_PWR_LSB 8
  223. #define COEX_TX_STATUS_SHARED_ANT_TX_PWR_MSB 15
  224. #define COEX_TX_STATUS_SHARED_ANT_TX_PWR_MASK 0x000000000000ff00
  225. /* Description OTHER_ANT_TX_PWR
  226. Actual tx power on the 'unshared' antenna(s)
  227. TXPCU sends at the beginning of transmission when tx_frame
  228. is on.
  229. For debug purpose only. PDG should not have modified the
  230. value given by the Coex.
  231. Transmit Power in s6.2 format.
  232. In units of 0.25 dBm
  233. <legal all>
  234. */
  235. #define COEX_TX_STATUS_OTHER_ANT_TX_PWR_OFFSET 0x0000000000000008
  236. #define COEX_TX_STATUS_OTHER_ANT_TX_PWR_LSB 16
  237. #define COEX_TX_STATUS_OTHER_ANT_TX_PWR_MSB 23
  238. #define COEX_TX_STATUS_OTHER_ANT_TX_PWR_MASK 0x0000000000ff0000
  239. /* Description RESERVED_2
  240. Generator should set to 0, consumer shall ignore <legal
  241. 0>
  242. */
  243. #define COEX_TX_STATUS_RESERVED_2_OFFSET 0x0000000000000008
  244. #define COEX_TX_STATUS_RESERVED_2_LSB 24
  245. #define COEX_TX_STATUS_RESERVED_2_MSB 31
  246. #define COEX_TX_STATUS_RESERVED_2_MASK 0x00000000ff000000
  247. /* Description TLV64_PADDING
  248. Automatic DWORD padding inserted while converting TLV32
  249. to TLV64 for 64 bit ARCH
  250. <legal 0>
  251. */
  252. #define COEX_TX_STATUS_TLV64_PADDING_OFFSET 0x0000000000000008
  253. #define COEX_TX_STATUS_TLV64_PADDING_LSB 32
  254. #define COEX_TX_STATUS_TLV64_PADDING_MSB 63
  255. #define COEX_TX_STATUS_TLV64_PADDING_MASK 0xffffffff00000000
  256. #endif // COEX_TX_STATUS