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