coex_rx_status.h 16 KB

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