l_sig_a_info.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. /*
  2. * Copyright (c) 2020, The Linux Foundation. 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. // ################ START SUMMARY #################
  21. //
  22. // Dword Fields
  23. // 0 rate[3:0], lsig_reserved[4], length[16:5], parity[17], tail[23:18], pkt_type[27:24], captured_implicit_sounding[28], reserved[31:29]
  24. //
  25. // ################ END SUMMARY #################
  26. #define NUM_OF_DWORDS_L_SIG_A_INFO 1
  27. struct l_sig_a_info {
  28. uint32_t rate : 4, //[3:0]
  29. lsig_reserved : 1, //[4]
  30. length : 12, //[16:5]
  31. parity : 1, //[17]
  32. tail : 6, //[23:18]
  33. pkt_type : 4, //[27:24]
  34. captured_implicit_sounding : 1, //[28]
  35. reserved : 3; //[31:29]
  36. };
  37. /*
  38. rate
  39. This format is originally defined for OFDM as a 4 bit
  40. field but the 5th bit was added to indicate 11b formatted
  41. frames. In the standard bit [4] is specified as reserved.
  42. For 11b frames this L-SIG is transformed in the PHY into the
  43. 11b preamble format. The following are the rates:
  44. <enum 8 ofdm_48_mbps> 64-QAM 2/3 (48 Mbps)
  45. <enum 9 ofdm_24_mbps> 16-QAM 1/2 (24 Mbps)
  46. <enum 10 ofdm_12_mbps> QPSK 1/2 (12 Mbps)
  47. <enum 11 ofdm_6_mbps> BPSK 1/2 (6 Mbps)
  48. <enum 12 ofdm_54_mbps> 64-QAM 3/4 (54 Mbps)
  49. <enum 13 ofdm_36_mbps> 16-QAM 3/4 (36 Mbps)
  50. <enum 14 ofdm_18_mbps> QPSK 1/2 (18 Mbps)
  51. <enum 15 ofdm_9_mbps> BPSK 3/4 (9 Mbps)
  52. <legal 8-15>
  53. lsig_reserved
  54. Reserved: Should be set to 0 by the MAC and ignored by
  55. the PHY
  56. <legal 0>
  57. length
  58. The length indicates the number of octets in this MPDU.
  59. Note that when using mixed mode 11n preamble this length
  60. provides the spoofed length for the PPDU. This length
  61. provides part of the information to derive the actually PPDU
  62. length. For legacy OFDM and 11B frames the maximum length
  63. is
  64. <legal all>
  65. parity
  66. 11a/n/ac TX: This field provides even parity over the
  67. first 18 bits of the signal field which means that the sum
  68. of 1s in the signal field will always be even on
  69. 11a/n/ac RX: this field contains the received parity
  70. field from the L-SIG symbol for the current packet.
  71. <legal 0-1>
  72. tail
  73. The 6 bits of tail is always set to 0 is used to flush
  74. the BCC encoder and decoder. <legal 0>
  75. pkt_type
  76. Only used on the RX side.
  77. Note: This is not really part of L-SIG
  78. Packet type:
  79. <enum 0 dot11a>802.11a PPDU type
  80. <enum 1 dot11b>802.11b PPDU type
  81. <enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
  82. <enum 3 dot11ac>802.11ac PPDU type
  83. <enum 4 dot11ax>802.11ax PPDU type
  84. <enum 5 dot11ba>802.11ba (WUR) PPDU type
  85. captured_implicit_sounding
  86. Only used on the RX side.
  87. Note: This is not really part of L-SIG
  88. This indicates that the PHY has captured implicit
  89. sounding.
  90. reserved
  91. Reserved: Should be set to 0 by the transmitting MAC and
  92. ignored by the PHY <legal 0>
  93. */
  94. /* Description L_SIG_A_INFO_0_RATE
  95. This format is originally defined for OFDM as a 4 bit
  96. field but the 5th bit was added to indicate 11b formatted
  97. frames. In the standard bit [4] is specified as reserved.
  98. For 11b frames this L-SIG is transformed in the PHY into the
  99. 11b preamble format. The following are the rates:
  100. <enum 8 ofdm_48_mbps> 64-QAM 2/3 (48 Mbps)
  101. <enum 9 ofdm_24_mbps> 16-QAM 1/2 (24 Mbps)
  102. <enum 10 ofdm_12_mbps> QPSK 1/2 (12 Mbps)
  103. <enum 11 ofdm_6_mbps> BPSK 1/2 (6 Mbps)
  104. <enum 12 ofdm_54_mbps> 64-QAM 3/4 (54 Mbps)
  105. <enum 13 ofdm_36_mbps> 16-QAM 3/4 (36 Mbps)
  106. <enum 14 ofdm_18_mbps> QPSK 1/2 (18 Mbps)
  107. <enum 15 ofdm_9_mbps> BPSK 3/4 (9 Mbps)
  108. <legal 8-15>
  109. */
  110. #define L_SIG_A_INFO_0_RATE_OFFSET 0x00000000
  111. #define L_SIG_A_INFO_0_RATE_LSB 0
  112. #define L_SIG_A_INFO_0_RATE_MASK 0x0000000f
  113. /* Description L_SIG_A_INFO_0_LSIG_RESERVED
  114. Reserved: Should be set to 0 by the MAC and ignored by
  115. the PHY
  116. <legal 0>
  117. */
  118. #define L_SIG_A_INFO_0_LSIG_RESERVED_OFFSET 0x00000000
  119. #define L_SIG_A_INFO_0_LSIG_RESERVED_LSB 4
  120. #define L_SIG_A_INFO_0_LSIG_RESERVED_MASK 0x00000010
  121. /* Description L_SIG_A_INFO_0_LENGTH
  122. The length indicates the number of octets in this MPDU.
  123. Note that when using mixed mode 11n preamble this length
  124. provides the spoofed length for the PPDU. This length
  125. provides part of the information to derive the actually PPDU
  126. length. For legacy OFDM and 11B frames the maximum length
  127. is
  128. <legal all>
  129. */
  130. #define L_SIG_A_INFO_0_LENGTH_OFFSET 0x00000000
  131. #define L_SIG_A_INFO_0_LENGTH_LSB 5
  132. #define L_SIG_A_INFO_0_LENGTH_MASK 0x0001ffe0
  133. /* Description L_SIG_A_INFO_0_PARITY
  134. 11a/n/ac TX: This field provides even parity over the
  135. first 18 bits of the signal field which means that the sum
  136. of 1s in the signal field will always be even on
  137. 11a/n/ac RX: this field contains the received parity
  138. field from the L-SIG symbol for the current packet.
  139. <legal 0-1>
  140. */
  141. #define L_SIG_A_INFO_0_PARITY_OFFSET 0x00000000
  142. #define L_SIG_A_INFO_0_PARITY_LSB 17
  143. #define L_SIG_A_INFO_0_PARITY_MASK 0x00020000
  144. /* Description L_SIG_A_INFO_0_TAIL
  145. The 6 bits of tail is always set to 0 is used to flush
  146. the BCC encoder and decoder. <legal 0>
  147. */
  148. #define L_SIG_A_INFO_0_TAIL_OFFSET 0x00000000
  149. #define L_SIG_A_INFO_0_TAIL_LSB 18
  150. #define L_SIG_A_INFO_0_TAIL_MASK 0x00fc0000
  151. /* Description L_SIG_A_INFO_0_PKT_TYPE
  152. Only used on the RX side.
  153. Note: This is not really part of L-SIG
  154. Packet type:
  155. <enum 0 dot11a>802.11a PPDU type
  156. <enum 1 dot11b>802.11b PPDU type
  157. <enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
  158. <enum 3 dot11ac>802.11ac PPDU type
  159. <enum 4 dot11ax>802.11ax PPDU type
  160. <enum 5 dot11ba>802.11ba (WUR) PPDU type
  161. */
  162. #define L_SIG_A_INFO_0_PKT_TYPE_OFFSET 0x00000000
  163. #define L_SIG_A_INFO_0_PKT_TYPE_LSB 24
  164. #define L_SIG_A_INFO_0_PKT_TYPE_MASK 0x0f000000
  165. /* Description L_SIG_A_INFO_0_CAPTURED_IMPLICIT_SOUNDING
  166. Only used on the RX side.
  167. Note: This is not really part of L-SIG
  168. This indicates that the PHY has captured implicit
  169. sounding.
  170. */
  171. #define L_SIG_A_INFO_0_CAPTURED_IMPLICIT_SOUNDING_OFFSET 0x00000000
  172. #define L_SIG_A_INFO_0_CAPTURED_IMPLICIT_SOUNDING_LSB 28
  173. #define L_SIG_A_INFO_0_CAPTURED_IMPLICIT_SOUNDING_MASK 0x10000000
  174. /* Description L_SIG_A_INFO_0_RESERVED
  175. Reserved: Should be set to 0 by the transmitting MAC and
  176. ignored by the PHY <legal 0>
  177. */
  178. #define L_SIG_A_INFO_0_RESERVED_OFFSET 0x00000000
  179. #define L_SIG_A_INFO_0_RESERVED_LSB 29
  180. #define L_SIG_A_INFO_0_RESERVED_MASK 0xe0000000
  181. #endif // _L_SIG_A_INFO_H_