l_sig_a_info.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. /*
  2. * Copyright (c) 2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. #ifndef _L_SIG_A_INFO_H_
  19. #define _L_SIG_A_INFO_H_
  20. #if !defined(__ASSEMBLER__)
  21. #endif
  22. // ################ START SUMMARY #################
  23. //
  24. // Dword Fields
  25. // 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]
  26. //
  27. // ################ END SUMMARY #################
  28. #define NUM_OF_DWORDS_L_SIG_A_INFO 1
  29. struct l_sig_a_info {
  30. uint32_t rate : 4, //[3:0]
  31. lsig_reserved : 1, //[4]
  32. length : 12, //[16:5]
  33. parity : 1, //[17]
  34. tail : 6, //[23:18]
  35. pkt_type : 4, //[27:24]
  36. captured_implicit_sounding : 1, //[28]
  37. reserved : 3; //[31:29]
  38. };
  39. /*
  40. rate
  41. This format is originally defined for OFDM as a 4 bit
  42. field but the 5th bit was added to indicate 11b formatted
  43. frames. In the standard bit [4] is specified as reserved.
  44. For 11b frames this L-SIG is transformed in the PHY into the
  45. 11b preamble format. The following are the rates:
  46. <enum 8 ofdm_48_mbps> 64-QAM 2/3 (48 Mbps)
  47. <enum 9 ofdm_24_mbps> 16-QAM 1/2 (24 Mbps)
  48. <enum 10 ofdm_12_mbps> QPSK 1/2 (12 Mbps)
  49. <enum 11 ofdm_6_mbps> BPSK 1/2 (6 Mbps)
  50. <enum 12 ofdm_54_mbps> 64-QAM 3/4 (54 Mbps)
  51. <enum 13 ofdm_36_mbps> 16-QAM 3/4 (36 Mbps)
  52. <enum 14 ofdm_18_mbps> QPSK 1/2 (18 Mbps)
  53. <enum 15 ofdm_9_mbps> BPSK 3/4 (9 Mbps)
  54. <legal 8-15>
  55. lsig_reserved
  56. Reserved: Should be set to 0 by the MAC and ignored by
  57. the PHY
  58. <legal 0>
  59. length
  60. The length indicates the number of octets in this MPDU.
  61. Note that when using mixed mode 11n preamble this length
  62. provides the spoofed length for the PPDU. This length
  63. provides part of the information to derive the actually PPDU
  64. length. For legacy OFDM and 11B frames the maximum length
  65. is
  66. <legal all>
  67. parity
  68. 11a/n/ac TX: This field provides even parity over the
  69. first 18 bits of the signal field which means that the sum
  70. of 1s in the signal field will always be even on
  71. 11a/n/ac RX: this field contains the received parity
  72. field from the L-SIG symbol for the current packet.
  73. <legal 0-1>
  74. tail
  75. The 6 bits of tail is always set to 0 is used to flush
  76. the BCC encoder and decoder. <legal 0>
  77. pkt_type
  78. Only used on the RX side.
  79. Note: This is not really part of L-SIG
  80. Packet type:
  81. <enum 0 dot11a>802.11a PPDU type
  82. <enum 1 dot11b>802.11b PPDU type
  83. <enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
  84. <enum 3 dot11ac>802.11ac PPDU type
  85. <enum 4 dot11ax>802.11ax PPDU type
  86. captured_implicit_sounding
  87. Only used on the RX side.
  88. Note: This is not really part of L-SIG
  89. This indicates that the PHY has captured implicit
  90. sounding.
  91. reserved
  92. Reserved: Should be set to 0 by the transmitting MAC and
  93. ignored by the PHY <legal 0>
  94. */
  95. /* Description L_SIG_A_INFO_0_RATE
  96. This format is originally defined for OFDM as a 4 bit
  97. field but the 5th bit was added to indicate 11b formatted
  98. frames. In the standard bit [4] is specified as reserved.
  99. For 11b frames this L-SIG is transformed in the PHY into the
  100. 11b preamble format. The following are the rates:
  101. <enum 8 ofdm_48_mbps> 64-QAM 2/3 (48 Mbps)
  102. <enum 9 ofdm_24_mbps> 16-QAM 1/2 (24 Mbps)
  103. <enum 10 ofdm_12_mbps> QPSK 1/2 (12 Mbps)
  104. <enum 11 ofdm_6_mbps> BPSK 1/2 (6 Mbps)
  105. <enum 12 ofdm_54_mbps> 64-QAM 3/4 (54 Mbps)
  106. <enum 13 ofdm_36_mbps> 16-QAM 3/4 (36 Mbps)
  107. <enum 14 ofdm_18_mbps> QPSK 1/2 (18 Mbps)
  108. <enum 15 ofdm_9_mbps> BPSK 3/4 (9 Mbps)
  109. <legal 8-15>
  110. */
  111. #define L_SIG_A_INFO_0_RATE_OFFSET 0x00000000
  112. #define L_SIG_A_INFO_0_RATE_LSB 0
  113. #define L_SIG_A_INFO_0_RATE_MASK 0x0000000f
  114. /* Description L_SIG_A_INFO_0_LSIG_RESERVED
  115. Reserved: Should be set to 0 by the MAC and ignored by
  116. the PHY
  117. <legal 0>
  118. */
  119. #define L_SIG_A_INFO_0_LSIG_RESERVED_OFFSET 0x00000000
  120. #define L_SIG_A_INFO_0_LSIG_RESERVED_LSB 4
  121. #define L_SIG_A_INFO_0_LSIG_RESERVED_MASK 0x00000010
  122. /* Description L_SIG_A_INFO_0_LENGTH
  123. The length indicates the number of octets in this MPDU.
  124. Note that when using mixed mode 11n preamble this length
  125. provides the spoofed length for the PPDU. This length
  126. provides part of the information to derive the actually PPDU
  127. length. For legacy OFDM and 11B frames the maximum length
  128. is
  129. <legal all>
  130. */
  131. #define L_SIG_A_INFO_0_LENGTH_OFFSET 0x00000000
  132. #define L_SIG_A_INFO_0_LENGTH_LSB 5
  133. #define L_SIG_A_INFO_0_LENGTH_MASK 0x0001ffe0
  134. /* Description L_SIG_A_INFO_0_PARITY
  135. 11a/n/ac TX: This field provides even parity over the
  136. first 18 bits of the signal field which means that the sum
  137. of 1s in the signal field will always be even on
  138. 11a/n/ac RX: this field contains the received parity
  139. field from the L-SIG symbol for the current packet.
  140. <legal 0-1>
  141. */
  142. #define L_SIG_A_INFO_0_PARITY_OFFSET 0x00000000
  143. #define L_SIG_A_INFO_0_PARITY_LSB 17
  144. #define L_SIG_A_INFO_0_PARITY_MASK 0x00020000
  145. /* Description L_SIG_A_INFO_0_TAIL
  146. The 6 bits of tail is always set to 0 is used to flush
  147. the BCC encoder and decoder. <legal 0>
  148. */
  149. #define L_SIG_A_INFO_0_TAIL_OFFSET 0x00000000
  150. #define L_SIG_A_INFO_0_TAIL_LSB 18
  151. #define L_SIG_A_INFO_0_TAIL_MASK 0x00fc0000
  152. /* Description L_SIG_A_INFO_0_PKT_TYPE
  153. Only used on the RX side.
  154. Note: This is not really part of L-SIG
  155. Packet type:
  156. <enum 0 dot11a>802.11a PPDU type
  157. <enum 1 dot11b>802.11b PPDU type
  158. <enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
  159. <enum 3 dot11ac>802.11ac PPDU type
  160. <enum 4 dot11ax>802.11ax 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_