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