vht_sig_a_info.h 16 KB

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