mactx_user_desc_per_user.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  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 _MACTX_USER_DESC_PER_USER_H_
  16. #define _MACTX_USER_DESC_PER_USER_H_
  17. #if !defined(__ASSEMBLER__)
  18. #endif
  19. #define NUM_OF_DWORDS_MACTX_USER_DESC_PER_USER 4
  20. #define NUM_OF_QWORDS_MACTX_USER_DESC_PER_USER 2
  21. struct mactx_user_desc_per_user {
  22. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  23. uint32_t psdu_length : 24, // [23:0]
  24. reserved_0a : 8; // [31:24]
  25. uint32_t ru_start_index : 8, // [7:0]
  26. ru_size : 4, // [11:8]
  27. reserved_1b : 4, // [15:12]
  28. ofdma_mu_mimo_enabled : 1, // [16:16]
  29. nss : 3, // [19:17]
  30. stream_offset : 3, // [22:20]
  31. reserved_1c : 1, // [23:23]
  32. mcs : 4, // [27:24]
  33. dcm : 1, // [28:28]
  34. reserved_1d : 3; // [31:29]
  35. uint32_t fec_type : 1, // [0:0]
  36. reserved_2a : 7, // [7:1]
  37. user_bf_type : 2, // [9:8]
  38. reserved_2b : 6, // [15:10]
  39. drop_user_cbf : 1, // [16:16]
  40. reserved_2c : 7, // [23:17]
  41. ldpc_extra_symbol : 1, // [24:24]
  42. force_extra_symbol : 1, // [25:25]
  43. reserved_2d : 6; // [31:26]
  44. uint32_t sw_peer_id : 16, // [15:0]
  45. per_user_subband_mask : 16; // [31:16]
  46. #else
  47. uint32_t reserved_0a : 8, // [31:24]
  48. psdu_length : 24; // [23:0]
  49. uint32_t reserved_1d : 3, // [31:29]
  50. dcm : 1, // [28:28]
  51. mcs : 4, // [27:24]
  52. reserved_1c : 1, // [23:23]
  53. stream_offset : 3, // [22:20]
  54. nss : 3, // [19:17]
  55. ofdma_mu_mimo_enabled : 1, // [16:16]
  56. reserved_1b : 4, // [15:12]
  57. ru_size : 4, // [11:8]
  58. ru_start_index : 8; // [7:0]
  59. uint32_t reserved_2d : 6, // [31:26]
  60. force_extra_symbol : 1, // [25:25]
  61. ldpc_extra_symbol : 1, // [24:24]
  62. reserved_2c : 7, // [23:17]
  63. drop_user_cbf : 1, // [16:16]
  64. reserved_2b : 6, // [15:10]
  65. user_bf_type : 2, // [9:8]
  66. reserved_2a : 7, // [7:1]
  67. fec_type : 1; // [0:0]
  68. uint32_t per_user_subband_mask : 16, // [31:16]
  69. sw_peer_id : 16; // [15:0]
  70. #endif
  71. };
  72. /* Description PSDU_LENGTH
  73. PSDU Length for the User in octets
  74. NOTE: This also holds good for .11ba packets
  75. <legal all>
  76. */
  77. #define MACTX_USER_DESC_PER_USER_PSDU_LENGTH_OFFSET 0x0000000000000000
  78. #define MACTX_USER_DESC_PER_USER_PSDU_LENGTH_LSB 0
  79. #define MACTX_USER_DESC_PER_USER_PSDU_LENGTH_MSB 23
  80. #define MACTX_USER_DESC_PER_USER_PSDU_LENGTH_MASK 0x0000000000ffffff
  81. /* Description RESERVED_0A
  82. <legal 0>
  83. */
  84. #define MACTX_USER_DESC_PER_USER_RESERVED_0A_OFFSET 0x0000000000000000
  85. #define MACTX_USER_DESC_PER_USER_RESERVED_0A_LSB 24
  86. #define MACTX_USER_DESC_PER_USER_RESERVED_0A_MSB 31
  87. #define MACTX_USER_DESC_PER_USER_RESERVED_0A_MASK 0x00000000ff000000
  88. /* Description RU_START_INDEX
  89. Field only valid in case of .11ax or .11be OFDMA transmission
  90. (=> from MACTX_PHY_DESC, field MU_type == OFDMA)
  91. OR
  92. 11ax SU "Narrow band" transmission.
  93. RU Number to which User is assigned
  94. RU numbering is over the entire BW, starting from 0 and
  95. for the different users in increasing frequency order and
  96. not primary-secondary order.
  97. For DL OFDMA transmissions, PDG shall fill this as instructed
  98. by SW.
  99. For UL OFDMA transmissions, the RU number within 80 MHz
  100. is available from the RU allocation information in the trigger.
  101. For 160 MHz UL OFDMA transmissions, the trigger RU allocation
  102. only mentions primary/secondary 80 MHz. PDG needs to convert
  103. this to lower/higher 80 MHz.
  104. If in 'PCU_PPDU_SETUP_START'/'MACTX_PRE_PHY_DESC,' CCA_Subband_channel_bonding_mask
  105. bit 0 is mapped to any of bits 4 - 7 of Freq_Subband_channel_bonding_mask,
  106. then the primary 80 MHz is the higher 80 MHz and the secondary
  107. 80 MHz is the lower one.
  108. Otherwise (if CCA_Subband_channel_bonding_mask bit 0 is
  109. mapped to any of bits 0 - 3 of Freq_Subband_channel_bonding_mask,
  110. then the primary 80 MHz is the lower 80 MHz and the secondary
  111. 80 MHz is the higher one.
  112. <legal 0-147>
  113. */
  114. #define MACTX_USER_DESC_PER_USER_RU_START_INDEX_OFFSET 0x0000000000000000
  115. #define MACTX_USER_DESC_PER_USER_RU_START_INDEX_LSB 32
  116. #define MACTX_USER_DESC_PER_USER_RU_START_INDEX_MSB 39
  117. #define MACTX_USER_DESC_PER_USER_RU_START_INDEX_MASK 0x000000ff00000000
  118. /* Description RU_SIZE
  119. The size of the RU for this user
  120. In case of HE extended range transmission, e-num 2 (10MHz)
  121. or e-num 7 (20MHz) are used.
  122. In case of trig transmission or OFDMA single user or MU-MIMO
  123. single user transmission, if the RU allocated to the user
  124. is the full BW (with respect to AP_bw) then the e-num 7
  125. is used.
  126. For all other cases, e-nums corresponding to the RU size
  127. allocated to the user is used.
  128. In case of EHT duplicate transmissions, this field indicates
  129. the width of the actual content before duplication, e.g.
  130. a 40 MHz PPDU duplicated to 160 MHz will have the bandwidth
  131. fields indicating 160 MHz and this field set to e-num 4
  132. (RU_484).
  133. <enum 0 RU_26>
  134. <enum 1 RU_52>
  135. <enum 2 RU_106>
  136. <enum 3 RU_242>
  137. <enum 4 RU_484>
  138. <enum 5 RU_996>
  139. <enum 6 RU_1992>
  140. <enum 7 RU_FULLBW> Set when the RU occupies the full packet
  141. bandwidth
  142. <enum 8 RU_FULLBW_240> Set when the RU occupies the full
  143. packet bandwidth
  144. <enum 9 RU_FULLBW_320> Set when the RU occupies the full
  145. packet bandwidth
  146. <enum 10 RU_MULTI_LARGE> HW will use per-user sub-band-mask
  147. to infer the actual RU-size for Multi-large-RU/SU-Puncturing
  148. <enum 11 RU_78> multi small RU
  149. <enum 12 RU_132> multi small RU<legal 0-12>
  150. */
  151. #define MACTX_USER_DESC_PER_USER_RU_SIZE_OFFSET 0x0000000000000000
  152. #define MACTX_USER_DESC_PER_USER_RU_SIZE_LSB 40
  153. #define MACTX_USER_DESC_PER_USER_RU_SIZE_MSB 43
  154. #define MACTX_USER_DESC_PER_USER_RU_SIZE_MASK 0x00000f0000000000
  155. /* Description RESERVED_1B
  156. <legal 0>
  157. */
  158. #define MACTX_USER_DESC_PER_USER_RESERVED_1B_OFFSET 0x0000000000000000
  159. #define MACTX_USER_DESC_PER_USER_RESERVED_1B_LSB 44
  160. #define MACTX_USER_DESC_PER_USER_RESERVED_1B_MSB 47
  161. #define MACTX_USER_DESC_PER_USER_RESERVED_1B_MASK 0x0000f00000000000
  162. /* Description OFDMA_MU_MIMO_ENABLED
  163. Field only valid in case of .11ax or .11be OFDMA transmission
  164. (=> from MACTX_PHY_DESC, field MU_type == OFDMA)
  165. When set, for this user there is MIMO transmission within
  166. the RU
  167. <legal all>
  168. */
  169. #define MACTX_USER_DESC_PER_USER_OFDMA_MU_MIMO_ENABLED_OFFSET 0x0000000000000000
  170. #define MACTX_USER_DESC_PER_USER_OFDMA_MU_MIMO_ENABLED_LSB 48
  171. #define MACTX_USER_DESC_PER_USER_OFDMA_MU_MIMO_ENABLED_MSB 48
  172. #define MACTX_USER_DESC_PER_USER_OFDMA_MU_MIMO_ENABLED_MASK 0x0001000000000000
  173. /* Description NSS
  174. Number of Spatial Streams occupied by the User
  175. <enum 0 1_spatial_stream>Single spatial stream
  176. <enum 1 2_spatial_streams>2 spatial streams
  177. <enum 2 3_spatial_streams>3 spatial streams
  178. <enum 3 4_spatial_streams>4 spatial streams
  179. <enum 4 5_spatial_streams>5 spatial streams
  180. <enum 5 6_spatial_streams>6 spatial streams
  181. <enum 6 7_spatial_streams>7 spatial streams
  182. <enum 7 8_spatial_streams>8 spatial streams
  183. */
  184. #define MACTX_USER_DESC_PER_USER_NSS_OFFSET 0x0000000000000000
  185. #define MACTX_USER_DESC_PER_USER_NSS_LSB 49
  186. #define MACTX_USER_DESC_PER_USER_NSS_MSB 51
  187. #define MACTX_USER_DESC_PER_USER_NSS_MASK 0x000e000000000000
  188. /* Description STREAM_OFFSET
  189. Field only valid in case of MU-MIMO transmission (=> from
  190. MACTX_PHY_DESC, field MU_type == MU-MIMO)
  191. OR
  192. when field Ofdma_mu_mimo_enabled is set
  193. Stream Offset from which the User occupies the Streams
  194. Note MAC:
  195. directly from pdg_fes_setup, based on BW
  196. <legal all>
  197. */
  198. #define MACTX_USER_DESC_PER_USER_STREAM_OFFSET_OFFSET 0x0000000000000000
  199. #define MACTX_USER_DESC_PER_USER_STREAM_OFFSET_LSB 52
  200. #define MACTX_USER_DESC_PER_USER_STREAM_OFFSET_MSB 54
  201. #define MACTX_USER_DESC_PER_USER_STREAM_OFFSET_MASK 0x0070000000000000
  202. /* Description RESERVED_1C
  203. <legal 0>
  204. */
  205. #define MACTX_USER_DESC_PER_USER_RESERVED_1C_OFFSET 0x0000000000000000
  206. #define MACTX_USER_DESC_PER_USER_RESERVED_1C_LSB 55
  207. #define MACTX_USER_DESC_PER_USER_RESERVED_1C_MSB 55
  208. #define MACTX_USER_DESC_PER_USER_RESERVED_1C_MASK 0x0080000000000000
  209. /* Description MCS
  210. Modulation Coding Scheme for the User
  211. The MCS to be used for the upcoming transmission. It must
  212. match the 4-bit MCS value that is sent in the appropriate
  213. signal field for the given packet type, except that EHT
  214. BPSK with DCM and/or duplicate is encoded as '0.'
  215. For details, refer to the SIG field, related to this pkt_type.
  216. (Note that this is slightly different then what is on the
  217. MAC side defined as "MCS_TYPE". For this reason, the 'legal
  218. values' here are NOT defined as MCS_TYPE)
  219. <legal all>
  220. */
  221. #define MACTX_USER_DESC_PER_USER_MCS_OFFSET 0x0000000000000000
  222. #define MACTX_USER_DESC_PER_USER_MCS_LSB 56
  223. #define MACTX_USER_DESC_PER_USER_MCS_MSB 59
  224. #define MACTX_USER_DESC_PER_USER_MCS_MASK 0x0f00000000000000
  225. /* Description DCM
  226. Field only valid in case of 11ax transmission
  227. Indicates whether dual sub-carrier modulation is applied
  228. 0: No DCM
  229. 1:DCM
  230. <legal all>
  231. */
  232. #define MACTX_USER_DESC_PER_USER_DCM_OFFSET 0x0000000000000000
  233. #define MACTX_USER_DESC_PER_USER_DCM_LSB 60
  234. #define MACTX_USER_DESC_PER_USER_DCM_MSB 60
  235. #define MACTX_USER_DESC_PER_USER_DCM_MASK 0x1000000000000000
  236. /* Description RESERVED_1D
  237. <legal 0>
  238. */
  239. #define MACTX_USER_DESC_PER_USER_RESERVED_1D_OFFSET 0x0000000000000000
  240. #define MACTX_USER_DESC_PER_USER_RESERVED_1D_LSB 61
  241. #define MACTX_USER_DESC_PER_USER_RESERVED_1D_MSB 63
  242. #define MACTX_USER_DESC_PER_USER_RESERVED_1D_MASK 0xe000000000000000
  243. /* Description FEC_TYPE
  244. 0: BCC
  245. 1: LDPC
  246. <legal all>
  247. */
  248. #define MACTX_USER_DESC_PER_USER_FEC_TYPE_OFFSET 0x0000000000000008
  249. #define MACTX_USER_DESC_PER_USER_FEC_TYPE_LSB 0
  250. #define MACTX_USER_DESC_PER_USER_FEC_TYPE_MSB 0
  251. #define MACTX_USER_DESC_PER_USER_FEC_TYPE_MASK 0x0000000000000001
  252. /* Description RESERVED_2A
  253. <legal 0>
  254. */
  255. #define MACTX_USER_DESC_PER_USER_RESERVED_2A_OFFSET 0x0000000000000008
  256. #define MACTX_USER_DESC_PER_USER_RESERVED_2A_LSB 1
  257. #define MACTX_USER_DESC_PER_USER_RESERVED_2A_MSB 7
  258. #define MACTX_USER_DESC_PER_USER_RESERVED_2A_MASK 0x00000000000000fe
  259. /* Description USER_BF_TYPE
  260. This field is valid for all packets using multiple antennas
  261. because it defines whether the user's tones will be beamformed,
  262. spatially spread, both or none of the above.
  263. <enum 0 USER_NO_BF> Direct mapping from Stream to Chain
  264. <enum 1 USER_WALSH_ONLY> Enable Walsh mapping only
  265. <enum 2 USER_BF_ONLY> Enable Beamforming only
  266. <enum 3 USER_WALSH_AND_BF> Enable Walsh and Beamforming
  267. NOTE: USER_NO_BF and USER_BF_ONLY are not allowed if the
  268. number of spatial streams (NSS) < the number of Tx chains
  269. (NTx).
  270. <legal all>
  271. */
  272. #define MACTX_USER_DESC_PER_USER_USER_BF_TYPE_OFFSET 0x0000000000000008
  273. #define MACTX_USER_DESC_PER_USER_USER_BF_TYPE_LSB 8
  274. #define MACTX_USER_DESC_PER_USER_USER_BF_TYPE_MSB 9
  275. #define MACTX_USER_DESC_PER_USER_USER_BF_TYPE_MASK 0x0000000000000300
  276. /* Description RESERVED_2B
  277. <legal 0>
  278. */
  279. #define MACTX_USER_DESC_PER_USER_RESERVED_2B_OFFSET 0x0000000000000008
  280. #define MACTX_USER_DESC_PER_USER_RESERVED_2B_LSB 10
  281. #define MACTX_USER_DESC_PER_USER_RESERVED_2B_MSB 15
  282. #define MACTX_USER_DESC_PER_USER_RESERVED_2B_MASK 0x000000000000fc00
  283. /* Description DROP_USER_CBF
  284. This user shall be dropped because of CBF FCS failure or
  285. no CBF reception.
  286. <legal all>
  287. */
  288. #define MACTX_USER_DESC_PER_USER_DROP_USER_CBF_OFFSET 0x0000000000000008
  289. #define MACTX_USER_DESC_PER_USER_DROP_USER_CBF_LSB 16
  290. #define MACTX_USER_DESC_PER_USER_DROP_USER_CBF_MSB 16
  291. #define MACTX_USER_DESC_PER_USER_DROP_USER_CBF_MASK 0x0000000000010000
  292. /* Description RESERVED_2C
  293. <legal 0>
  294. */
  295. #define MACTX_USER_DESC_PER_USER_RESERVED_2C_OFFSET 0x0000000000000008
  296. #define MACTX_USER_DESC_PER_USER_RESERVED_2C_LSB 17
  297. #define MACTX_USER_DESC_PER_USER_RESERVED_2C_MSB 23
  298. #define MACTX_USER_DESC_PER_USER_RESERVED_2C_MASK 0x0000000000fe0000
  299. /* Description LDPC_EXTRA_SYMBOL
  300. Set to 1 if the LDPC PPDU encoding process (if an SU PPDU),
  301. or at least one LDPC user's PPDU encoding process (if an
  302. MU PPDU), results in an extra OFDM symbol (or symbols)
  303. as described in 22.3.10.5.4 (LDPC coding) and 22.3.10.5.5
  304. (Encoding process for MU PPDUs). Set to 0 otherwise.
  305. <legal all>
  306. */
  307. #define MACTX_USER_DESC_PER_USER_LDPC_EXTRA_SYMBOL_OFFSET 0x0000000000000008
  308. #define MACTX_USER_DESC_PER_USER_LDPC_EXTRA_SYMBOL_LSB 24
  309. #define MACTX_USER_DESC_PER_USER_LDPC_EXTRA_SYMBOL_MSB 24
  310. #define MACTX_USER_DESC_PER_USER_LDPC_EXTRA_SYMBOL_MASK 0x0000000001000000
  311. /* Description FORCE_EXTRA_SYMBOL
  312. Set to 1 to force an extra OFDM symbol (or symbols) even
  313. if none of the users' PPDU encoding process resuls in an
  314. extra OFDM symbol (or symbols).
  315. <legal all>
  316. */
  317. #define MACTX_USER_DESC_PER_USER_FORCE_EXTRA_SYMBOL_OFFSET 0x0000000000000008
  318. #define MACTX_USER_DESC_PER_USER_FORCE_EXTRA_SYMBOL_LSB 25
  319. #define MACTX_USER_DESC_PER_USER_FORCE_EXTRA_SYMBOL_MSB 25
  320. #define MACTX_USER_DESC_PER_USER_FORCE_EXTRA_SYMBOL_MASK 0x0000000002000000
  321. /* Description RESERVED_2D
  322. <legal 0>
  323. */
  324. #define MACTX_USER_DESC_PER_USER_RESERVED_2D_OFFSET 0x0000000000000008
  325. #define MACTX_USER_DESC_PER_USER_RESERVED_2D_LSB 26
  326. #define MACTX_USER_DESC_PER_USER_RESERVED_2D_MSB 31
  327. #define MACTX_USER_DESC_PER_USER_RESERVED_2D_MASK 0x00000000fc000000
  328. /* Description SW_PEER_ID
  329. When set to 0, SW did not populate this field.
  330. The SW peer ID for this user
  331. <legal all>
  332. */
  333. #define MACTX_USER_DESC_PER_USER_SW_PEER_ID_OFFSET 0x0000000000000008
  334. #define MACTX_USER_DESC_PER_USER_SW_PEER_ID_LSB 32
  335. #define MACTX_USER_DESC_PER_USER_SW_PEER_ID_MSB 47
  336. #define MACTX_USER_DESC_PER_USER_SW_PEER_ID_MASK 0x0000ffff00000000
  337. /* Description PER_USER_SUBBAND_MASK
  338. This specifies a per-20 MHz subband mask per-user to be
  339. used in case of either multi-large-RU or preamble puncturing.
  340. <legal all>
  341. */
  342. #define MACTX_USER_DESC_PER_USER_PER_USER_SUBBAND_MASK_OFFSET 0x0000000000000008
  343. #define MACTX_USER_DESC_PER_USER_PER_USER_SUBBAND_MASK_LSB 48
  344. #define MACTX_USER_DESC_PER_USER_PER_USER_SUBBAND_MASK_MSB 63
  345. #define MACTX_USER_DESC_PER_USER_PER_USER_SUBBAND_MASK_MASK 0xffff000000000000
  346. #endif // MACTX_USER_DESC_PER_USER