l_sig_a_info.h 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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 _L_SIG_A_INFO_H_
  16. #define _L_SIG_A_INFO_H_
  17. #if !defined(__ASSEMBLER__)
  18. #endif
  19. #define NUM_OF_DWORDS_L_SIG_A_INFO 1
  20. struct l_sig_a_info {
  21. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  22. uint32_t rate : 4, // [3:0]
  23. lsig_reserved : 1, // [4:4]
  24. length : 12, // [16:5]
  25. parity : 1, // [17:17]
  26. tail : 6, // [23:18]
  27. pkt_type : 4, // [27:24]
  28. captured_implicit_sounding : 1, // [28:28]
  29. reserved : 2, // [30:29]
  30. rx_integrity_check_passed : 1; // [31:31]
  31. #else
  32. uint32_t rx_integrity_check_passed : 1, // [31:31]
  33. reserved : 2, // [30:29]
  34. captured_implicit_sounding : 1, // [28:28]
  35. pkt_type : 4, // [27:24]
  36. tail : 6, // [23:18]
  37. parity : 1, // [17:17]
  38. length : 12, // [16:5]
  39. lsig_reserved : 1, // [4:4]
  40. rate : 4; // [3:0]
  41. #endif
  42. };
  43. /* Description RATE
  44. This format is originally defined for OFDM as a 4 bit field
  45. but the 5th bit was added to indicate 11b formatted frames.
  46. In the standard bit [4] is specified as reserved. For
  47. 11b frames this L-SIG is transformed in the PHY into the
  48. 11b preamble format. The following are the rates:
  49. <enum 8 ofdm_48_mbps> 64-QAM 2/3 (48 Mbps)
  50. <enum 9 ofdm_24_mbps> 16-QAM 1/2 (24 Mbps)
  51. <enum 10 ofdm_12_mbps> QPSK 1/2 (12 Mbps)
  52. <enum 11 ofdm_6_mbps> BPSK 1/2 (6 Mbps)
  53. <enum 12 ofdm_54_mbps> 64-QAM 3/4 (54 Mbps)
  54. <enum 13 ofdm_36_mbps> 16-QAM 3/4 (36 Mbps)
  55. <enum 14 ofdm_18_mbps> QPSK 1/2 (18 Mbps)
  56. <enum 15 ofdm_9_mbps> BPSK 3/4 (9 Mbps)
  57. <legal 8-15>
  58. */
  59. #define L_SIG_A_INFO_RATE_OFFSET 0x00000000
  60. #define L_SIG_A_INFO_RATE_LSB 0
  61. #define L_SIG_A_INFO_RATE_MSB 3
  62. #define L_SIG_A_INFO_RATE_MASK 0x0000000f
  63. /* Description LSIG_RESERVED
  64. Reserved: Should be set to 0 by the MAC and ignored by the
  65. PHY
  66. <legal 0>
  67. */
  68. #define L_SIG_A_INFO_LSIG_RESERVED_OFFSET 0x00000000
  69. #define L_SIG_A_INFO_LSIG_RESERVED_LSB 4
  70. #define L_SIG_A_INFO_LSIG_RESERVED_MSB 4
  71. #define L_SIG_A_INFO_LSIG_RESERVED_MASK 0x00000010
  72. /* Description LENGTH
  73. The length indicates the number of octets in this MPDU.
  74. Note that when using mixed mode .11n preamble or .11ac/.11ax/.11ba/.11be
  75. this length provides the spoofed length for the PPDU.
  76. This length provides part of the information (viz. PPDU
  77. duration) to derive the actually PSDU length. For legacy
  78. OFDM and 11B frames the maximum length is 4095.
  79. <legal all>
  80. */
  81. #define L_SIG_A_INFO_LENGTH_OFFSET 0x00000000
  82. #define L_SIG_A_INFO_LENGTH_LSB 5
  83. #define L_SIG_A_INFO_LENGTH_MSB 16
  84. #define L_SIG_A_INFO_LENGTH_MASK 0x0001ffe0
  85. /* Description PARITY
  86. 11a/n/ac TX: This field provides even parity over the first
  87. 18 bits of the signal field which means that the sum of
  88. 1s in the signal field will always be even on transmission.
  89. The value of the field is computed by the MAC.
  90. 11a/n/ac RX: this field contains the received parity field
  91. from the L-SIG symbol for the current packet.
  92. <legal 0-1>
  93. */
  94. #define L_SIG_A_INFO_PARITY_OFFSET 0x00000000
  95. #define L_SIG_A_INFO_PARITY_LSB 17
  96. #define L_SIG_A_INFO_PARITY_MSB 17
  97. #define L_SIG_A_INFO_PARITY_MASK 0x00020000
  98. /* Description TAIL
  99. The 6 bits of tail is always set to 0 is used to flush the
  100. BCC encoder and decoder. <legal 0>
  101. */
  102. #define L_SIG_A_INFO_TAIL_OFFSET 0x00000000
  103. #define L_SIG_A_INFO_TAIL_LSB 18
  104. #define L_SIG_A_INFO_TAIL_MSB 23
  105. #define L_SIG_A_INFO_TAIL_MASK 0x00fc0000
  106. /* Description PKT_TYPE
  107. Only used on the RX side.
  108. Note: This is not really part of L-SIG
  109. Packet type:
  110. <enum 0 dot11a>802.11a PPDU type
  111. <enum 1 dot11b>802.11b PPDU type
  112. <enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
  113. <enum 3 dot11ac>802.11ac PPDU type
  114. <enum 4 dot11ax>802.11ax PPDU type
  115. <enum 5 dot11ba>802.11ba (WUR) PPDU type
  116. <enum 6 dot11be>802.11be PPDU type
  117. <enum 7 dot11az>802.11az (ranging) PPDU type
  118. <enum 8 dot11n_gf>802.11n Green Field PPDU type (unsupported
  119. & aborted)
  120. */
  121. #define L_SIG_A_INFO_PKT_TYPE_OFFSET 0x00000000
  122. #define L_SIG_A_INFO_PKT_TYPE_LSB 24
  123. #define L_SIG_A_INFO_PKT_TYPE_MSB 27
  124. #define L_SIG_A_INFO_PKT_TYPE_MASK 0x0f000000
  125. /* Description CAPTURED_IMPLICIT_SOUNDING
  126. Only used on the RX side.
  127. Note: This is not really part of L-SIG
  128. This indicates that the PHY has captured implicit sounding.
  129. */
  130. #define L_SIG_A_INFO_CAPTURED_IMPLICIT_SOUNDING_OFFSET 0x00000000
  131. #define L_SIG_A_INFO_CAPTURED_IMPLICIT_SOUNDING_LSB 28
  132. #define L_SIG_A_INFO_CAPTURED_IMPLICIT_SOUNDING_MSB 28
  133. #define L_SIG_A_INFO_CAPTURED_IMPLICIT_SOUNDING_MASK 0x10000000
  134. /* Description RESERVED
  135. Reserved: Should be set to 0 by the transmitting MAC and
  136. ignored by the PHY <legal 0>
  137. */
  138. #define L_SIG_A_INFO_RESERVED_OFFSET 0x00000000
  139. #define L_SIG_A_INFO_RESERVED_LSB 29
  140. #define L_SIG_A_INFO_RESERVED_MSB 30
  141. #define L_SIG_A_INFO_RESERVED_MASK 0x60000000
  142. /* Description RX_INTEGRITY_CHECK_PASSED
  143. TX side: Set to 0
  144. RX side: Set to 1 if PHY determines the L-SIG integrity
  145. check has passed, else set to 0
  146. <legal all>
  147. */
  148. #define L_SIG_A_INFO_RX_INTEGRITY_CHECK_PASSED_OFFSET 0x00000000
  149. #define L_SIG_A_INFO_RX_INTEGRITY_CHECK_PASSED_LSB 31
  150. #define L_SIG_A_INFO_RX_INTEGRITY_CHECK_PASSED_MSB 31
  151. #define L_SIG_A_INFO_RX_INTEGRITY_CHECK_PASSED_MASK 0x80000000
  152. #endif // L_SIG_A_INFO