mon_buffer_addr.h 6.5 KB

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