/* * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all * copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ // $ATH_LICENSE_HW_HDR_C$ // // DO NOT EDIT! This file is automatically generated // These definitions are tied to a particular hardware layout #ifndef _TCL_DATA_CMD_H_ #define _TCL_DATA_CMD_H_ #if !defined(__ASSEMBLER__) #endif #include "buffer_addr_info.h" // ################ START SUMMARY ################# // // Dword Fields // 0-1 struct buffer_addr_info buf_addr_info; // 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], reserved[13:10], addrx_en[14], addry_en[15], tcl_cmd_number[31:16] // 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], dscp_to_tid_priority_table_id[22], packet_offset[31:23] // 4 buffer_timestamp[18:0], buffer_timestamp_valid[19], mesh_enable[20], hlos_tid_overwrite[21], hlos_tid[25:22], reserved_4[31:26] // 5 reserved_5[31:0] // 6 reserved_6a[19:0], ring_id[27:20], looping_count[31:28] // // ################ END SUMMARY ################# #define NUM_OF_DWORDS_TCL_DATA_CMD 7 struct tcl_data_cmd { struct buffer_addr_info buf_addr_info; uint32_t buf_or_ext_desc_type : 1, //[0] epd : 1, //[1] encap_type : 2, //[3:2] encrypt_type : 4, //[7:4] src_buffer_swap : 1, //[8] link_meta_swap : 1, //[9] reserved : 4, //[13:10] addrx_en : 1, //[14] addry_en : 1, //[15] tcl_cmd_number : 16; //[31:16] uint32_t data_length : 16, //[15:0] ipv4_checksum_en : 1, //[16] udp_over_ipv4_checksum_en : 1, //[17] udp_over_ipv6_checksum_en : 1, //[18] tcp_over_ipv4_checksum_en : 1, //[19] tcp_over_ipv6_checksum_en : 1, //[20] to_fw : 1, //[21] dscp_to_tid_priority_table_id : 1, //[22] packet_offset : 9; //[31:23] uint32_t buffer_timestamp : 19, //[18:0] buffer_timestamp_valid : 1, //[19] mesh_enable : 1, //[20] hlos_tid_overwrite : 1, //[21] hlos_tid : 4, //[25:22] reserved_4 : 6; //[31:26] uint32_t reserved_5 : 32; //[31:0] uint32_t reserved_6a : 20, //[19:0] ring_id : 8, //[27:20] looping_count : 4; //[31:28] }; /* struct buffer_addr_info buf_addr_info Details of the physical address for a single buffer It also contains return ownership info as well as some meta data for SW related to this buffer. In case of Buf_or_ext_desc_type indicating 'MSDU_buffer', this address indicates the start of the meta data that is preceding the actual packet data. The start of the actual packet data is provided by field: Packet_offset buf_or_ext_desc_type The address points to an MSDU buffer. The address points to an MSDU link extension descriptor < legal all> epd When this bit is set then input packet is an EPD type encap_type Indicates the encapsulation that HW will perform: No encapsulation Ethernet 2 (DIX) or 802.3 (uses SNAP/LLC) DO NOT USE. Indicate Ethernet Used by the OLE during encapsulation. encrypt_type Field only valid for encap_type: RAW Indicates type of decrypt cipher used (as defined in the peer entry) WEP 40-bit WEP 104-bit TKIP without MIC WEP 128-bit TKIP with MIC WAPI AES CCMP 128 No crypto AES CCMP 256 AES CCMP 128 AES CCMP 256 WAPI GCM SM4 src_buffer_swap Treats source memory (packet buffer) organization as big-endian. The packets are read and byte swapped. 1'b0: Source memory is little endian 1'b1: Source memory is big endian link_meta_swap Treats link descriptor and Metadata as big-endian. The link descriptor/Metadata is read and byte swapped. 1'b0: Memory is little endian 1'b1: Memory is big endian reserved addrx_en Address X search enable in ASE 1'b0: Search disable 1'b1: Search Enable addry_en Address Y search enable in ASE 1'b0: Search disable 1'b1: Search Enable tcl_cmd_number This number can be used by SW to track, identify and link the created commands with the command statuses Is set to the value 'TCL_CMD_Number' of the related TCL_DATA command data_length Valid Data length in bytes. MSDU length in case of direct descriptor. Length of link extension descriptor in case of Link extension descriptor. This is used to know the size of Metadata. ipv4_checksum_en OLE related control Enable IPv4 checksum replacement udp_over_ipv4_checksum_en OLE related control Enable UDP over IPv4 checksum replacement. UDP checksum over IPv4 is optional for TCP/IP stacks. udp_over_ipv6_checksum_en OLE related control Enable UDP over IPv6 checksum replacement. UDP checksum over IPv6 is mandatory for TCP/IP stacks. tcp_over_ipv4_checksum_en OLE related control Enable TCP checksum over IPv4 replacement tcp_over_ipv6_checksum_en OLE related control Enable TCP checksum over IPv6 replacement to_fw Forward packet to FW along with classification result. The packet will not be forward to TQM when this bit is set 1'b0: Use classification result to forward the packet. 1'b1: Override classification result and forward packet only to FW. dscp_to_tid_priority_table_id The DSCP to tid conversion table to be used for this frame packet_offset Packet offset from Metadata in case of direct buffer descriptor. This field is valid when Buf_or_ext_desc_type is reset(= 0). buffer_timestamp Field only valid when 'Buffer_timestamp_valid ' is set. Frame system entrance timestamp. The timestamp is related to the global system timer Generally the first module (SW, TCL or TQM). that sees this frame and this timestamp field is not valid, shall fill in this field. Timestamp in units of 1024 us buffer_timestamp_valid When set, the Buffer_timestamp field contains valid info. mesh_enable If set to 1: * For raw WiFi frames, this indicates transmission to a mesh STA, enabling the interpretation of the 'Mesh Control Present' bit (bit 8) of QoS Control (otherwise this bit is ignored), * For native WiFi frames, this indicates that a 'Mesh Control' field is present between the header and the LLC. hlos_tid_overwrite When set, TCL shall ignore the IP DSCP and VLAN PCP fields and use HLOS_TID as the final TID. Otherwise TCL shall consider the DSCP and PCP fields as well as HLOS_TID and choose a final TID based on the configured priority hlos_tid HLOS MSDU priority Field is used when HLOS_TID_overwrite is set. Field is also used when HLOS_TID_overwrite is not set and DSCP/PCP is not available in the packet reserved_4 reserved_5 reserved_6a ring_id The buffer pointer ring ID. 0 refers to the IDLE ring 1 - N refers to other rings Helps with debugging when dumping ring contents. looping_count A count value that indicates the number of times the producer of entries into the Ring has looped around the ring. At initialization time, this value is set to 0. On the first loop, this value is set to 1. After the max value is reached allowed by the number of bits for this field, the count value continues with 0 again. In case SW is the consumer of the ring entries, it can use this field to figure out up to where the producer of entries has created new entries. This eliminates the need to check where the head pointer' of the ring is located once the SW starts processing an interrupt indicating that new entries have been put into this ring... Also note that SW if it wants only needs to look at the LSB bit of this count value. */ #define TCL_DATA_CMD_0_BUFFER_ADDR_INFO_BUF_ADDR_INFO_OFFSET 0x00000000 #define TCL_DATA_CMD_0_BUFFER_ADDR_INFO_BUF_ADDR_INFO_LSB 28 #define TCL_DATA_CMD_0_BUFFER_ADDR_INFO_BUF_ADDR_INFO_MASK 0xffffffff #define TCL_DATA_CMD_1_BUFFER_ADDR_INFO_BUF_ADDR_INFO_OFFSET 0x00000004 #define TCL_DATA_CMD_1_BUFFER_ADDR_INFO_BUF_ADDR_INFO_LSB 28 #define TCL_DATA_CMD_1_BUFFER_ADDR_INFO_BUF_ADDR_INFO_MASK 0xffffffff /* Description TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE The address points to an MSDU buffer. The address points to an MSDU link extension descriptor < legal all> */ #define TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_OFFSET 0x00000008 #define TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_LSB 0 #define TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_MASK 0x00000001 /* Description TCL_DATA_CMD_2_EPD When this bit is set then input packet is an EPD type */ #define TCL_DATA_CMD_2_EPD_OFFSET 0x00000008 #define TCL_DATA_CMD_2_EPD_LSB 1 #define TCL_DATA_CMD_2_EPD_MASK 0x00000002 /* Description TCL_DATA_CMD_2_ENCAP_TYPE Indicates the encapsulation that HW will perform: No encapsulation Ethernet 2 (DIX) or 802.3 (uses SNAP/LLC) DO NOT USE. Indicate Ethernet Used by the OLE during encapsulation. */ #define TCL_DATA_CMD_2_ENCAP_TYPE_OFFSET 0x00000008 #define TCL_DATA_CMD_2_ENCAP_TYPE_LSB 2 #define TCL_DATA_CMD_2_ENCAP_TYPE_MASK 0x0000000c /* Description TCL_DATA_CMD_2_ENCRYPT_TYPE Field only valid for encap_type: RAW Indicates type of decrypt cipher used (as defined in the peer entry) WEP 40-bit WEP 104-bit TKIP without MIC WEP 128-bit TKIP with MIC WAPI AES CCMP 128 No crypto AES CCMP 256 AES CCMP 128 AES CCMP 256 WAPI GCM SM4 */ #define TCL_DATA_CMD_2_ENCRYPT_TYPE_OFFSET 0x00000008 #define TCL_DATA_CMD_2_ENCRYPT_TYPE_LSB 4 #define TCL_DATA_CMD_2_ENCRYPT_TYPE_MASK 0x000000f0 /* Description TCL_DATA_CMD_2_SRC_BUFFER_SWAP Treats source memory (packet buffer) organization as big-endian. The packets are read and byte swapped. 1'b0: Source memory is little endian 1'b1: Source memory is big endian */ #define TCL_DATA_CMD_2_SRC_BUFFER_SWAP_OFFSET 0x00000008 #define TCL_DATA_CMD_2_SRC_BUFFER_SWAP_LSB 8 #define TCL_DATA_CMD_2_SRC_BUFFER_SWAP_MASK 0x00000100 /* Description TCL_DATA_CMD_2_LINK_META_SWAP Treats link descriptor and Metadata as big-endian. The link descriptor/Metadata is read and byte swapped. 1'b0: Memory is little endian 1'b1: Memory is big endian */ #define TCL_DATA_CMD_2_LINK_META_SWAP_OFFSET 0x00000008 #define TCL_DATA_CMD_2_LINK_META_SWAP_LSB 9 #define TCL_DATA_CMD_2_LINK_META_SWAP_MASK 0x00000200 /* Description TCL_DATA_CMD_2_RESERVED */ #define TCL_DATA_CMD_2_RESERVED_OFFSET 0x00000008 #define TCL_DATA_CMD_2_RESERVED_LSB 10 #define TCL_DATA_CMD_2_RESERVED_MASK 0x00003c00 /* Description TCL_DATA_CMD_2_ADDRX_EN Address X search enable in ASE 1'b0: Search disable 1'b1: Search Enable */ #define TCL_DATA_CMD_2_ADDRX_EN_OFFSET 0x00000008 #define TCL_DATA_CMD_2_ADDRX_EN_LSB 14 #define TCL_DATA_CMD_2_ADDRX_EN_MASK 0x00004000 /* Description TCL_DATA_CMD_2_ADDRY_EN Address Y search enable in ASE 1'b0: Search disable 1'b1: Search Enable */ #define TCL_DATA_CMD_2_ADDRY_EN_OFFSET 0x00000008 #define TCL_DATA_CMD_2_ADDRY_EN_LSB 15 #define TCL_DATA_CMD_2_ADDRY_EN_MASK 0x00008000 /* Description TCL_DATA_CMD_2_TCL_CMD_NUMBER This number can be used by SW to track, identify and link the created commands with the command statuses Is set to the value 'TCL_CMD_Number' of the related TCL_DATA command */ #define TCL_DATA_CMD_2_TCL_CMD_NUMBER_OFFSET 0x00000008 #define TCL_DATA_CMD_2_TCL_CMD_NUMBER_LSB 16 #define TCL_DATA_CMD_2_TCL_CMD_NUMBER_MASK 0xffff0000 /* Description TCL_DATA_CMD_3_DATA_LENGTH Valid Data length in bytes. MSDU length in case of direct descriptor. Length of link extension descriptor in case of Link extension descriptor. This is used to know the size of Metadata. */ #define TCL_DATA_CMD_3_DATA_LENGTH_OFFSET 0x0000000c #define TCL_DATA_CMD_3_DATA_LENGTH_LSB 0 #define TCL_DATA_CMD_3_DATA_LENGTH_MASK 0x0000ffff /* Description TCL_DATA_CMD_3_IPV4_CHECKSUM_EN OLE related control Enable IPv4 checksum replacement */ #define TCL_DATA_CMD_3_IPV4_CHECKSUM_EN_OFFSET 0x0000000c #define TCL_DATA_CMD_3_IPV4_CHECKSUM_EN_LSB 16 #define TCL_DATA_CMD_3_IPV4_CHECKSUM_EN_MASK 0x00010000 /* Description TCL_DATA_CMD_3_UDP_OVER_IPV4_CHECKSUM_EN OLE related control Enable UDP over IPv4 checksum replacement. UDP checksum over IPv4 is optional for TCP/IP stacks. */ #define TCL_DATA_CMD_3_UDP_OVER_IPV4_CHECKSUM_EN_OFFSET 0x0000000c #define TCL_DATA_CMD_3_UDP_OVER_IPV4_CHECKSUM_EN_LSB 17 #define TCL_DATA_CMD_3_UDP_OVER_IPV4_CHECKSUM_EN_MASK 0x00020000 /* Description TCL_DATA_CMD_3_UDP_OVER_IPV6_CHECKSUM_EN OLE related control Enable UDP over IPv6 checksum replacement. UDP checksum over IPv6 is mandatory for TCP/IP stacks. */ #define TCL_DATA_CMD_3_UDP_OVER_IPV6_CHECKSUM_EN_OFFSET 0x0000000c #define TCL_DATA_CMD_3_UDP_OVER_IPV6_CHECKSUM_EN_LSB 18 #define TCL_DATA_CMD_3_UDP_OVER_IPV6_CHECKSUM_EN_MASK 0x00040000 /* Description TCL_DATA_CMD_3_TCP_OVER_IPV4_CHECKSUM_EN OLE related control Enable TCP checksum over IPv4 replacement */ #define TCL_DATA_CMD_3_TCP_OVER_IPV4_CHECKSUM_EN_OFFSET 0x0000000c #define TCL_DATA_CMD_3_TCP_OVER_IPV4_CHECKSUM_EN_LSB 19 #define TCL_DATA_CMD_3_TCP_OVER_IPV4_CHECKSUM_EN_MASK 0x00080000 /* Description TCL_DATA_CMD_3_TCP_OVER_IPV6_CHECKSUM_EN OLE related control Enable TCP checksum over IPv6 replacement */ #define TCL_DATA_CMD_3_TCP_OVER_IPV6_CHECKSUM_EN_OFFSET 0x0000000c #define TCL_DATA_CMD_3_TCP_OVER_IPV6_CHECKSUM_EN_LSB 20 #define TCL_DATA_CMD_3_TCP_OVER_IPV6_CHECKSUM_EN_MASK 0x00100000 /* Description TCL_DATA_CMD_3_TO_FW Forward packet to FW along with classification result. The packet will not be forward to TQM when this bit is set 1'b0: Use classification result to forward the packet. 1'b1: Override classification result and forward packet only to FW. */ #define TCL_DATA_CMD_3_TO_FW_OFFSET 0x0000000c #define TCL_DATA_CMD_3_TO_FW_LSB 21 #define TCL_DATA_CMD_3_TO_FW_MASK 0x00200000 /* Description TCL_DATA_CMD_3_DSCP_TO_TID_PRIORITY_TABLE_ID The DSCP to tid conversion table to be used for this frame */ #define TCL_DATA_CMD_3_DSCP_TO_TID_PRIORITY_TABLE_ID_OFFSET 0x0000000c #define TCL_DATA_CMD_3_DSCP_TO_TID_PRIORITY_TABLE_ID_LSB 22 #define TCL_DATA_CMD_3_DSCP_TO_TID_PRIORITY_TABLE_ID_MASK 0x00400000 /* Description TCL_DATA_CMD_3_PACKET_OFFSET Packet offset from Metadata in case of direct buffer descriptor. This field is valid when Buf_or_ext_desc_type is reset(= 0). */ #define TCL_DATA_CMD_3_PACKET_OFFSET_OFFSET 0x0000000c #define TCL_DATA_CMD_3_PACKET_OFFSET_LSB 23 #define TCL_DATA_CMD_3_PACKET_OFFSET_MASK 0xff800000 /* Description TCL_DATA_CMD_4_BUFFER_TIMESTAMP Field only valid when 'Buffer_timestamp_valid ' is set. Frame system entrance timestamp. The timestamp is related to the global system timer Generally the first module (SW, TCL or TQM). that sees this frame and this timestamp field is not valid, shall fill in this field. Timestamp in units of 1024 us */ #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_OFFSET 0x00000010 #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_LSB 0 #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_MASK 0x0007ffff /* Description TCL_DATA_CMD_4_BUFFER_TIMESTAMP_VALID When set, the Buffer_timestamp field contains valid info. */ #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_VALID_OFFSET 0x00000010 #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_VALID_LSB 19 #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_VALID_MASK 0x00080000 /* Description TCL_DATA_CMD_4_MESH_ENABLE If set to 1: * For raw WiFi frames, this indicates transmission to a mesh STA, enabling the interpretation of the 'Mesh Control Present' bit (bit 8) of QoS Control (otherwise this bit is ignored), * For native WiFi frames, this indicates that a 'Mesh Control' field is present between the header and the LLC. */ #define TCL_DATA_CMD_4_MESH_ENABLE_OFFSET 0x00000010 #define TCL_DATA_CMD_4_MESH_ENABLE_LSB 20 #define TCL_DATA_CMD_4_MESH_ENABLE_MASK 0x00100000 /* Description TCL_DATA_CMD_4_HLOS_TID_OVERWRITE When set, TCL shall ignore the IP DSCP and VLAN PCP fields and use HLOS_TID as the final TID. Otherwise TCL shall consider the DSCP and PCP fields as well as HLOS_TID and choose a final TID based on the configured priority */ #define TCL_DATA_CMD_4_HLOS_TID_OVERWRITE_OFFSET 0x00000010 #define TCL_DATA_CMD_4_HLOS_TID_OVERWRITE_LSB 21 #define TCL_DATA_CMD_4_HLOS_TID_OVERWRITE_MASK 0x00200000 /* Description TCL_DATA_CMD_4_HLOS_TID HLOS MSDU priority Field is used when HLOS_TID_overwrite is set. Field is also used when HLOS_TID_overwrite is not set and DSCP/PCP is not available in the packet */ #define TCL_DATA_CMD_4_HLOS_TID_OFFSET 0x00000010 #define TCL_DATA_CMD_4_HLOS_TID_LSB 22 #define TCL_DATA_CMD_4_HLOS_TID_MASK 0x03c00000 /* Description TCL_DATA_CMD_4_RESERVED_4 */ #define TCL_DATA_CMD_4_RESERVED_4_OFFSET 0x00000010 #define TCL_DATA_CMD_4_RESERVED_4_LSB 26 #define TCL_DATA_CMD_4_RESERVED_4_MASK 0xfc000000 /* Description TCL_DATA_CMD_5_RESERVED_5 */ #define TCL_DATA_CMD_5_RESERVED_5_OFFSET 0x00000014 #define TCL_DATA_CMD_5_RESERVED_5_LSB 0 #define TCL_DATA_CMD_5_RESERVED_5_MASK 0xffffffff /* Description TCL_DATA_CMD_6_RESERVED_6A */ #define TCL_DATA_CMD_6_RESERVED_6A_OFFSET 0x00000018 #define TCL_DATA_CMD_6_RESERVED_6A_LSB 0 #define TCL_DATA_CMD_6_RESERVED_6A_MASK 0x000fffff /* Description TCL_DATA_CMD_6_RING_ID The buffer pointer ring ID. 0 refers to the IDLE ring 1 - N refers to other rings Helps with debugging when dumping ring contents. */ #define TCL_DATA_CMD_6_RING_ID_OFFSET 0x00000018 #define TCL_DATA_CMD_6_RING_ID_LSB 20 #define TCL_DATA_CMD_6_RING_ID_MASK 0x0ff00000 /* Description TCL_DATA_CMD_6_LOOPING_COUNT A count value that indicates the number of times the producer of entries into the Ring has looped around the ring. At initialization time, this value is set to 0. On the first loop, this value is set to 1. After the max value is reached allowed by the number of bits for this field, the count value continues with 0 again. In case SW is the consumer of the ring entries, it can use this field to figure out up to where the producer of entries has created new entries. This eliminates the need to check where the head pointer' of the ring is located once the SW starts processing an interrupt indicating that new entries have been put into this ring... Also note that SW if it wants only needs to look at the LSB bit of this count value. */ #define TCL_DATA_CMD_6_LOOPING_COUNT_OFFSET 0x00000018 #define TCL_DATA_CMD_6_LOOPING_COUNT_LSB 28 #define TCL_DATA_CMD_6_LOOPING_COUNT_MASK 0xf0000000 #endif // _TCL_DATA_CMD_H_