pdg_tx_req.h 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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 _PDG_TX_REQ_H_
  16. #define _PDG_TX_REQ_H_
  17. #if !defined(__ASSEMBLER__)
  18. #endif
  19. #define NUM_OF_DWORDS_PDG_TX_REQ 2
  20. #define NUM_OF_QWORDS_PDG_TX_REQ 1
  21. struct pdg_tx_req {
  22. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  23. uint32_t tx_reason : 2, // [1:0]
  24. use_puncture_pattern : 2, // [3:2]
  25. req_bw : 3, // [6:4]
  26. puncture_pattern_number : 6, // [12:7]
  27. reserved_0b : 1, // [13:13]
  28. req_paprd : 1, // [14:14]
  29. duration_field_boundary_valid : 1, // [15:15]
  30. duration_field_boundary : 16; // [31:16]
  31. uint32_t puncture_subband_mask : 16, // [15:0]
  32. reserved_0c : 16; // [31:16]
  33. #else
  34. uint32_t duration_field_boundary : 16, // [31:16]
  35. duration_field_boundary_valid : 1, // [15:15]
  36. req_paprd : 1, // [14:14]
  37. reserved_0b : 1, // [13:13]
  38. puncture_pattern_number : 6, // [12:7]
  39. req_bw : 3, // [6:4]
  40. use_puncture_pattern : 2, // [3:2]
  41. tx_reason : 2; // [1:0]
  42. uint32_t reserved_0c : 16, // [31:16]
  43. puncture_subband_mask : 16; // [15:0]
  44. #endif
  45. };
  46. /* Description TX_REASON
  47. <enum 0 tx_fes_protection_frame> RTS, CTS2Self or 11h
  48. protection type transmission preceding the regular PPDU
  49. portion of the coming FES.
  50. <enum 1 tx_fes_after_protection > Regular PPDU transmission
  51. that follows the transmission of medium protection frames:.
  52. <enum 2 tx_fes_only> Regular PPDU transmission without
  53. preceding medium protection frame exchanges.
  54. Note: Response frame transmissions are initiated with the
  55. PDG_RESPONSE TLV
  56. <legal 0-2>
  57. */
  58. #define PDG_TX_REQ_TX_REASON_OFFSET 0x0000000000000000
  59. #define PDG_TX_REQ_TX_REASON_LSB 0
  60. #define PDG_TX_REQ_TX_REASON_MSB 1
  61. #define PDG_TX_REQ_TX_REASON_MASK 0x0000000000000003
  62. /* Description USE_PUNCTURE_PATTERN
  63. When set, the transmission is based on puncture pattern
  64. selection
  65. <enum 0 NO_PUNCTURE> No puncturing
  66. <enum 1 PUNCTURE_FROM_TX_SETUP> Scheme 1 puncturing using
  67. 'TX_PUNCTURE_SETUP' settings
  68. <enum 2 PUNCTURE_RESPONSE_FROM_RX> DO NOT USE
  69. <enum 3 PUNCTURE_FROM_ALL_ALLOWED_MODES> New scheme 2 puncturing
  70. in Beryllium based on the field puncture_subband_mask selected
  71. from up to 37 allowed modes in TXPCU registers
  72. <legal 0-3>
  73. */
  74. #define PDG_TX_REQ_USE_PUNCTURE_PATTERN_OFFSET 0x0000000000000000
  75. #define PDG_TX_REQ_USE_PUNCTURE_PATTERN_LSB 2
  76. #define PDG_TX_REQ_USE_PUNCTURE_PATTERN_MSB 3
  77. #define PDG_TX_REQ_USE_PUNCTURE_PATTERN_MASK 0x000000000000000c
  78. /* Description REQ_BW
  79. Field not valid when use_puncture_pattern is set to PUNCTURE_FROM_TX_SETUP
  80. The BW of the upcoming transmission.
  81. Note: Coex might have changed this from the original request.
  82. <enum 0 20_mhz>20 Mhz BW
  83. <enum 1 40_mhz>40 Mhz BW
  84. <enum 2 80_mhz>80 Mhz BW
  85. <enum 3 160_mhz>160 Mhz BW
  86. <enum 4 320_mhz>320 Mhz BW
  87. <enum 5 240_mhz>240 Mhz BW
  88. */
  89. #define PDG_TX_REQ_REQ_BW_OFFSET 0x0000000000000000
  90. #define PDG_TX_REQ_REQ_BW_LSB 4
  91. #define PDG_TX_REQ_REQ_BW_MSB 6
  92. #define PDG_TX_REQ_REQ_BW_MASK 0x0000000000000070
  93. /* Description PUNCTURE_PATTERN_NUMBER
  94. Field only valid when "use_puncture_pattern" is set.
  95. The pattern number in case punctured transmission is enabled
  96. <legal all>
  97. */
  98. #define PDG_TX_REQ_PUNCTURE_PATTERN_NUMBER_OFFSET 0x0000000000000000
  99. #define PDG_TX_REQ_PUNCTURE_PATTERN_NUMBER_LSB 7
  100. #define PDG_TX_REQ_PUNCTURE_PATTERN_NUMBER_MSB 12
  101. #define PDG_TX_REQ_PUNCTURE_PATTERN_NUMBER_MASK 0x0000000000001f80
  102. /* Description RESERVED_0B
  103. <legal 0>
  104. */
  105. #define PDG_TX_REQ_RESERVED_0B_OFFSET 0x0000000000000000
  106. #define PDG_TX_REQ_RESERVED_0B_LSB 13
  107. #define PDG_TX_REQ_RESERVED_0B_MSB 13
  108. #define PDG_TX_REQ_RESERVED_0B_MASK 0x0000000000002000
  109. /* Description REQ_PAPRD
  110. Indicate this is a 'PAPRD' packet request. Exist in NS,
  111. Helium?
  112. This is a calibration related request.
  113. Field copied over from the scheduling command TLV.
  114. TODO: check the usage
  115. <legal 0>
  116. */
  117. #define PDG_TX_REQ_REQ_PAPRD_OFFSET 0x0000000000000000
  118. #define PDG_TX_REQ_REQ_PAPRD_LSB 14
  119. #define PDG_TX_REQ_REQ_PAPRD_MSB 14
  120. #define PDG_TX_REQ_REQ_PAPRD_MASK 0x0000000000004000
  121. /* Description DURATION_FIELD_BOUNDARY_VALID
  122. When set, PDG should take the 'duration_field_boundary'
  123. value into account when it is calculating the TX and RX
  124. boundaries for the upcoming transmission. Both RX and TX
  125. should not go beyond this time duration provided.
  126. <legal all>
  127. */
  128. #define PDG_TX_REQ_DURATION_FIELD_BOUNDARY_VALID_OFFSET 0x0000000000000000
  129. #define PDG_TX_REQ_DURATION_FIELD_BOUNDARY_VALID_LSB 15
  130. #define PDG_TX_REQ_DURATION_FIELD_BOUNDARY_VALID_MSB 15
  131. #define PDG_TX_REQ_DURATION_FIELD_BOUNDARY_VALID_MASK 0x0000000000008000
  132. /* Description DURATION_FIELD_BOUNDARY
  133. Field only valid when 'Duration_field_boundary_valid' is
  134. set
  135. Amount of time to both TX and RX boundaries that PDG should
  136. take into account for the upcoming transmission.
  137. <legal all>
  138. */
  139. #define PDG_TX_REQ_DURATION_FIELD_BOUNDARY_OFFSET 0x0000000000000000
  140. #define PDG_TX_REQ_DURATION_FIELD_BOUNDARY_LSB 16
  141. #define PDG_TX_REQ_DURATION_FIELD_BOUNDARY_MSB 31
  142. #define PDG_TX_REQ_DURATION_FIELD_BOUNDARY_MASK 0x00000000ffff0000
  143. /* Description PUNCTURE_SUBBAND_MASK
  144. Field only valid when use_puncture_pattern is set to PUNCTURE_FROM_ALL_ALLOWED_MODES
  145. This mask indicates which 20 Mhz channels are actively used
  146. in this transmission.
  147. Bit 0: primary 20 Mhz
  148. Bit 1: secondary 20 MHz
  149. Etc.
  150. <legal all>
  151. */
  152. #define PDG_TX_REQ_PUNCTURE_SUBBAND_MASK_OFFSET 0x0000000000000000
  153. #define PDG_TX_REQ_PUNCTURE_SUBBAND_MASK_LSB 32
  154. #define PDG_TX_REQ_PUNCTURE_SUBBAND_MASK_MSB 47
  155. #define PDG_TX_REQ_PUNCTURE_SUBBAND_MASK_MASK 0x0000ffff00000000
  156. /* Description RESERVED_0C
  157. Reserved for future power bits: Generator should set to
  158. 0, consumer shall ignore <legal 0>
  159. */
  160. #define PDG_TX_REQ_RESERVED_0C_OFFSET 0x0000000000000000
  161. #define PDG_TX_REQ_RESERVED_0C_LSB 48
  162. #define PDG_TX_REQ_RESERVED_0C_MSB 63
  163. #define PDG_TX_REQ_RESERVED_0C_MASK 0xffff000000000000
  164. #endif // PDG_TX_REQ