coex_tx_status.h 15 KB

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