1 /* 2 * Copyright (c) 2020 The Linux Foundation. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for 5 * any purpose with or without fee is hereby granted, provided that the 6 * above copyright notice and this permission notice appear in all 7 * copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16 * PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 // 20 // DO NOT EDIT! This file is automatically generated 21 // These definitions are tied to a particular hardware layout 22 23 24 #ifndef _RECEIVE_USER_INFO_H_ 25 #define _RECEIVE_USER_INFO_H_ 26 #if !defined(__ASSEMBLER__) 27 #endif 28 29 30 // ################ START SUMMARY ################# 31 // 32 // Dword Fields 33 // 0 phy_ppdu_id[15:0], user_rssi[23:16], pkt_type[27:24], stbc[28], reception_type[31:29] 34 // 1 rate_mcs[3:0], sgi[5:4], receive_bandwidth[7:6], mimo_ss_bitmap[15:8], ofdma_ru_allocation[23:16], ofdma_user_index[30:24], ofdma_content_channel[31] 35 // 2 ldpc[0], ru_width[7:1], reserved_2a[31:8] 36 // 37 // ################ END SUMMARY ################# 38 39 #define NUM_OF_DWORDS_RECEIVE_USER_INFO 3 40 41 struct receive_user_info { 42 uint32_t phy_ppdu_id : 16, //[15:0] 43 user_rssi : 8, //[23:16] 44 pkt_type : 4, //[27:24] 45 stbc : 1, //[28] 46 reception_type : 3; //[31:29] 47 uint32_t rate_mcs : 4, //[3:0] 48 sgi : 2, //[5:4] 49 receive_bandwidth : 2, //[7:6] 50 mimo_ss_bitmap : 8, //[15:8] 51 ofdma_ru_allocation : 8, //[23:16] 52 ofdma_user_index : 7, //[30:24] 53 ofdma_content_channel : 1; //[31] 54 uint32_t ldpc : 1, //[0] 55 ru_width : 7, //[7:1] 56 reserved_2a : 24; //[31:8] 57 }; 58 59 /* 60 61 phy_ppdu_id 62 63 A ppdu counter value that PHY increments for every PPDU 64 received. The counter value wraps around 65 66 <legal all> 67 68 user_rssi 69 70 RSSI for this user 71 72 Frequency domain RSSI measurement for this user. Based 73 on the channel estimate. 74 75 76 77 <legal all> 78 79 pkt_type 80 81 Packet type: 82 83 84 85 <enum 0 dot11a>802.11a PPDU type 86 87 <enum 1 dot11b>802.11b PPDU type 88 89 <enum 2 dot11n_mm>802.11n Mixed Mode PPDU type 90 91 <enum 3 dot11ac>802.11ac PPDU type 92 93 <enum 4 dot11ax>802.11ax PPDU type 94 95 <enum 5 dot11ba>802.11ba (WUR) PPDU type 96 97 stbc 98 99 When set, use STBC transmission rates 100 101 reception_type 102 103 Indicates what type of reception this is. 104 105 <enum 0 reception_type_SU > Basic SU reception (not 106 part of OFDMA or MU-MIMO) 107 108 <enum 1 reception_type_MU_MIMO > This is related to 109 DL type of reception 110 111 <enum 2 reception_type_MU_OFDMA > This is related 112 to DL type of reception 113 114 <enum 3 reception_type_MU_OFDMA_MIMO > This is 115 related to DL type of reception 116 117 <enum 4 reception_type_UL_MU_MIMO > This is related 118 to UL type of reception 119 120 <enum 5 reception_type_UL_MU_OFDMA > This is 121 related to UL type of reception 122 123 <enum 6 reception_type_UL_MU_OFDMA_MIMO > This is 124 related to UL type of reception 125 126 127 128 <legal 0-6> 129 130 rate_mcs 131 132 For details, refer to MCS_TYPE description 133 134 <legal all> 135 136 sgi 137 138 Field only valid when pkt type is HT, VHT or HE. 139 140 141 142 <enum 0 gi_0_8_us > Legacy normal GI. Can also be 143 used for HE 144 145 <enum 1 gi_0_4_us > Legacy short GI. Can also be 146 used for HE 147 148 <enum 2 gi_1_6_us > HE related GI 149 150 <enum 3 gi_3_2_us > HE related GI 151 152 <legal 0 - 3> 153 154 receive_bandwidth 155 156 Full receive Bandwidth 157 158 159 160 <enum 0 full_rx_bw_20_mhz> 161 162 <enum 1 full_rx_bw_40_mhz> 163 164 <enum 2 full_rx_bw_80_mhz> 165 166 <enum 3 full_rx_bw_160_mhz> 167 168 169 170 <legal 0-3> 171 172 mimo_ss_bitmap 173 174 Bitmap, with each bit indicating if the related spatial 175 stream is used for this STA 176 177 LSB related to SS 0 178 179 180 181 0: spatial stream not used for this reception 182 183 1: spatial stream used for this reception 184 185 186 187 <legal all> 188 189 ofdma_ru_allocation 190 191 Field only valid in case of OFDMA type receptions (DL 192 and UL) 193 194 195 196 Indicates the RU number associated with this user. 197 198 199 200 In case of reception where the transmission was DL MU 201 OFDMA, this field provides the RU pattern. Note that fields 202 ofdma_user_index and ofdma_content_channel are needed to 203 determine which RU (within a 40 MHz channel) was actually 204 assigned to this user, but this does not give info on which 205 40 MHz channel was assigned to this user. Please refer 206 DL_ofdma_ru_* in PHYRX_PKT_END_INFO for complete RU info for 207 this user. 208 209 210 211 In case of reception where the transmission was UL MU 212 OFDMA, PHY is recommended to insert the RU start index in 213 this field. Note that PHY may insert the RU width in 214 Reserved_2a[6:0]. 215 216 <legal all> 217 218 ofdma_user_index 219 220 Field only valid in the of DL MU OFDMA reception 221 222 223 224 The user number within the RU_allocation. 225 226 227 228 This is needed for SW to determine the exact RU position 229 within the reception. 230 231 <legal all> 232 233 ofdma_content_channel 234 235 Field only valid in the of DL MU OFDMA/MIMO reception 236 237 238 239 In case of DL MU reception, this field indicates the 240 content channel number where PHY found the RU information 241 for this user 242 243 244 245 This is needed for SW to determine the exact RU position 246 within the reception. 247 248 249 250 <enum 0 content_channel_1> 251 252 <enum 1 content_channel_2> 253 254 255 256 <legal all> 257 258 ldpc 259 260 When set, use LDPC transmission rates were used. 261 262 <legal all> 263 264 ru_width 265 266 In case of UL OFDMA reception, PHY is recommended to 267 insert the RU width 268 269 In Hastings80: was using Reserved_2a[6:0]. 270 271 <legal 1 - 74> 272 273 reserved_2a 274 275 <legal 0> 276 */ 277 278 279 /* Description RECEIVE_USER_INFO_0_PHY_PPDU_ID 280 281 A ppdu counter value that PHY increments for every PPDU 282 received. The counter value wraps around 283 284 <legal all> 285 */ 286 #define RECEIVE_USER_INFO_0_PHY_PPDU_ID_OFFSET 0x00000000 287 #define RECEIVE_USER_INFO_0_PHY_PPDU_ID_LSB 0 288 #define RECEIVE_USER_INFO_0_PHY_PPDU_ID_MASK 0x0000ffff 289 290 /* Description RECEIVE_USER_INFO_0_USER_RSSI 291 292 RSSI for this user 293 294 Frequency domain RSSI measurement for this user. Based 295 on the channel estimate. 296 297 298 299 <legal all> 300 */ 301 #define RECEIVE_USER_INFO_0_USER_RSSI_OFFSET 0x00000000 302 #define RECEIVE_USER_INFO_0_USER_RSSI_LSB 16 303 #define RECEIVE_USER_INFO_0_USER_RSSI_MASK 0x00ff0000 304 305 /* Description RECEIVE_USER_INFO_0_PKT_TYPE 306 307 Packet type: 308 309 310 311 <enum 0 dot11a>802.11a PPDU type 312 313 <enum 1 dot11b>802.11b PPDU type 314 315 <enum 2 dot11n_mm>802.11n Mixed Mode PPDU type 316 317 <enum 3 dot11ac>802.11ac PPDU type 318 319 <enum 4 dot11ax>802.11ax PPDU type 320 321 <enum 5 dot11ba>802.11ba (WUR) PPDU type 322 */ 323 #define RECEIVE_USER_INFO_0_PKT_TYPE_OFFSET 0x00000000 324 #define RECEIVE_USER_INFO_0_PKT_TYPE_LSB 24 325 #define RECEIVE_USER_INFO_0_PKT_TYPE_MASK 0x0f000000 326 327 /* Description RECEIVE_USER_INFO_0_STBC 328 329 When set, use STBC transmission rates 330 */ 331 #define RECEIVE_USER_INFO_0_STBC_OFFSET 0x00000000 332 #define RECEIVE_USER_INFO_0_STBC_LSB 28 333 #define RECEIVE_USER_INFO_0_STBC_MASK 0x10000000 334 335 /* Description RECEIVE_USER_INFO_0_RECEPTION_TYPE 336 337 Indicates what type of reception this is. 338 339 <enum 0 reception_type_SU > Basic SU reception (not 340 part of OFDMA or MU-MIMO) 341 342 <enum 1 reception_type_MU_MIMO > This is related to 343 DL type of reception 344 345 <enum 2 reception_type_MU_OFDMA > This is related 346 to DL type of reception 347 348 <enum 3 reception_type_MU_OFDMA_MIMO > This is 349 related to DL type of reception 350 351 <enum 4 reception_type_UL_MU_MIMO > This is related 352 to UL type of reception 353 354 <enum 5 reception_type_UL_MU_OFDMA > This is 355 related to UL type of reception 356 357 <enum 6 reception_type_UL_MU_OFDMA_MIMO > This is 358 related to UL type of reception 359 360 361 362 <legal 0-6> 363 */ 364 #define RECEIVE_USER_INFO_0_RECEPTION_TYPE_OFFSET 0x00000000 365 #define RECEIVE_USER_INFO_0_RECEPTION_TYPE_LSB 29 366 #define RECEIVE_USER_INFO_0_RECEPTION_TYPE_MASK 0xe0000000 367 368 /* Description RECEIVE_USER_INFO_1_RATE_MCS 369 370 For details, refer to MCS_TYPE description 371 372 <legal all> 373 */ 374 #define RECEIVE_USER_INFO_1_RATE_MCS_OFFSET 0x00000004 375 #define RECEIVE_USER_INFO_1_RATE_MCS_LSB 0 376 #define RECEIVE_USER_INFO_1_RATE_MCS_MASK 0x0000000f 377 378 /* Description RECEIVE_USER_INFO_1_SGI 379 380 Field only valid when pkt type is HT, VHT or HE. 381 382 383 384 <enum 0 gi_0_8_us > Legacy normal GI. Can also be 385 used for HE 386 387 <enum 1 gi_0_4_us > Legacy short GI. Can also be 388 used for HE 389 390 <enum 2 gi_1_6_us > HE related GI 391 392 <enum 3 gi_3_2_us > HE related GI 393 394 <legal 0 - 3> 395 */ 396 #define RECEIVE_USER_INFO_1_SGI_OFFSET 0x00000004 397 #define RECEIVE_USER_INFO_1_SGI_LSB 4 398 #define RECEIVE_USER_INFO_1_SGI_MASK 0x00000030 399 400 /* Description RECEIVE_USER_INFO_1_RECEIVE_BANDWIDTH 401 402 Full receive Bandwidth 403 404 405 406 <enum 0 full_rx_bw_20_mhz> 407 408 <enum 1 full_rx_bw_40_mhz> 409 410 <enum 2 full_rx_bw_80_mhz> 411 412 <enum 3 full_rx_bw_160_mhz> 413 414 415 416 <legal 0-3> 417 */ 418 #define RECEIVE_USER_INFO_1_RECEIVE_BANDWIDTH_OFFSET 0x00000004 419 #define RECEIVE_USER_INFO_1_RECEIVE_BANDWIDTH_LSB 6 420 #define RECEIVE_USER_INFO_1_RECEIVE_BANDWIDTH_MASK 0x000000c0 421 422 /* Description RECEIVE_USER_INFO_1_MIMO_SS_BITMAP 423 424 Bitmap, with each bit indicating if the related spatial 425 stream is used for this STA 426 427 LSB related to SS 0 428 429 430 431 0: spatial stream not used for this reception 432 433 1: spatial stream used for this reception 434 435 436 437 <legal all> 438 */ 439 #define RECEIVE_USER_INFO_1_MIMO_SS_BITMAP_OFFSET 0x00000004 440 #define RECEIVE_USER_INFO_1_MIMO_SS_BITMAP_LSB 8 441 #define RECEIVE_USER_INFO_1_MIMO_SS_BITMAP_MASK 0x0000ff00 442 443 /* Description RECEIVE_USER_INFO_1_OFDMA_RU_ALLOCATION 444 445 Field only valid in case of OFDMA type receptions (DL 446 and UL) 447 448 449 450 Indicates the RU number associated with this user. 451 452 453 454 In case of reception where the transmission was DL MU 455 OFDMA, this field provides the RU pattern. Note that fields 456 ofdma_user_index and ofdma_content_channel are needed to 457 determine which RU (within a 40 MHz channel) was actually 458 assigned to this user, but this does not give info on which 459 40 MHz channel was assigned to this user. Please refer 460 DL_ofdma_ru_* in PHYRX_PKT_END_INFO for complete RU info for 461 this user. 462 463 464 465 In case of reception where the transmission was UL MU 466 OFDMA, PHY is recommended to insert the RU start index in 467 this field. Note that PHY may insert the RU width in 468 Reserved_2a[6:0]. 469 470 <legal all> 471 */ 472 #define RECEIVE_USER_INFO_1_OFDMA_RU_ALLOCATION_OFFSET 0x00000004 473 #define RECEIVE_USER_INFO_1_OFDMA_RU_ALLOCATION_LSB 16 474 #define RECEIVE_USER_INFO_1_OFDMA_RU_ALLOCATION_MASK 0x00ff0000 475 476 /* Description RECEIVE_USER_INFO_1_OFDMA_USER_INDEX 477 478 Field only valid in the of DL MU OFDMA reception 479 480 481 482 The user number within the RU_allocation. 483 484 485 486 This is needed for SW to determine the exact RU position 487 within the reception. 488 489 <legal all> 490 */ 491 #define RECEIVE_USER_INFO_1_OFDMA_USER_INDEX_OFFSET 0x00000004 492 #define RECEIVE_USER_INFO_1_OFDMA_USER_INDEX_LSB 24 493 #define RECEIVE_USER_INFO_1_OFDMA_USER_INDEX_MASK 0x7f000000 494 495 /* Description RECEIVE_USER_INFO_1_OFDMA_CONTENT_CHANNEL 496 497 Field only valid in the of DL MU OFDMA/MIMO reception 498 499 500 501 In case of DL MU reception, this field indicates the 502 content channel number where PHY found the RU information 503 for this user 504 505 506 507 This is needed for SW to determine the exact RU position 508 within the reception. 509 510 511 512 <enum 0 content_channel_1> 513 514 <enum 1 content_channel_2> 515 516 517 518 <legal all> 519 */ 520 #define RECEIVE_USER_INFO_1_OFDMA_CONTENT_CHANNEL_OFFSET 0x00000004 521 #define RECEIVE_USER_INFO_1_OFDMA_CONTENT_CHANNEL_LSB 31 522 #define RECEIVE_USER_INFO_1_OFDMA_CONTENT_CHANNEL_MASK 0x80000000 523 524 /* Description RECEIVE_USER_INFO_2_LDPC 525 526 When set, use LDPC transmission rates were used. 527 528 <legal all> 529 */ 530 #define RECEIVE_USER_INFO_2_LDPC_OFFSET 0x00000008 531 #define RECEIVE_USER_INFO_2_LDPC_LSB 0 532 #define RECEIVE_USER_INFO_2_LDPC_MASK 0x00000001 533 534 /* Description RECEIVE_USER_INFO_2_RU_WIDTH 535 536 In case of UL OFDMA reception, PHY is recommended to 537 insert the RU width 538 539 In Hastings80: was using Reserved_2a[6:0]. 540 541 <legal 1 - 74> 542 */ 543 #define RECEIVE_USER_INFO_2_RU_WIDTH_OFFSET 0x00000008 544 #define RECEIVE_USER_INFO_2_RU_WIDTH_LSB 1 545 #define RECEIVE_USER_INFO_2_RU_WIDTH_MASK 0x000000fe 546 547 /* Description RECEIVE_USER_INFO_2_RESERVED_2A 548 549 <legal 0> 550 */ 551 #define RECEIVE_USER_INFO_2_RESERVED_2A_OFFSET 0x00000008 552 #define RECEIVE_USER_INFO_2_RESERVED_2A_LSB 8 553 #define RECEIVE_USER_INFO_2_RESERVED_2A_MASK 0xffffff00 554 555 556 #endif // _RECEIVE_USER_INFO_H_ 557