mon_buffer_addr.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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_BUFFER_ADDR_H_
  16. #define _MON_BUFFER_ADDR_H_
  17. #if !defined(__ASSEMBLER__)
  18. #endif
  19. #define NUM_OF_DWORDS_MON_BUFFER_ADDR 4
  20. #define NUM_OF_QWORDS_MON_BUFFER_ADDR 2
  21. struct mon_buffer_addr {
  22. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  23. uint32_t buffer_virt_addr_31_0 : 32; // [31:0]
  24. uint32_t buffer_virt_addr_63_32 : 32; // [31:0]
  25. uint32_t dma_length : 12, // [11:0]
  26. reserved_2a : 4, // [15:12]
  27. msdu_continuation : 1, // [16:16]
  28. truncated : 1, // [17:17]
  29. reserved_2b : 14; // [31:18]
  30. uint32_t tlv64_padding : 32; // [31:0]
  31. #else
  32. uint32_t buffer_virt_addr_31_0 : 32; // [31:0]
  33. uint32_t buffer_virt_addr_63_32 : 32; // [31:0]
  34. uint32_t reserved_2b : 14, // [31:18]
  35. truncated : 1, // [17:17]
  36. msdu_continuation : 1, // [16:16]
  37. reserved_2a : 4, // [15:12]
  38. dma_length : 12; // [11:0]
  39. uint32_t tlv64_padding : 32; // [31:0]
  40. #endif
  41. };
  42. /* Description BUFFER_VIRT_ADDR_31_0
  43. Lower 32 bits of the 64-bit virtual address of the packet
  44. buffer
  45. <legal all>
  46. */
  47. #define MON_BUFFER_ADDR_BUFFER_VIRT_ADDR_31_0_OFFSET 0x0000000000000000
  48. #define MON_BUFFER_ADDR_BUFFER_VIRT_ADDR_31_0_LSB 0
  49. #define MON_BUFFER_ADDR_BUFFER_VIRT_ADDR_31_0_MSB 31
  50. #define MON_BUFFER_ADDR_BUFFER_VIRT_ADDR_31_0_MASK 0x00000000ffffffff
  51. /* Description BUFFER_VIRT_ADDR_63_32
  52. Upper 32 bits of the 64-bit virtual address of the packet
  53. buffer
  54. <legal all>
  55. */
  56. #define MON_BUFFER_ADDR_BUFFER_VIRT_ADDR_63_32_OFFSET 0x0000000000000000
  57. #define MON_BUFFER_ADDR_BUFFER_VIRT_ADDR_63_32_LSB 32
  58. #define MON_BUFFER_ADDR_BUFFER_VIRT_ADDR_63_32_MSB 63
  59. #define MON_BUFFER_ADDR_BUFFER_VIRT_ADDR_63_32_MASK 0xffffffff00000000
  60. /* Description DMA_LENGTH
  61. The number of bytes DMA'd into the packet buffer MINUS 1.
  62. The packet could be truncated in case of a 'TX_FLUSH' or
  63. 'RX_FLUSH,' or in case of drops due to back-pressure.
  64. <legal all>
  65. */
  66. #define MON_BUFFER_ADDR_DMA_LENGTH_OFFSET 0x0000000000000008
  67. #define MON_BUFFER_ADDR_DMA_LENGTH_LSB 0
  68. #define MON_BUFFER_ADDR_DMA_LENGTH_MSB 11
  69. #define MON_BUFFER_ADDR_DMA_LENGTH_MASK 0x0000000000000fff
  70. /* Description RESERVED_2A
  71. <legal 0>
  72. */
  73. #define MON_BUFFER_ADDR_RESERVED_2A_OFFSET 0x0000000000000008
  74. #define MON_BUFFER_ADDR_RESERVED_2A_LSB 12
  75. #define MON_BUFFER_ADDR_RESERVED_2A_MSB 15
  76. #define MON_BUFFER_ADDR_RESERVED_2A_MASK 0x000000000000f000
  77. /* Description MSDU_CONTINUATION
  78. When set, this packet buffer was not able to hold the entire
  79. MSDU. The next buffer will therefore contain additional
  80. packet bytes.
  81. <legal all>
  82. */
  83. #define MON_BUFFER_ADDR_MSDU_CONTINUATION_OFFSET 0x0000000000000008
  84. #define MON_BUFFER_ADDR_MSDU_CONTINUATION_LSB 16
  85. #define MON_BUFFER_ADDR_MSDU_CONTINUATION_MSB 16
  86. #define MON_BUFFER_ADDR_MSDU_CONTINUATION_MASK 0x0000000000010000
  87. /* Description TRUNCATED
  88. When set, this TLV belongs to a previously truncated MPDU.
  89. <legal all>
  90. */
  91. #define MON_BUFFER_ADDR_TRUNCATED_OFFSET 0x0000000000000008
  92. #define MON_BUFFER_ADDR_TRUNCATED_LSB 17
  93. #define MON_BUFFER_ADDR_TRUNCATED_MSB 17
  94. #define MON_BUFFER_ADDR_TRUNCATED_MASK 0x0000000000020000
  95. /* Description RESERVED_2B
  96. <legal 0>
  97. */
  98. #define MON_BUFFER_ADDR_RESERVED_2B_OFFSET 0x0000000000000008
  99. #define MON_BUFFER_ADDR_RESERVED_2B_LSB 18
  100. #define MON_BUFFER_ADDR_RESERVED_2B_MSB 31
  101. #define MON_BUFFER_ADDR_RESERVED_2B_MASK 0x00000000fffc0000
  102. /* Description TLV64_PADDING
  103. Automatic DWORD padding inserted while converting TLV32
  104. to TLV64 for 64 bit ARCH
  105. <legal 0>
  106. */
  107. #define MON_BUFFER_ADDR_TLV64_PADDING_OFFSET 0x0000000000000008
  108. #define MON_BUFFER_ADDR_TLV64_PADDING_LSB 32
  109. #define MON_BUFFER_ADDR_TLV64_PADDING_MSB 63
  110. #define MON_BUFFER_ADDR_TLV64_PADDING_MASK 0xffffffff00000000
  111. #endif // MON_BUFFER_ADDR