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 _TCL_DATA_CMD_H_ 18 #define _TCL_DATA_CMD_H_ 19 #if !defined(__ASSEMBLER__) 20 #endif 21 22 #include "buffer_addr_info.h" 23 24 // ################ START SUMMARY ################# 25 // 26 // Dword Fields 27 // 0-1 struct buffer_addr_info buf_addr_info; 28 // 2 buf_or_ext_desc_type[0], epd[1], encap_type[3:2], encrypt_type[7:4], src_buffer_swap[8], link_meta_swap[9], tqm_no_drop[10], reserved_2a[11], search_type[13:12], addrx_en[14], addry_en[15], tcl_cmd_number[31:16] 29 // 3 data_length[15:0], ipv4_checksum_en[16], udp_over_ipv4_checksum_en[17], udp_over_ipv6_checksum_en[18], tcp_over_ipv4_checksum_en[19], tcp_over_ipv6_checksum_en[20], to_fw[21], reserved_3a[22], packet_offset[31:23] 30 // 4 buffer_timestamp[18:0], buffer_timestamp_valid[19], reserved_4a[20], hlos_tid_overwrite[21], hlos_tid[25:22], lmac_id[27:26], udp_flow_override[29:28], reserved_4b[31:30] 31 // 5 dscp_tid_table_num[5:0], search_index[25:6], cache_set_num[29:26], mesh_enable[31:30] 32 // 6 reserved_6a[19:0], ring_id[27:20], looping_count[31:28] 33 // 34 // ################ END SUMMARY ################# 35 36 #define NUM_OF_DWORDS_TCL_DATA_CMD 7 37 38 struct tcl_data_cmd { 39 struct buffer_addr_info buf_addr_info; 40 uint32_t buf_or_ext_desc_type : 1, //[0] 41 epd : 1, //[1] 42 encap_type : 2, //[3:2] 43 encrypt_type : 4, //[7:4] 44 src_buffer_swap : 1, //[8] 45 link_meta_swap : 1, //[9] 46 tqm_no_drop : 1, //[10] 47 reserved_2a : 1, //[11] 48 search_type : 2, //[13:12] 49 addrx_en : 1, //[14] 50 addry_en : 1, //[15] 51 tcl_cmd_number : 16; //[31:16] 52 uint32_t data_length : 16, //[15:0] 53 ipv4_checksum_en : 1, //[16] 54 udp_over_ipv4_checksum_en : 1, //[17] 55 udp_over_ipv6_checksum_en : 1, //[18] 56 tcp_over_ipv4_checksum_en : 1, //[19] 57 tcp_over_ipv6_checksum_en : 1, //[20] 58 to_fw : 1, //[21] 59 reserved_3a : 1, //[22] 60 packet_offset : 9; //[31:23] 61 uint32_t buffer_timestamp : 19, //[18:0] 62 buffer_timestamp_valid : 1, //[19] 63 reserved_4a : 1, //[20] 64 hlos_tid_overwrite : 1, //[21] 65 hlos_tid : 4, //[25:22] 66 lmac_id : 2, //[27:26] 67 udp_flow_override : 2, //[29:28] 68 reserved_4b : 2; //[31:30] 69 uint32_t dscp_tid_table_num : 6, //[5:0] 70 search_index : 20, //[25:6] 71 cache_set_num : 4, //[29:26] 72 mesh_enable : 2; //[31:30] 73 uint32_t reserved_6a : 20, //[19:0] 74 ring_id : 8, //[27:20] 75 looping_count : 4; //[31:28] 76 }; 77 78 /* 79 80 struct buffer_addr_info buf_addr_info 81 82 Details of the physical address for a single buffer 83 84 It also contains return ownership info as well as some 85 meta data for SW related to this buffer. 86 87 88 89 In case of Buf_or_ext_desc_type indicating 90 'MSDU_buffer', this address indicates the start of the meta 91 data that is preceding the actual packet data. 92 93 The start of the actual packet data is provided by 94 field: Packet_offset 95 96 buf_or_ext_desc_type 97 98 <enum 0 MSDU_buffer> The address points to an MSDU 99 buffer. 100 101 <enum 1 extension_descriptor> The address points to an 102 MSDU link extension descriptor 103 104 < legal all> 105 106 epd 107 108 When this bit is set then input packet is an EPD type 109 110 <legal all> 111 112 encap_type 113 114 Indicates the encapsulation that HW will perform: 115 116 <enum 0 RAW> No encapsulation 117 118 <enum 1 Native_WiFi> 119 120 <enum 2 Ethernet> Ethernet 2 (DIX) or 802.3 (uses 121 SNAP/LLC) 122 123 <enum 3 802_3> DO NOT USE. Indicate Ethernet 124 125 126 127 Used by the OLE during encapsulation. 128 129 <legal all> 130 131 encrypt_type 132 133 Field only valid for encap_type: RAW 134 135 136 137 Indicates type of decrypt cipher used (as defined in the 138 peer entry) 139 140 <enum 0 wep_40> WEP 40-bit 141 142 <enum 1 wep_104> WEP 104-bit 143 144 <enum 2 tkip_no_mic> TKIP without MIC 145 146 <enum 3 wep_128> WEP 128-bit 147 148 <enum 4 tkip_with_mic> TKIP with MIC 149 150 <enum 5 wapi> WAPI 151 152 <enum 6 aes_ccmp_128> AES CCMP 128 153 154 <enum 7 no_cipher> No crypto 155 156 <enum 8 aes_ccmp_256> AES CCMP 256 157 158 <enum 9 aes_gcmp_128> AES CCMP 128 159 160 <enum 10 aes_gcmp_256> AES CCMP 256 161 162 <enum 11 wapi_gcm_sm4> WAPI GCM SM4 163 164 165 166 <enum 12 wep_varied_width> DO not use... Only for higher 167 layer modules.. 168 169 <legal 0-12> 170 171 src_buffer_swap 172 173 Treats source memory (packet buffer) organization as 174 big-endian. The packets are read and byte swapped. 175 176 1'b0: Source memory is little endian 177 178 1'b1: Source memory is big endian 179 180 <legal all> 181 182 link_meta_swap 183 184 Treats link descriptor and Metadata as big-endian. The 185 link descriptor/Metadata is read and byte swapped. 186 187 1'b0: Memory is little endian 188 189 1'b1: Memory is big endian 190 191 <legal all> 192 193 tqm_no_drop 194 195 This bit is used to stop TQM from dropping MSDUs while 196 adding them to MSDU flows1'b1: Do not drop MSDU when any of 197 the threshold value is met while adding MSDU in a flow1'b1: 198 Drop MSDU when any of the threshold value is met while 199 adding MSDU in a flow 200 201 <legal all> 202 203 reserved_2a 204 205 <legal 0> 206 207 search_type 208 209 Search type select 210 211 212 213 <enum 0 Normal_search> Address and flow search will use 214 packet contents 215 216 <enum 1 Index_based_address_search> Address search will 217 218 <enum 2 Index_based_flow_search> Flow search will use 219 'search_index', and address search will use packet contents 220 221 <legal 0-2> 222 223 addrx_en 224 225 Address X search enable in ASE 226 227 1'b0: Search disable 228 229 1'b1: Search Enable 230 231 <legal all> 232 233 addry_en 234 235 Address Y search enable in ASE 236 237 1'b0: Search disable 238 239 1'b1: Search Enable 240 241 <legal all> 242 243 tcl_cmd_number 244 245 This number can be used by SW to track, identify and 246 link the created commands with the command statuses 247 248 249 250 Is set to the value 'TCL_CMD_Number' of the related 251 TCL_DATA command 252 253 <legal all> 254 255 data_length 256 257 Valid Data length in bytes. 258 259 260 261 MSDU length in case of direct descriptor. 262 263 Length of link extension descriptor in case of Link 264 extension descriptor. This is used to know the size of 265 Metadata. 266 267 <legal all> 268 269 ipv4_checksum_en 270 271 OLE related control 272 273 Enable IPv4 checksum replacement 274 275 udp_over_ipv4_checksum_en 276 277 OLE related control 278 279 Enable UDP over IPv4 checksum replacement. UDP checksum 280 over IPv4 is optional for TCP/IP stacks. 281 282 udp_over_ipv6_checksum_en 283 284 OLE related control 285 286 Enable UDP over IPv6 checksum replacement. UDP checksum 287 over IPv6 is mandatory for TCP/IP stacks. 288 289 tcp_over_ipv4_checksum_en 290 291 OLE related control 292 293 Enable TCP checksum over IPv4 replacement 294 295 tcp_over_ipv6_checksum_en 296 297 OLE related control 298 299 Enable TCP checksum over IPv6 replacement 300 301 to_fw 302 303 Forward packet to FW along with classification result. 304 The packet will not be forward to TQM when this bit is set 305 306 307 308 1'b0: Use classification result to forward the packet. 309 310 1'b1: Override classification result and forward packet 311 only to FW. 312 313 <legal all> 314 315 reserved_3a 316 317 <legal 0> 318 319 packet_offset 320 321 Packet offset from Metadata in case of direct buffer 322 descriptor. This field is valid when Buf_or_ext_desc_type is 323 reset(= 0). 324 325 <legal all> 326 327 buffer_timestamp 328 329 Field only valid when 'Buffer_timestamp_valid ' is set. 330 331 332 333 Frame system entrance timestamp. The timestamp is 334 related to the global system timer 335 336 337 338 Generally the first module (SW, TCL or TQM). that sees 339 this frame and this timestamp field is not valid, shall fill 340 in this field. 341 342 343 344 Timestamp in units of 1024 us 345 346 buffer_timestamp_valid 347 348 When set, the Buffer_timestamp field contains valid 349 info. 350 351 reserved_4a 352 353 <legal 0> 354 355 hlos_tid_overwrite 356 357 When set, TCL shall ignore the IP DSCP and VLAN PCP 358 fields and use HLOS_TID as the final TID. Otherwise TCL 359 shall consider the DSCP and PCP fields as well as HLOS_TID 360 and choose a final TID based on the configured priority 361 362 <legal all> 363 364 hlos_tid 365 366 HLOS MSDU priority 367 368 369 370 Field is used when HLOS_TID_overwrite is set. 371 372 373 374 Field is also used when HLOS_TID_overwrite is not set 375 and DSCP/PCP is not available in the packet 376 377 <legal all> 378 379 lmac_id 380 381 TCL uses this LMAC_ID in address search, i.e, while 382 finding matching entry for the packet in AST corresponding 383 to given LMAC_ID 384 385 If LMAC ID is all 1s (=> value 3), it indicates wildcard 386 match for any MAC 387 388 <legal 0-3> 389 390 udp_flow_override 391 392 TCL uses this to select the flow pointer from the peer 393 table, which can be overridden by SW for pre-encrypted raw 394 WiFi packets that cannot be parsed for UDP or for other 395 enterprise use cases: 396 397 <enum 0 FP_PARSE_IP> Use the flow-pointer based on 398 parsing the IPv4 or IPv6 header 399 400 <enum 1 FP_USE_NON_UDP> Use the non-UDP flow pointer 401 402 <enum 2 FP_USE_UDP> Use the UDP flow pointer 403 404 405 406 This is not supported in Moselle. 407 408 <legal 0-2> 409 410 reserved_4b 411 412 <legal 0> 413 414 dscp_tid_table_num 415 416 DSCP to TID mapping table number that need to be used 417 for the MSDU, should be specified using this field 418 419 <legal all> 420 421 search_index 422 423 The index that will be used for index based address or 424 flow search. The field is valid when 'search_type' is 1 or 425 2. 426 427 <legal all> 428 429 cache_set_num 430 431 Cache set number that should be used to cache the index 432 based search results, for address and flow search. This 433 value should be equal to LSB four bits of the hash value of 434 match data, in case of search index points to an entry which 435 may be used in content based search also. The value can be 436 anything when the entry pointed by search index will not be 437 used for content based search. 438 439 <legal all> 440 441 mesh_enable 442 443 If set to a non-zero value: 444 445 * For raw WiFi frames, this indicates transmission to a 446 mesh STA, enabling the interpretation of the 'Mesh Control 447 Present' bit (bit 8) of QoS Control (otherwise this bit is 448 ignored). The interpretation of the A-MSDU 'Length' field is 449 decided by the e-numerations below. 450 451 * For native WiFi frames, this indicates that a 'Mesh 452 Control' field is present between the header and the LLC. 453 The three non-zero values are interchangeable. 454 455 456 457 <enum 0 MESH_DISABLE> 458 459 <enum 1 MESH_Q2Q> A-MSDU 'Length' is big endian and 460 includes the length of Mesh Control. 461 462 <enum 2 MESH_11S_BE> A-MSDU 'Length' is big endian and 463 excludes the length of Mesh Control. 464 465 <enum 3 MESH_11S_LE> A-MSDU 'Length' is little endian 466 and excludes the length of Mesh Control. This is 467 802.11s-compliant. 468 469 <legal 0-3> 470 471 reserved_6a 472 473 <legal 0> 474 475 ring_id 476 477 The buffer pointer ring ID. 478 479 0 refers to the IDLE ring 480 481 1 - N refers to other rings 482 483 484 485 Helps with debugging when dumping ring contents. 486 487 <legal all> 488 489 looping_count 490 491 A count value that indicates the number of times the 492 producer of entries into the Ring has looped around the 493 ring. 494 495 At initialization time, this value is set to 0. On the 496 first loop, this value is set to 1. After the max value is 497 reached allowed by the number of bits for this field, the 498 count value continues with 0 again. 499 500 501 502 In case SW is the consumer of the ring entries, it can 503 use this field to figure out up to where the producer of 504 entries has created new entries. This eliminates the need to 505 check where the head pointer' of the ring is located once 506 the SW starts processing an interrupt indicating that new 507 entries have been put into this ring... 508 509 510 511 Also note that SW if it wants only needs to look at the 512 LSB bit of this count value. 513 514 <legal all> 515 */ 516 517 518 /* EXTERNAL REFERENCE : struct buffer_addr_info buf_addr_info */ 519 520 521 /* Description TCL_DATA_CMD_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0 522 523 Address (lower 32 bits) of the MSDU buffer OR 524 MSDU_EXTENSION descriptor OR Link Descriptor 525 526 527 528 In case of 'NULL' pointer, this field is set to 0 529 530 <legal all> 531 */ 532 #define TCL_DATA_CMD_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0_OFFSET 0x00000000 533 #define TCL_DATA_CMD_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0_LSB 0 534 #define TCL_DATA_CMD_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0_MASK 0xffffffff 535 536 /* Description TCL_DATA_CMD_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32 537 538 Address (upper 8 bits) of the MSDU buffer OR 539 MSDU_EXTENSION descriptor OR Link Descriptor 540 541 542 543 In case of 'NULL' pointer, this field is set to 0 544 545 <legal all> 546 */ 547 #define TCL_DATA_CMD_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32_OFFSET 0x00000004 548 #define TCL_DATA_CMD_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32_LSB 0 549 #define TCL_DATA_CMD_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32_MASK 0x000000ff 550 551 /* Description TCL_DATA_CMD_1_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER 552 553 Consumer: WBM 554 555 Producer: SW/FW 556 557 558 559 In case of 'NULL' pointer, this field is set to 0 560 561 562 563 Indicates to which buffer manager the buffer OR 564 MSDU_EXTENSION descriptor OR link descriptor that is being 565 pointed to shall be returned after the frame has been 566 processed. It is used by WBM for routing purposes. 567 568 569 570 <enum 0 WBM_IDLE_BUF_LIST> This buffer shall be returned 571 to the WMB buffer idle list 572 573 <enum 1 WBM_IDLE_DESC_LIST> This buffer shall be 574 returned to the WMB idle link descriptor idle list 575 576 <enum 2 FW_BM> This buffer shall be returned to the FW 577 578 <enum 3 SW0_BM> This buffer shall be returned to the SW, 579 ring 0 580 581 <enum 4 SW1_BM> This buffer shall be returned to the SW, 582 ring 1 583 584 <enum 5 SW2_BM> This buffer shall be returned to the SW, 585 ring 2 586 587 <enum 6 SW3_BM> This buffer shall be returned to the SW, 588 ring 3 589 590 <enum 7 SW4_BM> This buffer shall be returned to the SW, 591 ring 4 592 593 594 595 <legal all> 596 */ 597 #define TCL_DATA_CMD_1_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_OFFSET 0x00000004 598 #define TCL_DATA_CMD_1_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_LSB 8 599 #define TCL_DATA_CMD_1_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_MASK 0x00000700 600 601 /* Description TCL_DATA_CMD_1_BUF_ADDR_INFO_SW_BUFFER_COOKIE 602 603 Cookie field exclusively used by SW. 604 605 606 607 In case of 'NULL' pointer, this field is set to 0 608 609 610 611 HW ignores the contents, accept that it passes the 612 programmed value on to other descriptors together with the 613 physical address 614 615 616 617 Field can be used by SW to for example associate the 618 buffers physical address with the virtual address 619 620 The bit definitions as used by SW are within SW HLD 621 specification 622 623 624 625 NOTE1: 626 627 The three most significant bits can have a special 628 meaning in case this struct is embedded in a TX_MPDU_DETAILS 629 STRUCT, and field transmit_bw_restriction is set 630 631 632 633 In case of NON punctured transmission: 634 635 Sw_buffer_cookie[20:19] = 2'b00: 20 MHz TX only 636 637 Sw_buffer_cookie[20:19] = 2'b01: 40 MHz TX only 638 639 Sw_buffer_cookie[20:19] = 2'b10: 80 MHz TX only 640 641 Sw_buffer_cookie[20:19] = 2'b11: 160 MHz TX only 642 643 644 645 In case of punctured transmission: 646 647 Sw_buffer_cookie[20:18] = 3'b000: pattern 0 only 648 649 Sw_buffer_cookie[20:18] = 3'b001: pattern 1 only 650 651 Sw_buffer_cookie[20:18] = 3'b010: pattern 2 only 652 653 Sw_buffer_cookie[20:18] = 3'b011: pattern 3 only 654 655 Sw_buffer_cookie[20:18] = 3'b100: pattern 4 only 656 657 Sw_buffer_cookie[20:18] = 3'b101: pattern 5 only 658 659 Sw_buffer_cookie[20:18] = 3'b110: pattern 6 only 660 661 Sw_buffer_cookie[20:18] = 3'b111: pattern 7 only 662 663 664 665 Note: a punctured transmission is indicated by the 666 presence of TLV TX_PUNCTURE_SETUP embedded in the scheduler 667 TLV 668 669 670 671 NOTE 2:The five most significant bits can have a special 672 meaning in case this struct is embedded in an 673 RX_MSDU_DETAILS STRUCT, and Maple/Spruce Rx DMA is 674 configured for passing on the additional info 675 from 'RX_MPDU_INFO' structure in 'RX_MPDU_START' TLV 676 (FR56821). This is not supported in HastingsPrime, Pine or 677 Moselle. 678 679 680 681 Sw_buffer_cookie[20:17]: Tid: The TID field in the QoS 682 control field 683 684 685 686 Sw_buffer_cookie[16]: Mpdu_qos_control_valid: This field 687 indicates MPDUs with a QoS control field. 688 689 690 691 692 693 <legal all> 694 */ 695 #define TCL_DATA_CMD_1_BUF_ADDR_INFO_SW_BUFFER_COOKIE_OFFSET 0x00000004 696 #define TCL_DATA_CMD_1_BUF_ADDR_INFO_SW_BUFFER_COOKIE_LSB 11 697 #define TCL_DATA_CMD_1_BUF_ADDR_INFO_SW_BUFFER_COOKIE_MASK 0xfffff800 698 699 /* Description TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE 700 701 <enum 0 MSDU_buffer> The address points to an MSDU 702 buffer. 703 704 <enum 1 extension_descriptor> The address points to an 705 MSDU link extension descriptor 706 707 < legal all> 708 */ 709 #define TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_OFFSET 0x00000008 710 #define TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_LSB 0 711 #define TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_MASK 0x00000001 712 713 /* Description TCL_DATA_CMD_2_EPD 714 715 When this bit is set then input packet is an EPD type 716 717 <legal all> 718 */ 719 #define TCL_DATA_CMD_2_EPD_OFFSET 0x00000008 720 #define TCL_DATA_CMD_2_EPD_LSB 1 721 #define TCL_DATA_CMD_2_EPD_MASK 0x00000002 722 723 /* Description TCL_DATA_CMD_2_ENCAP_TYPE 724 725 Indicates the encapsulation that HW will perform: 726 727 <enum 0 RAW> No encapsulation 728 729 <enum 1 Native_WiFi> 730 731 <enum 2 Ethernet> Ethernet 2 (DIX) or 802.3 (uses 732 SNAP/LLC) 733 734 <enum 3 802_3> DO NOT USE. Indicate Ethernet 735 736 737 738 Used by the OLE during encapsulation. 739 740 <legal all> 741 */ 742 #define TCL_DATA_CMD_2_ENCAP_TYPE_OFFSET 0x00000008 743 #define TCL_DATA_CMD_2_ENCAP_TYPE_LSB 2 744 #define TCL_DATA_CMD_2_ENCAP_TYPE_MASK 0x0000000c 745 746 /* Description TCL_DATA_CMD_2_ENCRYPT_TYPE 747 748 Field only valid for encap_type: RAW 749 750 751 752 Indicates type of decrypt cipher used (as defined in the 753 peer entry) 754 755 <enum 0 wep_40> WEP 40-bit 756 757 <enum 1 wep_104> WEP 104-bit 758 759 <enum 2 tkip_no_mic> TKIP without MIC 760 761 <enum 3 wep_128> WEP 128-bit 762 763 <enum 4 tkip_with_mic> TKIP with MIC 764 765 <enum 5 wapi> WAPI 766 767 <enum 6 aes_ccmp_128> AES CCMP 128 768 769 <enum 7 no_cipher> No crypto 770 771 <enum 8 aes_ccmp_256> AES CCMP 256 772 773 <enum 9 aes_gcmp_128> AES CCMP 128 774 775 <enum 10 aes_gcmp_256> AES CCMP 256 776 777 <enum 11 wapi_gcm_sm4> WAPI GCM SM4 778 779 780 781 <enum 12 wep_varied_width> DO not use... Only for higher 782 layer modules.. 783 784 <legal 0-12> 785 */ 786 #define TCL_DATA_CMD_2_ENCRYPT_TYPE_OFFSET 0x00000008 787 #define TCL_DATA_CMD_2_ENCRYPT_TYPE_LSB 4 788 #define TCL_DATA_CMD_2_ENCRYPT_TYPE_MASK 0x000000f0 789 790 /* Description TCL_DATA_CMD_2_SRC_BUFFER_SWAP 791 792 Treats source memory (packet buffer) organization as 793 big-endian. The packets are read and byte swapped. 794 795 1'b0: Source memory is little endian 796 797 1'b1: Source memory is big endian 798 799 <legal all> 800 */ 801 #define TCL_DATA_CMD_2_SRC_BUFFER_SWAP_OFFSET 0x00000008 802 #define TCL_DATA_CMD_2_SRC_BUFFER_SWAP_LSB 8 803 #define TCL_DATA_CMD_2_SRC_BUFFER_SWAP_MASK 0x00000100 804 805 /* Description TCL_DATA_CMD_2_LINK_META_SWAP 806 807 Treats link descriptor and Metadata as big-endian. The 808 link descriptor/Metadata is read and byte swapped. 809 810 1'b0: Memory is little endian 811 812 1'b1: Memory is big endian 813 814 <legal all> 815 */ 816 #define TCL_DATA_CMD_2_LINK_META_SWAP_OFFSET 0x00000008 817 #define TCL_DATA_CMD_2_LINK_META_SWAP_LSB 9 818 #define TCL_DATA_CMD_2_LINK_META_SWAP_MASK 0x00000200 819 820 /* Description TCL_DATA_CMD_2_TQM_NO_DROP 821 822 This bit is used to stop TQM from dropping MSDUs while 823 adding them to MSDU flows1'b1: Do not drop MSDU when any of 824 the threshold value is met while adding MSDU in a flow1'b1: 825 Drop MSDU when any of the threshold value is met while 826 adding MSDU in a flow 827 828 <legal all> 829 */ 830 #define TCL_DATA_CMD_2_TQM_NO_DROP_OFFSET 0x00000008 831 #define TCL_DATA_CMD_2_TQM_NO_DROP_LSB 10 832 #define TCL_DATA_CMD_2_TQM_NO_DROP_MASK 0x00000400 833 834 /* Description TCL_DATA_CMD_2_RESERVED_2A 835 836 <legal 0> 837 */ 838 #define TCL_DATA_CMD_2_RESERVED_2A_OFFSET 0x00000008 839 #define TCL_DATA_CMD_2_RESERVED_2A_LSB 11 840 #define TCL_DATA_CMD_2_RESERVED_2A_MASK 0x00000800 841 842 /* Description TCL_DATA_CMD_2_SEARCH_TYPE 843 844 Search type select 845 846 847 848 <enum 0 Normal_search> Address and flow search will use 849 packet contents 850 851 <enum 1 Index_based_address_search> Address search will 852 853 <enum 2 Index_based_flow_search> Flow search will use 854 'search_index', and address search will use packet contents 855 856 <legal 0-2> 857 */ 858 #define TCL_DATA_CMD_2_SEARCH_TYPE_OFFSET 0x00000008 859 #define TCL_DATA_CMD_2_SEARCH_TYPE_LSB 12 860 #define TCL_DATA_CMD_2_SEARCH_TYPE_MASK 0x00003000 861 862 /* Description TCL_DATA_CMD_2_ADDRX_EN 863 864 Address X search enable in ASE 865 866 1'b0: Search disable 867 868 1'b1: Search Enable 869 870 <legal all> 871 */ 872 #define TCL_DATA_CMD_2_ADDRX_EN_OFFSET 0x00000008 873 #define TCL_DATA_CMD_2_ADDRX_EN_LSB 14 874 #define TCL_DATA_CMD_2_ADDRX_EN_MASK 0x00004000 875 876 /* Description TCL_DATA_CMD_2_ADDRY_EN 877 878 Address Y search enable in ASE 879 880 1'b0: Search disable 881 882 1'b1: Search Enable 883 884 <legal all> 885 */ 886 #define TCL_DATA_CMD_2_ADDRY_EN_OFFSET 0x00000008 887 #define TCL_DATA_CMD_2_ADDRY_EN_LSB 15 888 #define TCL_DATA_CMD_2_ADDRY_EN_MASK 0x00008000 889 890 /* Description TCL_DATA_CMD_2_TCL_CMD_NUMBER 891 892 This number can be used by SW to track, identify and 893 link the created commands with the command statuses 894 895 896 897 Is set to the value 'TCL_CMD_Number' of the related 898 TCL_DATA command 899 900 <legal all> 901 */ 902 #define TCL_DATA_CMD_2_TCL_CMD_NUMBER_OFFSET 0x00000008 903 #define TCL_DATA_CMD_2_TCL_CMD_NUMBER_LSB 16 904 #define TCL_DATA_CMD_2_TCL_CMD_NUMBER_MASK 0xffff0000 905 906 /* Description TCL_DATA_CMD_3_DATA_LENGTH 907 908 Valid Data length in bytes. 909 910 911 912 MSDU length in case of direct descriptor. 913 914 Length of link extension descriptor in case of Link 915 extension descriptor. This is used to know the size of 916 Metadata. 917 918 <legal all> 919 */ 920 #define TCL_DATA_CMD_3_DATA_LENGTH_OFFSET 0x0000000c 921 #define TCL_DATA_CMD_3_DATA_LENGTH_LSB 0 922 #define TCL_DATA_CMD_3_DATA_LENGTH_MASK 0x0000ffff 923 924 /* Description TCL_DATA_CMD_3_IPV4_CHECKSUM_EN 925 926 OLE related control 927 928 Enable IPv4 checksum replacement 929 */ 930 #define TCL_DATA_CMD_3_IPV4_CHECKSUM_EN_OFFSET 0x0000000c 931 #define TCL_DATA_CMD_3_IPV4_CHECKSUM_EN_LSB 16 932 #define TCL_DATA_CMD_3_IPV4_CHECKSUM_EN_MASK 0x00010000 933 934 /* Description TCL_DATA_CMD_3_UDP_OVER_IPV4_CHECKSUM_EN 935 936 OLE related control 937 938 Enable UDP over IPv4 checksum replacement. UDP checksum 939 over IPv4 is optional for TCP/IP stacks. 940 */ 941 #define TCL_DATA_CMD_3_UDP_OVER_IPV4_CHECKSUM_EN_OFFSET 0x0000000c 942 #define TCL_DATA_CMD_3_UDP_OVER_IPV4_CHECKSUM_EN_LSB 17 943 #define TCL_DATA_CMD_3_UDP_OVER_IPV4_CHECKSUM_EN_MASK 0x00020000 944 945 /* Description TCL_DATA_CMD_3_UDP_OVER_IPV6_CHECKSUM_EN 946 947 OLE related control 948 949 Enable UDP over IPv6 checksum replacement. UDP checksum 950 over IPv6 is mandatory for TCP/IP stacks. 951 */ 952 #define TCL_DATA_CMD_3_UDP_OVER_IPV6_CHECKSUM_EN_OFFSET 0x0000000c 953 #define TCL_DATA_CMD_3_UDP_OVER_IPV6_CHECKSUM_EN_LSB 18 954 #define TCL_DATA_CMD_3_UDP_OVER_IPV6_CHECKSUM_EN_MASK 0x00040000 955 956 /* Description TCL_DATA_CMD_3_TCP_OVER_IPV4_CHECKSUM_EN 957 958 OLE related control 959 960 Enable TCP checksum over IPv4 replacement 961 */ 962 #define TCL_DATA_CMD_3_TCP_OVER_IPV4_CHECKSUM_EN_OFFSET 0x0000000c 963 #define TCL_DATA_CMD_3_TCP_OVER_IPV4_CHECKSUM_EN_LSB 19 964 #define TCL_DATA_CMD_3_TCP_OVER_IPV4_CHECKSUM_EN_MASK 0x00080000 965 966 /* Description TCL_DATA_CMD_3_TCP_OVER_IPV6_CHECKSUM_EN 967 968 OLE related control 969 970 Enable TCP checksum over IPv6 replacement 971 */ 972 #define TCL_DATA_CMD_3_TCP_OVER_IPV6_CHECKSUM_EN_OFFSET 0x0000000c 973 #define TCL_DATA_CMD_3_TCP_OVER_IPV6_CHECKSUM_EN_LSB 20 974 #define TCL_DATA_CMD_3_TCP_OVER_IPV6_CHECKSUM_EN_MASK 0x00100000 975 976 /* Description TCL_DATA_CMD_3_TO_FW 977 978 Forward packet to FW along with classification result. 979 The packet will not be forward to TQM when this bit is set 980 981 982 983 1'b0: Use classification result to forward the packet. 984 985 1'b1: Override classification result and forward packet 986 only to FW. 987 988 <legal all> 989 */ 990 #define TCL_DATA_CMD_3_TO_FW_OFFSET 0x0000000c 991 #define TCL_DATA_CMD_3_TO_FW_LSB 21 992 #define TCL_DATA_CMD_3_TO_FW_MASK 0x00200000 993 994 /* Description TCL_DATA_CMD_3_RESERVED_3A 995 996 <legal 0> 997 */ 998 #define TCL_DATA_CMD_3_RESERVED_3A_OFFSET 0x0000000c 999 #define TCL_DATA_CMD_3_RESERVED_3A_LSB 22 1000 #define TCL_DATA_CMD_3_RESERVED_3A_MASK 0x00400000 1001 1002 /* Description TCL_DATA_CMD_3_PACKET_OFFSET 1003 1004 Packet offset from Metadata in case of direct buffer 1005 descriptor. This field is valid when Buf_or_ext_desc_type is 1006 reset(= 0). 1007 1008 <legal all> 1009 */ 1010 #define TCL_DATA_CMD_3_PACKET_OFFSET_OFFSET 0x0000000c 1011 #define TCL_DATA_CMD_3_PACKET_OFFSET_LSB 23 1012 #define TCL_DATA_CMD_3_PACKET_OFFSET_MASK 0xff800000 1013 1014 /* Description TCL_DATA_CMD_4_BUFFER_TIMESTAMP 1015 1016 Field only valid when 'Buffer_timestamp_valid ' is set. 1017 1018 1019 1020 Frame system entrance timestamp. The timestamp is 1021 related to the global system timer 1022 1023 1024 1025 Generally the first module (SW, TCL or TQM). that sees 1026 this frame and this timestamp field is not valid, shall fill 1027 in this field. 1028 1029 1030 1031 Timestamp in units of 1024 us 1032 */ 1033 #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_OFFSET 0x00000010 1034 #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_LSB 0 1035 #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_MASK 0x0007ffff 1036 1037 /* Description TCL_DATA_CMD_4_BUFFER_TIMESTAMP_VALID 1038 1039 When set, the Buffer_timestamp field contains valid 1040 info. 1041 */ 1042 #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_VALID_OFFSET 0x00000010 1043 #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_VALID_LSB 19 1044 #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_VALID_MASK 0x00080000 1045 1046 /* Description TCL_DATA_CMD_4_RESERVED_4A 1047 1048 <legal 0> 1049 */ 1050 #define TCL_DATA_CMD_4_RESERVED_4A_OFFSET 0x00000010 1051 #define TCL_DATA_CMD_4_RESERVED_4A_LSB 20 1052 #define TCL_DATA_CMD_4_RESERVED_4A_MASK 0x00100000 1053 1054 /* Description TCL_DATA_CMD_4_HLOS_TID_OVERWRITE 1055 1056 When set, TCL shall ignore the IP DSCP and VLAN PCP 1057 fields and use HLOS_TID as the final TID. Otherwise TCL 1058 shall consider the DSCP and PCP fields as well as HLOS_TID 1059 and choose a final TID based on the configured priority 1060 1061 <legal all> 1062 */ 1063 #define TCL_DATA_CMD_4_HLOS_TID_OVERWRITE_OFFSET 0x00000010 1064 #define TCL_DATA_CMD_4_HLOS_TID_OVERWRITE_LSB 21 1065 #define TCL_DATA_CMD_4_HLOS_TID_OVERWRITE_MASK 0x00200000 1066 1067 /* Description TCL_DATA_CMD_4_HLOS_TID 1068 1069 HLOS MSDU priority 1070 1071 1072 1073 Field is used when HLOS_TID_overwrite is set. 1074 1075 1076 1077 Field is also used when HLOS_TID_overwrite is not set 1078 and DSCP/PCP is not available in the packet 1079 1080 <legal all> 1081 */ 1082 #define TCL_DATA_CMD_4_HLOS_TID_OFFSET 0x00000010 1083 #define TCL_DATA_CMD_4_HLOS_TID_LSB 22 1084 #define TCL_DATA_CMD_4_HLOS_TID_MASK 0x03c00000 1085 1086 /* Description TCL_DATA_CMD_4_LMAC_ID 1087 1088 TCL uses this LMAC_ID in address search, i.e, while 1089 finding matching entry for the packet in AST corresponding 1090 to given LMAC_ID 1091 1092 If LMAC ID is all 1s (=> value 3), it indicates wildcard 1093 match for any MAC 1094 1095 <legal 0-3> 1096 */ 1097 #define TCL_DATA_CMD_4_LMAC_ID_OFFSET 0x00000010 1098 #define TCL_DATA_CMD_4_LMAC_ID_LSB 26 1099 #define TCL_DATA_CMD_4_LMAC_ID_MASK 0x0c000000 1100 1101 /* Description TCL_DATA_CMD_4_UDP_FLOW_OVERRIDE 1102 1103 TCL uses this to select the flow pointer from the peer 1104 table, which can be overridden by SW for pre-encrypted raw 1105 WiFi packets that cannot be parsed for UDP or for other 1106 enterprise use cases: 1107 1108 <enum 0 FP_PARSE_IP> Use the flow-pointer based on 1109 parsing the IPv4 or IPv6 header 1110 1111 <enum 1 FP_USE_NON_UDP> Use the non-UDP flow pointer 1112 1113 <enum 2 FP_USE_UDP> Use the UDP flow pointer 1114 1115 1116 1117 This is not supported in Moselle. 1118 1119 <legal 0-2> 1120 */ 1121 #define TCL_DATA_CMD_4_UDP_FLOW_OVERRIDE_OFFSET 0x00000010 1122 #define TCL_DATA_CMD_4_UDP_FLOW_OVERRIDE_LSB 28 1123 #define TCL_DATA_CMD_4_UDP_FLOW_OVERRIDE_MASK 0x30000000 1124 1125 /* Description TCL_DATA_CMD_4_RESERVED_4B 1126 1127 <legal 0> 1128 */ 1129 #define TCL_DATA_CMD_4_RESERVED_4B_OFFSET 0x00000010 1130 #define TCL_DATA_CMD_4_RESERVED_4B_LSB 30 1131 #define TCL_DATA_CMD_4_RESERVED_4B_MASK 0xc0000000 1132 1133 /* Description TCL_DATA_CMD_5_DSCP_TID_TABLE_NUM 1134 1135 DSCP to TID mapping table number that need to be used 1136 for the MSDU, should be specified using this field 1137 1138 <legal all> 1139 */ 1140 #define TCL_DATA_CMD_5_DSCP_TID_TABLE_NUM_OFFSET 0x00000014 1141 #define TCL_DATA_CMD_5_DSCP_TID_TABLE_NUM_LSB 0 1142 #define TCL_DATA_CMD_5_DSCP_TID_TABLE_NUM_MASK 0x0000003f 1143 1144 /* Description TCL_DATA_CMD_5_SEARCH_INDEX 1145 1146 The index that will be used for index based address or 1147 flow search. The field is valid when 'search_type' is 1 or 1148 2. 1149 1150 <legal all> 1151 */ 1152 #define TCL_DATA_CMD_5_SEARCH_INDEX_OFFSET 0x00000014 1153 #define TCL_DATA_CMD_5_SEARCH_INDEX_LSB 6 1154 #define TCL_DATA_CMD_5_SEARCH_INDEX_MASK 0x03ffffc0 1155 1156 /* Description TCL_DATA_CMD_5_CACHE_SET_NUM 1157 1158 Cache set number that should be used to cache the index 1159 based search results, for address and flow search. This 1160 value should be equal to LSB four bits of the hash value of 1161 match data, in case of search index points to an entry which 1162 may be used in content based search also. The value can be 1163 anything when the entry pointed by search index will not be 1164 used for content based search. 1165 1166 <legal all> 1167 */ 1168 #define TCL_DATA_CMD_5_CACHE_SET_NUM_OFFSET 0x00000014 1169 #define TCL_DATA_CMD_5_CACHE_SET_NUM_LSB 26 1170 #define TCL_DATA_CMD_5_CACHE_SET_NUM_MASK 0x3c000000 1171 1172 /* Description TCL_DATA_CMD_5_MESH_ENABLE 1173 1174 If set to a non-zero value: 1175 1176 * For raw WiFi frames, this indicates transmission to a 1177 mesh STA, enabling the interpretation of the 'Mesh Control 1178 Present' bit (bit 8) of QoS Control (otherwise this bit is 1179 ignored). The interpretation of the A-MSDU 'Length' field is 1180 decided by the e-numerations below. 1181 1182 * For native WiFi frames, this indicates that a 'Mesh 1183 Control' field is present between the header and the LLC. 1184 The three non-zero values are interchangeable. 1185 1186 1187 1188 <enum 0 MESH_DISABLE> 1189 1190 <enum 1 MESH_Q2Q> A-MSDU 'Length' is big endian and 1191 includes the length of Mesh Control. 1192 1193 <enum 2 MESH_11S_BE> A-MSDU 'Length' is big endian and 1194 excludes the length of Mesh Control. 1195 1196 <enum 3 MESH_11S_LE> A-MSDU 'Length' is little endian 1197 and excludes the length of Mesh Control. This is 1198 802.11s-compliant. 1199 1200 <legal 0-3> 1201 */ 1202 #define TCL_DATA_CMD_5_MESH_ENABLE_OFFSET 0x00000014 1203 #define TCL_DATA_CMD_5_MESH_ENABLE_LSB 30 1204 #define TCL_DATA_CMD_5_MESH_ENABLE_MASK 0xc0000000 1205 1206 /* Description TCL_DATA_CMD_6_RESERVED_6A 1207 1208 <legal 0> 1209 */ 1210 #define TCL_DATA_CMD_6_RESERVED_6A_OFFSET 0x00000018 1211 #define TCL_DATA_CMD_6_RESERVED_6A_LSB 0 1212 #define TCL_DATA_CMD_6_RESERVED_6A_MASK 0x000fffff 1213 1214 /* Description TCL_DATA_CMD_6_RING_ID 1215 1216 The buffer pointer ring ID. 1217 1218 0 refers to the IDLE ring 1219 1220 1 - N refers to other rings 1221 1222 1223 1224 Helps with debugging when dumping ring contents. 1225 1226 <legal all> 1227 */ 1228 #define TCL_DATA_CMD_6_RING_ID_OFFSET 0x00000018 1229 #define TCL_DATA_CMD_6_RING_ID_LSB 20 1230 #define TCL_DATA_CMD_6_RING_ID_MASK 0x0ff00000 1231 1232 /* Description TCL_DATA_CMD_6_LOOPING_COUNT 1233 1234 A count value that indicates the number of times the 1235 producer of entries into the Ring has looped around the 1236 ring. 1237 1238 At initialization time, this value is set to 0. On the 1239 first loop, this value is set to 1. After the max value is 1240 reached allowed by the number of bits for this field, the 1241 count value continues with 0 again. 1242 1243 1244 1245 In case SW is the consumer of the ring entries, it can 1246 use this field to figure out up to where the producer of 1247 entries has created new entries. This eliminates the need to 1248 check where the head pointer' of the ring is located once 1249 the SW starts processing an interrupt indicating that new 1250 entries have been put into this ring... 1251 1252 1253 1254 Also note that SW if it wants only needs to look at the 1255 LSB bit of this count value. 1256 1257 <legal all> 1258 */ 1259 #define TCL_DATA_CMD_6_LOOPING_COUNT_OFFSET 0x00000018 1260 #define TCL_DATA_CMD_6_LOOPING_COUNT_LSB 28 1261 #define TCL_DATA_CMD_6_LOOPING_COUNT_MASK 0xf0000000 1262 1263 1264 #endif // _TCL_DATA_CMD_H_ 1265