mon_destination_ring_with_drop.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  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 _MON_DESTINATION_RING_WITH_DROP_H_
  16. #define _MON_DESTINATION_RING_WITH_DROP_H_
  17. #if !defined(__ASSEMBLER__)
  18. #endif
  19. #define NUM_OF_DWORDS_MON_DESTINATION_RING_WITH_DROP 4
  20. struct mon_destination_ring_with_drop {
  21. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  22. uint32_t ppdu_drop_cnt : 10, // [9:0]
  23. mpdu_drop_cnt : 10, // [19:10]
  24. tlv_drop_cnt : 10, // [29:20]
  25. end_of_ppdu_seen : 1, // [30:30]
  26. reserved_0a : 1; // [31:31]
  27. uint32_t reserved_1a : 32; // [31:0]
  28. uint32_t ppdu_id : 32; // [31:0]
  29. uint32_t reserved_3a : 18, // [17:0]
  30. initiator : 1, // [18:18]
  31. empty_descriptor : 1, // [19:19]
  32. ring_id : 8, // [27:20]
  33. looping_count : 4; // [31:28]
  34. #else
  35. uint32_t reserved_0a : 1, // [31:31]
  36. end_of_ppdu_seen : 1, // [30:30]
  37. tlv_drop_cnt : 10, // [29:20]
  38. mpdu_drop_cnt : 10, // [19:10]
  39. ppdu_drop_cnt : 10; // [9:0]
  40. uint32_t reserved_1a : 32; // [31:0]
  41. uint32_t ppdu_id : 32; // [31:0]
  42. uint32_t looping_count : 4, // [31:28]
  43. ring_id : 8, // [27:20]
  44. empty_descriptor : 1, // [19:19]
  45. initiator : 1, // [18:18]
  46. reserved_3a : 18; // [17:0]
  47. #endif
  48. };
  49. /* Description PPDU_DROP_CNT
  50. The number of PPDUs dropped due to the back-pressure
  51. Set to 1023 if >1023 PPDUs got dropped
  52. <legal all>
  53. */
  54. #define MON_DESTINATION_RING_WITH_DROP_PPDU_DROP_CNT_OFFSET 0x00000000
  55. #define MON_DESTINATION_RING_WITH_DROP_PPDU_DROP_CNT_LSB 0
  56. #define MON_DESTINATION_RING_WITH_DROP_PPDU_DROP_CNT_MSB 9
  57. #define MON_DESTINATION_RING_WITH_DROP_PPDU_DROP_CNT_MASK 0x000003ff
  58. /* Description MPDU_DROP_CNT
  59. The number of MPDUs dropped within the first PPDU due to
  60. the back-pressure
  61. Set to 1023 if >1023 MPDUs got dropped
  62. <legal all>
  63. */
  64. #define MON_DESTINATION_RING_WITH_DROP_MPDU_DROP_CNT_OFFSET 0x00000000
  65. #define MON_DESTINATION_RING_WITH_DROP_MPDU_DROP_CNT_LSB 10
  66. #define MON_DESTINATION_RING_WITH_DROP_MPDU_DROP_CNT_MSB 19
  67. #define MON_DESTINATION_RING_WITH_DROP_MPDU_DROP_CNT_MASK 0x000ffc00
  68. /* Description TLV_DROP_CNT
  69. The number of PPDU-level (global or per-user) TLVs dropped
  70. within the first PPDU due to the back-pressure
  71. */
  72. #define MON_DESTINATION_RING_WITH_DROP_TLV_DROP_CNT_OFFSET 0x00000000
  73. #define MON_DESTINATION_RING_WITH_DROP_TLV_DROP_CNT_LSB 20
  74. #define MON_DESTINATION_RING_WITH_DROP_TLV_DROP_CNT_MSB 29
  75. #define MON_DESTINATION_RING_WITH_DROP_TLV_DROP_CNT_MASK 0x3ff00000
  76. /* Description END_OF_PPDU_SEEN
  77. Field valid only if mpdu_drop_cnt > 0 or tlv_drop_cnt >
  78. 0
  79. Set by TXMON if 'TX_FES_STATUS_END' is received for a partially
  80. dropped PPDU when Initiator = 1.
  81. Set by TXMON if 'RESPONSE_END_STATUS' is received for a
  82. partially dropped PPDU when Initiator = 0.
  83. Set by RXMON if 'RX_PPDU_END_STATUS_DONE' is received for
  84. a partially dropped PPDU.
  85. */
  86. #define MON_DESTINATION_RING_WITH_DROP_END_OF_PPDU_SEEN_OFFSET 0x00000000
  87. #define MON_DESTINATION_RING_WITH_DROP_END_OF_PPDU_SEEN_LSB 30
  88. #define MON_DESTINATION_RING_WITH_DROP_END_OF_PPDU_SEEN_MSB 30
  89. #define MON_DESTINATION_RING_WITH_DROP_END_OF_PPDU_SEEN_MASK 0x40000000
  90. /* Description RESERVED_0A
  91. <legal 0>
  92. */
  93. #define MON_DESTINATION_RING_WITH_DROP_RESERVED_0A_OFFSET 0x00000000
  94. #define MON_DESTINATION_RING_WITH_DROP_RESERVED_0A_LSB 31
  95. #define MON_DESTINATION_RING_WITH_DROP_RESERVED_0A_MSB 31
  96. #define MON_DESTINATION_RING_WITH_DROP_RESERVED_0A_MASK 0x80000000
  97. /* Description RESERVED_1A
  98. <legal 0>
  99. */
  100. #define MON_DESTINATION_RING_WITH_DROP_RESERVED_1A_OFFSET 0x00000004
  101. #define MON_DESTINATION_RING_WITH_DROP_RESERVED_1A_LSB 0
  102. #define MON_DESTINATION_RING_WITH_DROP_RESERVED_1A_MSB 31
  103. #define MON_DESTINATION_RING_WITH_DROP_RESERVED_1A_MASK 0xffffffff
  104. /* Description PPDU_ID
  105. The ID of the last PPDU which saw the back-pressure on AXI
  106. TXMON fills this with the schedule_id from 'TX_FES_SETUP'
  107. when Initiator = 1.
  108. TXMON fills this with the Phy_ppdu_id from 'RX_RESPONSE_REQUIRED_INFO'
  109. when Initiator = 0.
  110. RXMON fills this with the Phy_ppdu_id from 'RX_PPDU_START.'
  111. <legal all>
  112. */
  113. #define MON_DESTINATION_RING_WITH_DROP_PPDU_ID_OFFSET 0x00000008
  114. #define MON_DESTINATION_RING_WITH_DROP_PPDU_ID_LSB 0
  115. #define MON_DESTINATION_RING_WITH_DROP_PPDU_ID_MSB 31
  116. #define MON_DESTINATION_RING_WITH_DROP_PPDU_ID_MASK 0xffffffff
  117. /* Description RESERVED_3A
  118. <legal 0>
  119. */
  120. #define MON_DESTINATION_RING_WITH_DROP_RESERVED_3A_OFFSET 0x0000000c
  121. #define MON_DESTINATION_RING_WITH_DROP_RESERVED_3A_LSB 0
  122. #define MON_DESTINATION_RING_WITH_DROP_RESERVED_3A_MSB 17
  123. #define MON_DESTINATION_RING_WITH_DROP_RESERVED_3A_MASK 0x0003ffff
  124. /* Description INITIATOR
  125. 1: This descriptor belongs to a TX FES (TXOP initiator)
  126. 0: This descriptor belongs to a response TX (TXOP responder)
  127. <legal all>
  128. */
  129. #define MON_DESTINATION_RING_WITH_DROP_INITIATOR_OFFSET 0x0000000c
  130. #define MON_DESTINATION_RING_WITH_DROP_INITIATOR_LSB 18
  131. #define MON_DESTINATION_RING_WITH_DROP_INITIATOR_MSB 18
  132. #define MON_DESTINATION_RING_WITH_DROP_INITIATOR_MASK 0x00040000
  133. /* Description EMPTY_DESCRIPTOR
  134. 0: This descriptor is written on a flush or the end of a
  135. PPDU or the end of status buffer (see 'MON_DESTINATION_RING'
  136. structure)
  137. 1: This descriptor is written to indicate drop information
  138. <legal 1>
  139. */
  140. #define MON_DESTINATION_RING_WITH_DROP_EMPTY_DESCRIPTOR_OFFSET 0x0000000c
  141. #define MON_DESTINATION_RING_WITH_DROP_EMPTY_DESCRIPTOR_LSB 19
  142. #define MON_DESTINATION_RING_WITH_DROP_EMPTY_DESCRIPTOR_MSB 19
  143. #define MON_DESTINATION_RING_WITH_DROP_EMPTY_DESCRIPTOR_MASK 0x00080000
  144. /* Description RING_ID
  145. Consumer: SW/REO/DEBUG
  146. Producer: SRNG (of TXMON/RXMON)
  147. For debugging.
  148. This field is filled in by the SRNG module.
  149. It help to identify the ring that is being looked
  150. <legal 0>
  151. */
  152. #define MON_DESTINATION_RING_WITH_DROP_RING_ID_OFFSET 0x0000000c
  153. #define MON_DESTINATION_RING_WITH_DROP_RING_ID_LSB 20
  154. #define MON_DESTINATION_RING_WITH_DROP_RING_ID_MSB 27
  155. #define MON_DESTINATION_RING_WITH_DROP_RING_ID_MASK 0x0ff00000
  156. /* Description LOOPING_COUNT
  157. Consumer: SW/DEBUG
  158. Producer: SRNG (of TXMON/RXMON)
  159. For debugging.
  160. This field is filled in by the SRNG module.
  161. A count value that indicates the number of times the producer
  162. of entries into this Ring has looped around the ring.
  163. At initialization time, this value is set to 0. On the first
  164. loop, this value is set to 1. After the max value is reached
  165. allowed by the number of bits for this field, the count
  166. value continues with 0 again.
  167. In case SW is the consumer of the ring entries, it can use
  168. this field to figure out up to where the producer of entries
  169. has created new entries. This eliminates the need to check
  170. where the "head pointer' of the ring is located once the
  171. SW starts processing an interrupt indicating that new entries
  172. have been put into this ring...
  173. Also note that SW if it wants only needs to look at the
  174. LSB bit of this count value.
  175. <legal all>
  176. */
  177. #define MON_DESTINATION_RING_WITH_DROP_LOOPING_COUNT_OFFSET 0x0000000c
  178. #define MON_DESTINATION_RING_WITH_DROP_LOOPING_COUNT_LSB 28
  179. #define MON_DESTINATION_RING_WITH_DROP_LOOPING_COUNT_MSB 31
  180. #define MON_DESTINATION_RING_WITH_DROP_LOOPING_COUNT_MASK 0xf0000000
  181. #endif // MON_DESTINATION_RING_WITH_DROP