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