l_sig_a_info.h 8.6 KB

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