txpcu_buffer_basics.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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_BASICS_H_
  16. #define _TXPCU_BUFFER_BASICS_H_
  17. #if !defined(__ASSEMBLER__)
  18. #endif
  19. #define NUM_OF_DWORDS_TXPCU_BUFFER_BASICS 1
  20. struct txpcu_buffer_basics {
  21. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  22. uint32_t available_memory : 8, // [7:0]
  23. partial_tx_data_tlv_count : 8, // [15:8]
  24. tx_data_tlv_count : 16; // [31:16]
  25. #else
  26. uint32_t tx_data_tlv_count : 16, // [31:16]
  27. partial_tx_data_tlv_count : 8, // [15:8]
  28. available_memory : 8; // [7:0]
  29. #endif
  30. };
  31. /* Description AVAILABLE_MEMORY
  32. The amount of TX_FIFO memory in 128 byte units that is available.
  33. TXPCU gets this from the Avail_fifo_mem signal from SFM.
  34. When SFM is indicating a larger available amount, that value
  35. shall be saturated to 0xFF in this field.
  36. <legal all>
  37. */
  38. #define TXPCU_BUFFER_BASICS_AVAILABLE_MEMORY_OFFSET 0x00000000
  39. #define TXPCU_BUFFER_BASICS_AVAILABLE_MEMORY_LSB 0
  40. #define TXPCU_BUFFER_BASICS_AVAILABLE_MEMORY_MSB 7
  41. #define TXPCU_BUFFER_BASICS_AVAILABLE_MEMORY_MASK 0x000000ff
  42. /* Description PARTIAL_TX_DATA_TLV_COUNT
  43. The number of 16 bytes units received of the TX_DATA TLV
  44. that is currently under reception by TXPCU.
  45. Value saturates at 255 in case TX_DATA TLV length is larger
  46. then 4080 bytes. This is unlikely as TX_DATA will generally
  47. not be larger then then the Max MSDU size.
  48. <legal all>
  49. */
  50. #define TXPCU_BUFFER_BASICS_PARTIAL_TX_DATA_TLV_COUNT_OFFSET 0x00000000
  51. #define TXPCU_BUFFER_BASICS_PARTIAL_TX_DATA_TLV_COUNT_LSB 8
  52. #define TXPCU_BUFFER_BASICS_PARTIAL_TX_DATA_TLV_COUNT_MSB 15
  53. #define TXPCU_BUFFER_BASICS_PARTIAL_TX_DATA_TLV_COUNT_MASK 0x0000ff00
  54. /* Description TX_DATA_TLV_COUNT
  55. The number of completely received TX_DATA TLVs (of all the
  56. users together) received by TXPCU
  57. <legal all>
  58. */
  59. #define TXPCU_BUFFER_BASICS_TX_DATA_TLV_COUNT_OFFSET 0x00000000
  60. #define TXPCU_BUFFER_BASICS_TX_DATA_TLV_COUNT_LSB 16
  61. #define TXPCU_BUFFER_BASICS_TX_DATA_TLV_COUNT_MSB 31
  62. #define TXPCU_BUFFER_BASICS_TX_DATA_TLV_COUNT_MASK 0xffff0000
  63. #endif // TXPCU_BUFFER_BASICS