mon_destination_ring_with_drop.h 11 KB

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