ol_fw_tx_dbg.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. /*
  2. * Copyright (c) 2012 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file ol_fw_tx_dbg.h
  28. *
  29. * @details data structs used for uploading summary info about the FW's tx
  30. */
  31. #ifndef _OL_FW_TX_DBG__H_
  32. #define _OL_FW_TX_DBG__H_
  33. /*
  34. * Undef ATH_SUPPORT_FW_TX_DBG to remove the FW tx debug feature.
  35. * Removing the FW tx debug feature saves a modest amount of program memory.
  36. * The data memory allocation for the FW tx debug feature is controlled
  37. * by the host --> target resource configuration parameters; even if
  38. * ATH_SUPPORT_FW_TX_DBG is defined, no data memory will be allocated for
  39. * the FW tx debug log unless the host --> target resource configuration
  40. * specifies it.
  41. */
  42. #define ATH_SUPPORT_FW_TX_DBG 1 /* enabled */
  43. //#undef ATH_SUPPORT_FW_TX_DBG /* disabled */
  44. #if defined(ATH_TARGET)
  45. #include <osapi.h> /* A_UINT32 */
  46. #else
  47. #include <a_types.h> /* A_UINT32 */
  48. #include <a_osapi.h> /* PREPACK, POSTPACK */
  49. #endif
  50. enum ol_fw_tx_dbg_log_mode {
  51. ol_fw_tx_dbg_log_mode_wraparound, /* overwrite old data with new */
  52. ol_fw_tx_dbg_log_mode_single, /* fill log once, then stop */
  53. };
  54. /*
  55. * tx PPDU stats upload message header
  56. */
  57. struct ol_fw_tx_dbg_ppdu_msg_hdr {
  58. /* word 0 */
  59. #define OL_FW_TX_DBG_PPDU_HDR_NUM_MPDU_BYTES_WORD 0
  60. #define OL_FW_TX_DBG_PPDU_HDR_NUM_MPDU_BYTES_S 0
  61. #define OL_FW_TX_DBG_PPDU_HDR_NUM_MPDU_BYTES_M 0x000000ff
  62. A_UINT8 mpdu_bytes_array_len; /* length of array of per-MPDU byte counts */
  63. #define OL_FW_TX_DBG_PPDU_HDR_NUM_MSDU_BYTES_WORD 0
  64. #define OL_FW_TX_DBG_PPDU_HDR_NUM_MSDU_BYTES_S 8
  65. #define OL_FW_TX_DBG_PPDU_HDR_NUM_MSDU_BYTES_M 0x0000ff00
  66. A_UINT8 msdu_bytes_array_len; /* length of array of per-MSDU byte counts */
  67. #define OL_FW_TX_DBG_PPDU_HDR_NUM_MPDU_MSDUS_WORD 0
  68. #define OL_FW_TX_DBG_PPDU_HDR_NUM_MPDU_MSDUS_S 16
  69. #define OL_FW_TX_DBG_PPDU_HDR_NUM_MPDU_MSDUS_M 0x00ff0000
  70. A_UINT8 mpdu_msdus_array_len; /* length of array of per-MPDU MSDU counts */
  71. A_UINT8 reserved;
  72. /* word 1 */
  73. #define OL_FW_TX_DBG_PPDU_HDR_MICROSEC_PER_TICK_WORD 1
  74. #define OL_FW_TX_DBG_PPDU_HDR_MICROSEC_PER_TICK_S 0
  75. #define OL_FW_TX_DBG_PPDU_HDR_MICROSEC_PER_TICK_M 0xffffffff
  76. A_UINT32 microsec_per_tick; /* conversion for timestamp entries */
  77. };
  78. /*
  79. * tx PPDU log element / stats upload message element
  80. */
  81. struct ol_fw_tx_dbg_ppdu_base {
  82. /* word 0 - filled in during tx enqueue */
  83. #define OL_FW_TX_DBG_PPDU_START_SEQ_NUM_WORD 0
  84. #define OL_FW_TX_DBG_PPDU_START_SEQ_NUM_S 0
  85. #define OL_FW_TX_DBG_PPDU_START_SEQ_NUM_M 0x0000ffff
  86. A_UINT16 start_seq_num;
  87. #define OL_FW_TX_DBG_PPDU_START_PN_LSBS_WORD 0
  88. #define OL_FW_TX_DBG_PPDU_START_PN_LSBS_S 16
  89. #define OL_FW_TX_DBG_PPDU_START_PN_LSBS_M 0xffff0000
  90. A_UINT16 start_pn_lsbs;
  91. /* word 1 - filled in during tx enqueue */
  92. #define OL_FW_TX_DBG_PPDU_NUM_BYTES_WORD 1
  93. #define OL_FW_TX_DBG_PPDU_NUM_BYTES_S 0
  94. #define OL_FW_TX_DBG_PPDU_NUM_BYTES_M 0xffffffff
  95. A_UINT32 num_bytes;
  96. /* word 2 - filled in during tx enqueue */
  97. #define OL_FW_TX_DBG_PPDU_NUM_MSDUS_WORD 2
  98. #define OL_FW_TX_DBG_PPDU_NUM_MSDUS_S 0
  99. #define OL_FW_TX_DBG_PPDU_NUM_MSDUS_M 0x000000ff
  100. A_UINT8 num_msdus;
  101. #define OL_FW_TX_DBG_PPDU_NUM_MPDUS_WORD 2
  102. #define OL_FW_TX_DBG_PPDU_NUM_MPDUS_S 8
  103. #define OL_FW_TX_DBG_PPDU_NUM_MPDUS_M 0x0000ff00
  104. A_UINT8 num_mpdus;
  105. A_UINT16
  106. #define OL_FW_TX_DBG_PPDU_EXT_TID_WORD 2
  107. #define OL_FW_TX_DBG_PPDU_EXT_TID_S 16
  108. #define OL_FW_TX_DBG_PPDU_EXT_TID_M 0x001f0000
  109. ext_tid : 5,
  110. #define OL_FW_TX_DBG_PPDU_PEER_ID_WORD 2
  111. #define OL_FW_TX_DBG_PPDU_PEER_ID_S 21
  112. #define OL_FW_TX_DBG_PPDU_PEER_ID_M 0xffe00000
  113. peer_id : 11;
  114. /* word 3 - filled in during tx enqueue */
  115. #define OL_FW_TX_DBG_PPDU_TIME_ENQUEUE_WORD 3
  116. #define OL_FW_TX_DBG_PPDU_TIME_ENQUEUE_S 0
  117. #define OL_FW_TX_DBG_PPDU_TIME_ENQUEUE_M 0xffffffff
  118. A_UINT32 timestamp_enqueue;
  119. /* word 4 - filled in during tx completion */
  120. #define OL_FW_TX_DBG_PPDU_TIME_COMPL_WORD 4
  121. #define OL_FW_TX_DBG_PPDU_TIME_COMPL_S 0
  122. #define OL_FW_TX_DBG_PPDU_TIME_COMPL_M 0xffffffff
  123. A_UINT32 timestamp_completion;
  124. /* word 5 - filled in during tx completion */
  125. #define OL_FW_TX_DBG_PPDU_BLOCK_ACK_LSBS_WORD 5
  126. #define OL_FW_TX_DBG_PPDU_BLOCK_ACK_LSBS_S 0
  127. #define OL_FW_TX_DBG_PPDU_BLOCK_ACK_LSBS_M 0xffffffff
  128. A_UINT32 block_ack_bitmap_lsbs;
  129. /* word 6 - filled in during tx completion */
  130. #define OL_FW_TX_DBG_PPDU_BLOCK_ACK_MSBS_WORD 6
  131. #define OL_FW_TX_DBG_PPDU_BLOCK_ACK_MSBS_S 0
  132. #define OL_FW_TX_DBG_PPDU_BLOCK_ACK_MSBS_M 0xffffffff
  133. A_UINT32 block_ack_bitmap_msbs;
  134. /* word 7 - filled in during tx completion (enqueue would work too) */
  135. #define OL_FW_TX_DBG_PPDU_ENQUEUED_LSBS_WORD 7
  136. #define OL_FW_TX_DBG_PPDU_ENQUEUED_LSBS_S 0
  137. #define OL_FW_TX_DBG_PPDU_ENQUEUED_LSBS_M 0xffffffff
  138. A_UINT32 enqueued_bitmap_lsbs;
  139. /* word 8 - filled in during tx completion (enqueue would work too) */
  140. #define OL_FW_TX_DBG_PPDU_ENQUEUED_MSBS_WORD 8
  141. #define OL_FW_TX_DBG_PPDU_ENQUEUED_MSBS_S 0
  142. #define OL_FW_TX_DBG_PPDU_ENQUEUED_MSBS_M 0xffffffff
  143. A_UINT32 enqueued_bitmap_msbs;
  144. /* word 9 - filled in during tx completion */
  145. #define OL_FW_TX_DBG_PPDU_RATE_CODE_WORD 9
  146. #define OL_FW_TX_DBG_PPDU_RATE_CODE_S 0
  147. #define OL_FW_TX_DBG_PPDU_RATE_CODE_M 0x000000ff
  148. A_UINT8 rate_code;
  149. #define OL_FW_TX_DBG_PPDU_RATE_FLAGS_WORD 9
  150. #define OL_FW_TX_DBG_PPDU_RATE_FLAGS_S 8
  151. #define OL_FW_TX_DBG_PPDU_RATE_FLAGS_M 0x0000ff00
  152. A_UINT8 rate_flags; /* includes dynamic bandwidth info */
  153. #define OL_FW_TX_DBG_PPDU_TRIES_WORD 9
  154. #define OL_FW_TX_DBG_PPDU_TRIES_S 16
  155. #define OL_FW_TX_DBG_PPDU_TRIES_M 0x00ff0000
  156. A_UINT8 tries;
  157. #define OL_FW_TX_DBG_PPDU_COMPLETE_WORD 9
  158. #define OL_FW_TX_DBG_PPDU_COMPLETE_S 24
  159. #define OL_FW_TX_DBG_PPDU_COMPLETE_M 0xff000000
  160. A_UINT8 complete;
  161. };
  162. #endif /* _OL_FW_TX_DBG__H_ */