rx_ppdu_start.h 7.0 KB

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