ht_sig_info.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  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 _HT_SIG_INFO_H_
  17. #define _HT_SIG_INFO_H_
  18. #if !defined(__ASSEMBLER__)
  19. #endif
  20. // ################ START SUMMARY #################
  21. //
  22. // Dword Fields
  23. // 0 mcs[6:0], cbw[7], length[23:8], reserved_0[31:24]
  24. // 1 smoothing[0], not_sounding[1], ht_reserved[2], aggregation[3], stbc[5:4], fec_coding[6], short_gi[7], num_ext_sp_str[9:8], crc[17:10], signal_tail[23:18], reserved_1[31:24]
  25. //
  26. // ################ END SUMMARY #################
  27. #define NUM_OF_DWORDS_HT_SIG_INFO 2
  28. struct ht_sig_info {
  29. uint32_t mcs : 7, //[6:0]
  30. cbw : 1, //[7]
  31. length : 16, //[23:8]
  32. reserved_0 : 8; //[31:24]
  33. uint32_t smoothing : 1, //[0]
  34. not_sounding : 1, //[1]
  35. ht_reserved : 1, //[2]
  36. aggregation : 1, //[3]
  37. stbc : 2, //[5:4]
  38. fec_coding : 1, //[6]
  39. short_gi : 1, //[7]
  40. num_ext_sp_str : 2, //[9:8]
  41. crc : 8, //[17:10]
  42. signal_tail : 6, //[23:18]
  43. reserved_1 : 8; //[31:24]
  44. };
  45. /*
  46. mcs
  47. Modulation Coding Scheme:
  48. 0-7 are used for single stream
  49. 8-15 are used for 2 streams
  50. 16-23 are used for 3 streams
  51. 24-31 are used for 4 streams
  52. 32 is used for duplicate HT20 (unsupported)
  53. 33-76 is used for unequal modulation (unsupported)
  54. 77-127 is reserved.
  55. <legal 0-31>
  56. cbw
  57. Packet bandwidth:
  58. <enum 0 ht_20_mhz>
  59. <enum 1 ht_40_mhz>
  60. <legal 0-1>
  61. length
  62. This is the MPDU or A-MPDU length in octets of the PPDU
  63. <legal all>
  64. reserved_0
  65. This field is not part of HT-SIG
  66. Reserved: Should be set to 0 by the MAC and ignored by
  67. the PHY <legal 0>
  68. smoothing
  69. Field indicates if smoothing is needed
  70. E_num 0 do_smoothing Unsupported setting: indicates
  71. smoothing is often used for beamforming
  72. <legal 1>
  73. not_sounding
  74. E_num 0 sounding Unsupported setting: indicates
  75. sounding is used
  76. <enum 1 no_sounding> Indicates no sounding is used
  77. <legal 1>
  78. ht_reserved
  79. Reserved: Should be set to 1 by the MAC and ignored by
  80. the PHY
  81. <legal 1>
  82. aggregation
  83. <enum 0 mpdu> Indicates MPDU format
  84. <enum 1 a_mpdu> Indicates A-MPDU format
  85. <legal 0-1>
  86. stbc
  87. <enum 0 no_stbc> Indicates no STBC
  88. <enum 1 1_str_stbc> Indicates 1 stream STBC
  89. E_num 2 2_str_stbc Indicates 2 stream STBC
  90. (Unsupported)
  91. <legal 0-1>
  92. fec_coding
  93. <enum 0 ht_bcc> Indicates BCC coding
  94. <enum 1 ht_ldpc> Indicates LDPC coding
  95. <legal 0-1>
  96. short_gi
  97. <enum 0 ht_normal_gi> Indicates normal guard
  98. interval
  99. <legal 0-1>
  100. num_ext_sp_str
  101. Number of extension spatial streams: (Used for TxBF)
  102. <enum 0 0_ext_sp_str> No extension spatial streams
  103. E_num 1 1_ext_sp_str Not supported: 1 extension
  104. spatial streams
  105. E_num 2 2_ext_sp_str Not supported: 2 extension
  106. spatial streams
  107. <legal 0>
  108. crc
  109. The CRC protects the HT-SIG (HT-SIG[0][23:0] and
  110. HT-SIG[1][9:0]. The generator polynomial is G(D) = D8 + D2 +
  111. D + 1. <legal all>
  112. signal_tail
  113. The 6 bits of tail is always set to 0 is used to flush
  114. the BCC encoder and decoder. <legal 0>
  115. reserved_1
  116. This field is not part of HT-SIG:
  117. Reserved: Should be set to 0 by the MAC and ignored by
  118. the PHY. <legal 0>
  119. */
  120. /* Description HT_SIG_INFO_0_MCS
  121. Modulation Coding Scheme:
  122. 0-7 are used for single stream
  123. 8-15 are used for 2 streams
  124. 16-23 are used for 3 streams
  125. 24-31 are used for 4 streams
  126. 32 is used for duplicate HT20 (unsupported)
  127. 33-76 is used for unequal modulation (unsupported)
  128. 77-127 is reserved.
  129. <legal 0-31>
  130. */
  131. #define HT_SIG_INFO_0_MCS_OFFSET 0x00000000
  132. #define HT_SIG_INFO_0_MCS_LSB 0
  133. #define HT_SIG_INFO_0_MCS_MASK 0x0000007f
  134. /* Description HT_SIG_INFO_0_CBW
  135. Packet bandwidth:
  136. <enum 0 ht_20_mhz>
  137. <enum 1 ht_40_mhz>
  138. <legal 0-1>
  139. */
  140. #define HT_SIG_INFO_0_CBW_OFFSET 0x00000000
  141. #define HT_SIG_INFO_0_CBW_LSB 7
  142. #define HT_SIG_INFO_0_CBW_MASK 0x00000080
  143. /* Description HT_SIG_INFO_0_LENGTH
  144. This is the MPDU or A-MPDU length in octets of the PPDU
  145. <legal all>
  146. */
  147. #define HT_SIG_INFO_0_LENGTH_OFFSET 0x00000000
  148. #define HT_SIG_INFO_0_LENGTH_LSB 8
  149. #define HT_SIG_INFO_0_LENGTH_MASK 0x00ffff00
  150. /* Description HT_SIG_INFO_0_RESERVED_0
  151. This field is not part of HT-SIG
  152. Reserved: Should be set to 0 by the MAC and ignored by
  153. the PHY <legal 0>
  154. */
  155. #define HT_SIG_INFO_0_RESERVED_0_OFFSET 0x00000000
  156. #define HT_SIG_INFO_0_RESERVED_0_LSB 24
  157. #define HT_SIG_INFO_0_RESERVED_0_MASK 0xff000000
  158. /* Description HT_SIG_INFO_1_SMOOTHING
  159. Field indicates if smoothing is needed
  160. E_num 0 do_smoothing Unsupported setting: indicates
  161. smoothing is often used for beamforming
  162. <legal 1>
  163. */
  164. #define HT_SIG_INFO_1_SMOOTHING_OFFSET 0x00000004
  165. #define HT_SIG_INFO_1_SMOOTHING_LSB 0
  166. #define HT_SIG_INFO_1_SMOOTHING_MASK 0x00000001
  167. /* Description HT_SIG_INFO_1_NOT_SOUNDING
  168. E_num 0 sounding Unsupported setting: indicates
  169. sounding is used
  170. <enum 1 no_sounding> Indicates no sounding is used
  171. <legal 1>
  172. */
  173. #define HT_SIG_INFO_1_NOT_SOUNDING_OFFSET 0x00000004
  174. #define HT_SIG_INFO_1_NOT_SOUNDING_LSB 1
  175. #define HT_SIG_INFO_1_NOT_SOUNDING_MASK 0x00000002
  176. /* Description HT_SIG_INFO_1_HT_RESERVED
  177. Reserved: Should be set to 1 by the MAC and ignored by
  178. the PHY
  179. <legal 1>
  180. */
  181. #define HT_SIG_INFO_1_HT_RESERVED_OFFSET 0x00000004
  182. #define HT_SIG_INFO_1_HT_RESERVED_LSB 2
  183. #define HT_SIG_INFO_1_HT_RESERVED_MASK 0x00000004
  184. /* Description HT_SIG_INFO_1_AGGREGATION
  185. <enum 0 mpdu> Indicates MPDU format
  186. <enum 1 a_mpdu> Indicates A-MPDU format
  187. <legal 0-1>
  188. */
  189. #define HT_SIG_INFO_1_AGGREGATION_OFFSET 0x00000004
  190. #define HT_SIG_INFO_1_AGGREGATION_LSB 3
  191. #define HT_SIG_INFO_1_AGGREGATION_MASK 0x00000008
  192. /* Description HT_SIG_INFO_1_STBC
  193. <enum 0 no_stbc> Indicates no STBC
  194. <enum 1 1_str_stbc> Indicates 1 stream STBC
  195. E_num 2 2_str_stbc Indicates 2 stream STBC
  196. (Unsupported)
  197. <legal 0-1>
  198. */
  199. #define HT_SIG_INFO_1_STBC_OFFSET 0x00000004
  200. #define HT_SIG_INFO_1_STBC_LSB 4
  201. #define HT_SIG_INFO_1_STBC_MASK 0x00000030
  202. /* Description HT_SIG_INFO_1_FEC_CODING
  203. <enum 0 ht_bcc> Indicates BCC coding
  204. <enum 1 ht_ldpc> Indicates LDPC coding
  205. <legal 0-1>
  206. */
  207. #define HT_SIG_INFO_1_FEC_CODING_OFFSET 0x00000004
  208. #define HT_SIG_INFO_1_FEC_CODING_LSB 6
  209. #define HT_SIG_INFO_1_FEC_CODING_MASK 0x00000040
  210. /* Description HT_SIG_INFO_1_SHORT_GI
  211. <enum 0 ht_normal_gi> Indicates normal guard
  212. interval
  213. <legal 0-1>
  214. */
  215. #define HT_SIG_INFO_1_SHORT_GI_OFFSET 0x00000004
  216. #define HT_SIG_INFO_1_SHORT_GI_LSB 7
  217. #define HT_SIG_INFO_1_SHORT_GI_MASK 0x00000080
  218. /* Description HT_SIG_INFO_1_NUM_EXT_SP_STR
  219. Number of extension spatial streams: (Used for TxBF)
  220. <enum 0 0_ext_sp_str> No extension spatial streams
  221. E_num 1 1_ext_sp_str Not supported: 1 extension
  222. spatial streams
  223. E_num 2 2_ext_sp_str Not supported: 2 extension
  224. spatial streams
  225. <legal 0>
  226. */
  227. #define HT_SIG_INFO_1_NUM_EXT_SP_STR_OFFSET 0x00000004
  228. #define HT_SIG_INFO_1_NUM_EXT_SP_STR_LSB 8
  229. #define HT_SIG_INFO_1_NUM_EXT_SP_STR_MASK 0x00000300
  230. /* Description HT_SIG_INFO_1_CRC
  231. The CRC protects the HT-SIG (HT-SIG[0][23:0] and
  232. HT-SIG[1][9:0]. The generator polynomial is G(D) = D8 + D2 +
  233. D + 1. <legal all>
  234. */
  235. #define HT_SIG_INFO_1_CRC_OFFSET 0x00000004
  236. #define HT_SIG_INFO_1_CRC_LSB 10
  237. #define HT_SIG_INFO_1_CRC_MASK 0x0003fc00
  238. /* Description HT_SIG_INFO_1_SIGNAL_TAIL
  239. The 6 bits of tail is always set to 0 is used to flush
  240. the BCC encoder and decoder. <legal 0>
  241. */
  242. #define HT_SIG_INFO_1_SIGNAL_TAIL_OFFSET 0x00000004
  243. #define HT_SIG_INFO_1_SIGNAL_TAIL_LSB 18
  244. #define HT_SIG_INFO_1_SIGNAL_TAIL_MASK 0x00fc0000
  245. /* Description HT_SIG_INFO_1_RESERVED_1
  246. This field is not part of HT-SIG:
  247. Reserved: Should be set to 0 by the MAC and ignored by
  248. the PHY. <legal 0>
  249. */
  250. #define HT_SIG_INFO_1_RESERVED_1_OFFSET 0x00000004
  251. #define HT_SIG_INFO_1_RESERVED_1_LSB 24
  252. #define HT_SIG_INFO_1_RESERVED_1_MASK 0xff000000
  253. #endif // _HT_SIG_INFO_H_