mactx_user_desc_per_user.h 20 KB

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