rx_ppdu_start.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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 _RX_PPDU_START_H_
  16. #define _RX_PPDU_START_H_
  17. #if !defined(__ASSEMBLER__)
  18. #endif
  19. #define NUM_OF_DWORDS_RX_PPDU_START 6
  20. #define NUM_OF_QWORDS_RX_PPDU_START 3
  21. struct rx_ppdu_start {
  22. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  23. uint32_t phy_ppdu_id : 16, // [15:0]
  24. preamble_time_to_rxframe : 8, // [23:16]
  25. reserved_0a : 8; // [31:24]
  26. uint32_t sw_phy_meta_data : 32; // [31:0]
  27. uint32_t ppdu_start_timestamp_31_0 : 32; // [31:0]
  28. uint32_t ppdu_start_timestamp_63_32 : 32; // [31:0]
  29. uint32_t rxframe_assert_timestamp : 32; // [31:0]
  30. uint32_t tlv64_padding : 32; // [31:0]
  31. #else
  32. uint32_t reserved_0a : 8, // [31:24]
  33. preamble_time_to_rxframe : 8, // [23:16]
  34. phy_ppdu_id : 16; // [15:0]
  35. uint32_t sw_phy_meta_data : 32; // [31:0]
  36. uint32_t ppdu_start_timestamp_31_0 : 32; // [31:0]
  37. uint32_t ppdu_start_timestamp_63_32 : 32; // [31:0]
  38. uint32_t rxframe_assert_timestamp : 32; // [31:0]
  39. uint32_t tlv64_padding : 32; // [31:0]
  40. #endif
  41. };
  42. /* Description PHY_PPDU_ID
  43. A ppdu counter value that PHY increments for every PPDU
  44. received. The counter value wraps around
  45. <legal all>
  46. */
  47. #define RX_PPDU_START_PHY_PPDU_ID_OFFSET 0x0000000000000000
  48. #define RX_PPDU_START_PHY_PPDU_ID_LSB 0
  49. #define RX_PPDU_START_PHY_PPDU_ID_MSB 15
  50. #define RX_PPDU_START_PHY_PPDU_ID_MASK 0x000000000000ffff
  51. /* Description PREAMBLE_TIME_TO_RXFRAME
  52. The amount of time (in us) of the frame being put on the
  53. medium, and PHY raising rx_frame
  54. From 'PHYRX_RSSI_LEGACY. Preamble_time_to_rx_frame'
  55. <legal all>
  56. */
  57. #define RX_PPDU_START_PREAMBLE_TIME_TO_RXFRAME_OFFSET 0x0000000000000000
  58. #define RX_PPDU_START_PREAMBLE_TIME_TO_RXFRAME_LSB 16
  59. #define RX_PPDU_START_PREAMBLE_TIME_TO_RXFRAME_MSB 23
  60. #define RX_PPDU_START_PREAMBLE_TIME_TO_RXFRAME_MASK 0x0000000000ff0000
  61. /* Description RESERVED_0A
  62. Reserved
  63. <legal 0>
  64. */
  65. #define RX_PPDU_START_RESERVED_0A_OFFSET 0x0000000000000000
  66. #define RX_PPDU_START_RESERVED_0A_LSB 24
  67. #define RX_PPDU_START_RESERVED_0A_MSB 31
  68. #define RX_PPDU_START_RESERVED_0A_MASK 0x00000000ff000000
  69. /* Description SW_PHY_META_DATA
  70. SW programmed Meta data provided by the PHY.
  71. Can be used for SW to indicate the channel the device is
  72. on.
  73. From 'PHYRX_RSSI_LEGACY.Sw_phy_meta_data'
  74. */
  75. #define RX_PPDU_START_SW_PHY_META_DATA_OFFSET 0x0000000000000000
  76. #define RX_PPDU_START_SW_PHY_META_DATA_LSB 32
  77. #define RX_PPDU_START_SW_PHY_META_DATA_MSB 63
  78. #define RX_PPDU_START_SW_PHY_META_DATA_MASK 0xffffffff00000000
  79. /* Description PPDU_START_TIMESTAMP_31_0
  80. Timestamp that indicates when the PPDU that contained this
  81. MPDU started on the medium, lower 32 bits.
  82. The timestamp is captured by the PHY and given to the MAC
  83. in 'PHYRX_RSSI_LEGACY.ppdu_start_timestamp_*.'
  84. <legal all>
  85. */
  86. #define RX_PPDU_START_PPDU_START_TIMESTAMP_31_0_OFFSET 0x0000000000000008
  87. #define RX_PPDU_START_PPDU_START_TIMESTAMP_31_0_LSB 0
  88. #define RX_PPDU_START_PPDU_START_TIMESTAMP_31_0_MSB 31
  89. #define RX_PPDU_START_PPDU_START_TIMESTAMP_31_0_MASK 0x00000000ffffffff
  90. /* Description PPDU_START_TIMESTAMP_63_32
  91. Timestamp that indicates when the PPDU that contained this
  92. MPDU started on the medium, upper 32 bits.
  93. The timestamp is captured by the PHY and given to the MAC
  94. in 'PHYRX_RSSI_LEGACY.ppdu_start_timestamp_*.'
  95. <legal all>
  96. */
  97. #define RX_PPDU_START_PPDU_START_TIMESTAMP_63_32_OFFSET 0x0000000000000008
  98. #define RX_PPDU_START_PPDU_START_TIMESTAMP_63_32_LSB 32
  99. #define RX_PPDU_START_PPDU_START_TIMESTAMP_63_32_MSB 63
  100. #define RX_PPDU_START_PPDU_START_TIMESTAMP_63_32_MASK 0xffffffff00000000
  101. /* Description RXFRAME_ASSERT_TIMESTAMP
  102. MAC timer Timestamp that indicates when PHY asserted the
  103. 'rx_frame' signal for the reception of this PPDU
  104. <legal all>
  105. */
  106. #define RX_PPDU_START_RXFRAME_ASSERT_TIMESTAMP_OFFSET 0x0000000000000010
  107. #define RX_PPDU_START_RXFRAME_ASSERT_TIMESTAMP_LSB 0
  108. #define RX_PPDU_START_RXFRAME_ASSERT_TIMESTAMP_MSB 31
  109. #define RX_PPDU_START_RXFRAME_ASSERT_TIMESTAMP_MASK 0x00000000ffffffff
  110. /* Description TLV64_PADDING
  111. Automatic DWORD padding inserted while converting TLV32
  112. to TLV64 for 64 bit ARCH
  113. <legal 0>
  114. */
  115. #define RX_PPDU_START_TLV64_PADDING_OFFSET 0x0000000000000010
  116. #define RX_PPDU_START_TLV64_PADDING_LSB 32
  117. #define RX_PPDU_START_TLV64_PADDING_MSB 63
  118. #define RX_PPDU_START_TLV64_PADDING_MASK 0xffffffff00000000
  119. #endif // RX_PPDU_START