mon_drop.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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_DROP_H_
  16. #define _MON_DROP_H_
  17. #if !defined(__ASSEMBLER__)
  18. #endif
  19. #define NUM_OF_DWORDS_MON_DROP 2
  20. #define NUM_OF_QWORDS_MON_DROP 1
  21. struct mon_drop {
  22. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  23. uint32_t ppdu_id : 32; // [31:0]
  24. uint32_t ppdu_drop_cnt : 10, // [9:0]
  25. mpdu_drop_cnt : 10, // [19:10]
  26. tlv_drop_cnt : 10, // [29:20]
  27. end_of_ppdu_seen : 1, // [30:30]
  28. reserved_1a : 1; // [31:31]
  29. #else
  30. uint32_t ppdu_id : 32; // [31:0]
  31. uint32_t reserved_1a : 1, // [31:31]
  32. end_of_ppdu_seen : 1, // [30:30]
  33. tlv_drop_cnt : 10, // [29:20]
  34. mpdu_drop_cnt : 10, // [19:10]
  35. ppdu_drop_cnt : 10; // [9:0]
  36. #endif
  37. };
  38. /* Description PPDU_ID
  39. The ID of the last PPDU which saw the back-pressure on AXI
  40. TXMON fills this with the schedule_id from 'TX_FES_SETUP'
  41. in case of a TX FES (TXOP initiator).
  42. TXMON fills this with the Phy_ppdu_id from 'RX_RESPONSE_REQUIRED_INFO'
  43. in case of a response TX (TXOP responder).
  44. RXMON fills this with the Phy_ppdu_id from 'RX_PPDU_START.'
  45. <legal all>
  46. */
  47. #define MON_DROP_PPDU_ID_OFFSET 0x0000000000000000
  48. #define MON_DROP_PPDU_ID_LSB 0
  49. #define MON_DROP_PPDU_ID_MSB 31
  50. #define MON_DROP_PPDU_ID_MASK 0x00000000ffffffff
  51. /* Description PPDU_DROP_CNT
  52. The number of PPDUs dropped due to the back-pressure
  53. Set to 1023 if >1023 PPDUs got dropped
  54. <legal all>
  55. */
  56. #define MON_DROP_PPDU_DROP_CNT_OFFSET 0x0000000000000000
  57. #define MON_DROP_PPDU_DROP_CNT_LSB 32
  58. #define MON_DROP_PPDU_DROP_CNT_MSB 41
  59. #define MON_DROP_PPDU_DROP_CNT_MASK 0x000003ff00000000
  60. /* Description MPDU_DROP_CNT
  61. The number of MPDUs dropped within the first PPDU due to
  62. the back-pressure
  63. Set to 1023 if >1023 MPDUs got dropped
  64. <legal all>
  65. */
  66. #define MON_DROP_MPDU_DROP_CNT_OFFSET 0x0000000000000000
  67. #define MON_DROP_MPDU_DROP_CNT_LSB 42
  68. #define MON_DROP_MPDU_DROP_CNT_MSB 51
  69. #define MON_DROP_MPDU_DROP_CNT_MASK 0x000ffc0000000000
  70. /* Description TLV_DROP_CNT
  71. The number of PPDU-level (global or per-user) TLVs dropped
  72. within the first PPDU due to the back-pressure
  73. */
  74. #define MON_DROP_TLV_DROP_CNT_OFFSET 0x0000000000000000
  75. #define MON_DROP_TLV_DROP_CNT_LSB 52
  76. #define MON_DROP_TLV_DROP_CNT_MSB 61
  77. #define MON_DROP_TLV_DROP_CNT_MASK 0x3ff0000000000000
  78. /* Description END_OF_PPDU_SEEN
  79. Field valid only if mpdu_drop_cnt > 0 or tlv_drop_cnt >
  80. 0
  81. Set by TXMON if 'TX_FES_STATUS_END' is received but dropped
  82. in case of a TX FES (TXOP initiator).
  83. Set by TXMON if 'RESPONSE_END_STATUS' is received but dropped
  84. in case of a response TX (TXOP responder).
  85. Set by RXMON if 'RX_PPDU_END' is received but dropped
  86. */
  87. #define MON_DROP_END_OF_PPDU_SEEN_OFFSET 0x0000000000000000
  88. #define MON_DROP_END_OF_PPDU_SEEN_LSB 62
  89. #define MON_DROP_END_OF_PPDU_SEEN_MSB 62
  90. #define MON_DROP_END_OF_PPDU_SEEN_MASK 0x4000000000000000
  91. /* Description RESERVED_1A
  92. <legal 0>
  93. */
  94. #define MON_DROP_RESERVED_1A_OFFSET 0x0000000000000000
  95. #define MON_DROP_RESERVED_1A_LSB 63
  96. #define MON_DROP_RESERVED_1A_MSB 63
  97. #define MON_DROP_RESERVED_1A_MASK 0x8000000000000000
  98. #endif // MON_DROP