coex_rx_status.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  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_RX_STATUS_H_
  16. #define _COEX_RX_STATUS_H_
  17. #if !defined(__ASSEMBLER__)
  18. #endif
  19. #define NUM_OF_DWORDS_COEX_RX_STATUS 2
  20. #define NUM_OF_QWORDS_COEX_RX_STATUS 1
  21. struct coex_rx_status {
  22. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  23. uint32_t rx_mac_frame_status : 2, // [1:0]
  24. rx_with_tx_response : 1, // [2:2]
  25. rx_rate : 5, // [7:3]
  26. rx_bw : 3, // [10:8]
  27. single_mpdu : 1, // [11:11]
  28. filter_status : 1, // [12:12]
  29. ampdu : 1, // [13:13]
  30. directed : 1, // [14:14]
  31. reserved_0 : 1, // [15:15]
  32. rx_nss : 3, // [18:16]
  33. rx_rssi : 8, // [26:19]
  34. rx_type : 3, // [29:27]
  35. retry_bit_setting : 1, // [30:30]
  36. more_data_bit_setting : 1; // [31:31]
  37. uint32_t remain_rx_packet_time : 16, // [15:0]
  38. rx_remaining_fes_time : 16; // [31:16]
  39. #else
  40. uint32_t more_data_bit_setting : 1, // [31:31]
  41. retry_bit_setting : 1, // [30:30]
  42. rx_type : 3, // [29:27]
  43. rx_rssi : 8, // [26:19]
  44. rx_nss : 3, // [18:16]
  45. reserved_0 : 1, // [15:15]
  46. directed : 1, // [14:14]
  47. ampdu : 1, // [13:13]
  48. filter_status : 1, // [12:12]
  49. single_mpdu : 1, // [11:11]
  50. rx_bw : 3, // [10:8]
  51. rx_rate : 5, // [7:3]
  52. rx_with_tx_response : 1, // [2:2]
  53. rx_mac_frame_status : 2; // [1:0]
  54. uint32_t rx_remaining_fes_time : 16, // [31:16]
  55. remain_rx_packet_time : 16; // [15:0]
  56. #endif
  57. };
  58. /* Description RX_MAC_FRAME_STATUS
  59. RXPCU send this bit as 1 when it receives the begin of a
  60. frame from PHY, and it passes the address filter. RXPCUsend
  61. this bit as 0 when the frame ends. (on/off bit)
  62. <enum 0 ppdu_start> start of PPDU reception.
  63. For SU: Generated the first time the MPDU header passes
  64. the address filter and is destined to this STA.
  65. For MU: Generated the first time the MPDU header from any
  66. user passes the address filter and is destined to this
  67. STA.
  68. <enum 1 first_mpdu_FCS_pass> message only sent in case
  69. of A-MPDU reception.
  70. For SU: first time the FCS of an MPDU passes (and frame
  71. is destined to this device)
  72. For MU: first time the FCS of any MPDU passes (and frame
  73. is destined to this device)
  74. <enum 2 ppdu_end> receive of PPDU frame reception has
  75. finished
  76. <enum 3 ppdu_end_due_to_phy_nap> receive of PPDU frame reception
  77. has finished as it has been aborted due to PHY NAP generation
  78. <legal all>
  79. */
  80. #define COEX_RX_STATUS_RX_MAC_FRAME_STATUS_OFFSET 0x0000000000000000
  81. #define COEX_RX_STATUS_RX_MAC_FRAME_STATUS_LSB 0
  82. #define COEX_RX_STATUS_RX_MAC_FRAME_STATUS_MSB 1
  83. #define COEX_RX_STATUS_RX_MAC_FRAME_STATUS_MASK 0x0000000000000003
  84. /* Description RX_WITH_TX_RESPONSE
  85. Field only valid when rx_mac_frame_status is first_mpdu_FCS_pass
  86. or ppdu_end.
  87. For SU: RXPCU set this bit to indicate it is expecting the
  88. TX to send a response after the receive.
  89. For MU: RXPCU set this bit to indicate it is expecting that
  90. at least for one of the users a response after the reception
  91. needs to be generated.
  92. <legal all>
  93. */
  94. #define COEX_RX_STATUS_RX_WITH_TX_RESPONSE_OFFSET 0x0000000000000000
  95. #define COEX_RX_STATUS_RX_WITH_TX_RESPONSE_LSB 2
  96. #define COEX_RX_STATUS_RX_WITH_TX_RESPONSE_MSB 2
  97. #define COEX_RX_STATUS_RX_WITH_TX_RESPONSE_MASK 0x0000000000000004
  98. /* Description RX_RATE
  99. For SU: RXPCU send the current receive rate at the beginning
  100. of receive when rate is available from PHY.
  101. For MU: RXPCU to use the current receive rate from the first
  102. USER that triggers this TLV to be generated.
  103. Field is always valid
  104. <legal all>
  105. */
  106. #define COEX_RX_STATUS_RX_RATE_OFFSET 0x0000000000000000
  107. #define COEX_RX_STATUS_RX_RATE_LSB 3
  108. #define COEX_RX_STATUS_RX_RATE_MSB 7
  109. #define COEX_RX_STATUS_RX_RATE_MASK 0x00000000000000f8
  110. /* Description RX_BW
  111. Actual RX bandwidth. Not SU or MU dependent.
  112. RXPCU send the current receive rate at the beginning of
  113. receive. This information is from PHY.
  114. Field is always valid
  115. <enum 0 20_mhz>20 Mhz BW
  116. <enum 1 40_mhz>40 Mhz BW
  117. <enum 2 80_mhz>80 Mhz BW
  118. <enum 3 160_mhz>160 Mhz BW
  119. <enum 4 320_mhz>320 Mhz BW
  120. <enum 5 240_mhz>240 Mhz BW
  121. */
  122. #define COEX_RX_STATUS_RX_BW_OFFSET 0x0000000000000000
  123. #define COEX_RX_STATUS_RX_BW_LSB 8
  124. #define COEX_RX_STATUS_RX_BW_MSB 10
  125. #define COEX_RX_STATUS_RX_BW_MASK 0x0000000000000700
  126. /* Description SINGLE_MPDU
  127. For SU: Once set the Received frame is a single MPDU. This
  128. can be a non-AMPDU reception or A-MPDU reception but with
  129. an EOF bit set (VHT single AMPDU).
  130. For MU: RXPCU to base this on the first USER that triggers
  131. this TLV to be generated.
  132. <legal all>
  133. */
  134. #define COEX_RX_STATUS_SINGLE_MPDU_OFFSET 0x0000000000000000
  135. #define COEX_RX_STATUS_SINGLE_MPDU_LSB 11
  136. #define COEX_RX_STATUS_SINGLE_MPDU_MSB 11
  137. #define COEX_RX_STATUS_SINGLE_MPDU_MASK 0x0000000000000800
  138. /* Description FILTER_STATUS
  139. 1: LMAC is interested in receiving the full packet and forward
  140. it to downstream modules. 0: LMAC is not interested in
  141. receiving the packet.
  142. In HastingsPrime based on the register bit 'COEX_RX_STATUS_NOFILTERIN,'
  143. Rx PCU will send this TLV for filtered-out packets as well,
  144. with appropriate info in the fields filter_status, AMPDU
  145. and Directed. Otherwise, and in other chips, this TLV is
  146. sent only for packets filtered in, with these fields set
  147. to zero.
  148. <legal all>
  149. */
  150. #define COEX_RX_STATUS_FILTER_STATUS_OFFSET 0x0000000000000000
  151. #define COEX_RX_STATUS_FILTER_STATUS_LSB 12
  152. #define COEX_RX_STATUS_FILTER_STATUS_MSB 12
  153. #define COEX_RX_STATUS_FILTER_STATUS_MASK 0x0000000000001000
  154. /* Description AMPDU
  155. 1: Indicates received frame is an AMPDU0: indicates received
  156. frames in not an AMPDU
  157. In HastingsPrime based on the register bit 'COEX_RX_STATUS_NOFILTERIN,'
  158. Rx PCU will send this TLV for filtered-out packets as well,
  159. with appropriate info in the fields filter_status, AMPDU
  160. and Directed. Otherwise, and in other chips, this TLV is
  161. sent only for packets filtered in, with these fields set
  162. to zero.
  163. <legal all>
  164. */
  165. #define COEX_RX_STATUS_AMPDU_OFFSET 0x0000000000000000
  166. #define COEX_RX_STATUS_AMPDU_LSB 13
  167. #define COEX_RX_STATUS_AMPDU_MSB 13
  168. #define COEX_RX_STATUS_AMPDU_MASK 0x0000000000002000
  169. /* Description DIRECTED
  170. 1: indicates AD1 matches our Receiver address0: indicates
  171. AD1 does not match our Receiver address
  172. In HastingsPrime based on the register bit 'COEX_RX_STATUS_NOFILTERIN,'
  173. Rx PCU will send this TLV for filtered-out packets as well,
  174. with appropriate info in the fields filter_status, AMPDU
  175. and Directed. Otherwise, and in other chips, this TLV is
  176. sent only for packets filtered in, with these fields set
  177. to zero.
  178. <legal all>
  179. */
  180. #define COEX_RX_STATUS_DIRECTED_OFFSET 0x0000000000000000
  181. #define COEX_RX_STATUS_DIRECTED_LSB 14
  182. #define COEX_RX_STATUS_DIRECTED_MSB 14
  183. #define COEX_RX_STATUS_DIRECTED_MASK 0x0000000000004000
  184. /* Description RESERVED_0
  185. <legal 0>
  186. */
  187. #define COEX_RX_STATUS_RESERVED_0_OFFSET 0x0000000000000000
  188. #define COEX_RX_STATUS_RESERVED_0_LSB 15
  189. #define COEX_RX_STATUS_RESERVED_0_MSB 15
  190. #define COEX_RX_STATUS_RESERVED_0_MASK 0x0000000000008000
  191. /* Description RX_NSS
  192. For SU: Number of spatial streams in the reception. Field
  193. is always valid
  194. For MU: RXPCU to base this on the first USER that triggers
  195. this TLV to be generated.
  196. <enum 0 1_spatial_stream>Single spatial stream
  197. <enum 1 2_spatial_streams>2 spatial streams
  198. <enum 2 3_spatial_streams>3 spatial streams
  199. <enum 3 4_spatial_streams>4 spatial streams
  200. <enum 4 5_spatial_streams>5 spatial streams
  201. <enum 5 6_spatial_streams>6 spatial streams
  202. <enum 6 7_spatial_streams>7 spatial streams
  203. <enum 7 8_spatial_streams>8 spatial streams
  204. */
  205. #define COEX_RX_STATUS_RX_NSS_OFFSET 0x0000000000000000
  206. #define COEX_RX_STATUS_RX_NSS_LSB 16
  207. #define COEX_RX_STATUS_RX_NSS_MSB 18
  208. #define COEX_RX_STATUS_RX_NSS_MASK 0x0000000000070000
  209. /* Description RX_RSSI
  210. RXPCU send the current receive RSSI (from the PHYRX_RSSI_LEGACY
  211. TLV) at the beginning of reception. This is information
  212. is from PHY and is not SU or MU dependent.
  213. Field is always valid
  214. <legal all>
  215. */
  216. #define COEX_RX_STATUS_RX_RSSI_OFFSET 0x0000000000000000
  217. #define COEX_RX_STATUS_RX_RSSI_LSB 19
  218. #define COEX_RX_STATUS_RX_RSSI_MSB 26
  219. #define COEX_RX_STATUS_RX_RSSI_MASK 0x0000000007f80000
  220. /* Description RX_TYPE
  221. For SU: RXPCU send the current receive packet type. Field
  222. is always valid.This info is from MAC.
  223. For MU: RXPCU to base this on the first USER that triggers
  224. this TLV to be generated.
  225. <enum 0 data >
  226. <enum 1 management>
  227. <enum 2 beacon>
  228. <enum 3 control> For reception of RTS frame
  229. <enum 4 control_response> For reception of CTS, ACK
  230. or BA frames
  231. <enum 5 others>
  232. <legal 0-5>
  233. */
  234. #define COEX_RX_STATUS_RX_TYPE_OFFSET 0x0000000000000000
  235. #define COEX_RX_STATUS_RX_TYPE_LSB 27
  236. #define COEX_RX_STATUS_RX_TYPE_MSB 29
  237. #define COEX_RX_STATUS_RX_TYPE_MASK 0x0000000038000000
  238. /* Description RETRY_BIT_SETTING
  239. For SU: Value of the retry bit in the frame control field
  240. of the first MPDU MAC header that passes the RxPCU frame
  241. filter
  242. For MU: RXPCU to base this on the first USER that triggers
  243. this TLV to be generated.
  244. <legal all>
  245. */
  246. #define COEX_RX_STATUS_RETRY_BIT_SETTING_OFFSET 0x0000000000000000
  247. #define COEX_RX_STATUS_RETRY_BIT_SETTING_LSB 30
  248. #define COEX_RX_STATUS_RETRY_BIT_SETTING_MSB 30
  249. #define COEX_RX_STATUS_RETRY_BIT_SETTING_MASK 0x0000000040000000
  250. /* Description MORE_DATA_BIT_SETTING
  251. For SU: Value of the more data bit in the frame control
  252. field of the first MPDU MAC header that passes the RxPCU
  253. frame filter
  254. For MU: RXPCU to base this on the first USER that triggers
  255. this TLV to be generated.
  256. <legal all>
  257. */
  258. #define COEX_RX_STATUS_MORE_DATA_BIT_SETTING_OFFSET 0x0000000000000000
  259. #define COEX_RX_STATUS_MORE_DATA_BIT_SETTING_LSB 31
  260. #define COEX_RX_STATUS_MORE_DATA_BIT_SETTING_MSB 31
  261. #define COEX_RX_STATUS_MORE_DATA_BIT_SETTING_MASK 0x0000000080000000
  262. /* Description REMAIN_RX_PACKET_TIME
  263. HWSCH sends current remaining rx PPDU frame time. This time
  264. covers the entire rx_frame. This information is not in
  265. the L-SIG and we expect to get it from PHY at the start
  266. of the reception.
  267. This is not SU or MU dependent.
  268. <legal all>
  269. */
  270. #define COEX_RX_STATUS_REMAIN_RX_PACKET_TIME_OFFSET 0x0000000000000000
  271. #define COEX_RX_STATUS_REMAIN_RX_PACKET_TIME_LSB 32
  272. #define COEX_RX_STATUS_REMAIN_RX_PACKET_TIME_MSB 47
  273. #define COEX_RX_STATUS_REMAIN_RX_PACKET_TIME_MASK 0x0000ffff00000000
  274. /* Description RX_REMAINING_FES_TIME
  275. RXPCU sends the remaining time FES time the moment a frame
  276. with proper FCS is received. The time indicated is the
  277. remaining rx packet time with the duration field value added.
  278. As long as no frame with valid FCS is received, this field
  279. should be set equal to 'remain_rx_packet_time'
  280. This is not SU or MU dependent.
  281. <legal all>
  282. */
  283. #define COEX_RX_STATUS_RX_REMAINING_FES_TIME_OFFSET 0x0000000000000000
  284. #define COEX_RX_STATUS_RX_REMAINING_FES_TIME_LSB 48
  285. #define COEX_RX_STATUS_RX_REMAINING_FES_TIME_MSB 63
  286. #define COEX_RX_STATUS_RX_REMAINING_FES_TIME_MASK 0xffff000000000000
  287. #endif // COEX_RX_STATUS