txpcu_buffer_status.h 5.4 KB

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