1 /* 2 * Copyright (c) 2020, The Linux Foundation. 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 _RX_MPDU_DESC_INFO_H_ 18 #define _RX_MPDU_DESC_INFO_H_ 19 #if !defined(__ASSEMBLER__) 20 #endif 21 22 23 // ################ START SUMMARY ################# 24 // 25 // Dword Fields 26 // 0 msdu_count[7:0], mpdu_sequence_number[19:8], fragment_flag[20], mpdu_retry_bit[21], ampdu_flag[22], bar_frame[23], pn_fields_contain_valid_info[24], sa_is_valid[25], sa_idx_timeout[26], da_is_valid[27], da_is_mcbc[28], da_idx_timeout[29], raw_mpdu[30], more_fragment_flag[31] 27 // 1 peer_meta_data[31:0] 28 // 29 // ################ END SUMMARY ################# 30 31 #define NUM_OF_DWORDS_RX_MPDU_DESC_INFO 2 32 33 struct rx_mpdu_desc_info { 34 uint32_t msdu_count : 8, //[7:0] 35 mpdu_sequence_number : 12, //[19:8] 36 fragment_flag : 1, //[20] 37 mpdu_retry_bit : 1, //[21] 38 ampdu_flag : 1, //[22] 39 bar_frame : 1, //[23] 40 pn_fields_contain_valid_info : 1, //[24] 41 sa_is_valid : 1, //[25] 42 sa_idx_timeout : 1, //[26] 43 da_is_valid : 1, //[27] 44 da_is_mcbc : 1, //[28] 45 da_idx_timeout : 1, //[29] 46 raw_mpdu : 1, //[30] 47 more_fragment_flag : 1; //[31] 48 uint32_t peer_meta_data : 32; //[31:0] 49 }; 50 51 /* 52 53 msdu_count 54 55 Consumer: REO/SW/FW 56 57 Producer: RXDMA 58 59 60 61 The number of MSDUs within the MPDU 62 63 <legal all> 64 65 mpdu_sequence_number 66 67 Consumer: REO/SW/FW 68 69 Producer: RXDMA 70 71 72 73 The field can have two different meanings based on the 74 setting of field 'BAR_frame': 75 76 77 78 'BAR_frame' is NOT set: 79 80 The MPDU sequence number of the received frame. 81 82 83 84 'BAR_frame' is set. 85 86 The MPDU Start sequence number from the BAR frame 87 88 <legal all> 89 90 fragment_flag 91 92 Consumer: REO/SW/FW 93 94 Producer: RXDMA 95 96 97 98 When set, this MPDU is a fragment and REO should forward 99 this fragment MPDU to the REO destination ring without any 100 reorder checks, pn checks or bitmap update. This implies 101 that REO is forwarding the pointer to the MSDU link 102 descriptor. The destination ring is coming from a 103 programmable register setting in REO 104 105 106 107 <legal all> 108 109 mpdu_retry_bit 110 111 Consumer: REO/SW/FW 112 113 Producer: RXDMA 114 115 116 117 The retry bit setting from the MPDU header of the 118 received frame 119 120 <legal all> 121 122 ampdu_flag 123 124 Consumer: REO/SW/FW 125 126 Producer: RXDMA 127 128 129 130 When set, the MPDU was received as part of an A-MPDU. 131 132 <legal all> 133 134 bar_frame 135 136 Consumer: REO/SW/FW 137 138 Producer: RXDMA 139 140 141 142 When set, the received frame is a BAR frame. After 143 processing, this frame shall be pushed to SW or deleted. 144 145 <legal all> 146 147 pn_fields_contain_valid_info 148 149 Consumer: REO/SW/FW 150 151 Producer: RXDMA 152 153 154 155 Copied here by RXDMA from RX_MPDU_END 156 157 When not set, REO will Not perform a PN sequence number 158 check 159 160 sa_is_valid 161 162 When set, OLE found a valid SA entry for all MSDUs in 163 this MPDU 164 165 <legal all> 166 167 sa_idx_timeout 168 169 When set, at least 1 MSDU within the MPDU has an 170 unsuccessful MAC source address search due to the expiration 171 of the search timer. 172 173 <legal all> 174 175 da_is_valid 176 177 When set, OLE found a valid DA entry for all MSDUs in 178 this MPDU 179 180 <legal all> 181 182 da_is_mcbc 183 184 Field Only valid if da_is_valid is set 185 186 187 188 When set, at least one of the DA addresses is a 189 Multicast or Broadcast address. 190 191 <legal all> 192 193 da_idx_timeout 194 195 When set, at least 1 MSDU within the MPDU has an 196 unsuccessful MAC destination address search due to the 197 expiration of the search timer. 198 199 <legal all> 200 201 raw_mpdu 202 203 Field only valid when first_msdu_in_mpdu_flag is set. 204 205 206 207 When set, the contents in the MSDU buffer contains a 208 'RAW' MPDU. This 'RAW' MPDU might be spread out over 209 multiple MSDU buffers. 210 211 <legal all> 212 213 more_fragment_flag 214 215 The More Fragment bit setting from the MPDU header of 216 the received frame 217 218 219 220 <legal all> 221 222 peer_meta_data 223 224 Meta data that SW has programmed in the Peer table entry 225 of the transmitting STA. 226 227 <legal all> 228 */ 229 230 231 /* Description RX_MPDU_DESC_INFO_0_MSDU_COUNT 232 233 Consumer: REO/SW/FW 234 235 Producer: RXDMA 236 237 238 239 The number of MSDUs within the MPDU 240 241 <legal all> 242 */ 243 #define RX_MPDU_DESC_INFO_0_MSDU_COUNT_OFFSET 0x00000000 244 #define RX_MPDU_DESC_INFO_0_MSDU_COUNT_LSB 0 245 #define RX_MPDU_DESC_INFO_0_MSDU_COUNT_MASK 0x000000ff 246 247 /* Description RX_MPDU_DESC_INFO_0_MPDU_SEQUENCE_NUMBER 248 249 Consumer: REO/SW/FW 250 251 Producer: RXDMA 252 253 254 255 The field can have two different meanings based on the 256 setting of field 'BAR_frame': 257 258 259 260 'BAR_frame' is NOT set: 261 262 The MPDU sequence number of the received frame. 263 264 265 266 'BAR_frame' is set. 267 268 The MPDU Start sequence number from the BAR frame 269 270 <legal all> 271 */ 272 #define RX_MPDU_DESC_INFO_0_MPDU_SEQUENCE_NUMBER_OFFSET 0x00000000 273 #define RX_MPDU_DESC_INFO_0_MPDU_SEQUENCE_NUMBER_LSB 8 274 #define RX_MPDU_DESC_INFO_0_MPDU_SEQUENCE_NUMBER_MASK 0x000fff00 275 276 /* Description RX_MPDU_DESC_INFO_0_FRAGMENT_FLAG 277 278 Consumer: REO/SW/FW 279 280 Producer: RXDMA 281 282 283 284 When set, this MPDU is a fragment and REO should forward 285 this fragment MPDU to the REO destination ring without any 286 reorder checks, pn checks or bitmap update. This implies 287 that REO is forwarding the pointer to the MSDU link 288 descriptor. The destination ring is coming from a 289 programmable register setting in REO 290 291 292 293 <legal all> 294 */ 295 #define RX_MPDU_DESC_INFO_0_FRAGMENT_FLAG_OFFSET 0x00000000 296 #define RX_MPDU_DESC_INFO_0_FRAGMENT_FLAG_LSB 20 297 #define RX_MPDU_DESC_INFO_0_FRAGMENT_FLAG_MASK 0x00100000 298 299 /* Description RX_MPDU_DESC_INFO_0_MPDU_RETRY_BIT 300 301 Consumer: REO/SW/FW 302 303 Producer: RXDMA 304 305 306 307 The retry bit setting from the MPDU header of the 308 received frame 309 310 <legal all> 311 */ 312 #define RX_MPDU_DESC_INFO_0_MPDU_RETRY_BIT_OFFSET 0x00000000 313 #define RX_MPDU_DESC_INFO_0_MPDU_RETRY_BIT_LSB 21 314 #define RX_MPDU_DESC_INFO_0_MPDU_RETRY_BIT_MASK 0x00200000 315 316 /* Description RX_MPDU_DESC_INFO_0_AMPDU_FLAG 317 318 Consumer: REO/SW/FW 319 320 Producer: RXDMA 321 322 323 324 When set, the MPDU was received as part of an A-MPDU. 325 326 <legal all> 327 */ 328 #define RX_MPDU_DESC_INFO_0_AMPDU_FLAG_OFFSET 0x00000000 329 #define RX_MPDU_DESC_INFO_0_AMPDU_FLAG_LSB 22 330 #define RX_MPDU_DESC_INFO_0_AMPDU_FLAG_MASK 0x00400000 331 332 /* Description RX_MPDU_DESC_INFO_0_BAR_FRAME 333 334 Consumer: REO/SW/FW 335 336 Producer: RXDMA 337 338 339 340 When set, the received frame is a BAR frame. After 341 processing, this frame shall be pushed to SW or deleted. 342 343 <legal all> 344 */ 345 #define RX_MPDU_DESC_INFO_0_BAR_FRAME_OFFSET 0x00000000 346 #define RX_MPDU_DESC_INFO_0_BAR_FRAME_LSB 23 347 #define RX_MPDU_DESC_INFO_0_BAR_FRAME_MASK 0x00800000 348 349 /* Description RX_MPDU_DESC_INFO_0_PN_FIELDS_CONTAIN_VALID_INFO 350 351 Consumer: REO/SW/FW 352 353 Producer: RXDMA 354 355 356 357 Copied here by RXDMA from RX_MPDU_END 358 359 When not set, REO will Not perform a PN sequence number 360 check 361 */ 362 #define RX_MPDU_DESC_INFO_0_PN_FIELDS_CONTAIN_VALID_INFO_OFFSET 0x00000000 363 #define RX_MPDU_DESC_INFO_0_PN_FIELDS_CONTAIN_VALID_INFO_LSB 24 364 #define RX_MPDU_DESC_INFO_0_PN_FIELDS_CONTAIN_VALID_INFO_MASK 0x01000000 365 366 /* Description RX_MPDU_DESC_INFO_0_SA_IS_VALID 367 368 When set, OLE found a valid SA entry for all MSDUs in 369 this MPDU 370 371 <legal all> 372 */ 373 #define RX_MPDU_DESC_INFO_0_SA_IS_VALID_OFFSET 0x00000000 374 #define RX_MPDU_DESC_INFO_0_SA_IS_VALID_LSB 25 375 #define RX_MPDU_DESC_INFO_0_SA_IS_VALID_MASK 0x02000000 376 377 /* Description RX_MPDU_DESC_INFO_0_SA_IDX_TIMEOUT 378 379 When set, at least 1 MSDU within the MPDU has an 380 unsuccessful MAC source address search due to the expiration 381 of the search timer. 382 383 <legal all> 384 */ 385 #define RX_MPDU_DESC_INFO_0_SA_IDX_TIMEOUT_OFFSET 0x00000000 386 #define RX_MPDU_DESC_INFO_0_SA_IDX_TIMEOUT_LSB 26 387 #define RX_MPDU_DESC_INFO_0_SA_IDX_TIMEOUT_MASK 0x04000000 388 389 /* Description RX_MPDU_DESC_INFO_0_DA_IS_VALID 390 391 When set, OLE found a valid DA entry for all MSDUs in 392 this MPDU 393 394 <legal all> 395 */ 396 #define RX_MPDU_DESC_INFO_0_DA_IS_VALID_OFFSET 0x00000000 397 #define RX_MPDU_DESC_INFO_0_DA_IS_VALID_LSB 27 398 #define RX_MPDU_DESC_INFO_0_DA_IS_VALID_MASK 0x08000000 399 400 /* Description RX_MPDU_DESC_INFO_0_DA_IS_MCBC 401 402 Field Only valid if da_is_valid is set 403 404 405 406 When set, at least one of the DA addresses is a 407 Multicast or Broadcast address. 408 409 <legal all> 410 */ 411 #define RX_MPDU_DESC_INFO_0_DA_IS_MCBC_OFFSET 0x00000000 412 #define RX_MPDU_DESC_INFO_0_DA_IS_MCBC_LSB 28 413 #define RX_MPDU_DESC_INFO_0_DA_IS_MCBC_MASK 0x10000000 414 415 /* Description RX_MPDU_DESC_INFO_0_DA_IDX_TIMEOUT 416 417 When set, at least 1 MSDU within the MPDU has an 418 unsuccessful MAC destination address search due to the 419 expiration of the search timer. 420 421 <legal all> 422 */ 423 #define RX_MPDU_DESC_INFO_0_DA_IDX_TIMEOUT_OFFSET 0x00000000 424 #define RX_MPDU_DESC_INFO_0_DA_IDX_TIMEOUT_LSB 29 425 #define RX_MPDU_DESC_INFO_0_DA_IDX_TIMEOUT_MASK 0x20000000 426 427 /* Description RX_MPDU_DESC_INFO_0_RAW_MPDU 428 429 Field only valid when first_msdu_in_mpdu_flag is set. 430 431 432 433 When set, the contents in the MSDU buffer contains a 434 'RAW' MPDU. This 'RAW' MPDU might be spread out over 435 multiple MSDU buffers. 436 437 <legal all> 438 */ 439 #define RX_MPDU_DESC_INFO_0_RAW_MPDU_OFFSET 0x00000000 440 #define RX_MPDU_DESC_INFO_0_RAW_MPDU_LSB 30 441 #define RX_MPDU_DESC_INFO_0_RAW_MPDU_MASK 0x40000000 442 443 /* Description RX_MPDU_DESC_INFO_0_MORE_FRAGMENT_FLAG 444 445 The More Fragment bit setting from the MPDU header of 446 the received frame 447 448 449 450 <legal all> 451 */ 452 #define RX_MPDU_DESC_INFO_0_MORE_FRAGMENT_FLAG_OFFSET 0x00000000 453 #define RX_MPDU_DESC_INFO_0_MORE_FRAGMENT_FLAG_LSB 31 454 #define RX_MPDU_DESC_INFO_0_MORE_FRAGMENT_FLAG_MASK 0x80000000 455 456 /* Description RX_MPDU_DESC_INFO_1_PEER_META_DATA 457 458 Meta data that SW has programmed in the Peer table entry 459 of the transmitting STA. 460 461 <legal all> 462 */ 463 #define RX_MPDU_DESC_INFO_1_PEER_META_DATA_OFFSET 0x00000004 464 #define RX_MPDU_DESC_INFO_1_PEER_META_DATA_LSB 0 465 #define RX_MPDU_DESC_INFO_1_PEER_META_DATA_MASK 0xffffffff 466 467 468 #endif // _RX_MPDU_DESC_INFO_H_ 469