txpcu_buffer_status.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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 _TXPCU_BUFFER_STATUS_H_
  16. #define _TXPCU_BUFFER_STATUS_H_
  17. #if !defined(__ASSEMBLER__)
  18. #endif
  19. #include "txpcu_buffer_basics.h"
  20. #define NUM_OF_DWORDS_TXPCU_BUFFER_STATUS 2
  21. #define NUM_OF_QWORDS_TXPCU_BUFFER_STATUS 1
  22. struct txpcu_buffer_status {
  23. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  24. struct txpcu_buffer_basics txpcu_basix_buffer_info;
  25. uint32_t reserved : 15, // [14:0]
  26. msdu_end : 1, // [15:15]
  27. tx_data_sync_value : 16; // [31:16]
  28. #else
  29. struct txpcu_buffer_basics txpcu_basix_buffer_info;
  30. uint32_t tx_data_sync_value : 16, // [31:16]
  31. msdu_end : 1, // [15:15]
  32. reserved : 15; // [14:0]
  33. #endif
  34. };
  35. /* Description TXPCU_BASIX_BUFFER_INFO
  36. Global overview of the TXPCU buffer
  37. <legal all>
  38. */
  39. /* Description AVAILABLE_MEMORY
  40. The amount of TX_FIFO memory in 128 byte units that is available.
  41. TXPCU gets this from the Avail_fifo_mem signal from SFM.
  42. When SFM is indicating a larger available amount, that value
  43. shall be saturated to 0xFF in this field.
  44. <legal all>
  45. */
  46. #define TXPCU_BUFFER_STATUS_TXPCU_BASIX_BUFFER_INFO_AVAILABLE_MEMORY_OFFSET 0x0000000000000000
  47. #define TXPCU_BUFFER_STATUS_TXPCU_BASIX_BUFFER_INFO_AVAILABLE_MEMORY_LSB 0
  48. #define TXPCU_BUFFER_STATUS_TXPCU_BASIX_BUFFER_INFO_AVAILABLE_MEMORY_MSB 7
  49. #define TXPCU_BUFFER_STATUS_TXPCU_BASIX_BUFFER_INFO_AVAILABLE_MEMORY_MASK 0x00000000000000ff
  50. /* Description PARTIAL_TX_DATA_TLV_COUNT
  51. The number of 16 bytes units received of the TX_DATA TLV
  52. that is currently under reception by TXPCU.
  53. Value saturates at 255 in case TX_DATA TLV length is larger
  54. then 4080 bytes. This is unlikely as TX_DATA will generally
  55. not be larger then then the Max MSDU size.
  56. <legal all>
  57. */
  58. #define TXPCU_BUFFER_STATUS_TXPCU_BASIX_BUFFER_INFO_PARTIAL_TX_DATA_TLV_COUNT_OFFSET 0x0000000000000000
  59. #define TXPCU_BUFFER_STATUS_TXPCU_BASIX_BUFFER_INFO_PARTIAL_TX_DATA_TLV_COUNT_LSB 8
  60. #define TXPCU_BUFFER_STATUS_TXPCU_BASIX_BUFFER_INFO_PARTIAL_TX_DATA_TLV_COUNT_MSB 15
  61. #define TXPCU_BUFFER_STATUS_TXPCU_BASIX_BUFFER_INFO_PARTIAL_TX_DATA_TLV_COUNT_MASK 0x000000000000ff00
  62. /* Description TX_DATA_TLV_COUNT
  63. The number of completely received TX_DATA TLVs (of all the
  64. users together) received by TXPCU
  65. <legal all>
  66. */
  67. #define TXPCU_BUFFER_STATUS_TXPCU_BASIX_BUFFER_INFO_TX_DATA_TLV_COUNT_OFFSET 0x0000000000000000
  68. #define TXPCU_BUFFER_STATUS_TXPCU_BASIX_BUFFER_INFO_TX_DATA_TLV_COUNT_LSB 16
  69. #define TXPCU_BUFFER_STATUS_TXPCU_BASIX_BUFFER_INFO_TX_DATA_TLV_COUNT_MSB 31
  70. #define TXPCU_BUFFER_STATUS_TXPCU_BASIX_BUFFER_INFO_TX_DATA_TLV_COUNT_MASK 0x00000000ffff0000
  71. /* Description RESERVED
  72. <legal 0>
  73. */
  74. #define TXPCU_BUFFER_STATUS_RESERVED_OFFSET 0x0000000000000000
  75. #define TXPCU_BUFFER_STATUS_RESERVED_LSB 32
  76. #define TXPCU_BUFFER_STATUS_RESERVED_MSB 46
  77. #define TXPCU_BUFFER_STATUS_RESERVED_MASK 0x00007fff00000000
  78. /* Description MSDU_END
  79. Bit to indicate that TXPCU has received an entire MSDU and
  80. 'TX_MSDU_END'
  81. <legal all>
  82. */
  83. #define TXPCU_BUFFER_STATUS_MSDU_END_OFFSET 0x0000000000000000
  84. #define TXPCU_BUFFER_STATUS_MSDU_END_LSB 47
  85. #define TXPCU_BUFFER_STATUS_MSDU_END_MSB 47
  86. #define TXPCU_BUFFER_STATUS_MSDU_END_MASK 0x0000800000000000
  87. /* Description TX_DATA_SYNC_VALUE
  88. The last received sync_value number from the TX_DATA_SYNC
  89. TLV
  90. At reception of TX_FES_SETUP, TXPCU initializes this value
  91. to 0
  92. <legal all>
  93. */
  94. #define TXPCU_BUFFER_STATUS_TX_DATA_SYNC_VALUE_OFFSET 0x0000000000000000
  95. #define TXPCU_BUFFER_STATUS_TX_DATA_SYNC_VALUE_LSB 48
  96. #define TXPCU_BUFFER_STATUS_TX_DATA_SYNC_VALUE_MSB 63
  97. #define TXPCU_BUFFER_STATUS_TX_DATA_SYNC_VALUE_MASK 0xffff000000000000
  98. #endif // TXPCU_BUFFER_STATUS