mon_drop.h 5.7 KB

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