vht_sig_a_info.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. /* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
  2. *
  3. * Permission to use, copy, modify, and/or distribute this software for any
  4. * purpose with or without fee is hereby granted, provided that the above
  5. * copyright notice and this permission notice appear in all copies.
  6. *
  7. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  10. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  12. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  13. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  14. */
  15. #ifndef _VHT_SIG_A_INFO_H_
  16. #define _VHT_SIG_A_INFO_H_
  17. #if !defined(__ASSEMBLER__)
  18. #endif
  19. #define NUM_OF_DWORDS_VHT_SIG_A_INFO 2
  20. struct vht_sig_a_info {
  21. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  22. uint32_t bandwidth : 2, // [1:0]
  23. vhta_reserved_0 : 1, // [2:2]
  24. stbc : 1, // [3:3]
  25. group_id : 6, // [9:4]
  26. n_sts : 12, // [21:10]
  27. txop_ps_not_allowed : 1, // [22:22]
  28. vhta_reserved_0b : 1, // [23:23]
  29. reserved_0 : 8; // [31:24]
  30. uint32_t gi_setting : 2, // [1:0]
  31. su_mu_coding : 1, // [2:2]
  32. ldpc_extra_symbol : 1, // [3:3]
  33. mcs : 4, // [7:4]
  34. beamformed : 1, // [8:8]
  35. vhta_reserved_1 : 1, // [9:9]
  36. crc : 8, // [17:10]
  37. tail : 6, // [23:18]
  38. reserved_1 : 7, // [30:24]
  39. rx_integrity_check_passed : 1; // [31:31]
  40. #else
  41. uint32_t reserved_0 : 8, // [31:24]
  42. vhta_reserved_0b : 1, // [23:23]
  43. txop_ps_not_allowed : 1, // [22:22]
  44. n_sts : 12, // [21:10]
  45. group_id : 6, // [9:4]
  46. stbc : 1, // [3:3]
  47. vhta_reserved_0 : 1, // [2:2]
  48. bandwidth : 2; // [1:0]
  49. uint32_t rx_integrity_check_passed : 1, // [31:31]
  50. reserved_1 : 7, // [30:24]
  51. tail : 6, // [23:18]
  52. crc : 8, // [17:10]
  53. vhta_reserved_1 : 1, // [9:9]
  54. beamformed : 1, // [8:8]
  55. mcs : 4, // [7:4]
  56. ldpc_extra_symbol : 1, // [3:3]
  57. su_mu_coding : 1, // [2:2]
  58. gi_setting : 2; // [1:0]
  59. #endif
  60. };
  61. /* Description BANDWIDTH
  62. Packet bandwidth
  63. <enum 0 20_MHZ_11AC>
  64. <enum 1 40_MHZ_11AC>
  65. <enum 2 80_MHZ_11AC>
  66. <enum 3 160_MHZ_11AC>
  67. <legal 0-3>
  68. */
  69. #define VHT_SIG_A_INFO_BANDWIDTH_OFFSET 0x00000000
  70. #define VHT_SIG_A_INFO_BANDWIDTH_LSB 0
  71. #define VHT_SIG_A_INFO_BANDWIDTH_MSB 1
  72. #define VHT_SIG_A_INFO_BANDWIDTH_MASK 0x00000003
  73. /* Description VHTA_RESERVED_0
  74. Reserved. Set to 1 by MAC, PHY should ignore
  75. <legal 1>
  76. */
  77. #define VHT_SIG_A_INFO_VHTA_RESERVED_0_OFFSET 0x00000000
  78. #define VHT_SIG_A_INFO_VHTA_RESERVED_0_LSB 2
  79. #define VHT_SIG_A_INFO_VHTA_RESERVED_0_MSB 2
  80. #define VHT_SIG_A_INFO_VHTA_RESERVED_0_MASK 0x00000004
  81. /* Description STBC
  82. Space time block coding:
  83. <enum 0 stbc_disabled> Indicates STBC is disabled
  84. <enum 1 stbc_enabled> Indicates STBC is enabled on
  85. all streams
  86. <legal 0-1>
  87. */
  88. #define VHT_SIG_A_INFO_STBC_OFFSET 0x00000000
  89. #define VHT_SIG_A_INFO_STBC_LSB 3
  90. #define VHT_SIG_A_INFO_STBC_MSB 3
  91. #define VHT_SIG_A_INFO_STBC_MASK 0x00000008
  92. /* Description GROUP_ID
  93. In a SU VHT PPDU, if the PPDU carries MPDU(s) addressed
  94. to an AP or to a mesh STA, the Group ID field is set to
  95. 0, otherwise it is set to 63. In an NDP PPDU the Group
  96. ID is set according to IEEE 802.11ac_D1.0 Section 9.30.6
  97. (Transmission of a VHT NDP). For a MU-MIMO PPDU the Group
  98. ID is set as in 802.11ac_D1.0 Section 22.3.11.3 (Group
  99. ID). <legal all>
  100. */
  101. #define VHT_SIG_A_INFO_GROUP_ID_OFFSET 0x00000000
  102. #define VHT_SIG_A_INFO_GROUP_ID_LSB 4
  103. #define VHT_SIG_A_INFO_GROUP_ID_MSB 9
  104. #define VHT_SIG_A_INFO_GROUP_ID_MASK 0x000003f0
  105. /* Description N_STS
  106. For MU:
  107. 3 bits/user with maximum of 4 users (user u uses
  108. vht_sig_a[0][10+3u] - vht_sig_a[0][12+3u]), u = 0, 1, 2,
  109. 3)
  110. Set to 0 for 0 space time streams
  111. Set to 1 for 1 space time stream
  112. Set to 2 for 2 space time streams
  113. Set to 3 for 3 space time streams
  114. Set to 4 for 4 space time streams (not supported in Wifi
  115. 3.0)
  116. Values 5-7 are reserved
  117. In this field, references to user "u" should be interpreted
  118. as MU user "u". As described in the previous chapter in
  119. this document (see chapter on User number), the MU user
  120. value for a given client is defined for each MU group that
  121. the client participates in. The MU user number is not related
  122. to the internal user number that is used within the BFer.
  123. For SU:
  124. vht_sig_a[0][12:10]
  125. Set to 0 for 1 space time stream
  126. Set to 1 for 2 space time streams
  127. Set to 2 for 3 space time streams
  128. Set to 3 for 4 space time streams
  129. Set to 4 for 5 space time streams
  130. Set to 5 for 6 space time streams
  131. Set to 6 for 7 space time streams
  132. Set to 7 for 8 space time streams
  133. vht_sig_a[0][21:13]
  134. Partial AID:
  135. Set to the value of the TXVECTOR parameter PARTIAL_AID.
  136. Partial AID provides an abbreviated indication of the intended
  137. recipient(s) of the frame (see IEEE802.11ac_D1.0 Section
  138. 9.17a (Partial AID in VHT PPDUs)).
  139. <legal all>
  140. */
  141. #define VHT_SIG_A_INFO_N_STS_OFFSET 0x00000000
  142. #define VHT_SIG_A_INFO_N_STS_LSB 10
  143. #define VHT_SIG_A_INFO_N_STS_MSB 21
  144. #define VHT_SIG_A_INFO_N_STS_MASK 0x003ffc00
  145. /* Description TXOP_PS_NOT_ALLOWED
  146. E_num 0 txop_ps_allowed Not supported: If set to by
  147. VHT AP if it allows non-AP VHT STAs in TXOP power save
  148. mode to enter Doze state during a TXOP
  149. <enum 1 no_txop_ps_allowed> Otherwise
  150. <legal 1>
  151. */
  152. #define VHT_SIG_A_INFO_TXOP_PS_NOT_ALLOWED_OFFSET 0x00000000
  153. #define VHT_SIG_A_INFO_TXOP_PS_NOT_ALLOWED_LSB 22
  154. #define VHT_SIG_A_INFO_TXOP_PS_NOT_ALLOWED_MSB 22
  155. #define VHT_SIG_A_INFO_TXOP_PS_NOT_ALLOWED_MASK 0x00400000
  156. /* Description VHTA_RESERVED_0B
  157. Reserved: Should be set to 1 by the MAC and ignored by the
  158. PHY <legal 1>
  159. */
  160. #define VHT_SIG_A_INFO_VHTA_RESERVED_0B_OFFSET 0x00000000
  161. #define VHT_SIG_A_INFO_VHTA_RESERVED_0B_LSB 23
  162. #define VHT_SIG_A_INFO_VHTA_RESERVED_0B_MSB 23
  163. #define VHT_SIG_A_INFO_VHTA_RESERVED_0B_MASK 0x00800000
  164. /* Description RESERVED_0
  165. This field is not part of HT-SIG:
  166. Reserved: Should be set to 0 by the MAC and ignored by the
  167. PHY <legal 0>
  168. */
  169. #define VHT_SIG_A_INFO_RESERVED_0_OFFSET 0x00000000
  170. #define VHT_SIG_A_INFO_RESERVED_0_LSB 24
  171. #define VHT_SIG_A_INFO_RESERVED_0_MSB 31
  172. #define VHT_SIG_A_INFO_RESERVED_0_MASK 0xff000000
  173. /* Description GI_SETTING
  174. <enum 0 normal_gi> Indicates short guard interval is
  175. not used in the data field
  176. <enum 1 short_gi> Indicates short guard interval is
  177. used in the data field
  178. <enum 3 short_gi_ambiguity> Indicates short guard interval
  179. is used in the data field and NSYM mod 10 = 9
  180. NSYM is defined in IEEE802.11ac_D1.0 Section 22.4.3 (TXTIME
  181. and PSDU_LENGTH calculation).
  182. <legal 0,1,3>
  183. */
  184. #define VHT_SIG_A_INFO_GI_SETTING_OFFSET 0x00000004
  185. #define VHT_SIG_A_INFO_GI_SETTING_LSB 0
  186. #define VHT_SIG_A_INFO_GI_SETTING_MSB 1
  187. #define VHT_SIG_A_INFO_GI_SETTING_MASK 0x00000003
  188. /* Description SU_MU_CODING
  189. For an SU PPDU, B2 is set to 0 for BCC, 1 for LDPC For an
  190. MU PPDU, if the MU[0] NSTS field is nonzero(#6773), then
  191. B2 indicates the coding used for user 0; set to 0 for BCC
  192. and 1 for LDPC. If the MU[0] NSTS field is 0, then this
  193. field is reserved and set to 1
  194. */
  195. #define VHT_SIG_A_INFO_SU_MU_CODING_OFFSET 0x00000004
  196. #define VHT_SIG_A_INFO_SU_MU_CODING_LSB 2
  197. #define VHT_SIG_A_INFO_SU_MU_CODING_MSB 2
  198. #define VHT_SIG_A_INFO_SU_MU_CODING_MASK 0x00000004
  199. /* Description LDPC_EXTRA_SYMBOL
  200. Set to 1 if the LDPC PPDU encoding process (if an SU PPDU),
  201. or at least one LDPC user's PPDU encoding process (if an
  202. MU PPDU), results in an extra OFDM symbol (or symbols)
  203. as described in 22.3.10.5.4 (LDPC coding) and 22.3.10.5.5
  204. (Encoding process for MU PPDUs). Set to 0 otherwise.
  205. */
  206. #define VHT_SIG_A_INFO_LDPC_EXTRA_SYMBOL_OFFSET 0x00000004
  207. #define VHT_SIG_A_INFO_LDPC_EXTRA_SYMBOL_LSB 3
  208. #define VHT_SIG_A_INFO_LDPC_EXTRA_SYMBOL_MSB 3
  209. #define VHT_SIG_A_INFO_LDPC_EXTRA_SYMBOL_MASK 0x00000008
  210. /* Description MCS
  211. For SU:
  212. Set to 0 for BPSK 1/2
  213. Set to 1 for QPSK 1/2
  214. Set to 2 for QPSK 3/4
  215. Set to 3 for 16-QAM 1/2
  216. Set to 4 for 16-QAM 3/4
  217. Set to 5 for 64-QAM 2/3
  218. Set to 6 for 64-QAM 3/4
  219. Set to 7 for 64-QAM 5/6
  220. Set to 8 for 256-QAM 3/4
  221. Set to 9 for 256-QAM 5/6
  222. For MU:
  223. If NSTS for user 1 is non-zero, then vht_sig_a[1][4] indicates
  224. coding for user 1: set to 0 for BCC, 1 for LDPC.
  225. If NSTS for user 1 is set to 0, then vht_sig_a[1][4] is
  226. reserved and set to 1.
  227. If NSTS for user 2 is non-zero, then vht_sig_a[1][5] indicates
  228. coding for user 2: set to 0 for BCC, 1 for LDPC.
  229. If NSTS for user 2 is set to 0, then vht_sig_a[1][5] is
  230. reserved and set to 1.
  231. If NSTS for user 3 is non-zero, then vht_sig_a[1][6] indicates
  232. coding for user 3: set to 0 for BCC, 1 for LDPC.
  233. If NSTS for user 3 is set to 0, then vht_sig_a[1][6] is
  234. reserved and set to 1.
  235. vht_sig_a[1][7] is reserved and set to 1
  236. <legal 0-15>
  237. */
  238. #define VHT_SIG_A_INFO_MCS_OFFSET 0x00000004
  239. #define VHT_SIG_A_INFO_MCS_LSB 4
  240. #define VHT_SIG_A_INFO_MCS_MSB 7
  241. #define VHT_SIG_A_INFO_MCS_MASK 0x000000f0
  242. /* Description BEAMFORMED
  243. For SU:
  244. Set to 1 if a Beamforming steering matrix is applied to
  245. the waveform in an SU transmission as described in IEEE802.11ac_D1.0
  246. Section 19.3.11.11.2 (Spatial mapping), set to 0 otherwise.
  247. For MU:
  248. Reserved and set to 1
  249. <legal 0-1>
  250. */
  251. #define VHT_SIG_A_INFO_BEAMFORMED_OFFSET 0x00000004
  252. #define VHT_SIG_A_INFO_BEAMFORMED_LSB 8
  253. #define VHT_SIG_A_INFO_BEAMFORMED_MSB 8
  254. #define VHT_SIG_A_INFO_BEAMFORMED_MASK 0x00000100
  255. /* Description VHTA_RESERVED_1
  256. Reserved and set to 1. <legal 1>
  257. */
  258. #define VHT_SIG_A_INFO_VHTA_RESERVED_1_OFFSET 0x00000004
  259. #define VHT_SIG_A_INFO_VHTA_RESERVED_1_LSB 9
  260. #define VHT_SIG_A_INFO_VHTA_RESERVED_1_MSB 9
  261. #define VHT_SIG_A_INFO_VHTA_RESERVED_1_MASK 0x00000200
  262. /* Description CRC
  263. CRC calculated as in IEEE802.11ac_D1.0 Section 19.3.9.4.4
  264. (CRC calculation for HTSIG) with C7 in vht_sig_a[1][10],
  265. etc. <legal all>
  266. */
  267. #define VHT_SIG_A_INFO_CRC_OFFSET 0x00000004
  268. #define VHT_SIG_A_INFO_CRC_LSB 10
  269. #define VHT_SIG_A_INFO_CRC_MSB 17
  270. #define VHT_SIG_A_INFO_CRC_MASK 0x0003fc00
  271. /* Description TAIL
  272. Used to terminate the trellis of the convolutional decoder.
  273. Set to 0. <legal 0>
  274. */
  275. #define VHT_SIG_A_INFO_TAIL_OFFSET 0x00000004
  276. #define VHT_SIG_A_INFO_TAIL_LSB 18
  277. #define VHT_SIG_A_INFO_TAIL_MSB 23
  278. #define VHT_SIG_A_INFO_TAIL_MASK 0x00fc0000
  279. /* Description RESERVED_1
  280. This field is not part of HT-SIG:
  281. Reserved: Should be set to 0 by the MAC and ignored by the
  282. PHY <legal 0>
  283. */
  284. #define VHT_SIG_A_INFO_RESERVED_1_OFFSET 0x00000004
  285. #define VHT_SIG_A_INFO_RESERVED_1_LSB 24
  286. #define VHT_SIG_A_INFO_RESERVED_1_MSB 30
  287. #define VHT_SIG_A_INFO_RESERVED_1_MASK 0x7f000000
  288. /* Description RX_INTEGRITY_CHECK_PASSED
  289. TX side: Set to 0
  290. RX side: Set to 1 if PHY determines the VHT-SIG-A CRC check
  291. has passed, else set to 0
  292. <legal all>
  293. */
  294. #define VHT_SIG_A_INFO_RX_INTEGRITY_CHECK_PASSED_OFFSET 0x00000004
  295. #define VHT_SIG_A_INFO_RX_INTEGRITY_CHECK_PASSED_LSB 31
  296. #define VHT_SIG_A_INFO_RX_INTEGRITY_CHECK_PASSED_MSB 31
  297. #define VHT_SIG_A_INFO_RX_INTEGRITY_CHECK_PASSED_MASK 0x80000000
  298. #endif // VHT_SIG_A_INFO