ht_sig_info.h 11 KB

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