18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * This file is part of the Chelsio T4 Ethernet driver for Linux. 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Copyright (c) 2003-2014 Chelsio Communications, Inc. All rights reserved. 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * This software is available to you under a choice of one of two 78c2ecf20Sopenharmony_ci * licenses. You may choose to be licensed under the terms of the GNU 88c2ecf20Sopenharmony_ci * General Public License (GPL) Version 2, available from the file 98c2ecf20Sopenharmony_ci * COPYING in the main directory of this source tree, or the 108c2ecf20Sopenharmony_ci * OpenIB.org BSD license below: 118c2ecf20Sopenharmony_ci * 128c2ecf20Sopenharmony_ci * Redistribution and use in source and binary forms, with or 138c2ecf20Sopenharmony_ci * without modification, are permitted provided that the following 148c2ecf20Sopenharmony_ci * conditions are met: 158c2ecf20Sopenharmony_ci * 168c2ecf20Sopenharmony_ci * - Redistributions of source code must retain the above 178c2ecf20Sopenharmony_ci * copyright notice, this list of conditions and the following 188c2ecf20Sopenharmony_ci * disclaimer. 198c2ecf20Sopenharmony_ci * 208c2ecf20Sopenharmony_ci * - Redistributions in binary form must reproduce the above 218c2ecf20Sopenharmony_ci * copyright notice, this list of conditions and the following 228c2ecf20Sopenharmony_ci * disclaimer in the documentation and/or other materials 238c2ecf20Sopenharmony_ci * provided with the distribution. 248c2ecf20Sopenharmony_ci * 258c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 268c2ecf20Sopenharmony_ci * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 278c2ecf20Sopenharmony_ci * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 288c2ecf20Sopenharmony_ci * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 298c2ecf20Sopenharmony_ci * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 308c2ecf20Sopenharmony_ci * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 318c2ecf20Sopenharmony_ci * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 328c2ecf20Sopenharmony_ci * SOFTWARE. 338c2ecf20Sopenharmony_ci */ 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci#ifndef __T4_MSG_H 368c2ecf20Sopenharmony_ci#define __T4_MSG_H 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ci#include <linux/types.h> 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_cienum { 418c2ecf20Sopenharmony_ci CPL_PASS_OPEN_REQ = 0x1, 428c2ecf20Sopenharmony_ci CPL_PASS_ACCEPT_RPL = 0x2, 438c2ecf20Sopenharmony_ci CPL_ACT_OPEN_REQ = 0x3, 448c2ecf20Sopenharmony_ci CPL_SET_TCB_FIELD = 0x5, 458c2ecf20Sopenharmony_ci CPL_GET_TCB = 0x6, 468c2ecf20Sopenharmony_ci CPL_CLOSE_CON_REQ = 0x8, 478c2ecf20Sopenharmony_ci CPL_CLOSE_LISTSRV_REQ = 0x9, 488c2ecf20Sopenharmony_ci CPL_ABORT_REQ = 0xA, 498c2ecf20Sopenharmony_ci CPL_ABORT_RPL = 0xB, 508c2ecf20Sopenharmony_ci CPL_TX_DATA = 0xC, 518c2ecf20Sopenharmony_ci CPL_RX_DATA_ACK = 0xD, 528c2ecf20Sopenharmony_ci CPL_TX_PKT = 0xE, 538c2ecf20Sopenharmony_ci CPL_L2T_WRITE_REQ = 0x12, 548c2ecf20Sopenharmony_ci CPL_SMT_WRITE_REQ = 0x14, 558c2ecf20Sopenharmony_ci CPL_TID_RELEASE = 0x1A, 568c2ecf20Sopenharmony_ci CPL_SRQ_TABLE_REQ = 0x1C, 578c2ecf20Sopenharmony_ci CPL_TX_DATA_ISO = 0x1F, 588c2ecf20Sopenharmony_ci 598c2ecf20Sopenharmony_ci CPL_CLOSE_LISTSRV_RPL = 0x20, 608c2ecf20Sopenharmony_ci CPL_GET_TCB_RPL = 0x22, 618c2ecf20Sopenharmony_ci CPL_L2T_WRITE_RPL = 0x23, 628c2ecf20Sopenharmony_ci CPL_PASS_OPEN_RPL = 0x24, 638c2ecf20Sopenharmony_ci CPL_ACT_OPEN_RPL = 0x25, 648c2ecf20Sopenharmony_ci CPL_PEER_CLOSE = 0x26, 658c2ecf20Sopenharmony_ci CPL_ABORT_REQ_RSS = 0x2B, 668c2ecf20Sopenharmony_ci CPL_ABORT_RPL_RSS = 0x2D, 678c2ecf20Sopenharmony_ci CPL_SMT_WRITE_RPL = 0x2E, 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ci CPL_RX_PHYS_ADDR = 0x30, 708c2ecf20Sopenharmony_ci CPL_CLOSE_CON_RPL = 0x32, 718c2ecf20Sopenharmony_ci CPL_ISCSI_HDR = 0x33, 728c2ecf20Sopenharmony_ci CPL_RDMA_CQE = 0x35, 738c2ecf20Sopenharmony_ci CPL_RDMA_CQE_READ_RSP = 0x36, 748c2ecf20Sopenharmony_ci CPL_RDMA_CQE_ERR = 0x37, 758c2ecf20Sopenharmony_ci CPL_RX_DATA = 0x39, 768c2ecf20Sopenharmony_ci CPL_SET_TCB_RPL = 0x3A, 778c2ecf20Sopenharmony_ci CPL_RX_PKT = 0x3B, 788c2ecf20Sopenharmony_ci CPL_RX_DDP_COMPLETE = 0x3F, 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci CPL_ACT_ESTABLISH = 0x40, 818c2ecf20Sopenharmony_ci CPL_PASS_ESTABLISH = 0x41, 828c2ecf20Sopenharmony_ci CPL_RX_DATA_DDP = 0x42, 838c2ecf20Sopenharmony_ci CPL_PASS_ACCEPT_REQ = 0x44, 848c2ecf20Sopenharmony_ci CPL_RX_ISCSI_CMP = 0x45, 858c2ecf20Sopenharmony_ci CPL_TRACE_PKT_T5 = 0x48, 868c2ecf20Sopenharmony_ci CPL_RX_ISCSI_DDP = 0x49, 878c2ecf20Sopenharmony_ci CPL_RX_TLS_CMP = 0x4E, 888c2ecf20Sopenharmony_ci 898c2ecf20Sopenharmony_ci CPL_RDMA_READ_REQ = 0x60, 908c2ecf20Sopenharmony_ci 918c2ecf20Sopenharmony_ci CPL_PASS_OPEN_REQ6 = 0x81, 928c2ecf20Sopenharmony_ci CPL_ACT_OPEN_REQ6 = 0x83, 938c2ecf20Sopenharmony_ci 948c2ecf20Sopenharmony_ci CPL_TX_TLS_PDU = 0x88, 958c2ecf20Sopenharmony_ci CPL_TX_TLS_SFO = 0x89, 968c2ecf20Sopenharmony_ci CPL_TX_SEC_PDU = 0x8A, 978c2ecf20Sopenharmony_ci CPL_TX_TLS_ACK = 0x8B, 988c2ecf20Sopenharmony_ci 998c2ecf20Sopenharmony_ci CPL_RDMA_TERMINATE = 0xA2, 1008c2ecf20Sopenharmony_ci CPL_RDMA_WRITE = 0xA4, 1018c2ecf20Sopenharmony_ci CPL_SGE_EGR_UPDATE = 0xA5, 1028c2ecf20Sopenharmony_ci CPL_RX_MPS_PKT = 0xAF, 1038c2ecf20Sopenharmony_ci 1048c2ecf20Sopenharmony_ci CPL_TRACE_PKT = 0xB0, 1058c2ecf20Sopenharmony_ci CPL_TLS_DATA = 0xB1, 1068c2ecf20Sopenharmony_ci CPL_ISCSI_DATA = 0xB2, 1078c2ecf20Sopenharmony_ci 1088c2ecf20Sopenharmony_ci CPL_FW4_MSG = 0xC0, 1098c2ecf20Sopenharmony_ci CPL_FW4_PLD = 0xC1, 1108c2ecf20Sopenharmony_ci CPL_FW4_ACK = 0xC3, 1118c2ecf20Sopenharmony_ci CPL_SRQ_TABLE_RPL = 0xCC, 1128c2ecf20Sopenharmony_ci 1138c2ecf20Sopenharmony_ci CPL_RX_PHYS_DSGL = 0xD0, 1148c2ecf20Sopenharmony_ci 1158c2ecf20Sopenharmony_ci CPL_FW6_MSG = 0xE0, 1168c2ecf20Sopenharmony_ci CPL_FW6_PLD = 0xE1, 1178c2ecf20Sopenharmony_ci CPL_TX_TNL_LSO = 0xEC, 1188c2ecf20Sopenharmony_ci CPL_TX_PKT_LSO = 0xED, 1198c2ecf20Sopenharmony_ci CPL_TX_PKT_XT = 0xEE, 1208c2ecf20Sopenharmony_ci 1218c2ecf20Sopenharmony_ci NUM_CPL_CMDS 1228c2ecf20Sopenharmony_ci}; 1238c2ecf20Sopenharmony_ci 1248c2ecf20Sopenharmony_cienum CPL_error { 1258c2ecf20Sopenharmony_ci CPL_ERR_NONE = 0, 1268c2ecf20Sopenharmony_ci CPL_ERR_TCAM_PARITY = 1, 1278c2ecf20Sopenharmony_ci CPL_ERR_TCAM_MISS = 2, 1288c2ecf20Sopenharmony_ci CPL_ERR_TCAM_FULL = 3, 1298c2ecf20Sopenharmony_ci CPL_ERR_BAD_LENGTH = 15, 1308c2ecf20Sopenharmony_ci CPL_ERR_BAD_ROUTE = 18, 1318c2ecf20Sopenharmony_ci CPL_ERR_CONN_RESET = 20, 1328c2ecf20Sopenharmony_ci CPL_ERR_CONN_EXIST_SYNRECV = 21, 1338c2ecf20Sopenharmony_ci CPL_ERR_CONN_EXIST = 22, 1348c2ecf20Sopenharmony_ci CPL_ERR_ARP_MISS = 23, 1358c2ecf20Sopenharmony_ci CPL_ERR_BAD_SYN = 24, 1368c2ecf20Sopenharmony_ci CPL_ERR_CONN_TIMEDOUT = 30, 1378c2ecf20Sopenharmony_ci CPL_ERR_XMIT_TIMEDOUT = 31, 1388c2ecf20Sopenharmony_ci CPL_ERR_PERSIST_TIMEDOUT = 32, 1398c2ecf20Sopenharmony_ci CPL_ERR_FINWAIT2_TIMEDOUT = 33, 1408c2ecf20Sopenharmony_ci CPL_ERR_KEEPALIVE_TIMEDOUT = 34, 1418c2ecf20Sopenharmony_ci CPL_ERR_RTX_NEG_ADVICE = 35, 1428c2ecf20Sopenharmony_ci CPL_ERR_PERSIST_NEG_ADVICE = 36, 1438c2ecf20Sopenharmony_ci CPL_ERR_KEEPALV_NEG_ADVICE = 37, 1448c2ecf20Sopenharmony_ci CPL_ERR_ABORT_FAILED = 42, 1458c2ecf20Sopenharmony_ci CPL_ERR_IWARP_FLM = 50, 1468c2ecf20Sopenharmony_ci CPL_CONTAINS_READ_RPL = 60, 1478c2ecf20Sopenharmony_ci CPL_CONTAINS_WRITE_RPL = 61, 1488c2ecf20Sopenharmony_ci}; 1498c2ecf20Sopenharmony_ci 1508c2ecf20Sopenharmony_cienum { 1518c2ecf20Sopenharmony_ci CPL_CONN_POLICY_AUTO = 0, 1528c2ecf20Sopenharmony_ci CPL_CONN_POLICY_ASK = 1, 1538c2ecf20Sopenharmony_ci CPL_CONN_POLICY_FILTER = 2, 1548c2ecf20Sopenharmony_ci CPL_CONN_POLICY_DENY = 3 1558c2ecf20Sopenharmony_ci}; 1568c2ecf20Sopenharmony_ci 1578c2ecf20Sopenharmony_cienum { 1588c2ecf20Sopenharmony_ci ULP_MODE_NONE = 0, 1598c2ecf20Sopenharmony_ci ULP_MODE_ISCSI = 2, 1608c2ecf20Sopenharmony_ci ULP_MODE_RDMA = 4, 1618c2ecf20Sopenharmony_ci ULP_MODE_TCPDDP = 5, 1628c2ecf20Sopenharmony_ci ULP_MODE_FCOE = 6, 1638c2ecf20Sopenharmony_ci ULP_MODE_TLS = 8, 1648c2ecf20Sopenharmony_ci}; 1658c2ecf20Sopenharmony_ci 1668c2ecf20Sopenharmony_cienum { 1678c2ecf20Sopenharmony_ci ULP_CRC_HEADER = 1 << 0, 1688c2ecf20Sopenharmony_ci ULP_CRC_DATA = 1 << 1 1698c2ecf20Sopenharmony_ci}; 1708c2ecf20Sopenharmony_ci 1718c2ecf20Sopenharmony_cienum { 1728c2ecf20Sopenharmony_ci CPL_ABORT_SEND_RST = 0, 1738c2ecf20Sopenharmony_ci CPL_ABORT_NO_RST, 1748c2ecf20Sopenharmony_ci}; 1758c2ecf20Sopenharmony_ci 1768c2ecf20Sopenharmony_cienum { /* TX_PKT_XT checksum types */ 1778c2ecf20Sopenharmony_ci TX_CSUM_TCP = 0, 1788c2ecf20Sopenharmony_ci TX_CSUM_UDP = 1, 1798c2ecf20Sopenharmony_ci TX_CSUM_CRC16 = 4, 1808c2ecf20Sopenharmony_ci TX_CSUM_CRC32 = 5, 1818c2ecf20Sopenharmony_ci TX_CSUM_CRC32C = 6, 1828c2ecf20Sopenharmony_ci TX_CSUM_FCOE = 7, 1838c2ecf20Sopenharmony_ci TX_CSUM_TCPIP = 8, 1848c2ecf20Sopenharmony_ci TX_CSUM_UDPIP = 9, 1858c2ecf20Sopenharmony_ci TX_CSUM_TCPIP6 = 10, 1868c2ecf20Sopenharmony_ci TX_CSUM_UDPIP6 = 11, 1878c2ecf20Sopenharmony_ci TX_CSUM_IP = 12, 1888c2ecf20Sopenharmony_ci}; 1898c2ecf20Sopenharmony_ci 1908c2ecf20Sopenharmony_ciunion opcode_tid { 1918c2ecf20Sopenharmony_ci __be32 opcode_tid; 1928c2ecf20Sopenharmony_ci u8 opcode; 1938c2ecf20Sopenharmony_ci}; 1948c2ecf20Sopenharmony_ci 1958c2ecf20Sopenharmony_ci#define CPL_OPCODE_S 24 1968c2ecf20Sopenharmony_ci#define CPL_OPCODE_V(x) ((x) << CPL_OPCODE_S) 1978c2ecf20Sopenharmony_ci#define CPL_OPCODE_G(x) (((x) >> CPL_OPCODE_S) & 0xFF) 1988c2ecf20Sopenharmony_ci#define TID_G(x) ((x) & 0xFFFFFF) 1998c2ecf20Sopenharmony_ci 2008c2ecf20Sopenharmony_ci/* tid is assumed to be 24-bits */ 2018c2ecf20Sopenharmony_ci#define MK_OPCODE_TID(opcode, tid) (CPL_OPCODE_V(opcode) | (tid)) 2028c2ecf20Sopenharmony_ci 2038c2ecf20Sopenharmony_ci#define OPCODE_TID(cmd) ((cmd)->ot.opcode_tid) 2048c2ecf20Sopenharmony_ci 2058c2ecf20Sopenharmony_ci/* extract the TID from a CPL command */ 2068c2ecf20Sopenharmony_ci#define GET_TID(cmd) (TID_G(be32_to_cpu(OPCODE_TID(cmd)))) 2078c2ecf20Sopenharmony_ci 2088c2ecf20Sopenharmony_ci/* partitioning of TID fields that also carry a queue id */ 2098c2ecf20Sopenharmony_ci#define TID_TID_S 0 2108c2ecf20Sopenharmony_ci#define TID_TID_M 0x3fff 2118c2ecf20Sopenharmony_ci#define TID_TID_V(x) ((x) << TID_TID_S) 2128c2ecf20Sopenharmony_ci#define TID_TID_G(x) (((x) >> TID_TID_S) & TID_TID_M) 2138c2ecf20Sopenharmony_ci 2148c2ecf20Sopenharmony_ci#define TID_QID_S 14 2158c2ecf20Sopenharmony_ci#define TID_QID_M 0x3ff 2168c2ecf20Sopenharmony_ci#define TID_QID_V(x) ((x) << TID_QID_S) 2178c2ecf20Sopenharmony_ci#define TID_QID_G(x) (((x) >> TID_QID_S) & TID_QID_M) 2188c2ecf20Sopenharmony_ci 2198c2ecf20Sopenharmony_cistruct rss_header { 2208c2ecf20Sopenharmony_ci u8 opcode; 2218c2ecf20Sopenharmony_ci#if defined(__LITTLE_ENDIAN_BITFIELD) 2228c2ecf20Sopenharmony_ci u8 channel:2; 2238c2ecf20Sopenharmony_ci u8 filter_hit:1; 2248c2ecf20Sopenharmony_ci u8 filter_tid:1; 2258c2ecf20Sopenharmony_ci u8 hash_type:2; 2268c2ecf20Sopenharmony_ci u8 ipv6:1; 2278c2ecf20Sopenharmony_ci u8 send2fw:1; 2288c2ecf20Sopenharmony_ci#else 2298c2ecf20Sopenharmony_ci u8 send2fw:1; 2308c2ecf20Sopenharmony_ci u8 ipv6:1; 2318c2ecf20Sopenharmony_ci u8 hash_type:2; 2328c2ecf20Sopenharmony_ci u8 filter_tid:1; 2338c2ecf20Sopenharmony_ci u8 filter_hit:1; 2348c2ecf20Sopenharmony_ci u8 channel:2; 2358c2ecf20Sopenharmony_ci#endif 2368c2ecf20Sopenharmony_ci __be16 qid; 2378c2ecf20Sopenharmony_ci __be32 hash_val; 2388c2ecf20Sopenharmony_ci}; 2398c2ecf20Sopenharmony_ci 2408c2ecf20Sopenharmony_cistruct work_request_hdr { 2418c2ecf20Sopenharmony_ci __be32 wr_hi; 2428c2ecf20Sopenharmony_ci __be32 wr_mid; 2438c2ecf20Sopenharmony_ci __be64 wr_lo; 2448c2ecf20Sopenharmony_ci}; 2458c2ecf20Sopenharmony_ci 2468c2ecf20Sopenharmony_ci/* wr_hi fields */ 2478c2ecf20Sopenharmony_ci#define WR_OP_S 24 2488c2ecf20Sopenharmony_ci#define WR_OP_V(x) ((__u64)(x) << WR_OP_S) 2498c2ecf20Sopenharmony_ci 2508c2ecf20Sopenharmony_ci#define WR_HDR struct work_request_hdr wr 2518c2ecf20Sopenharmony_ci 2528c2ecf20Sopenharmony_ci/* option 0 fields */ 2538c2ecf20Sopenharmony_ci#define TX_CHAN_S 2 2548c2ecf20Sopenharmony_ci#define TX_CHAN_V(x) ((x) << TX_CHAN_S) 2558c2ecf20Sopenharmony_ci 2568c2ecf20Sopenharmony_ci#define ULP_MODE_S 8 2578c2ecf20Sopenharmony_ci#define ULP_MODE_V(x) ((x) << ULP_MODE_S) 2588c2ecf20Sopenharmony_ci 2598c2ecf20Sopenharmony_ci#define RCV_BUFSIZ_S 12 2608c2ecf20Sopenharmony_ci#define RCV_BUFSIZ_M 0x3FFU 2618c2ecf20Sopenharmony_ci#define RCV_BUFSIZ_V(x) ((x) << RCV_BUFSIZ_S) 2628c2ecf20Sopenharmony_ci 2638c2ecf20Sopenharmony_ci#define SMAC_SEL_S 28 2648c2ecf20Sopenharmony_ci#define SMAC_SEL_V(x) ((__u64)(x) << SMAC_SEL_S) 2658c2ecf20Sopenharmony_ci 2668c2ecf20Sopenharmony_ci#define L2T_IDX_S 36 2678c2ecf20Sopenharmony_ci#define L2T_IDX_V(x) ((__u64)(x) << L2T_IDX_S) 2688c2ecf20Sopenharmony_ci 2698c2ecf20Sopenharmony_ci#define WND_SCALE_S 50 2708c2ecf20Sopenharmony_ci#define WND_SCALE_V(x) ((__u64)(x) << WND_SCALE_S) 2718c2ecf20Sopenharmony_ci 2728c2ecf20Sopenharmony_ci#define KEEP_ALIVE_S 54 2738c2ecf20Sopenharmony_ci#define KEEP_ALIVE_V(x) ((__u64)(x) << KEEP_ALIVE_S) 2748c2ecf20Sopenharmony_ci#define KEEP_ALIVE_F KEEP_ALIVE_V(1ULL) 2758c2ecf20Sopenharmony_ci 2768c2ecf20Sopenharmony_ci#define MSS_IDX_S 60 2778c2ecf20Sopenharmony_ci#define MSS_IDX_M 0xF 2788c2ecf20Sopenharmony_ci#define MSS_IDX_V(x) ((__u64)(x) << MSS_IDX_S) 2798c2ecf20Sopenharmony_ci#define MSS_IDX_G(x) (((x) >> MSS_IDX_S) & MSS_IDX_M) 2808c2ecf20Sopenharmony_ci 2818c2ecf20Sopenharmony_ci/* option 2 fields */ 2828c2ecf20Sopenharmony_ci#define RSS_QUEUE_S 0 2838c2ecf20Sopenharmony_ci#define RSS_QUEUE_M 0x3FF 2848c2ecf20Sopenharmony_ci#define RSS_QUEUE_V(x) ((x) << RSS_QUEUE_S) 2858c2ecf20Sopenharmony_ci#define RSS_QUEUE_G(x) (((x) >> RSS_QUEUE_S) & RSS_QUEUE_M) 2868c2ecf20Sopenharmony_ci 2878c2ecf20Sopenharmony_ci#define RSS_QUEUE_VALID_S 10 2888c2ecf20Sopenharmony_ci#define RSS_QUEUE_VALID_V(x) ((x) << RSS_QUEUE_VALID_S) 2898c2ecf20Sopenharmony_ci#define RSS_QUEUE_VALID_F RSS_QUEUE_VALID_V(1U) 2908c2ecf20Sopenharmony_ci 2918c2ecf20Sopenharmony_ci#define RX_FC_DISABLE_S 20 2928c2ecf20Sopenharmony_ci#define RX_FC_DISABLE_V(x) ((x) << RX_FC_DISABLE_S) 2938c2ecf20Sopenharmony_ci#define RX_FC_DISABLE_F RX_FC_DISABLE_V(1U) 2948c2ecf20Sopenharmony_ci 2958c2ecf20Sopenharmony_ci#define RX_FC_VALID_S 22 2968c2ecf20Sopenharmony_ci#define RX_FC_VALID_V(x) ((x) << RX_FC_VALID_S) 2978c2ecf20Sopenharmony_ci#define RX_FC_VALID_F RX_FC_VALID_V(1U) 2988c2ecf20Sopenharmony_ci 2998c2ecf20Sopenharmony_ci#define RX_CHANNEL_S 26 3008c2ecf20Sopenharmony_ci#define RX_CHANNEL_V(x) ((x) << RX_CHANNEL_S) 3018c2ecf20Sopenharmony_ci#define RX_CHANNEL_F RX_CHANNEL_V(1U) 3028c2ecf20Sopenharmony_ci 3038c2ecf20Sopenharmony_ci#define WND_SCALE_EN_S 28 3048c2ecf20Sopenharmony_ci#define WND_SCALE_EN_V(x) ((x) << WND_SCALE_EN_S) 3058c2ecf20Sopenharmony_ci#define WND_SCALE_EN_F WND_SCALE_EN_V(1U) 3068c2ecf20Sopenharmony_ci 3078c2ecf20Sopenharmony_ci#define T5_OPT_2_VALID_S 31 3088c2ecf20Sopenharmony_ci#define T5_OPT_2_VALID_V(x) ((x) << T5_OPT_2_VALID_S) 3098c2ecf20Sopenharmony_ci#define T5_OPT_2_VALID_F T5_OPT_2_VALID_V(1U) 3108c2ecf20Sopenharmony_ci 3118c2ecf20Sopenharmony_cistruct cpl_pass_open_req { 3128c2ecf20Sopenharmony_ci WR_HDR; 3138c2ecf20Sopenharmony_ci union opcode_tid ot; 3148c2ecf20Sopenharmony_ci __be16 local_port; 3158c2ecf20Sopenharmony_ci __be16 peer_port; 3168c2ecf20Sopenharmony_ci __be32 local_ip; 3178c2ecf20Sopenharmony_ci __be32 peer_ip; 3188c2ecf20Sopenharmony_ci __be64 opt0; 3198c2ecf20Sopenharmony_ci __be64 opt1; 3208c2ecf20Sopenharmony_ci}; 3218c2ecf20Sopenharmony_ci 3228c2ecf20Sopenharmony_ci/* option 0 fields */ 3238c2ecf20Sopenharmony_ci#define NO_CONG_S 4 3248c2ecf20Sopenharmony_ci#define NO_CONG_V(x) ((x) << NO_CONG_S) 3258c2ecf20Sopenharmony_ci#define NO_CONG_F NO_CONG_V(1U) 3268c2ecf20Sopenharmony_ci 3278c2ecf20Sopenharmony_ci#define DELACK_S 5 3288c2ecf20Sopenharmony_ci#define DELACK_V(x) ((x) << DELACK_S) 3298c2ecf20Sopenharmony_ci#define DELACK_F DELACK_V(1U) 3308c2ecf20Sopenharmony_ci 3318c2ecf20Sopenharmony_ci#define NON_OFFLOAD_S 7 3328c2ecf20Sopenharmony_ci#define NON_OFFLOAD_V(x) ((x) << NON_OFFLOAD_S) 3338c2ecf20Sopenharmony_ci#define NON_OFFLOAD_F NON_OFFLOAD_V(1U) 3348c2ecf20Sopenharmony_ci 3358c2ecf20Sopenharmony_ci#define DSCP_S 22 3368c2ecf20Sopenharmony_ci#define DSCP_M 0x3F 3378c2ecf20Sopenharmony_ci#define DSCP_V(x) ((x) << DSCP_S) 3388c2ecf20Sopenharmony_ci#define DSCP_G(x) (((x) >> DSCP_S) & DSCP_M) 3398c2ecf20Sopenharmony_ci 3408c2ecf20Sopenharmony_ci#define TCAM_BYPASS_S 48 3418c2ecf20Sopenharmony_ci#define TCAM_BYPASS_V(x) ((__u64)(x) << TCAM_BYPASS_S) 3428c2ecf20Sopenharmony_ci#define TCAM_BYPASS_F TCAM_BYPASS_V(1ULL) 3438c2ecf20Sopenharmony_ci 3448c2ecf20Sopenharmony_ci#define NAGLE_S 49 3458c2ecf20Sopenharmony_ci#define NAGLE_V(x) ((__u64)(x) << NAGLE_S) 3468c2ecf20Sopenharmony_ci#define NAGLE_F NAGLE_V(1ULL) 3478c2ecf20Sopenharmony_ci 3488c2ecf20Sopenharmony_ci/* option 1 fields */ 3498c2ecf20Sopenharmony_ci#define SYN_RSS_ENABLE_S 0 3508c2ecf20Sopenharmony_ci#define SYN_RSS_ENABLE_V(x) ((x) << SYN_RSS_ENABLE_S) 3518c2ecf20Sopenharmony_ci#define SYN_RSS_ENABLE_F SYN_RSS_ENABLE_V(1U) 3528c2ecf20Sopenharmony_ci 3538c2ecf20Sopenharmony_ci#define SYN_RSS_QUEUE_S 2 3548c2ecf20Sopenharmony_ci#define SYN_RSS_QUEUE_V(x) ((x) << SYN_RSS_QUEUE_S) 3558c2ecf20Sopenharmony_ci 3568c2ecf20Sopenharmony_ci#define CONN_POLICY_S 22 3578c2ecf20Sopenharmony_ci#define CONN_POLICY_V(x) ((x) << CONN_POLICY_S) 3588c2ecf20Sopenharmony_ci 3598c2ecf20Sopenharmony_cistruct cpl_pass_open_req6 { 3608c2ecf20Sopenharmony_ci WR_HDR; 3618c2ecf20Sopenharmony_ci union opcode_tid ot; 3628c2ecf20Sopenharmony_ci __be16 local_port; 3638c2ecf20Sopenharmony_ci __be16 peer_port; 3648c2ecf20Sopenharmony_ci __be64 local_ip_hi; 3658c2ecf20Sopenharmony_ci __be64 local_ip_lo; 3668c2ecf20Sopenharmony_ci __be64 peer_ip_hi; 3678c2ecf20Sopenharmony_ci __be64 peer_ip_lo; 3688c2ecf20Sopenharmony_ci __be64 opt0; 3698c2ecf20Sopenharmony_ci __be64 opt1; 3708c2ecf20Sopenharmony_ci}; 3718c2ecf20Sopenharmony_ci 3728c2ecf20Sopenharmony_cistruct cpl_pass_open_rpl { 3738c2ecf20Sopenharmony_ci union opcode_tid ot; 3748c2ecf20Sopenharmony_ci u8 rsvd[3]; 3758c2ecf20Sopenharmony_ci u8 status; 3768c2ecf20Sopenharmony_ci}; 3778c2ecf20Sopenharmony_ci 3788c2ecf20Sopenharmony_cistruct tcp_options { 3798c2ecf20Sopenharmony_ci __be16 mss; 3808c2ecf20Sopenharmony_ci __u8 wsf; 3818c2ecf20Sopenharmony_ci#if defined(__LITTLE_ENDIAN_BITFIELD) 3828c2ecf20Sopenharmony_ci __u8:4; 3838c2ecf20Sopenharmony_ci __u8 unknown:1; 3848c2ecf20Sopenharmony_ci __u8:1; 3858c2ecf20Sopenharmony_ci __u8 sack:1; 3868c2ecf20Sopenharmony_ci __u8 tstamp:1; 3878c2ecf20Sopenharmony_ci#else 3888c2ecf20Sopenharmony_ci __u8 tstamp:1; 3898c2ecf20Sopenharmony_ci __u8 sack:1; 3908c2ecf20Sopenharmony_ci __u8:1; 3918c2ecf20Sopenharmony_ci __u8 unknown:1; 3928c2ecf20Sopenharmony_ci __u8:4; 3938c2ecf20Sopenharmony_ci#endif 3948c2ecf20Sopenharmony_ci}; 3958c2ecf20Sopenharmony_ci 3968c2ecf20Sopenharmony_cistruct cpl_pass_accept_req { 3978c2ecf20Sopenharmony_ci union opcode_tid ot; 3988c2ecf20Sopenharmony_ci __be16 rsvd; 3998c2ecf20Sopenharmony_ci __be16 len; 4008c2ecf20Sopenharmony_ci __be32 hdr_len; 4018c2ecf20Sopenharmony_ci __be16 vlan; 4028c2ecf20Sopenharmony_ci __be16 l2info; 4038c2ecf20Sopenharmony_ci __be32 tos_stid; 4048c2ecf20Sopenharmony_ci struct tcp_options tcpopt; 4058c2ecf20Sopenharmony_ci}; 4068c2ecf20Sopenharmony_ci 4078c2ecf20Sopenharmony_ci/* cpl_pass_accept_req.hdr_len fields */ 4088c2ecf20Sopenharmony_ci#define SYN_RX_CHAN_S 0 4098c2ecf20Sopenharmony_ci#define SYN_RX_CHAN_M 0xF 4108c2ecf20Sopenharmony_ci#define SYN_RX_CHAN_V(x) ((x) << SYN_RX_CHAN_S) 4118c2ecf20Sopenharmony_ci#define SYN_RX_CHAN_G(x) (((x) >> SYN_RX_CHAN_S) & SYN_RX_CHAN_M) 4128c2ecf20Sopenharmony_ci 4138c2ecf20Sopenharmony_ci#define TCP_HDR_LEN_S 10 4148c2ecf20Sopenharmony_ci#define TCP_HDR_LEN_M 0x3F 4158c2ecf20Sopenharmony_ci#define TCP_HDR_LEN_V(x) ((x) << TCP_HDR_LEN_S) 4168c2ecf20Sopenharmony_ci#define TCP_HDR_LEN_G(x) (((x) >> TCP_HDR_LEN_S) & TCP_HDR_LEN_M) 4178c2ecf20Sopenharmony_ci 4188c2ecf20Sopenharmony_ci#define IP_HDR_LEN_S 16 4198c2ecf20Sopenharmony_ci#define IP_HDR_LEN_M 0x3FF 4208c2ecf20Sopenharmony_ci#define IP_HDR_LEN_V(x) ((x) << IP_HDR_LEN_S) 4218c2ecf20Sopenharmony_ci#define IP_HDR_LEN_G(x) (((x) >> IP_HDR_LEN_S) & IP_HDR_LEN_M) 4228c2ecf20Sopenharmony_ci 4238c2ecf20Sopenharmony_ci#define ETH_HDR_LEN_S 26 4248c2ecf20Sopenharmony_ci#define ETH_HDR_LEN_M 0x1F 4258c2ecf20Sopenharmony_ci#define ETH_HDR_LEN_V(x) ((x) << ETH_HDR_LEN_S) 4268c2ecf20Sopenharmony_ci#define ETH_HDR_LEN_G(x) (((x) >> ETH_HDR_LEN_S) & ETH_HDR_LEN_M) 4278c2ecf20Sopenharmony_ci 4288c2ecf20Sopenharmony_ci/* cpl_pass_accept_req.l2info fields */ 4298c2ecf20Sopenharmony_ci#define SYN_MAC_IDX_S 0 4308c2ecf20Sopenharmony_ci#define SYN_MAC_IDX_M 0x1FF 4318c2ecf20Sopenharmony_ci#define SYN_MAC_IDX_V(x) ((x) << SYN_MAC_IDX_S) 4328c2ecf20Sopenharmony_ci#define SYN_MAC_IDX_G(x) (((x) >> SYN_MAC_IDX_S) & SYN_MAC_IDX_M) 4338c2ecf20Sopenharmony_ci 4348c2ecf20Sopenharmony_ci#define SYN_XACT_MATCH_S 9 4358c2ecf20Sopenharmony_ci#define SYN_XACT_MATCH_V(x) ((x) << SYN_XACT_MATCH_S) 4368c2ecf20Sopenharmony_ci#define SYN_XACT_MATCH_F SYN_XACT_MATCH_V(1U) 4378c2ecf20Sopenharmony_ci 4388c2ecf20Sopenharmony_ci#define SYN_INTF_S 12 4398c2ecf20Sopenharmony_ci#define SYN_INTF_M 0xF 4408c2ecf20Sopenharmony_ci#define SYN_INTF_V(x) ((x) << SYN_INTF_S) 4418c2ecf20Sopenharmony_ci#define SYN_INTF_G(x) (((x) >> SYN_INTF_S) & SYN_INTF_M) 4428c2ecf20Sopenharmony_ci 4438c2ecf20Sopenharmony_cienum { /* TCP congestion control algorithms */ 4448c2ecf20Sopenharmony_ci CONG_ALG_RENO, 4458c2ecf20Sopenharmony_ci CONG_ALG_TAHOE, 4468c2ecf20Sopenharmony_ci CONG_ALG_NEWRENO, 4478c2ecf20Sopenharmony_ci CONG_ALG_HIGHSPEED 4488c2ecf20Sopenharmony_ci}; 4498c2ecf20Sopenharmony_ci 4508c2ecf20Sopenharmony_ci#define CONG_CNTRL_S 14 4518c2ecf20Sopenharmony_ci#define CONG_CNTRL_M 0x3 4528c2ecf20Sopenharmony_ci#define CONG_CNTRL_V(x) ((x) << CONG_CNTRL_S) 4538c2ecf20Sopenharmony_ci#define CONG_CNTRL_G(x) (((x) >> CONG_CNTRL_S) & CONG_CNTRL_M) 4548c2ecf20Sopenharmony_ci 4558c2ecf20Sopenharmony_ci#define T5_ISS_S 18 4568c2ecf20Sopenharmony_ci#define T5_ISS_V(x) ((x) << T5_ISS_S) 4578c2ecf20Sopenharmony_ci#define T5_ISS_F T5_ISS_V(1U) 4588c2ecf20Sopenharmony_ci 4598c2ecf20Sopenharmony_cistruct cpl_pass_accept_rpl { 4608c2ecf20Sopenharmony_ci WR_HDR; 4618c2ecf20Sopenharmony_ci union opcode_tid ot; 4628c2ecf20Sopenharmony_ci __be32 opt2; 4638c2ecf20Sopenharmony_ci __be64 opt0; 4648c2ecf20Sopenharmony_ci}; 4658c2ecf20Sopenharmony_ci 4668c2ecf20Sopenharmony_ci/* option 2 fields */ 4678c2ecf20Sopenharmony_ci#define RX_COALESCE_VALID_S 11 4688c2ecf20Sopenharmony_ci#define RX_COALESCE_VALID_V(x) ((x) << RX_COALESCE_VALID_S) 4698c2ecf20Sopenharmony_ci#define RX_COALESCE_VALID_F RX_COALESCE_VALID_V(1U) 4708c2ecf20Sopenharmony_ci 4718c2ecf20Sopenharmony_ci#define RX_COALESCE_S 12 4728c2ecf20Sopenharmony_ci#define RX_COALESCE_V(x) ((x) << RX_COALESCE_S) 4738c2ecf20Sopenharmony_ci 4748c2ecf20Sopenharmony_ci#define PACE_S 16 4758c2ecf20Sopenharmony_ci#define PACE_V(x) ((x) << PACE_S) 4768c2ecf20Sopenharmony_ci 4778c2ecf20Sopenharmony_ci#define TX_QUEUE_S 23 4788c2ecf20Sopenharmony_ci#define TX_QUEUE_M 0x7 4798c2ecf20Sopenharmony_ci#define TX_QUEUE_V(x) ((x) << TX_QUEUE_S) 4808c2ecf20Sopenharmony_ci#define TX_QUEUE_G(x) (((x) >> TX_QUEUE_S) & TX_QUEUE_M) 4818c2ecf20Sopenharmony_ci 4828c2ecf20Sopenharmony_ci#define CCTRL_ECN_S 27 4838c2ecf20Sopenharmony_ci#define CCTRL_ECN_V(x) ((x) << CCTRL_ECN_S) 4848c2ecf20Sopenharmony_ci#define CCTRL_ECN_F CCTRL_ECN_V(1U) 4858c2ecf20Sopenharmony_ci 4868c2ecf20Sopenharmony_ci#define TSTAMPS_EN_S 29 4878c2ecf20Sopenharmony_ci#define TSTAMPS_EN_V(x) ((x) << TSTAMPS_EN_S) 4888c2ecf20Sopenharmony_ci#define TSTAMPS_EN_F TSTAMPS_EN_V(1U) 4898c2ecf20Sopenharmony_ci 4908c2ecf20Sopenharmony_ci#define SACK_EN_S 30 4918c2ecf20Sopenharmony_ci#define SACK_EN_V(x) ((x) << SACK_EN_S) 4928c2ecf20Sopenharmony_ci#define SACK_EN_F SACK_EN_V(1U) 4938c2ecf20Sopenharmony_ci 4948c2ecf20Sopenharmony_cistruct cpl_t5_pass_accept_rpl { 4958c2ecf20Sopenharmony_ci WR_HDR; 4968c2ecf20Sopenharmony_ci union opcode_tid ot; 4978c2ecf20Sopenharmony_ci __be32 opt2; 4988c2ecf20Sopenharmony_ci __be64 opt0; 4998c2ecf20Sopenharmony_ci __be32 iss; 5008c2ecf20Sopenharmony_ci __be32 rsvd; 5018c2ecf20Sopenharmony_ci}; 5028c2ecf20Sopenharmony_ci 5038c2ecf20Sopenharmony_cistruct cpl_act_open_req { 5048c2ecf20Sopenharmony_ci WR_HDR; 5058c2ecf20Sopenharmony_ci union opcode_tid ot; 5068c2ecf20Sopenharmony_ci __be16 local_port; 5078c2ecf20Sopenharmony_ci __be16 peer_port; 5088c2ecf20Sopenharmony_ci __be32 local_ip; 5098c2ecf20Sopenharmony_ci __be32 peer_ip; 5108c2ecf20Sopenharmony_ci __be64 opt0; 5118c2ecf20Sopenharmony_ci __be32 params; 5128c2ecf20Sopenharmony_ci __be32 opt2; 5138c2ecf20Sopenharmony_ci}; 5148c2ecf20Sopenharmony_ci 5158c2ecf20Sopenharmony_ci#define FILTER_TUPLE_S 24 5168c2ecf20Sopenharmony_ci#define FILTER_TUPLE_M 0xFFFFFFFFFF 5178c2ecf20Sopenharmony_ci#define FILTER_TUPLE_V(x) ((x) << FILTER_TUPLE_S) 5188c2ecf20Sopenharmony_ci#define FILTER_TUPLE_G(x) (((x) >> FILTER_TUPLE_S) & FILTER_TUPLE_M) 5198c2ecf20Sopenharmony_cistruct cpl_t5_act_open_req { 5208c2ecf20Sopenharmony_ci WR_HDR; 5218c2ecf20Sopenharmony_ci union opcode_tid ot; 5228c2ecf20Sopenharmony_ci __be16 local_port; 5238c2ecf20Sopenharmony_ci __be16 peer_port; 5248c2ecf20Sopenharmony_ci __be32 local_ip; 5258c2ecf20Sopenharmony_ci __be32 peer_ip; 5268c2ecf20Sopenharmony_ci __be64 opt0; 5278c2ecf20Sopenharmony_ci __be32 rsvd; 5288c2ecf20Sopenharmony_ci __be32 opt2; 5298c2ecf20Sopenharmony_ci __be64 params; 5308c2ecf20Sopenharmony_ci}; 5318c2ecf20Sopenharmony_ci 5328c2ecf20Sopenharmony_cistruct cpl_t6_act_open_req { 5338c2ecf20Sopenharmony_ci WR_HDR; 5348c2ecf20Sopenharmony_ci union opcode_tid ot; 5358c2ecf20Sopenharmony_ci __be16 local_port; 5368c2ecf20Sopenharmony_ci __be16 peer_port; 5378c2ecf20Sopenharmony_ci __be32 local_ip; 5388c2ecf20Sopenharmony_ci __be32 peer_ip; 5398c2ecf20Sopenharmony_ci __be64 opt0; 5408c2ecf20Sopenharmony_ci __be32 rsvd; 5418c2ecf20Sopenharmony_ci __be32 opt2; 5428c2ecf20Sopenharmony_ci __be64 params; 5438c2ecf20Sopenharmony_ci __be32 rsvd2; 5448c2ecf20Sopenharmony_ci __be32 opt3; 5458c2ecf20Sopenharmony_ci}; 5468c2ecf20Sopenharmony_ci 5478c2ecf20Sopenharmony_cistruct cpl_act_open_req6 { 5488c2ecf20Sopenharmony_ci WR_HDR; 5498c2ecf20Sopenharmony_ci union opcode_tid ot; 5508c2ecf20Sopenharmony_ci __be16 local_port; 5518c2ecf20Sopenharmony_ci __be16 peer_port; 5528c2ecf20Sopenharmony_ci __be64 local_ip_hi; 5538c2ecf20Sopenharmony_ci __be64 local_ip_lo; 5548c2ecf20Sopenharmony_ci __be64 peer_ip_hi; 5558c2ecf20Sopenharmony_ci __be64 peer_ip_lo; 5568c2ecf20Sopenharmony_ci __be64 opt0; 5578c2ecf20Sopenharmony_ci __be32 params; 5588c2ecf20Sopenharmony_ci __be32 opt2; 5598c2ecf20Sopenharmony_ci}; 5608c2ecf20Sopenharmony_ci 5618c2ecf20Sopenharmony_cistruct cpl_t5_act_open_req6 { 5628c2ecf20Sopenharmony_ci WR_HDR; 5638c2ecf20Sopenharmony_ci union opcode_tid ot; 5648c2ecf20Sopenharmony_ci __be16 local_port; 5658c2ecf20Sopenharmony_ci __be16 peer_port; 5668c2ecf20Sopenharmony_ci __be64 local_ip_hi; 5678c2ecf20Sopenharmony_ci __be64 local_ip_lo; 5688c2ecf20Sopenharmony_ci __be64 peer_ip_hi; 5698c2ecf20Sopenharmony_ci __be64 peer_ip_lo; 5708c2ecf20Sopenharmony_ci __be64 opt0; 5718c2ecf20Sopenharmony_ci __be32 rsvd; 5728c2ecf20Sopenharmony_ci __be32 opt2; 5738c2ecf20Sopenharmony_ci __be64 params; 5748c2ecf20Sopenharmony_ci}; 5758c2ecf20Sopenharmony_ci 5768c2ecf20Sopenharmony_cistruct cpl_t6_act_open_req6 { 5778c2ecf20Sopenharmony_ci WR_HDR; 5788c2ecf20Sopenharmony_ci union opcode_tid ot; 5798c2ecf20Sopenharmony_ci __be16 local_port; 5808c2ecf20Sopenharmony_ci __be16 peer_port; 5818c2ecf20Sopenharmony_ci __be64 local_ip_hi; 5828c2ecf20Sopenharmony_ci __be64 local_ip_lo; 5838c2ecf20Sopenharmony_ci __be64 peer_ip_hi; 5848c2ecf20Sopenharmony_ci __be64 peer_ip_lo; 5858c2ecf20Sopenharmony_ci __be64 opt0; 5868c2ecf20Sopenharmony_ci __be32 rsvd; 5878c2ecf20Sopenharmony_ci __be32 opt2; 5888c2ecf20Sopenharmony_ci __be64 params; 5898c2ecf20Sopenharmony_ci __be32 rsvd2; 5908c2ecf20Sopenharmony_ci __be32 opt3; 5918c2ecf20Sopenharmony_ci}; 5928c2ecf20Sopenharmony_ci 5938c2ecf20Sopenharmony_cistruct cpl_act_open_rpl { 5948c2ecf20Sopenharmony_ci union opcode_tid ot; 5958c2ecf20Sopenharmony_ci __be32 atid_status; 5968c2ecf20Sopenharmony_ci}; 5978c2ecf20Sopenharmony_ci 5988c2ecf20Sopenharmony_ci/* cpl_act_open_rpl.atid_status fields */ 5998c2ecf20Sopenharmony_ci#define AOPEN_STATUS_S 0 6008c2ecf20Sopenharmony_ci#define AOPEN_STATUS_M 0xFF 6018c2ecf20Sopenharmony_ci#define AOPEN_STATUS_G(x) (((x) >> AOPEN_STATUS_S) & AOPEN_STATUS_M) 6028c2ecf20Sopenharmony_ci 6038c2ecf20Sopenharmony_ci#define AOPEN_ATID_S 8 6048c2ecf20Sopenharmony_ci#define AOPEN_ATID_M 0xFFFFFF 6058c2ecf20Sopenharmony_ci#define AOPEN_ATID_G(x) (((x) >> AOPEN_ATID_S) & AOPEN_ATID_M) 6068c2ecf20Sopenharmony_ci 6078c2ecf20Sopenharmony_cistruct cpl_pass_establish { 6088c2ecf20Sopenharmony_ci union opcode_tid ot; 6098c2ecf20Sopenharmony_ci __be32 rsvd; 6108c2ecf20Sopenharmony_ci __be32 tos_stid; 6118c2ecf20Sopenharmony_ci __be16 mac_idx; 6128c2ecf20Sopenharmony_ci __be16 tcp_opt; 6138c2ecf20Sopenharmony_ci __be32 snd_isn; 6148c2ecf20Sopenharmony_ci __be32 rcv_isn; 6158c2ecf20Sopenharmony_ci}; 6168c2ecf20Sopenharmony_ci 6178c2ecf20Sopenharmony_ci/* cpl_pass_establish.tos_stid fields */ 6188c2ecf20Sopenharmony_ci#define PASS_OPEN_TID_S 0 6198c2ecf20Sopenharmony_ci#define PASS_OPEN_TID_M 0xFFFFFF 6208c2ecf20Sopenharmony_ci#define PASS_OPEN_TID_V(x) ((x) << PASS_OPEN_TID_S) 6218c2ecf20Sopenharmony_ci#define PASS_OPEN_TID_G(x) (((x) >> PASS_OPEN_TID_S) & PASS_OPEN_TID_M) 6228c2ecf20Sopenharmony_ci 6238c2ecf20Sopenharmony_ci#define PASS_OPEN_TOS_S 24 6248c2ecf20Sopenharmony_ci#define PASS_OPEN_TOS_M 0xFF 6258c2ecf20Sopenharmony_ci#define PASS_OPEN_TOS_V(x) ((x) << PASS_OPEN_TOS_S) 6268c2ecf20Sopenharmony_ci#define PASS_OPEN_TOS_G(x) (((x) >> PASS_OPEN_TOS_S) & PASS_OPEN_TOS_M) 6278c2ecf20Sopenharmony_ci 6288c2ecf20Sopenharmony_ci/* cpl_pass_establish.tcp_opt fields (also applies to act_open_establish) */ 6298c2ecf20Sopenharmony_ci#define TCPOPT_WSCALE_OK_S 5 6308c2ecf20Sopenharmony_ci#define TCPOPT_WSCALE_OK_M 0x1 6318c2ecf20Sopenharmony_ci#define TCPOPT_WSCALE_OK_G(x) \ 6328c2ecf20Sopenharmony_ci (((x) >> TCPOPT_WSCALE_OK_S) & TCPOPT_WSCALE_OK_M) 6338c2ecf20Sopenharmony_ci 6348c2ecf20Sopenharmony_ci#define TCPOPT_SACK_S 6 6358c2ecf20Sopenharmony_ci#define TCPOPT_SACK_M 0x1 6368c2ecf20Sopenharmony_ci#define TCPOPT_SACK_G(x) (((x) >> TCPOPT_SACK_S) & TCPOPT_SACK_M) 6378c2ecf20Sopenharmony_ci 6388c2ecf20Sopenharmony_ci#define TCPOPT_TSTAMP_S 7 6398c2ecf20Sopenharmony_ci#define TCPOPT_TSTAMP_M 0x1 6408c2ecf20Sopenharmony_ci#define TCPOPT_TSTAMP_G(x) (((x) >> TCPOPT_TSTAMP_S) & TCPOPT_TSTAMP_M) 6418c2ecf20Sopenharmony_ci 6428c2ecf20Sopenharmony_ci#define TCPOPT_SND_WSCALE_S 8 6438c2ecf20Sopenharmony_ci#define TCPOPT_SND_WSCALE_M 0xF 6448c2ecf20Sopenharmony_ci#define TCPOPT_SND_WSCALE_G(x) \ 6458c2ecf20Sopenharmony_ci (((x) >> TCPOPT_SND_WSCALE_S) & TCPOPT_SND_WSCALE_M) 6468c2ecf20Sopenharmony_ci 6478c2ecf20Sopenharmony_ci#define TCPOPT_MSS_S 12 6488c2ecf20Sopenharmony_ci#define TCPOPT_MSS_M 0xF 6498c2ecf20Sopenharmony_ci#define TCPOPT_MSS_G(x) (((x) >> TCPOPT_MSS_S) & TCPOPT_MSS_M) 6508c2ecf20Sopenharmony_ci 6518c2ecf20Sopenharmony_ci#define T6_TCP_HDR_LEN_S 8 6528c2ecf20Sopenharmony_ci#define T6_TCP_HDR_LEN_V(x) ((x) << T6_TCP_HDR_LEN_S) 6538c2ecf20Sopenharmony_ci#define T6_TCP_HDR_LEN_G(x) (((x) >> T6_TCP_HDR_LEN_S) & TCP_HDR_LEN_M) 6548c2ecf20Sopenharmony_ci 6558c2ecf20Sopenharmony_ci#define T6_IP_HDR_LEN_S 14 6568c2ecf20Sopenharmony_ci#define T6_IP_HDR_LEN_V(x) ((x) << T6_IP_HDR_LEN_S) 6578c2ecf20Sopenharmony_ci#define T6_IP_HDR_LEN_G(x) (((x) >> T6_IP_HDR_LEN_S) & IP_HDR_LEN_M) 6588c2ecf20Sopenharmony_ci 6598c2ecf20Sopenharmony_ci#define T6_ETH_HDR_LEN_S 24 6608c2ecf20Sopenharmony_ci#define T6_ETH_HDR_LEN_M 0xFF 6618c2ecf20Sopenharmony_ci#define T6_ETH_HDR_LEN_V(x) ((x) << T6_ETH_HDR_LEN_S) 6628c2ecf20Sopenharmony_ci#define T6_ETH_HDR_LEN_G(x) (((x) >> T6_ETH_HDR_LEN_S) & T6_ETH_HDR_LEN_M) 6638c2ecf20Sopenharmony_ci 6648c2ecf20Sopenharmony_cistruct cpl_act_establish { 6658c2ecf20Sopenharmony_ci union opcode_tid ot; 6668c2ecf20Sopenharmony_ci __be32 rsvd; 6678c2ecf20Sopenharmony_ci __be32 tos_atid; 6688c2ecf20Sopenharmony_ci __be16 mac_idx; 6698c2ecf20Sopenharmony_ci __be16 tcp_opt; 6708c2ecf20Sopenharmony_ci __be32 snd_isn; 6718c2ecf20Sopenharmony_ci __be32 rcv_isn; 6728c2ecf20Sopenharmony_ci}; 6738c2ecf20Sopenharmony_ci 6748c2ecf20Sopenharmony_cistruct cpl_get_tcb { 6758c2ecf20Sopenharmony_ci WR_HDR; 6768c2ecf20Sopenharmony_ci union opcode_tid ot; 6778c2ecf20Sopenharmony_ci __be16 reply_ctrl; 6788c2ecf20Sopenharmony_ci __be16 cookie; 6798c2ecf20Sopenharmony_ci}; 6808c2ecf20Sopenharmony_ci 6818c2ecf20Sopenharmony_ci/* cpl_get_tcb.reply_ctrl fields */ 6828c2ecf20Sopenharmony_ci#define QUEUENO_S 0 6838c2ecf20Sopenharmony_ci#define QUEUENO_V(x) ((x) << QUEUENO_S) 6848c2ecf20Sopenharmony_ci 6858c2ecf20Sopenharmony_ci#define REPLY_CHAN_S 14 6868c2ecf20Sopenharmony_ci#define REPLY_CHAN_V(x) ((x) << REPLY_CHAN_S) 6878c2ecf20Sopenharmony_ci#define REPLY_CHAN_F REPLY_CHAN_V(1U) 6888c2ecf20Sopenharmony_ci 6898c2ecf20Sopenharmony_ci#define NO_REPLY_S 15 6908c2ecf20Sopenharmony_ci#define NO_REPLY_V(x) ((x) << NO_REPLY_S) 6918c2ecf20Sopenharmony_ci#define NO_REPLY_F NO_REPLY_V(1U) 6928c2ecf20Sopenharmony_ci 6938c2ecf20Sopenharmony_cistruct cpl_get_tcb_rpl { 6948c2ecf20Sopenharmony_ci union opcode_tid ot; 6958c2ecf20Sopenharmony_ci __u8 cookie; 6968c2ecf20Sopenharmony_ci __u8 status; 6978c2ecf20Sopenharmony_ci __be16 len; 6988c2ecf20Sopenharmony_ci}; 6998c2ecf20Sopenharmony_ci 7008c2ecf20Sopenharmony_cistruct cpl_set_tcb_field { 7018c2ecf20Sopenharmony_ci WR_HDR; 7028c2ecf20Sopenharmony_ci union opcode_tid ot; 7038c2ecf20Sopenharmony_ci __be16 reply_ctrl; 7048c2ecf20Sopenharmony_ci __be16 word_cookie; 7058c2ecf20Sopenharmony_ci __be64 mask; 7068c2ecf20Sopenharmony_ci __be64 val; 7078c2ecf20Sopenharmony_ci}; 7088c2ecf20Sopenharmony_ci 7098c2ecf20Sopenharmony_cistruct cpl_set_tcb_field_core { 7108c2ecf20Sopenharmony_ci union opcode_tid ot; 7118c2ecf20Sopenharmony_ci __be16 reply_ctrl; 7128c2ecf20Sopenharmony_ci __be16 word_cookie; 7138c2ecf20Sopenharmony_ci __be64 mask; 7148c2ecf20Sopenharmony_ci __be64 val; 7158c2ecf20Sopenharmony_ci}; 7168c2ecf20Sopenharmony_ci 7178c2ecf20Sopenharmony_ci/* cpl_set_tcb_field.word_cookie fields */ 7188c2ecf20Sopenharmony_ci#define TCB_WORD_S 0 7198c2ecf20Sopenharmony_ci#define TCB_WORD_V(x) ((x) << TCB_WORD_S) 7208c2ecf20Sopenharmony_ci 7218c2ecf20Sopenharmony_ci#define TCB_COOKIE_S 5 7228c2ecf20Sopenharmony_ci#define TCB_COOKIE_M 0x7 7238c2ecf20Sopenharmony_ci#define TCB_COOKIE_V(x) ((x) << TCB_COOKIE_S) 7248c2ecf20Sopenharmony_ci#define TCB_COOKIE_G(x) (((x) >> TCB_COOKIE_S) & TCB_COOKIE_M) 7258c2ecf20Sopenharmony_ci 7268c2ecf20Sopenharmony_cistruct cpl_set_tcb_rpl { 7278c2ecf20Sopenharmony_ci union opcode_tid ot; 7288c2ecf20Sopenharmony_ci __be16 rsvd; 7298c2ecf20Sopenharmony_ci u8 cookie; 7308c2ecf20Sopenharmony_ci u8 status; 7318c2ecf20Sopenharmony_ci __be64 oldval; 7328c2ecf20Sopenharmony_ci}; 7338c2ecf20Sopenharmony_ci 7348c2ecf20Sopenharmony_cistruct cpl_close_con_req { 7358c2ecf20Sopenharmony_ci WR_HDR; 7368c2ecf20Sopenharmony_ci union opcode_tid ot; 7378c2ecf20Sopenharmony_ci __be32 rsvd; 7388c2ecf20Sopenharmony_ci}; 7398c2ecf20Sopenharmony_ci 7408c2ecf20Sopenharmony_cistruct cpl_close_con_rpl { 7418c2ecf20Sopenharmony_ci union opcode_tid ot; 7428c2ecf20Sopenharmony_ci u8 rsvd[3]; 7438c2ecf20Sopenharmony_ci u8 status; 7448c2ecf20Sopenharmony_ci __be32 snd_nxt; 7458c2ecf20Sopenharmony_ci __be32 rcv_nxt; 7468c2ecf20Sopenharmony_ci}; 7478c2ecf20Sopenharmony_ci 7488c2ecf20Sopenharmony_cistruct cpl_close_listsvr_req { 7498c2ecf20Sopenharmony_ci WR_HDR; 7508c2ecf20Sopenharmony_ci union opcode_tid ot; 7518c2ecf20Sopenharmony_ci __be16 reply_ctrl; 7528c2ecf20Sopenharmony_ci __be16 rsvd; 7538c2ecf20Sopenharmony_ci}; 7548c2ecf20Sopenharmony_ci 7558c2ecf20Sopenharmony_ci/* additional cpl_close_listsvr_req.reply_ctrl field */ 7568c2ecf20Sopenharmony_ci#define LISTSVR_IPV6_S 14 7578c2ecf20Sopenharmony_ci#define LISTSVR_IPV6_V(x) ((x) << LISTSVR_IPV6_S) 7588c2ecf20Sopenharmony_ci#define LISTSVR_IPV6_F LISTSVR_IPV6_V(1U) 7598c2ecf20Sopenharmony_ci 7608c2ecf20Sopenharmony_cistruct cpl_close_listsvr_rpl { 7618c2ecf20Sopenharmony_ci union opcode_tid ot; 7628c2ecf20Sopenharmony_ci u8 rsvd[3]; 7638c2ecf20Sopenharmony_ci u8 status; 7648c2ecf20Sopenharmony_ci}; 7658c2ecf20Sopenharmony_ci 7668c2ecf20Sopenharmony_cistruct cpl_abort_req_rss { 7678c2ecf20Sopenharmony_ci union opcode_tid ot; 7688c2ecf20Sopenharmony_ci u8 rsvd[3]; 7698c2ecf20Sopenharmony_ci u8 status; 7708c2ecf20Sopenharmony_ci}; 7718c2ecf20Sopenharmony_ci 7728c2ecf20Sopenharmony_cistruct cpl_abort_req_rss6 { 7738c2ecf20Sopenharmony_ci union opcode_tid ot; 7748c2ecf20Sopenharmony_ci __be32 srqidx_status; 7758c2ecf20Sopenharmony_ci}; 7768c2ecf20Sopenharmony_ci 7778c2ecf20Sopenharmony_ci#define ABORT_RSS_STATUS_S 0 7788c2ecf20Sopenharmony_ci#define ABORT_RSS_STATUS_M 0xff 7798c2ecf20Sopenharmony_ci#define ABORT_RSS_STATUS_V(x) ((x) << ABORT_RSS_STATUS_S) 7808c2ecf20Sopenharmony_ci#define ABORT_RSS_STATUS_G(x) (((x) >> ABORT_RSS_STATUS_S) & ABORT_RSS_STATUS_M) 7818c2ecf20Sopenharmony_ci 7828c2ecf20Sopenharmony_ci#define ABORT_RSS_SRQIDX_S 8 7838c2ecf20Sopenharmony_ci#define ABORT_RSS_SRQIDX_M 0xffffff 7848c2ecf20Sopenharmony_ci#define ABORT_RSS_SRQIDX_V(x) ((x) << ABORT_RSS_SRQIDX_S) 7858c2ecf20Sopenharmony_ci#define ABORT_RSS_SRQIDX_G(x) (((x) >> ABORT_RSS_SRQIDX_S) & ABORT_RSS_SRQIDX_M) 7868c2ecf20Sopenharmony_ci 7878c2ecf20Sopenharmony_cistruct cpl_abort_req { 7888c2ecf20Sopenharmony_ci WR_HDR; 7898c2ecf20Sopenharmony_ci union opcode_tid ot; 7908c2ecf20Sopenharmony_ci __be32 rsvd0; 7918c2ecf20Sopenharmony_ci u8 rsvd1; 7928c2ecf20Sopenharmony_ci u8 cmd; 7938c2ecf20Sopenharmony_ci u8 rsvd2[6]; 7948c2ecf20Sopenharmony_ci}; 7958c2ecf20Sopenharmony_ci 7968c2ecf20Sopenharmony_cistruct cpl_abort_rpl_rss { 7978c2ecf20Sopenharmony_ci union opcode_tid ot; 7988c2ecf20Sopenharmony_ci u8 rsvd[3]; 7998c2ecf20Sopenharmony_ci u8 status; 8008c2ecf20Sopenharmony_ci}; 8018c2ecf20Sopenharmony_ci 8028c2ecf20Sopenharmony_cistruct cpl_abort_rpl_rss6 { 8038c2ecf20Sopenharmony_ci union opcode_tid ot; 8048c2ecf20Sopenharmony_ci __be32 srqidx_status; 8058c2ecf20Sopenharmony_ci}; 8068c2ecf20Sopenharmony_ci 8078c2ecf20Sopenharmony_cistruct cpl_abort_rpl { 8088c2ecf20Sopenharmony_ci WR_HDR; 8098c2ecf20Sopenharmony_ci union opcode_tid ot; 8108c2ecf20Sopenharmony_ci __be32 rsvd0; 8118c2ecf20Sopenharmony_ci u8 rsvd1; 8128c2ecf20Sopenharmony_ci u8 cmd; 8138c2ecf20Sopenharmony_ci u8 rsvd2[6]; 8148c2ecf20Sopenharmony_ci}; 8158c2ecf20Sopenharmony_ci 8168c2ecf20Sopenharmony_cistruct cpl_peer_close { 8178c2ecf20Sopenharmony_ci union opcode_tid ot; 8188c2ecf20Sopenharmony_ci __be32 rcv_nxt; 8198c2ecf20Sopenharmony_ci}; 8208c2ecf20Sopenharmony_ci 8218c2ecf20Sopenharmony_cistruct cpl_tid_release { 8228c2ecf20Sopenharmony_ci WR_HDR; 8238c2ecf20Sopenharmony_ci union opcode_tid ot; 8248c2ecf20Sopenharmony_ci __be32 rsvd; 8258c2ecf20Sopenharmony_ci}; 8268c2ecf20Sopenharmony_ci 8278c2ecf20Sopenharmony_cistruct cpl_tx_pkt_core { 8288c2ecf20Sopenharmony_ci __be32 ctrl0; 8298c2ecf20Sopenharmony_ci __be16 pack; 8308c2ecf20Sopenharmony_ci __be16 len; 8318c2ecf20Sopenharmony_ci __be64 ctrl1; 8328c2ecf20Sopenharmony_ci}; 8338c2ecf20Sopenharmony_ci 8348c2ecf20Sopenharmony_cistruct cpl_tx_pkt { 8358c2ecf20Sopenharmony_ci WR_HDR; 8368c2ecf20Sopenharmony_ci struct cpl_tx_pkt_core c; 8378c2ecf20Sopenharmony_ci}; 8388c2ecf20Sopenharmony_ci 8398c2ecf20Sopenharmony_ci#define cpl_tx_pkt_xt cpl_tx_pkt 8408c2ecf20Sopenharmony_ci 8418c2ecf20Sopenharmony_ci/* cpl_tx_pkt_core.ctrl0 fields */ 8428c2ecf20Sopenharmony_ci#define TXPKT_VF_S 0 8438c2ecf20Sopenharmony_ci#define TXPKT_VF_V(x) ((x) << TXPKT_VF_S) 8448c2ecf20Sopenharmony_ci 8458c2ecf20Sopenharmony_ci#define TXPKT_PF_S 8 8468c2ecf20Sopenharmony_ci#define TXPKT_PF_V(x) ((x) << TXPKT_PF_S) 8478c2ecf20Sopenharmony_ci 8488c2ecf20Sopenharmony_ci#define TXPKT_VF_VLD_S 11 8498c2ecf20Sopenharmony_ci#define TXPKT_VF_VLD_V(x) ((x) << TXPKT_VF_VLD_S) 8508c2ecf20Sopenharmony_ci#define TXPKT_VF_VLD_F TXPKT_VF_VLD_V(1U) 8518c2ecf20Sopenharmony_ci 8528c2ecf20Sopenharmony_ci#define TXPKT_OVLAN_IDX_S 12 8538c2ecf20Sopenharmony_ci#define TXPKT_OVLAN_IDX_V(x) ((x) << TXPKT_OVLAN_IDX_S) 8548c2ecf20Sopenharmony_ci 8558c2ecf20Sopenharmony_ci#define TXPKT_T5_OVLAN_IDX_S 12 8568c2ecf20Sopenharmony_ci#define TXPKT_T5_OVLAN_IDX_V(x) ((x) << TXPKT_T5_OVLAN_IDX_S) 8578c2ecf20Sopenharmony_ci 8588c2ecf20Sopenharmony_ci#define TXPKT_INTF_S 16 8598c2ecf20Sopenharmony_ci#define TXPKT_INTF_V(x) ((x) << TXPKT_INTF_S) 8608c2ecf20Sopenharmony_ci 8618c2ecf20Sopenharmony_ci#define TXPKT_INS_OVLAN_S 21 8628c2ecf20Sopenharmony_ci#define TXPKT_INS_OVLAN_V(x) ((x) << TXPKT_INS_OVLAN_S) 8638c2ecf20Sopenharmony_ci#define TXPKT_INS_OVLAN_F TXPKT_INS_OVLAN_V(1U) 8648c2ecf20Sopenharmony_ci 8658c2ecf20Sopenharmony_ci#define TXPKT_TSTAMP_S 23 8668c2ecf20Sopenharmony_ci#define TXPKT_TSTAMP_V(x) ((x) << TXPKT_TSTAMP_S) 8678c2ecf20Sopenharmony_ci#define TXPKT_TSTAMP_F TXPKT_TSTAMP_V(1ULL) 8688c2ecf20Sopenharmony_ci 8698c2ecf20Sopenharmony_ci#define TXPKT_OPCODE_S 24 8708c2ecf20Sopenharmony_ci#define TXPKT_OPCODE_V(x) ((x) << TXPKT_OPCODE_S) 8718c2ecf20Sopenharmony_ci 8728c2ecf20Sopenharmony_ci/* cpl_tx_pkt_core.ctrl1 fields */ 8738c2ecf20Sopenharmony_ci#define TXPKT_CSUM_END_S 12 8748c2ecf20Sopenharmony_ci#define TXPKT_CSUM_END_V(x) ((x) << TXPKT_CSUM_END_S) 8758c2ecf20Sopenharmony_ci 8768c2ecf20Sopenharmony_ci#define TXPKT_CSUM_START_S 20 8778c2ecf20Sopenharmony_ci#define TXPKT_CSUM_START_V(x) ((x) << TXPKT_CSUM_START_S) 8788c2ecf20Sopenharmony_ci 8798c2ecf20Sopenharmony_ci#define TXPKT_IPHDR_LEN_S 20 8808c2ecf20Sopenharmony_ci#define TXPKT_IPHDR_LEN_V(x) ((__u64)(x) << TXPKT_IPHDR_LEN_S) 8818c2ecf20Sopenharmony_ci 8828c2ecf20Sopenharmony_ci#define TXPKT_CSUM_LOC_S 30 8838c2ecf20Sopenharmony_ci#define TXPKT_CSUM_LOC_V(x) ((__u64)(x) << TXPKT_CSUM_LOC_S) 8848c2ecf20Sopenharmony_ci 8858c2ecf20Sopenharmony_ci#define TXPKT_ETHHDR_LEN_S 34 8868c2ecf20Sopenharmony_ci#define TXPKT_ETHHDR_LEN_V(x) ((__u64)(x) << TXPKT_ETHHDR_LEN_S) 8878c2ecf20Sopenharmony_ci 8888c2ecf20Sopenharmony_ci#define T6_TXPKT_ETHHDR_LEN_S 32 8898c2ecf20Sopenharmony_ci#define T6_TXPKT_ETHHDR_LEN_V(x) ((__u64)(x) << T6_TXPKT_ETHHDR_LEN_S) 8908c2ecf20Sopenharmony_ci 8918c2ecf20Sopenharmony_ci#define TXPKT_CSUM_TYPE_S 40 8928c2ecf20Sopenharmony_ci#define TXPKT_CSUM_TYPE_V(x) ((__u64)(x) << TXPKT_CSUM_TYPE_S) 8938c2ecf20Sopenharmony_ci 8948c2ecf20Sopenharmony_ci#define TXPKT_VLAN_S 44 8958c2ecf20Sopenharmony_ci#define TXPKT_VLAN_V(x) ((__u64)(x) << TXPKT_VLAN_S) 8968c2ecf20Sopenharmony_ci 8978c2ecf20Sopenharmony_ci#define TXPKT_VLAN_VLD_S 60 8988c2ecf20Sopenharmony_ci#define TXPKT_VLAN_VLD_V(x) ((__u64)(x) << TXPKT_VLAN_VLD_S) 8998c2ecf20Sopenharmony_ci#define TXPKT_VLAN_VLD_F TXPKT_VLAN_VLD_V(1ULL) 9008c2ecf20Sopenharmony_ci 9018c2ecf20Sopenharmony_ci#define TXPKT_IPCSUM_DIS_S 62 9028c2ecf20Sopenharmony_ci#define TXPKT_IPCSUM_DIS_V(x) ((__u64)(x) << TXPKT_IPCSUM_DIS_S) 9038c2ecf20Sopenharmony_ci#define TXPKT_IPCSUM_DIS_F TXPKT_IPCSUM_DIS_V(1ULL) 9048c2ecf20Sopenharmony_ci 9058c2ecf20Sopenharmony_ci#define TXPKT_L4CSUM_DIS_S 63 9068c2ecf20Sopenharmony_ci#define TXPKT_L4CSUM_DIS_V(x) ((__u64)(x) << TXPKT_L4CSUM_DIS_S) 9078c2ecf20Sopenharmony_ci#define TXPKT_L4CSUM_DIS_F TXPKT_L4CSUM_DIS_V(1ULL) 9088c2ecf20Sopenharmony_ci 9098c2ecf20Sopenharmony_cistruct cpl_tx_pkt_lso_core { 9108c2ecf20Sopenharmony_ci __be32 lso_ctrl; 9118c2ecf20Sopenharmony_ci __be16 ipid_ofst; 9128c2ecf20Sopenharmony_ci __be16 mss; 9138c2ecf20Sopenharmony_ci __be32 seqno_offset; 9148c2ecf20Sopenharmony_ci __be32 len; 9158c2ecf20Sopenharmony_ci /* encapsulated CPL (TX_PKT, TX_PKT_XT or TX_DATA) follows here */ 9168c2ecf20Sopenharmony_ci}; 9178c2ecf20Sopenharmony_ci 9188c2ecf20Sopenharmony_ci/* cpl_tx_pkt_lso_core.lso_ctrl fields */ 9198c2ecf20Sopenharmony_ci#define LSO_TCPHDR_LEN_S 0 9208c2ecf20Sopenharmony_ci#define LSO_TCPHDR_LEN_V(x) ((x) << LSO_TCPHDR_LEN_S) 9218c2ecf20Sopenharmony_ci 9228c2ecf20Sopenharmony_ci#define LSO_IPHDR_LEN_S 4 9238c2ecf20Sopenharmony_ci#define LSO_IPHDR_LEN_V(x) ((x) << LSO_IPHDR_LEN_S) 9248c2ecf20Sopenharmony_ci 9258c2ecf20Sopenharmony_ci#define LSO_ETHHDR_LEN_S 16 9268c2ecf20Sopenharmony_ci#define LSO_ETHHDR_LEN_V(x) ((x) << LSO_ETHHDR_LEN_S) 9278c2ecf20Sopenharmony_ci 9288c2ecf20Sopenharmony_ci#define LSO_IPV6_S 20 9298c2ecf20Sopenharmony_ci#define LSO_IPV6_V(x) ((x) << LSO_IPV6_S) 9308c2ecf20Sopenharmony_ci#define LSO_IPV6_F LSO_IPV6_V(1U) 9318c2ecf20Sopenharmony_ci 9328c2ecf20Sopenharmony_ci#define LSO_LAST_SLICE_S 22 9338c2ecf20Sopenharmony_ci#define LSO_LAST_SLICE_V(x) ((x) << LSO_LAST_SLICE_S) 9348c2ecf20Sopenharmony_ci#define LSO_LAST_SLICE_F LSO_LAST_SLICE_V(1U) 9358c2ecf20Sopenharmony_ci 9368c2ecf20Sopenharmony_ci#define LSO_FIRST_SLICE_S 23 9378c2ecf20Sopenharmony_ci#define LSO_FIRST_SLICE_V(x) ((x) << LSO_FIRST_SLICE_S) 9388c2ecf20Sopenharmony_ci#define LSO_FIRST_SLICE_F LSO_FIRST_SLICE_V(1U) 9398c2ecf20Sopenharmony_ci 9408c2ecf20Sopenharmony_ci#define LSO_OPCODE_S 24 9418c2ecf20Sopenharmony_ci#define LSO_OPCODE_V(x) ((x) << LSO_OPCODE_S) 9428c2ecf20Sopenharmony_ci 9438c2ecf20Sopenharmony_ci#define LSO_T5_XFER_SIZE_S 0 9448c2ecf20Sopenharmony_ci#define LSO_T5_XFER_SIZE_V(x) ((x) << LSO_T5_XFER_SIZE_S) 9458c2ecf20Sopenharmony_ci 9468c2ecf20Sopenharmony_cistruct cpl_tx_pkt_lso { 9478c2ecf20Sopenharmony_ci WR_HDR; 9488c2ecf20Sopenharmony_ci struct cpl_tx_pkt_lso_core c; 9498c2ecf20Sopenharmony_ci /* encapsulated CPL (TX_PKT, TX_PKT_XT or TX_DATA) follows here */ 9508c2ecf20Sopenharmony_ci}; 9518c2ecf20Sopenharmony_ci 9528c2ecf20Sopenharmony_cistruct cpl_iscsi_hdr { 9538c2ecf20Sopenharmony_ci union opcode_tid ot; 9548c2ecf20Sopenharmony_ci __be16 pdu_len_ddp; 9558c2ecf20Sopenharmony_ci __be16 len; 9568c2ecf20Sopenharmony_ci __be32 seq; 9578c2ecf20Sopenharmony_ci __be16 urg; 9588c2ecf20Sopenharmony_ci u8 rsvd; 9598c2ecf20Sopenharmony_ci u8 status; 9608c2ecf20Sopenharmony_ci}; 9618c2ecf20Sopenharmony_ci 9628c2ecf20Sopenharmony_ci/* cpl_iscsi_hdr.pdu_len_ddp fields */ 9638c2ecf20Sopenharmony_ci#define ISCSI_PDU_LEN_S 0 9648c2ecf20Sopenharmony_ci#define ISCSI_PDU_LEN_M 0x7FFF 9658c2ecf20Sopenharmony_ci#define ISCSI_PDU_LEN_V(x) ((x) << ISCSI_PDU_LEN_S) 9668c2ecf20Sopenharmony_ci#define ISCSI_PDU_LEN_G(x) (((x) >> ISCSI_PDU_LEN_S) & ISCSI_PDU_LEN_M) 9678c2ecf20Sopenharmony_ci 9688c2ecf20Sopenharmony_ci#define ISCSI_DDP_S 15 9698c2ecf20Sopenharmony_ci#define ISCSI_DDP_V(x) ((x) << ISCSI_DDP_S) 9708c2ecf20Sopenharmony_ci#define ISCSI_DDP_F ISCSI_DDP_V(1U) 9718c2ecf20Sopenharmony_ci 9728c2ecf20Sopenharmony_cistruct cpl_rx_data_ddp { 9738c2ecf20Sopenharmony_ci union opcode_tid ot; 9748c2ecf20Sopenharmony_ci __be16 urg; 9758c2ecf20Sopenharmony_ci __be16 len; 9768c2ecf20Sopenharmony_ci __be32 seq; 9778c2ecf20Sopenharmony_ci union { 9788c2ecf20Sopenharmony_ci __be32 nxt_seq; 9798c2ecf20Sopenharmony_ci __be32 ddp_report; 9808c2ecf20Sopenharmony_ci }; 9818c2ecf20Sopenharmony_ci __be32 ulp_crc; 9828c2ecf20Sopenharmony_ci __be32 ddpvld; 9838c2ecf20Sopenharmony_ci}; 9848c2ecf20Sopenharmony_ci 9858c2ecf20Sopenharmony_ci#define cpl_rx_iscsi_ddp cpl_rx_data_ddp 9868c2ecf20Sopenharmony_ci 9878c2ecf20Sopenharmony_cistruct cpl_iscsi_data { 9888c2ecf20Sopenharmony_ci union opcode_tid ot; 9898c2ecf20Sopenharmony_ci __u8 rsvd0[2]; 9908c2ecf20Sopenharmony_ci __be16 len; 9918c2ecf20Sopenharmony_ci __be32 seq; 9928c2ecf20Sopenharmony_ci __be16 urg; 9938c2ecf20Sopenharmony_ci __u8 rsvd1; 9948c2ecf20Sopenharmony_ci __u8 status; 9958c2ecf20Sopenharmony_ci}; 9968c2ecf20Sopenharmony_ci 9978c2ecf20Sopenharmony_cistruct cpl_rx_iscsi_cmp { 9988c2ecf20Sopenharmony_ci union opcode_tid ot; 9998c2ecf20Sopenharmony_ci __be16 pdu_len_ddp; 10008c2ecf20Sopenharmony_ci __be16 len; 10018c2ecf20Sopenharmony_ci __be32 seq; 10028c2ecf20Sopenharmony_ci __be16 urg; 10038c2ecf20Sopenharmony_ci __u8 rsvd; 10048c2ecf20Sopenharmony_ci __u8 status; 10058c2ecf20Sopenharmony_ci __be32 ulp_crc; 10068c2ecf20Sopenharmony_ci __be32 ddpvld; 10078c2ecf20Sopenharmony_ci}; 10088c2ecf20Sopenharmony_ci 10098c2ecf20Sopenharmony_cistruct cpl_tx_data_iso { 10108c2ecf20Sopenharmony_ci __be32 op_to_scsi; 10118c2ecf20Sopenharmony_ci __u8 reserved1; 10128c2ecf20Sopenharmony_ci __u8 ahs_len; 10138c2ecf20Sopenharmony_ci __be16 mpdu; 10148c2ecf20Sopenharmony_ci __be32 burst_size; 10158c2ecf20Sopenharmony_ci __be32 len; 10168c2ecf20Sopenharmony_ci __be32 reserved2_seglen_offset; 10178c2ecf20Sopenharmony_ci __be32 datasn_offset; 10188c2ecf20Sopenharmony_ci __be32 buffer_offset; 10198c2ecf20Sopenharmony_ci __be32 reserved3; 10208c2ecf20Sopenharmony_ci 10218c2ecf20Sopenharmony_ci /* encapsulated CPL_TX_DATA follows here */ 10228c2ecf20Sopenharmony_ci}; 10238c2ecf20Sopenharmony_ci 10248c2ecf20Sopenharmony_ci/* cpl_tx_data_iso.op_to_scsi fields */ 10258c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_OP_S 24 10268c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_OP_M 0xff 10278c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_OP_V(x) ((x) << CPL_TX_DATA_ISO_OP_S) 10288c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_OP_G(x) \ 10298c2ecf20Sopenharmony_ci (((x) >> CPL_TX_DATA_ISO_OP_S) & CPL_TX_DATA_ISO_OP_M) 10308c2ecf20Sopenharmony_ci 10318c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_FIRST_S 23 10328c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_FIRST_M 0x1 10338c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_FIRST_V(x) ((x) << CPL_TX_DATA_ISO_FIRST_S) 10348c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_FIRST_G(x) \ 10358c2ecf20Sopenharmony_ci (((x) >> CPL_TX_DATA_ISO_FIRST_S) & CPL_TX_DATA_ISO_FIRST_M) 10368c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_FIRST_F CPL_TX_DATA_ISO_FIRST_V(1U) 10378c2ecf20Sopenharmony_ci 10388c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_LAST_S 22 10398c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_LAST_M 0x1 10408c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_LAST_V(x) ((x) << CPL_TX_DATA_ISO_LAST_S) 10418c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_LAST_G(x) \ 10428c2ecf20Sopenharmony_ci (((x) >> CPL_TX_DATA_ISO_LAST_S) & CPL_TX_DATA_ISO_LAST_M) 10438c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_LAST_F CPL_TX_DATA_ISO_LAST_V(1U) 10448c2ecf20Sopenharmony_ci 10458c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_CPLHDRLEN_S 21 10468c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_CPLHDRLEN_M 0x1 10478c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_CPLHDRLEN_V(x) ((x) << CPL_TX_DATA_ISO_CPLHDRLEN_S) 10488c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_CPLHDRLEN_G(x) \ 10498c2ecf20Sopenharmony_ci (((x) >> CPL_TX_DATA_ISO_CPLHDRLEN_S) & CPL_TX_DATA_ISO_CPLHDRLEN_M) 10508c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_CPLHDRLEN_F CPL_TX_DATA_ISO_CPLHDRLEN_V(1U) 10518c2ecf20Sopenharmony_ci 10528c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_HDRCRC_S 20 10538c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_HDRCRC_M 0x1 10548c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_HDRCRC_V(x) ((x) << CPL_TX_DATA_ISO_HDRCRC_S) 10558c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_HDRCRC_G(x) \ 10568c2ecf20Sopenharmony_ci (((x) >> CPL_TX_DATA_ISO_HDRCRC_S) & CPL_TX_DATA_ISO_HDRCRC_M) 10578c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_HDRCRC_F CPL_TX_DATA_ISO_HDRCRC_V(1U) 10588c2ecf20Sopenharmony_ci 10598c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_PLDCRC_S 19 10608c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_PLDCRC_M 0x1 10618c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_PLDCRC_V(x) ((x) << CPL_TX_DATA_ISO_PLDCRC_S) 10628c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_PLDCRC_G(x) \ 10638c2ecf20Sopenharmony_ci (((x) >> CPL_TX_DATA_ISO_PLDCRC_S) & CPL_TX_DATA_ISO_PLDCRC_M) 10648c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_PLDCRC_F CPL_TX_DATA_ISO_PLDCRC_V(1U) 10658c2ecf20Sopenharmony_ci 10668c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_IMMEDIATE_S 18 10678c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_IMMEDIATE_M 0x1 10688c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_IMMEDIATE_V(x) ((x) << CPL_TX_DATA_ISO_IMMEDIATE_S) 10698c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_IMMEDIATE_G(x) \ 10708c2ecf20Sopenharmony_ci (((x) >> CPL_TX_DATA_ISO_IMMEDIATE_S) & CPL_TX_DATA_ISO_IMMEDIATE_M) 10718c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_IMMEDIATE_F CPL_TX_DATA_ISO_IMMEDIATE_V(1U) 10728c2ecf20Sopenharmony_ci 10738c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_SCSI_S 16 10748c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_SCSI_M 0x3 10758c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_SCSI_V(x) ((x) << CPL_TX_DATA_ISO_SCSI_S) 10768c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_SCSI_G(x) \ 10778c2ecf20Sopenharmony_ci (((x) >> CPL_TX_DATA_ISO_SCSI_S) & CPL_TX_DATA_ISO_SCSI_M) 10788c2ecf20Sopenharmony_ci 10798c2ecf20Sopenharmony_ci/* cpl_tx_data_iso.reserved2_seglen_offset fields */ 10808c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_SEGLEN_OFFSET_S 0 10818c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_SEGLEN_OFFSET_M 0xffffff 10828c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_SEGLEN_OFFSET_V(x) \ 10838c2ecf20Sopenharmony_ci ((x) << CPL_TX_DATA_ISO_SEGLEN_OFFSET_S) 10848c2ecf20Sopenharmony_ci#define CPL_TX_DATA_ISO_SEGLEN_OFFSET_G(x) \ 10858c2ecf20Sopenharmony_ci (((x) >> CPL_TX_DATA_ISO_SEGLEN_OFFSET_S) & \ 10868c2ecf20Sopenharmony_ci CPL_TX_DATA_ISO_SEGLEN_OFFSET_M) 10878c2ecf20Sopenharmony_ci 10888c2ecf20Sopenharmony_cistruct cpl_rx_data { 10898c2ecf20Sopenharmony_ci union opcode_tid ot; 10908c2ecf20Sopenharmony_ci __be16 rsvd; 10918c2ecf20Sopenharmony_ci __be16 len; 10928c2ecf20Sopenharmony_ci __be32 seq; 10938c2ecf20Sopenharmony_ci __be16 urg; 10948c2ecf20Sopenharmony_ci#if defined(__LITTLE_ENDIAN_BITFIELD) 10958c2ecf20Sopenharmony_ci u8 dack_mode:2; 10968c2ecf20Sopenharmony_ci u8 psh:1; 10978c2ecf20Sopenharmony_ci u8 heartbeat:1; 10988c2ecf20Sopenharmony_ci u8 ddp_off:1; 10998c2ecf20Sopenharmony_ci u8 :3; 11008c2ecf20Sopenharmony_ci#else 11018c2ecf20Sopenharmony_ci u8 :3; 11028c2ecf20Sopenharmony_ci u8 ddp_off:1; 11038c2ecf20Sopenharmony_ci u8 heartbeat:1; 11048c2ecf20Sopenharmony_ci u8 psh:1; 11058c2ecf20Sopenharmony_ci u8 dack_mode:2; 11068c2ecf20Sopenharmony_ci#endif 11078c2ecf20Sopenharmony_ci u8 status; 11088c2ecf20Sopenharmony_ci}; 11098c2ecf20Sopenharmony_ci 11108c2ecf20Sopenharmony_cistruct cpl_rx_data_ack { 11118c2ecf20Sopenharmony_ci WR_HDR; 11128c2ecf20Sopenharmony_ci union opcode_tid ot; 11138c2ecf20Sopenharmony_ci __be32 credit_dack; 11148c2ecf20Sopenharmony_ci}; 11158c2ecf20Sopenharmony_ci 11168c2ecf20Sopenharmony_ci/* cpl_rx_data_ack.ack_seq fields */ 11178c2ecf20Sopenharmony_ci#define RX_CREDITS_S 0 11188c2ecf20Sopenharmony_ci#define RX_CREDITS_V(x) ((x) << RX_CREDITS_S) 11198c2ecf20Sopenharmony_ci 11208c2ecf20Sopenharmony_ci#define RX_FORCE_ACK_S 28 11218c2ecf20Sopenharmony_ci#define RX_FORCE_ACK_V(x) ((x) << RX_FORCE_ACK_S) 11228c2ecf20Sopenharmony_ci#define RX_FORCE_ACK_F RX_FORCE_ACK_V(1U) 11238c2ecf20Sopenharmony_ci 11248c2ecf20Sopenharmony_ci#define RX_DACK_MODE_S 29 11258c2ecf20Sopenharmony_ci#define RX_DACK_MODE_M 0x3 11268c2ecf20Sopenharmony_ci#define RX_DACK_MODE_V(x) ((x) << RX_DACK_MODE_S) 11278c2ecf20Sopenharmony_ci#define RX_DACK_MODE_G(x) (((x) >> RX_DACK_MODE_S) & RX_DACK_MODE_M) 11288c2ecf20Sopenharmony_ci 11298c2ecf20Sopenharmony_ci#define RX_DACK_CHANGE_S 31 11308c2ecf20Sopenharmony_ci#define RX_DACK_CHANGE_V(x) ((x) << RX_DACK_CHANGE_S) 11318c2ecf20Sopenharmony_ci#define RX_DACK_CHANGE_F RX_DACK_CHANGE_V(1U) 11328c2ecf20Sopenharmony_ci 11338c2ecf20Sopenharmony_cistruct cpl_rx_pkt { 11348c2ecf20Sopenharmony_ci struct rss_header rsshdr; 11358c2ecf20Sopenharmony_ci u8 opcode; 11368c2ecf20Sopenharmony_ci#if defined(__LITTLE_ENDIAN_BITFIELD) 11378c2ecf20Sopenharmony_ci u8 iff:4; 11388c2ecf20Sopenharmony_ci u8 csum_calc:1; 11398c2ecf20Sopenharmony_ci u8 ipmi_pkt:1; 11408c2ecf20Sopenharmony_ci u8 vlan_ex:1; 11418c2ecf20Sopenharmony_ci u8 ip_frag:1; 11428c2ecf20Sopenharmony_ci#else 11438c2ecf20Sopenharmony_ci u8 ip_frag:1; 11448c2ecf20Sopenharmony_ci u8 vlan_ex:1; 11458c2ecf20Sopenharmony_ci u8 ipmi_pkt:1; 11468c2ecf20Sopenharmony_ci u8 csum_calc:1; 11478c2ecf20Sopenharmony_ci u8 iff:4; 11488c2ecf20Sopenharmony_ci#endif 11498c2ecf20Sopenharmony_ci __be16 csum; 11508c2ecf20Sopenharmony_ci __be16 vlan; 11518c2ecf20Sopenharmony_ci __be16 len; 11528c2ecf20Sopenharmony_ci __be32 l2info; 11538c2ecf20Sopenharmony_ci __be16 hdr_len; 11548c2ecf20Sopenharmony_ci __be16 err_vec; 11558c2ecf20Sopenharmony_ci}; 11568c2ecf20Sopenharmony_ci 11578c2ecf20Sopenharmony_ci#define RX_T6_ETHHDR_LEN_M 0xFF 11588c2ecf20Sopenharmony_ci#define RX_T6_ETHHDR_LEN_G(x) (((x) >> RX_ETHHDR_LEN_S) & RX_T6_ETHHDR_LEN_M) 11598c2ecf20Sopenharmony_ci 11608c2ecf20Sopenharmony_ci#define RXF_PSH_S 20 11618c2ecf20Sopenharmony_ci#define RXF_PSH_V(x) ((x) << RXF_PSH_S) 11628c2ecf20Sopenharmony_ci#define RXF_PSH_F RXF_PSH_V(1U) 11638c2ecf20Sopenharmony_ci 11648c2ecf20Sopenharmony_ci#define RXF_SYN_S 21 11658c2ecf20Sopenharmony_ci#define RXF_SYN_V(x) ((x) << RXF_SYN_S) 11668c2ecf20Sopenharmony_ci#define RXF_SYN_F RXF_SYN_V(1U) 11678c2ecf20Sopenharmony_ci 11688c2ecf20Sopenharmony_ci#define RXF_UDP_S 22 11698c2ecf20Sopenharmony_ci#define RXF_UDP_V(x) ((x) << RXF_UDP_S) 11708c2ecf20Sopenharmony_ci#define RXF_UDP_F RXF_UDP_V(1U) 11718c2ecf20Sopenharmony_ci 11728c2ecf20Sopenharmony_ci#define RXF_TCP_S 23 11738c2ecf20Sopenharmony_ci#define RXF_TCP_V(x) ((x) << RXF_TCP_S) 11748c2ecf20Sopenharmony_ci#define RXF_TCP_F RXF_TCP_V(1U) 11758c2ecf20Sopenharmony_ci 11768c2ecf20Sopenharmony_ci#define RXF_IP_S 24 11778c2ecf20Sopenharmony_ci#define RXF_IP_V(x) ((x) << RXF_IP_S) 11788c2ecf20Sopenharmony_ci#define RXF_IP_F RXF_IP_V(1U) 11798c2ecf20Sopenharmony_ci 11808c2ecf20Sopenharmony_ci#define RXF_IP6_S 25 11818c2ecf20Sopenharmony_ci#define RXF_IP6_V(x) ((x) << RXF_IP6_S) 11828c2ecf20Sopenharmony_ci#define RXF_IP6_F RXF_IP6_V(1U) 11838c2ecf20Sopenharmony_ci 11848c2ecf20Sopenharmony_ci#define RXF_SYN_COOKIE_S 26 11858c2ecf20Sopenharmony_ci#define RXF_SYN_COOKIE_V(x) ((x) << RXF_SYN_COOKIE_S) 11868c2ecf20Sopenharmony_ci#define RXF_SYN_COOKIE_F RXF_SYN_COOKIE_V(1U) 11878c2ecf20Sopenharmony_ci 11888c2ecf20Sopenharmony_ci#define RXF_FCOE_S 26 11898c2ecf20Sopenharmony_ci#define RXF_FCOE_V(x) ((x) << RXF_FCOE_S) 11908c2ecf20Sopenharmony_ci#define RXF_FCOE_F RXF_FCOE_V(1U) 11918c2ecf20Sopenharmony_ci 11928c2ecf20Sopenharmony_ci#define RXF_LRO_S 27 11938c2ecf20Sopenharmony_ci#define RXF_LRO_V(x) ((x) << RXF_LRO_S) 11948c2ecf20Sopenharmony_ci#define RXF_LRO_F RXF_LRO_V(1U) 11958c2ecf20Sopenharmony_ci 11968c2ecf20Sopenharmony_ci/* rx_pkt.l2info fields */ 11978c2ecf20Sopenharmony_ci#define RX_ETHHDR_LEN_S 0 11988c2ecf20Sopenharmony_ci#define RX_ETHHDR_LEN_M 0x1F 11998c2ecf20Sopenharmony_ci#define RX_ETHHDR_LEN_V(x) ((x) << RX_ETHHDR_LEN_S) 12008c2ecf20Sopenharmony_ci#define RX_ETHHDR_LEN_G(x) (((x) >> RX_ETHHDR_LEN_S) & RX_ETHHDR_LEN_M) 12018c2ecf20Sopenharmony_ci 12028c2ecf20Sopenharmony_ci#define RX_T5_ETHHDR_LEN_S 0 12038c2ecf20Sopenharmony_ci#define RX_T5_ETHHDR_LEN_M 0x3F 12048c2ecf20Sopenharmony_ci#define RX_T5_ETHHDR_LEN_V(x) ((x) << RX_T5_ETHHDR_LEN_S) 12058c2ecf20Sopenharmony_ci#define RX_T5_ETHHDR_LEN_G(x) (((x) >> RX_T5_ETHHDR_LEN_S) & RX_T5_ETHHDR_LEN_M) 12068c2ecf20Sopenharmony_ci 12078c2ecf20Sopenharmony_ci#define RX_MACIDX_S 8 12088c2ecf20Sopenharmony_ci#define RX_MACIDX_M 0x1FF 12098c2ecf20Sopenharmony_ci#define RX_MACIDX_V(x) ((x) << RX_MACIDX_S) 12108c2ecf20Sopenharmony_ci#define RX_MACIDX_G(x) (((x) >> RX_MACIDX_S) & RX_MACIDX_M) 12118c2ecf20Sopenharmony_ci 12128c2ecf20Sopenharmony_ci#define RXF_SYN_S 21 12138c2ecf20Sopenharmony_ci#define RXF_SYN_V(x) ((x) << RXF_SYN_S) 12148c2ecf20Sopenharmony_ci#define RXF_SYN_F RXF_SYN_V(1U) 12158c2ecf20Sopenharmony_ci 12168c2ecf20Sopenharmony_ci#define RX_CHAN_S 28 12178c2ecf20Sopenharmony_ci#define RX_CHAN_M 0xF 12188c2ecf20Sopenharmony_ci#define RX_CHAN_V(x) ((x) << RX_CHAN_S) 12198c2ecf20Sopenharmony_ci#define RX_CHAN_G(x) (((x) >> RX_CHAN_S) & RX_CHAN_M) 12208c2ecf20Sopenharmony_ci 12218c2ecf20Sopenharmony_ci/* rx_pkt.hdr_len fields */ 12228c2ecf20Sopenharmony_ci#define RX_TCPHDR_LEN_S 0 12238c2ecf20Sopenharmony_ci#define RX_TCPHDR_LEN_M 0x3F 12248c2ecf20Sopenharmony_ci#define RX_TCPHDR_LEN_V(x) ((x) << RX_TCPHDR_LEN_S) 12258c2ecf20Sopenharmony_ci#define RX_TCPHDR_LEN_G(x) (((x) >> RX_TCPHDR_LEN_S) & RX_TCPHDR_LEN_M) 12268c2ecf20Sopenharmony_ci 12278c2ecf20Sopenharmony_ci#define RX_IPHDR_LEN_S 6 12288c2ecf20Sopenharmony_ci#define RX_IPHDR_LEN_M 0x3FF 12298c2ecf20Sopenharmony_ci#define RX_IPHDR_LEN_V(x) ((x) << RX_IPHDR_LEN_S) 12308c2ecf20Sopenharmony_ci#define RX_IPHDR_LEN_G(x) (((x) >> RX_IPHDR_LEN_S) & RX_IPHDR_LEN_M) 12318c2ecf20Sopenharmony_ci 12328c2ecf20Sopenharmony_ci/* rx_pkt.err_vec fields */ 12338c2ecf20Sopenharmony_ci#define RXERR_CSUM_S 13 12348c2ecf20Sopenharmony_ci#define RXERR_CSUM_V(x) ((x) << RXERR_CSUM_S) 12358c2ecf20Sopenharmony_ci#define RXERR_CSUM_F RXERR_CSUM_V(1U) 12368c2ecf20Sopenharmony_ci 12378c2ecf20Sopenharmony_ci#define T6_COMPR_RXERR_LEN_S 1 12388c2ecf20Sopenharmony_ci#define T6_COMPR_RXERR_LEN_V(x) ((x) << T6_COMPR_RXERR_LEN_S) 12398c2ecf20Sopenharmony_ci#define T6_COMPR_RXERR_LEN_F T6_COMPR_RXERR_LEN_V(1U) 12408c2ecf20Sopenharmony_ci 12418c2ecf20Sopenharmony_ci#define T6_COMPR_RXERR_VEC_S 0 12428c2ecf20Sopenharmony_ci#define T6_COMPR_RXERR_VEC_M 0x3F 12438c2ecf20Sopenharmony_ci#define T6_COMPR_RXERR_VEC_V(x) ((x) << T6_COMPR_RXERR_LEN_S) 12448c2ecf20Sopenharmony_ci#define T6_COMPR_RXERR_VEC_G(x) \ 12458c2ecf20Sopenharmony_ci (((x) >> T6_COMPR_RXERR_VEC_S) & T6_COMPR_RXERR_VEC_M) 12468c2ecf20Sopenharmony_ci 12478c2ecf20Sopenharmony_ci/* Logical OR of RX_ERROR_CSUM, RX_ERROR_CSIP */ 12488c2ecf20Sopenharmony_ci#define T6_COMPR_RXERR_SUM_S 4 12498c2ecf20Sopenharmony_ci#define T6_COMPR_RXERR_SUM_V(x) ((x) << T6_COMPR_RXERR_SUM_S) 12508c2ecf20Sopenharmony_ci#define T6_COMPR_RXERR_SUM_F T6_COMPR_RXERR_SUM_V(1U) 12518c2ecf20Sopenharmony_ci 12528c2ecf20Sopenharmony_ci#define T6_RX_TNLHDR_LEN_S 8 12538c2ecf20Sopenharmony_ci#define T6_RX_TNLHDR_LEN_M 0xFF 12548c2ecf20Sopenharmony_ci#define T6_RX_TNLHDR_LEN_V(x) ((x) << T6_RX_TNLHDR_LEN_S) 12558c2ecf20Sopenharmony_ci#define T6_RX_TNLHDR_LEN_G(x) (((x) >> T6_RX_TNLHDR_LEN_S) & T6_RX_TNLHDR_LEN_M) 12568c2ecf20Sopenharmony_ci 12578c2ecf20Sopenharmony_cistruct cpl_trace_pkt { 12588c2ecf20Sopenharmony_ci u8 opcode; 12598c2ecf20Sopenharmony_ci u8 intf; 12608c2ecf20Sopenharmony_ci#if defined(__LITTLE_ENDIAN_BITFIELD) 12618c2ecf20Sopenharmony_ci u8 runt:4; 12628c2ecf20Sopenharmony_ci u8 filter_hit:4; 12638c2ecf20Sopenharmony_ci u8 :6; 12648c2ecf20Sopenharmony_ci u8 err:1; 12658c2ecf20Sopenharmony_ci u8 trunc:1; 12668c2ecf20Sopenharmony_ci#else 12678c2ecf20Sopenharmony_ci u8 filter_hit:4; 12688c2ecf20Sopenharmony_ci u8 runt:4; 12698c2ecf20Sopenharmony_ci u8 trunc:1; 12708c2ecf20Sopenharmony_ci u8 err:1; 12718c2ecf20Sopenharmony_ci u8 :6; 12728c2ecf20Sopenharmony_ci#endif 12738c2ecf20Sopenharmony_ci __be16 rsvd; 12748c2ecf20Sopenharmony_ci __be16 len; 12758c2ecf20Sopenharmony_ci __be64 tstamp; 12768c2ecf20Sopenharmony_ci}; 12778c2ecf20Sopenharmony_ci 12788c2ecf20Sopenharmony_cistruct cpl_t5_trace_pkt { 12798c2ecf20Sopenharmony_ci __u8 opcode; 12808c2ecf20Sopenharmony_ci __u8 intf; 12818c2ecf20Sopenharmony_ci#if defined(__LITTLE_ENDIAN_BITFIELD) 12828c2ecf20Sopenharmony_ci __u8 runt:4; 12838c2ecf20Sopenharmony_ci __u8 filter_hit:4; 12848c2ecf20Sopenharmony_ci __u8:6; 12858c2ecf20Sopenharmony_ci __u8 err:1; 12868c2ecf20Sopenharmony_ci __u8 trunc:1; 12878c2ecf20Sopenharmony_ci#else 12888c2ecf20Sopenharmony_ci __u8 filter_hit:4; 12898c2ecf20Sopenharmony_ci __u8 runt:4; 12908c2ecf20Sopenharmony_ci __u8 trunc:1; 12918c2ecf20Sopenharmony_ci __u8 err:1; 12928c2ecf20Sopenharmony_ci __u8:6; 12938c2ecf20Sopenharmony_ci#endif 12948c2ecf20Sopenharmony_ci __be16 rsvd; 12958c2ecf20Sopenharmony_ci __be16 len; 12968c2ecf20Sopenharmony_ci __be64 tstamp; 12978c2ecf20Sopenharmony_ci __be64 rsvd1; 12988c2ecf20Sopenharmony_ci}; 12998c2ecf20Sopenharmony_ci 13008c2ecf20Sopenharmony_cistruct cpl_l2t_write_req { 13018c2ecf20Sopenharmony_ci WR_HDR; 13028c2ecf20Sopenharmony_ci union opcode_tid ot; 13038c2ecf20Sopenharmony_ci __be16 params; 13048c2ecf20Sopenharmony_ci __be16 l2t_idx; 13058c2ecf20Sopenharmony_ci __be16 vlan; 13068c2ecf20Sopenharmony_ci u8 dst_mac[6]; 13078c2ecf20Sopenharmony_ci}; 13088c2ecf20Sopenharmony_ci 13098c2ecf20Sopenharmony_ci/* cpl_l2t_write_req.params fields */ 13108c2ecf20Sopenharmony_ci#define L2T_W_INFO_S 2 13118c2ecf20Sopenharmony_ci#define L2T_W_INFO_V(x) ((x) << L2T_W_INFO_S) 13128c2ecf20Sopenharmony_ci 13138c2ecf20Sopenharmony_ci#define L2T_W_PORT_S 8 13148c2ecf20Sopenharmony_ci#define L2T_W_PORT_V(x) ((x) << L2T_W_PORT_S) 13158c2ecf20Sopenharmony_ci 13168c2ecf20Sopenharmony_ci#define L2T_W_NOREPLY_S 15 13178c2ecf20Sopenharmony_ci#define L2T_W_NOREPLY_V(x) ((x) << L2T_W_NOREPLY_S) 13188c2ecf20Sopenharmony_ci#define L2T_W_NOREPLY_F L2T_W_NOREPLY_V(1U) 13198c2ecf20Sopenharmony_ci 13208c2ecf20Sopenharmony_ci#define CPL_L2T_VLAN_NONE 0xfff 13218c2ecf20Sopenharmony_ci 13228c2ecf20Sopenharmony_cistruct cpl_l2t_write_rpl { 13238c2ecf20Sopenharmony_ci union opcode_tid ot; 13248c2ecf20Sopenharmony_ci u8 status; 13258c2ecf20Sopenharmony_ci u8 rsvd[3]; 13268c2ecf20Sopenharmony_ci}; 13278c2ecf20Sopenharmony_ci 13288c2ecf20Sopenharmony_cistruct cpl_smt_write_req { 13298c2ecf20Sopenharmony_ci WR_HDR; 13308c2ecf20Sopenharmony_ci union opcode_tid ot; 13318c2ecf20Sopenharmony_ci __be32 params; 13328c2ecf20Sopenharmony_ci __be16 pfvf1; 13338c2ecf20Sopenharmony_ci u8 src_mac1[6]; 13348c2ecf20Sopenharmony_ci __be16 pfvf0; 13358c2ecf20Sopenharmony_ci u8 src_mac0[6]; 13368c2ecf20Sopenharmony_ci}; 13378c2ecf20Sopenharmony_ci 13388c2ecf20Sopenharmony_cistruct cpl_t6_smt_write_req { 13398c2ecf20Sopenharmony_ci WR_HDR; 13408c2ecf20Sopenharmony_ci union opcode_tid ot; 13418c2ecf20Sopenharmony_ci __be32 params; 13428c2ecf20Sopenharmony_ci __be64 tag; 13438c2ecf20Sopenharmony_ci __be16 pfvf0; 13448c2ecf20Sopenharmony_ci u8 src_mac0[6]; 13458c2ecf20Sopenharmony_ci __be32 local_ip; 13468c2ecf20Sopenharmony_ci __be32 rsvd; 13478c2ecf20Sopenharmony_ci}; 13488c2ecf20Sopenharmony_ci 13498c2ecf20Sopenharmony_cistruct cpl_smt_write_rpl { 13508c2ecf20Sopenharmony_ci union opcode_tid ot; 13518c2ecf20Sopenharmony_ci u8 status; 13528c2ecf20Sopenharmony_ci u8 rsvd[3]; 13538c2ecf20Sopenharmony_ci}; 13548c2ecf20Sopenharmony_ci 13558c2ecf20Sopenharmony_ci/* cpl_smt_{read,write}_req.params fields */ 13568c2ecf20Sopenharmony_ci#define SMTW_OVLAN_IDX_S 16 13578c2ecf20Sopenharmony_ci#define SMTW_OVLAN_IDX_V(x) ((x) << SMTW_OVLAN_IDX_S) 13588c2ecf20Sopenharmony_ci 13598c2ecf20Sopenharmony_ci#define SMTW_IDX_S 20 13608c2ecf20Sopenharmony_ci#define SMTW_IDX_V(x) ((x) << SMTW_IDX_S) 13618c2ecf20Sopenharmony_ci 13628c2ecf20Sopenharmony_ci#define SMTW_NORPL_S 31 13638c2ecf20Sopenharmony_ci#define SMTW_NORPL_V(x) ((x) << SMTW_NORPL_S) 13648c2ecf20Sopenharmony_ci#define SMTW_NORPL_F SMTW_NORPL_V(1U) 13658c2ecf20Sopenharmony_ci 13668c2ecf20Sopenharmony_cistruct cpl_rdma_terminate { 13678c2ecf20Sopenharmony_ci union opcode_tid ot; 13688c2ecf20Sopenharmony_ci __be16 rsvd; 13698c2ecf20Sopenharmony_ci __be16 len; 13708c2ecf20Sopenharmony_ci}; 13718c2ecf20Sopenharmony_ci 13728c2ecf20Sopenharmony_cistruct cpl_sge_egr_update { 13738c2ecf20Sopenharmony_ci __be32 opcode_qid; 13748c2ecf20Sopenharmony_ci __be16 cidx; 13758c2ecf20Sopenharmony_ci __be16 pidx; 13768c2ecf20Sopenharmony_ci}; 13778c2ecf20Sopenharmony_ci 13788c2ecf20Sopenharmony_ci/* cpl_sge_egr_update.ot fields */ 13798c2ecf20Sopenharmony_ci#define EGR_QID_S 0 13808c2ecf20Sopenharmony_ci#define EGR_QID_M 0x1FFFF 13818c2ecf20Sopenharmony_ci#define EGR_QID_G(x) (((x) >> EGR_QID_S) & EGR_QID_M) 13828c2ecf20Sopenharmony_ci 13838c2ecf20Sopenharmony_ci/* cpl_fw*.type values */ 13848c2ecf20Sopenharmony_cienum { 13858c2ecf20Sopenharmony_ci FW_TYPE_CMD_RPL = 0, 13868c2ecf20Sopenharmony_ci FW_TYPE_WR_RPL = 1, 13878c2ecf20Sopenharmony_ci FW_TYPE_CQE = 2, 13888c2ecf20Sopenharmony_ci FW_TYPE_OFLD_CONNECTION_WR_RPL = 3, 13898c2ecf20Sopenharmony_ci FW_TYPE_RSSCPL = 4, 13908c2ecf20Sopenharmony_ci}; 13918c2ecf20Sopenharmony_ci 13928c2ecf20Sopenharmony_cistruct cpl_fw4_pld { 13938c2ecf20Sopenharmony_ci u8 opcode; 13948c2ecf20Sopenharmony_ci u8 rsvd0[3]; 13958c2ecf20Sopenharmony_ci u8 type; 13968c2ecf20Sopenharmony_ci u8 rsvd1; 13978c2ecf20Sopenharmony_ci __be16 len; 13988c2ecf20Sopenharmony_ci __be64 data; 13998c2ecf20Sopenharmony_ci __be64 rsvd2; 14008c2ecf20Sopenharmony_ci}; 14018c2ecf20Sopenharmony_ci 14028c2ecf20Sopenharmony_cistruct cpl_fw6_pld { 14038c2ecf20Sopenharmony_ci u8 opcode; 14048c2ecf20Sopenharmony_ci u8 rsvd[5]; 14058c2ecf20Sopenharmony_ci __be16 len; 14068c2ecf20Sopenharmony_ci __be64 data[4]; 14078c2ecf20Sopenharmony_ci}; 14088c2ecf20Sopenharmony_ci 14098c2ecf20Sopenharmony_cistruct cpl_fw4_msg { 14108c2ecf20Sopenharmony_ci u8 opcode; 14118c2ecf20Sopenharmony_ci u8 type; 14128c2ecf20Sopenharmony_ci __be16 rsvd0; 14138c2ecf20Sopenharmony_ci __be32 rsvd1; 14148c2ecf20Sopenharmony_ci __be64 data[2]; 14158c2ecf20Sopenharmony_ci}; 14168c2ecf20Sopenharmony_ci 14178c2ecf20Sopenharmony_cistruct cpl_fw4_ack { 14188c2ecf20Sopenharmony_ci union opcode_tid ot; 14198c2ecf20Sopenharmony_ci u8 credits; 14208c2ecf20Sopenharmony_ci u8 rsvd0[2]; 14218c2ecf20Sopenharmony_ci u8 seq_vld; 14228c2ecf20Sopenharmony_ci __be32 snd_nxt; 14238c2ecf20Sopenharmony_ci __be32 snd_una; 14248c2ecf20Sopenharmony_ci __be64 rsvd1; 14258c2ecf20Sopenharmony_ci}; 14268c2ecf20Sopenharmony_ci 14278c2ecf20Sopenharmony_cienum { 14288c2ecf20Sopenharmony_ci CPL_FW4_ACK_FLAGS_SEQVAL = 0x1, /* seqn valid */ 14298c2ecf20Sopenharmony_ci CPL_FW4_ACK_FLAGS_CH = 0x2, /* channel change complete */ 14308c2ecf20Sopenharmony_ci CPL_FW4_ACK_FLAGS_FLOWC = 0x4, /* fw_flowc_wr complete */ 14318c2ecf20Sopenharmony_ci}; 14328c2ecf20Sopenharmony_ci 14338c2ecf20Sopenharmony_ci#define CPL_FW4_ACK_FLOWID_S 0 14348c2ecf20Sopenharmony_ci#define CPL_FW4_ACK_FLOWID_M 0xffffff 14358c2ecf20Sopenharmony_ci#define CPL_FW4_ACK_FLOWID_G(x) \ 14368c2ecf20Sopenharmony_ci (((x) >> CPL_FW4_ACK_FLOWID_S) & CPL_FW4_ACK_FLOWID_M) 14378c2ecf20Sopenharmony_ci 14388c2ecf20Sopenharmony_cistruct cpl_fw6_msg { 14398c2ecf20Sopenharmony_ci u8 opcode; 14408c2ecf20Sopenharmony_ci u8 type; 14418c2ecf20Sopenharmony_ci __be16 rsvd0; 14428c2ecf20Sopenharmony_ci __be32 rsvd1; 14438c2ecf20Sopenharmony_ci __be64 data[4]; 14448c2ecf20Sopenharmony_ci}; 14458c2ecf20Sopenharmony_ci 14468c2ecf20Sopenharmony_ci/* cpl_fw6_msg.type values */ 14478c2ecf20Sopenharmony_cienum { 14488c2ecf20Sopenharmony_ci FW6_TYPE_CMD_RPL = 0, 14498c2ecf20Sopenharmony_ci FW6_TYPE_WR_RPL = 1, 14508c2ecf20Sopenharmony_ci FW6_TYPE_CQE = 2, 14518c2ecf20Sopenharmony_ci FW6_TYPE_OFLD_CONNECTION_WR_RPL = 3, 14528c2ecf20Sopenharmony_ci FW6_TYPE_RSSCPL = FW_TYPE_RSSCPL, 14538c2ecf20Sopenharmony_ci}; 14548c2ecf20Sopenharmony_ci 14558c2ecf20Sopenharmony_cistruct cpl_fw6_msg_ofld_connection_wr_rpl { 14568c2ecf20Sopenharmony_ci __u64 cookie; 14578c2ecf20Sopenharmony_ci __be32 tid; /* or atid in case of active failure */ 14588c2ecf20Sopenharmony_ci __u8 t_state; 14598c2ecf20Sopenharmony_ci __u8 retval; 14608c2ecf20Sopenharmony_ci __u8 rsvd[2]; 14618c2ecf20Sopenharmony_ci}; 14628c2ecf20Sopenharmony_ci 14638c2ecf20Sopenharmony_cistruct cpl_tx_data { 14648c2ecf20Sopenharmony_ci union opcode_tid ot; 14658c2ecf20Sopenharmony_ci __be32 len; 14668c2ecf20Sopenharmony_ci __be32 rsvd; 14678c2ecf20Sopenharmony_ci __be32 flags; 14688c2ecf20Sopenharmony_ci}; 14698c2ecf20Sopenharmony_ci 14708c2ecf20Sopenharmony_ci/* cpl_tx_data.flags field */ 14718c2ecf20Sopenharmony_ci#define TX_FORCE_S 13 14728c2ecf20Sopenharmony_ci#define TX_FORCE_V(x) ((x) << TX_FORCE_S) 14738c2ecf20Sopenharmony_ci 14748c2ecf20Sopenharmony_ci#define TX_DATA_MSS_S 16 14758c2ecf20Sopenharmony_ci#define TX_DATA_MSS_M 0xFFFF 14768c2ecf20Sopenharmony_ci#define TX_DATA_MSS_V(x) ((x) << TX_DATA_MSS_S) 14778c2ecf20Sopenharmony_ci#define TX_DATA_MSS_G(x) (((x) >> TX_DATA_MSS_S) & TX_DATA_MSS_M) 14788c2ecf20Sopenharmony_ci 14798c2ecf20Sopenharmony_ci#define TX_LENGTH_S 0 14808c2ecf20Sopenharmony_ci#define TX_LENGTH_M 0xFFFF 14818c2ecf20Sopenharmony_ci#define TX_LENGTH_V(x) ((x) << TX_LENGTH_S) 14828c2ecf20Sopenharmony_ci#define TX_LENGTH_G(x) (((x) >> TX_LENGTH_S) & TX_LENGTH_M) 14838c2ecf20Sopenharmony_ci 14848c2ecf20Sopenharmony_ci#define T6_TX_FORCE_S 20 14858c2ecf20Sopenharmony_ci#define T6_TX_FORCE_V(x) ((x) << T6_TX_FORCE_S) 14868c2ecf20Sopenharmony_ci#define T6_TX_FORCE_F T6_TX_FORCE_V(1U) 14878c2ecf20Sopenharmony_ci 14888c2ecf20Sopenharmony_ci#define TX_URG_S 16 14898c2ecf20Sopenharmony_ci#define TX_URG_V(x) ((x) << TX_URG_S) 14908c2ecf20Sopenharmony_ci 14918c2ecf20Sopenharmony_ci#define TX_SHOVE_S 14 14928c2ecf20Sopenharmony_ci#define TX_SHOVE_V(x) ((x) << TX_SHOVE_S) 14938c2ecf20Sopenharmony_ci#define TX_SHOVE_F TX_SHOVE_V(1U) 14948c2ecf20Sopenharmony_ci 14958c2ecf20Sopenharmony_ci#define TX_BYPASS_S 21 14968c2ecf20Sopenharmony_ci#define TX_BYPASS_V(x) ((x) << TX_BYPASS_S) 14978c2ecf20Sopenharmony_ci#define TX_BYPASS_F TX_BYPASS_V(1U) 14988c2ecf20Sopenharmony_ci 14998c2ecf20Sopenharmony_ci#define TX_PUSH_S 22 15008c2ecf20Sopenharmony_ci#define TX_PUSH_V(x) ((x) << TX_PUSH_S) 15018c2ecf20Sopenharmony_ci#define TX_PUSH_F TX_PUSH_V(1U) 15028c2ecf20Sopenharmony_ci 15038c2ecf20Sopenharmony_ci#define TX_ULP_MODE_S 10 15048c2ecf20Sopenharmony_ci#define TX_ULP_MODE_M 0x7 15058c2ecf20Sopenharmony_ci#define TX_ULP_MODE_V(x) ((x) << TX_ULP_MODE_S) 15068c2ecf20Sopenharmony_ci#define TX_ULP_MODE_G(x) (((x) >> TX_ULP_MODE_S) & TX_ULP_MODE_M) 15078c2ecf20Sopenharmony_ci 15088c2ecf20Sopenharmony_cienum { 15098c2ecf20Sopenharmony_ci ULP_TX_MEM_READ = 2, 15108c2ecf20Sopenharmony_ci ULP_TX_MEM_WRITE = 3, 15118c2ecf20Sopenharmony_ci ULP_TX_PKT = 4 15128c2ecf20Sopenharmony_ci}; 15138c2ecf20Sopenharmony_ci 15148c2ecf20Sopenharmony_cienum { 15158c2ecf20Sopenharmony_ci ULP_TX_SC_NOOP = 0x80, 15168c2ecf20Sopenharmony_ci ULP_TX_SC_IMM = 0x81, 15178c2ecf20Sopenharmony_ci ULP_TX_SC_DSGL = 0x82, 15188c2ecf20Sopenharmony_ci ULP_TX_SC_ISGL = 0x83, 15198c2ecf20Sopenharmony_ci ULP_TX_SC_MEMRD = 0x86 15208c2ecf20Sopenharmony_ci}; 15218c2ecf20Sopenharmony_ci 15228c2ecf20Sopenharmony_ci#define ULPTX_CMD_S 24 15238c2ecf20Sopenharmony_ci#define ULPTX_CMD_V(x) ((x) << ULPTX_CMD_S) 15248c2ecf20Sopenharmony_ci 15258c2ecf20Sopenharmony_ci#define ULPTX_LEN16_S 0 15268c2ecf20Sopenharmony_ci#define ULPTX_LEN16_M 0xFF 15278c2ecf20Sopenharmony_ci#define ULPTX_LEN16_V(x) ((x) << ULPTX_LEN16_S) 15288c2ecf20Sopenharmony_ci 15298c2ecf20Sopenharmony_ci#define ULP_TX_SC_MORE_S 23 15308c2ecf20Sopenharmony_ci#define ULP_TX_SC_MORE_V(x) ((x) << ULP_TX_SC_MORE_S) 15318c2ecf20Sopenharmony_ci#define ULP_TX_SC_MORE_F ULP_TX_SC_MORE_V(1U) 15328c2ecf20Sopenharmony_ci 15338c2ecf20Sopenharmony_cistruct ulptx_sge_pair { 15348c2ecf20Sopenharmony_ci __be32 len[2]; 15358c2ecf20Sopenharmony_ci __be64 addr[2]; 15368c2ecf20Sopenharmony_ci}; 15378c2ecf20Sopenharmony_ci 15388c2ecf20Sopenharmony_cistruct ulptx_sgl { 15398c2ecf20Sopenharmony_ci __be32 cmd_nsge; 15408c2ecf20Sopenharmony_ci __be32 len0; 15418c2ecf20Sopenharmony_ci __be64 addr0; 15428c2ecf20Sopenharmony_ci struct ulptx_sge_pair sge[]; 15438c2ecf20Sopenharmony_ci}; 15448c2ecf20Sopenharmony_ci 15458c2ecf20Sopenharmony_cistruct ulptx_idata { 15468c2ecf20Sopenharmony_ci __be32 cmd_more; 15478c2ecf20Sopenharmony_ci __be32 len; 15488c2ecf20Sopenharmony_ci}; 15498c2ecf20Sopenharmony_ci 15508c2ecf20Sopenharmony_cistruct ulp_txpkt { 15518c2ecf20Sopenharmony_ci __be32 cmd_dest; 15528c2ecf20Sopenharmony_ci __be32 len; 15538c2ecf20Sopenharmony_ci}; 15548c2ecf20Sopenharmony_ci 15558c2ecf20Sopenharmony_ci#define ULPTX_CMD_S 24 15568c2ecf20Sopenharmony_ci#define ULPTX_CMD_M 0xFF 15578c2ecf20Sopenharmony_ci#define ULPTX_CMD_V(x) ((x) << ULPTX_CMD_S) 15588c2ecf20Sopenharmony_ci 15598c2ecf20Sopenharmony_ci#define ULPTX_NSGE_S 0 15608c2ecf20Sopenharmony_ci#define ULPTX_NSGE_V(x) ((x) << ULPTX_NSGE_S) 15618c2ecf20Sopenharmony_ci 15628c2ecf20Sopenharmony_ci#define ULPTX_MORE_S 23 15638c2ecf20Sopenharmony_ci#define ULPTX_MORE_V(x) ((x) << ULPTX_MORE_S) 15648c2ecf20Sopenharmony_ci#define ULPTX_MORE_F ULPTX_MORE_V(1U) 15658c2ecf20Sopenharmony_ci 15668c2ecf20Sopenharmony_ci#define ULP_TXPKT_DEST_S 16 15678c2ecf20Sopenharmony_ci#define ULP_TXPKT_DEST_M 0x3 15688c2ecf20Sopenharmony_ci#define ULP_TXPKT_DEST_V(x) ((x) << ULP_TXPKT_DEST_S) 15698c2ecf20Sopenharmony_ci 15708c2ecf20Sopenharmony_ci#define ULP_TXPKT_FID_S 4 15718c2ecf20Sopenharmony_ci#define ULP_TXPKT_FID_M 0x7ff 15728c2ecf20Sopenharmony_ci#define ULP_TXPKT_FID_V(x) ((x) << ULP_TXPKT_FID_S) 15738c2ecf20Sopenharmony_ci 15748c2ecf20Sopenharmony_ci#define ULP_TXPKT_RO_S 3 15758c2ecf20Sopenharmony_ci#define ULP_TXPKT_RO_V(x) ((x) << ULP_TXPKT_RO_S) 15768c2ecf20Sopenharmony_ci#define ULP_TXPKT_RO_F ULP_TXPKT_RO_V(1U) 15778c2ecf20Sopenharmony_ci 15788c2ecf20Sopenharmony_cienum cpl_tx_tnl_lso_type { 15798c2ecf20Sopenharmony_ci TX_TNL_TYPE_OPAQUE, 15808c2ecf20Sopenharmony_ci TX_TNL_TYPE_NVGRE, 15818c2ecf20Sopenharmony_ci TX_TNL_TYPE_VXLAN, 15828c2ecf20Sopenharmony_ci TX_TNL_TYPE_GENEVE, 15838c2ecf20Sopenharmony_ci}; 15848c2ecf20Sopenharmony_ci 15858c2ecf20Sopenharmony_cistruct cpl_tx_tnl_lso { 15868c2ecf20Sopenharmony_ci __be32 op_to_IpIdSplitOut; 15878c2ecf20Sopenharmony_ci __be16 IpIdOffsetOut; 15888c2ecf20Sopenharmony_ci __be16 UdpLenSetOut_to_TnlHdrLen; 15898c2ecf20Sopenharmony_ci __be64 r1; 15908c2ecf20Sopenharmony_ci __be32 Flow_to_TcpHdrLen; 15918c2ecf20Sopenharmony_ci __be16 IpIdOffset; 15928c2ecf20Sopenharmony_ci __be16 IpIdSplit_to_Mss; 15938c2ecf20Sopenharmony_ci __be32 TCPSeqOffset; 15948c2ecf20Sopenharmony_ci __be32 EthLenOffset_Size; 15958c2ecf20Sopenharmony_ci /* encapsulated CPL (TX_PKT_XT) follows here */ 15968c2ecf20Sopenharmony_ci}; 15978c2ecf20Sopenharmony_ci 15988c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_OPCODE_S 24 15998c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_OPCODE_M 0xff 16008c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_OPCODE_V(x) ((x) << CPL_TX_TNL_LSO_OPCODE_S) 16018c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_OPCODE_G(x) \ 16028c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TNL_LSO_OPCODE_S) & CPL_TX_TNL_LSO_OPCODE_M) 16038c2ecf20Sopenharmony_ci 16048c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_FIRST_S 23 16058c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_FIRST_M 0x1 16068c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_FIRST_V(x) ((x) << CPL_TX_TNL_LSO_FIRST_S) 16078c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_FIRST_G(x) \ 16088c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TNL_LSO_FIRST_S) & CPL_TX_TNL_LSO_FIRST_M) 16098c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_FIRST_F CPL_TX_TNL_LSO_FIRST_V(1U) 16108c2ecf20Sopenharmony_ci 16118c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_LAST_S 22 16128c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_LAST_M 0x1 16138c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_LAST_V(x) ((x) << CPL_TX_TNL_LSO_LAST_S) 16148c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_LAST_G(x) \ 16158c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TNL_LSO_LAST_S) & CPL_TX_TNL_LSO_LAST_M) 16168c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_LAST_F CPL_TX_TNL_LSO_LAST_V(1U) 16178c2ecf20Sopenharmony_ci 16188c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_ETHHDRLENXOUT_S 21 16198c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_ETHHDRLENXOUT_M 0x1 16208c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_ETHHDRLENXOUT_V(x) \ 16218c2ecf20Sopenharmony_ci ((x) << CPL_TX_TNL_LSO_ETHHDRLENXOUT_S) 16228c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_ETHHDRLENXOUT_G(x) \ 16238c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TNL_LSO_ETHHDRLENXOUT_S) & \ 16248c2ecf20Sopenharmony_ci CPL_TX_TNL_LSO_ETHHDRLENXOUT_M) 16258c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_ETHHDRLENXOUT_F CPL_TX_TNL_LSO_ETHHDRLENXOUT_V(1U) 16268c2ecf20Sopenharmony_ci 16278c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPV6OUT_S 20 16288c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPV6OUT_M 0x1 16298c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPV6OUT_V(x) ((x) << CPL_TX_TNL_LSO_IPV6OUT_S) 16308c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPV6OUT_G(x) \ 16318c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TNL_LSO_IPV6OUT_S) & CPL_TX_TNL_LSO_IPV6OUT_M) 16328c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPV6OUT_F CPL_TX_TNL_LSO_IPV6OUT_V(1U) 16338c2ecf20Sopenharmony_ci 16348c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_ETHHDRLEN_S 16 16358c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_ETHHDRLEN_M 0xf 16368c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_ETHHDRLEN_V(x) ((x) << CPL_TX_TNL_LSO_ETHHDRLEN_S) 16378c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_ETHHDRLEN_G(x) \ 16388c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TNL_LSO_ETHHDRLEN_S) & CPL_TX_TNL_LSO_ETHHDRLEN_M) 16398c2ecf20Sopenharmony_ci 16408c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPHDRLEN_S 4 16418c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPHDRLEN_M 0xfff 16428c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPHDRLEN_V(x) ((x) << CPL_TX_TNL_LSO_IPHDRLEN_S) 16438c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPHDRLEN_G(x) \ 16448c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TNL_LSO_IPHDRLEN_S) & CPL_TX_TNL_LSO_IPHDRLEN_M) 16458c2ecf20Sopenharmony_ci 16468c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_TCPHDRLEN_S 0 16478c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_TCPHDRLEN_M 0xf 16488c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_TCPHDRLEN_V(x) ((x) << CPL_TX_TNL_LSO_TCPHDRLEN_S) 16498c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_TCPHDRLEN_G(x) \ 16508c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TNL_LSO_TCPHDRLEN_S) & CPL_TX_TNL_LSO_TCPHDRLEN_M) 16518c2ecf20Sopenharmony_ci 16528c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_MSS_S 0 16538c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_MSS_M 0x3fff 16548c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_MSS_V(x) ((x) << CPL_TX_TNL_LSO_MSS_S) 16558c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_MSS_G(x) \ 16568c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TNL_LSO_MSS_S) & CPL_TX_TNL_LSO_MSS_M) 16578c2ecf20Sopenharmony_ci 16588c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_SIZE_S 0 16598c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_SIZE_M 0xfffffff 16608c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_SIZE_V(x) ((x) << CPL_TX_TNL_LSO_SIZE_S) 16618c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_SIZE_G(x) \ 16628c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TNL_LSO_SIZE_S) & CPL_TX_TNL_LSO_SIZE_M) 16638c2ecf20Sopenharmony_ci 16648c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_ETHHDRLENOUT_S 16 16658c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_ETHHDRLENOUT_M 0xf 16668c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_ETHHDRLENOUT_V(x) \ 16678c2ecf20Sopenharmony_ci ((x) << CPL_TX_TNL_LSO_ETHHDRLENOUT_S) 16688c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_ETHHDRLENOUT_G(x) \ 16698c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TNL_LSO_ETHHDRLENOUT_S) & CPL_TX_TNL_LSO_ETHHDRLENOUT_M) 16708c2ecf20Sopenharmony_ci 16718c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPHDRLENOUT_S 4 16728c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPHDRLENOUT_M 0xfff 16738c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPHDRLENOUT_V(x) ((x) << CPL_TX_TNL_LSO_IPHDRLENOUT_S) 16748c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPHDRLENOUT_G(x) \ 16758c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TNL_LSO_IPHDRLENOUT_S) & CPL_TX_TNL_LSO_IPHDRLENOUT_M) 16768c2ecf20Sopenharmony_ci 16778c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPHDRCHKOUT_S 3 16788c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPHDRCHKOUT_M 0x1 16798c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPHDRCHKOUT_V(x) ((x) << CPL_TX_TNL_LSO_IPHDRCHKOUT_S) 16808c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPHDRCHKOUT_G(x) \ 16818c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TNL_LSO_IPHDRCHKOUT_S) & CPL_TX_TNL_LSO_IPHDRCHKOUT_M) 16828c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPHDRCHKOUT_F CPL_TX_TNL_LSO_IPHDRCHKOUT_V(1U) 16838c2ecf20Sopenharmony_ci 16848c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPLENSETOUT_S 2 16858c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPLENSETOUT_M 0x1 16868c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPLENSETOUT_V(x) ((x) << CPL_TX_TNL_LSO_IPLENSETOUT_S) 16878c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPLENSETOUT_G(x) \ 16888c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TNL_LSO_IPLENSETOUT_S) & CPL_TX_TNL_LSO_IPLENSETOUT_M) 16898c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPLENSETOUT_F CPL_TX_TNL_LSO_IPLENSETOUT_V(1U) 16908c2ecf20Sopenharmony_ci 16918c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPIDINCOUT_S 1 16928c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPIDINCOUT_M 0x1 16938c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPIDINCOUT_V(x) ((x) << CPL_TX_TNL_LSO_IPIDINCOUT_S) 16948c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPIDINCOUT_G(x) \ 16958c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TNL_LSO_IPIDINCOUT_S) & CPL_TX_TNL_LSO_IPIDINCOUT_M) 16968c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPIDINCOUT_F CPL_TX_TNL_LSO_IPIDINCOUT_V(1U) 16978c2ecf20Sopenharmony_ci 16988c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_UDPCHKCLROUT_S 14 16998c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_UDPCHKCLROUT_M 0x1 17008c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_UDPCHKCLROUT_V(x) \ 17018c2ecf20Sopenharmony_ci ((x) << CPL_TX_TNL_LSO_UDPCHKCLROUT_S) 17028c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_UDPCHKCLROUT_G(x) \ 17038c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TNL_LSO_UDPCHKCLROUT_S) & \ 17048c2ecf20Sopenharmony_ci CPL_TX_TNL_LSO_UDPCHKCLROUT_M) 17058c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_UDPCHKCLROUT_F CPL_TX_TNL_LSO_UDPCHKCLROUT_V(1U) 17068c2ecf20Sopenharmony_ci 17078c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_UDPLENSETOUT_S 15 17088c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_UDPLENSETOUT_M 0x1 17098c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_UDPLENSETOUT_V(x) \ 17108c2ecf20Sopenharmony_ci ((x) << CPL_TX_TNL_LSO_UDPLENSETOUT_S) 17118c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_UDPLENSETOUT_G(x) \ 17128c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TNL_LSO_UDPLENSETOUT_S) & \ 17138c2ecf20Sopenharmony_ci CPL_TX_TNL_LSO_UDPLENSETOUT_M) 17148c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_UDPLENSETOUT_F CPL_TX_TNL_LSO_UDPLENSETOUT_V(1U) 17158c2ecf20Sopenharmony_ci 17168c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_TNLTYPE_S 12 17178c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_TNLTYPE_M 0x3 17188c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_TNLTYPE_V(x) ((x) << CPL_TX_TNL_LSO_TNLTYPE_S) 17198c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_TNLTYPE_G(x) \ 17208c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TNL_LSO_TNLTYPE_S) & CPL_TX_TNL_LSO_TNLTYPE_M) 17218c2ecf20Sopenharmony_ci 17228c2ecf20Sopenharmony_ci#define S_CPL_TX_TNL_LSO_ETHHDRLEN 16 17238c2ecf20Sopenharmony_ci#define M_CPL_TX_TNL_LSO_ETHHDRLEN 0xf 17248c2ecf20Sopenharmony_ci#define V_CPL_TX_TNL_LSO_ETHHDRLEN(x) ((x) << S_CPL_TX_TNL_LSO_ETHHDRLEN) 17258c2ecf20Sopenharmony_ci#define G_CPL_TX_TNL_LSO_ETHHDRLEN(x) \ 17268c2ecf20Sopenharmony_ci (((x) >> S_CPL_TX_TNL_LSO_ETHHDRLEN) & M_CPL_TX_TNL_LSO_ETHHDRLEN) 17278c2ecf20Sopenharmony_ci 17288c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_TNLHDRLEN_S 0 17298c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_TNLHDRLEN_M 0xfff 17308c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_TNLHDRLEN_V(x) ((x) << CPL_TX_TNL_LSO_TNLHDRLEN_S) 17318c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_TNLHDRLEN_G(x) \ 17328c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TNL_LSO_TNLHDRLEN_S) & CPL_TX_TNL_LSO_TNLHDRLEN_M) 17338c2ecf20Sopenharmony_ci 17348c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPV6_S 20 17358c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPV6_M 0x1 17368c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPV6_V(x) ((x) << CPL_TX_TNL_LSO_IPV6_S) 17378c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPV6_G(x) \ 17388c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TNL_LSO_IPV6_S) & CPL_TX_TNL_LSO_IPV6_M) 17398c2ecf20Sopenharmony_ci#define CPL_TX_TNL_LSO_IPV6_F CPL_TX_TNL_LSO_IPV6_V(1U) 17408c2ecf20Sopenharmony_ci 17418c2ecf20Sopenharmony_ci#define ULP_TX_SC_MORE_S 23 17428c2ecf20Sopenharmony_ci#define ULP_TX_SC_MORE_V(x) ((x) << ULP_TX_SC_MORE_S) 17438c2ecf20Sopenharmony_ci#define ULP_TX_SC_MORE_F ULP_TX_SC_MORE_V(1U) 17448c2ecf20Sopenharmony_ci 17458c2ecf20Sopenharmony_cistruct ulp_mem_io { 17468c2ecf20Sopenharmony_ci WR_HDR; 17478c2ecf20Sopenharmony_ci __be32 cmd; 17488c2ecf20Sopenharmony_ci __be32 len16; /* command length */ 17498c2ecf20Sopenharmony_ci __be32 dlen; /* data length in 32-byte units */ 17508c2ecf20Sopenharmony_ci __be32 lock_addr; 17518c2ecf20Sopenharmony_ci}; 17528c2ecf20Sopenharmony_ci 17538c2ecf20Sopenharmony_ci#define ULP_MEMIO_LOCK_S 31 17548c2ecf20Sopenharmony_ci#define ULP_MEMIO_LOCK_V(x) ((x) << ULP_MEMIO_LOCK_S) 17558c2ecf20Sopenharmony_ci#define ULP_MEMIO_LOCK_F ULP_MEMIO_LOCK_V(1U) 17568c2ecf20Sopenharmony_ci 17578c2ecf20Sopenharmony_ci/* additional ulp_mem_io.cmd fields */ 17588c2ecf20Sopenharmony_ci#define ULP_MEMIO_ORDER_S 23 17598c2ecf20Sopenharmony_ci#define ULP_MEMIO_ORDER_V(x) ((x) << ULP_MEMIO_ORDER_S) 17608c2ecf20Sopenharmony_ci#define ULP_MEMIO_ORDER_F ULP_MEMIO_ORDER_V(1U) 17618c2ecf20Sopenharmony_ci 17628c2ecf20Sopenharmony_ci#define T5_ULP_MEMIO_IMM_S 23 17638c2ecf20Sopenharmony_ci#define T5_ULP_MEMIO_IMM_V(x) ((x) << T5_ULP_MEMIO_IMM_S) 17648c2ecf20Sopenharmony_ci#define T5_ULP_MEMIO_IMM_F T5_ULP_MEMIO_IMM_V(1U) 17658c2ecf20Sopenharmony_ci 17668c2ecf20Sopenharmony_ci#define T5_ULP_MEMIO_ORDER_S 22 17678c2ecf20Sopenharmony_ci#define T5_ULP_MEMIO_ORDER_V(x) ((x) << T5_ULP_MEMIO_ORDER_S) 17688c2ecf20Sopenharmony_ci#define T5_ULP_MEMIO_ORDER_F T5_ULP_MEMIO_ORDER_V(1U) 17698c2ecf20Sopenharmony_ci 17708c2ecf20Sopenharmony_ci#define T5_ULP_MEMIO_FID_S 4 17718c2ecf20Sopenharmony_ci#define T5_ULP_MEMIO_FID_M 0x7ff 17728c2ecf20Sopenharmony_ci#define T5_ULP_MEMIO_FID_V(x) ((x) << T5_ULP_MEMIO_FID_S) 17738c2ecf20Sopenharmony_ci 17748c2ecf20Sopenharmony_ci/* ulp_mem_io.lock_addr fields */ 17758c2ecf20Sopenharmony_ci#define ULP_MEMIO_ADDR_S 0 17768c2ecf20Sopenharmony_ci#define ULP_MEMIO_ADDR_V(x) ((x) << ULP_MEMIO_ADDR_S) 17778c2ecf20Sopenharmony_ci 17788c2ecf20Sopenharmony_ci/* ulp_mem_io.dlen fields */ 17798c2ecf20Sopenharmony_ci#define ULP_MEMIO_DATA_LEN_S 0 17808c2ecf20Sopenharmony_ci#define ULP_MEMIO_DATA_LEN_V(x) ((x) << ULP_MEMIO_DATA_LEN_S) 17818c2ecf20Sopenharmony_ci 17828c2ecf20Sopenharmony_ci#define ULPTX_NSGE_S 0 17838c2ecf20Sopenharmony_ci#define ULPTX_NSGE_M 0xFFFF 17848c2ecf20Sopenharmony_ci#define ULPTX_NSGE_V(x) ((x) << ULPTX_NSGE_S) 17858c2ecf20Sopenharmony_ci#define ULPTX_NSGE_G(x) (((x) >> ULPTX_NSGE_S) & ULPTX_NSGE_M) 17868c2ecf20Sopenharmony_ci 17878c2ecf20Sopenharmony_cistruct ulptx_sc_memrd { 17888c2ecf20Sopenharmony_ci __be32 cmd_to_len; 17898c2ecf20Sopenharmony_ci __be32 addr; 17908c2ecf20Sopenharmony_ci}; 17918c2ecf20Sopenharmony_ci 17928c2ecf20Sopenharmony_ci#define ULP_TXPKT_DATAMODIFY_S 23 17938c2ecf20Sopenharmony_ci#define ULP_TXPKT_DATAMODIFY_M 0x1 17948c2ecf20Sopenharmony_ci#define ULP_TXPKT_DATAMODIFY_V(x) ((x) << ULP_TXPKT_DATAMODIFY_S) 17958c2ecf20Sopenharmony_ci#define ULP_TXPKT_DATAMODIFY_G(x) \ 17968c2ecf20Sopenharmony_ci (((x) >> ULP_TXPKT_DATAMODIFY_S) & ULP_TXPKT_DATAMODIFY__M) 17978c2ecf20Sopenharmony_ci#define ULP_TXPKT_DATAMODIFY_F ULP_TXPKT_DATAMODIFY_V(1U) 17988c2ecf20Sopenharmony_ci 17998c2ecf20Sopenharmony_ci#define ULP_TXPKT_CHANNELID_S 22 18008c2ecf20Sopenharmony_ci#define ULP_TXPKT_CHANNELID_M 0x1 18018c2ecf20Sopenharmony_ci#define ULP_TXPKT_CHANNELID_V(x) ((x) << ULP_TXPKT_CHANNELID_S) 18028c2ecf20Sopenharmony_ci#define ULP_TXPKT_CHANNELID_G(x) \ 18038c2ecf20Sopenharmony_ci (((x) >> ULP_TXPKT_CHANNELID_S) & ULP_TXPKT_CHANNELID_M) 18048c2ecf20Sopenharmony_ci#define ULP_TXPKT_CHANNELID_F ULP_TXPKT_CHANNELID_V(1U) 18058c2ecf20Sopenharmony_ci 18068c2ecf20Sopenharmony_ci#define SCMD_SEQ_NO_CTRL_S 29 18078c2ecf20Sopenharmony_ci#define SCMD_SEQ_NO_CTRL_M 0x3 18088c2ecf20Sopenharmony_ci#define SCMD_SEQ_NO_CTRL_V(x) ((x) << SCMD_SEQ_NO_CTRL_S) 18098c2ecf20Sopenharmony_ci#define SCMD_SEQ_NO_CTRL_G(x) \ 18108c2ecf20Sopenharmony_ci (((x) >> SCMD_SEQ_NO_CTRL_S) & SCMD_SEQ_NO_CTRL_M) 18118c2ecf20Sopenharmony_ci 18128c2ecf20Sopenharmony_ci/* StsFieldPrsnt- Status field at the end of the TLS PDU */ 18138c2ecf20Sopenharmony_ci#define SCMD_STATUS_PRESENT_S 28 18148c2ecf20Sopenharmony_ci#define SCMD_STATUS_PRESENT_M 0x1 18158c2ecf20Sopenharmony_ci#define SCMD_STATUS_PRESENT_V(x) ((x) << SCMD_STATUS_PRESENT_S) 18168c2ecf20Sopenharmony_ci#define SCMD_STATUS_PRESENT_G(x) \ 18178c2ecf20Sopenharmony_ci (((x) >> SCMD_STATUS_PRESENT_S) & SCMD_STATUS_PRESENT_M) 18188c2ecf20Sopenharmony_ci#define SCMD_STATUS_PRESENT_F SCMD_STATUS_PRESENT_V(1U) 18198c2ecf20Sopenharmony_ci 18208c2ecf20Sopenharmony_ci/* ProtoVersion - Protocol Version 0: 1.2, 1:1.1, 2:DTLS, 3:Generic, 18218c2ecf20Sopenharmony_ci * 3-15: Reserved. 18228c2ecf20Sopenharmony_ci */ 18238c2ecf20Sopenharmony_ci#define SCMD_PROTO_VERSION_S 24 18248c2ecf20Sopenharmony_ci#define SCMD_PROTO_VERSION_M 0xf 18258c2ecf20Sopenharmony_ci#define SCMD_PROTO_VERSION_V(x) ((x) << SCMD_PROTO_VERSION_S) 18268c2ecf20Sopenharmony_ci#define SCMD_PROTO_VERSION_G(x) \ 18278c2ecf20Sopenharmony_ci (((x) >> SCMD_PROTO_VERSION_S) & SCMD_PROTO_VERSION_M) 18288c2ecf20Sopenharmony_ci 18298c2ecf20Sopenharmony_ci/* EncDecCtrl - Encryption/Decryption Control. 0: Encrypt, 1: Decrypt */ 18308c2ecf20Sopenharmony_ci#define SCMD_ENC_DEC_CTRL_S 23 18318c2ecf20Sopenharmony_ci#define SCMD_ENC_DEC_CTRL_M 0x1 18328c2ecf20Sopenharmony_ci#define SCMD_ENC_DEC_CTRL_V(x) ((x) << SCMD_ENC_DEC_CTRL_S) 18338c2ecf20Sopenharmony_ci#define SCMD_ENC_DEC_CTRL_G(x) \ 18348c2ecf20Sopenharmony_ci (((x) >> SCMD_ENC_DEC_CTRL_S) & SCMD_ENC_DEC_CTRL_M) 18358c2ecf20Sopenharmony_ci#define SCMD_ENC_DEC_CTRL_F SCMD_ENC_DEC_CTRL_V(1U) 18368c2ecf20Sopenharmony_ci 18378c2ecf20Sopenharmony_ci/* CipherAuthSeqCtrl - Cipher Authentication Sequence Control. */ 18388c2ecf20Sopenharmony_ci#define SCMD_CIPH_AUTH_SEQ_CTRL_S 22 18398c2ecf20Sopenharmony_ci#define SCMD_CIPH_AUTH_SEQ_CTRL_M 0x1 18408c2ecf20Sopenharmony_ci#define SCMD_CIPH_AUTH_SEQ_CTRL_V(x) \ 18418c2ecf20Sopenharmony_ci ((x) << SCMD_CIPH_AUTH_SEQ_CTRL_S) 18428c2ecf20Sopenharmony_ci#define SCMD_CIPH_AUTH_SEQ_CTRL_G(x) \ 18438c2ecf20Sopenharmony_ci (((x) >> SCMD_CIPH_AUTH_SEQ_CTRL_S) & SCMD_CIPH_AUTH_SEQ_CTRL_M) 18448c2ecf20Sopenharmony_ci#define SCMD_CIPH_AUTH_SEQ_CTRL_F SCMD_CIPH_AUTH_SEQ_CTRL_V(1U) 18458c2ecf20Sopenharmony_ci 18468c2ecf20Sopenharmony_ci/* CiphMode - Cipher Mode. 0: NOP, 1:AES-CBC, 2:AES-GCM, 3:AES-CTR, 18478c2ecf20Sopenharmony_ci * 4:Generic-AES, 5-15: Reserved. 18488c2ecf20Sopenharmony_ci */ 18498c2ecf20Sopenharmony_ci#define SCMD_CIPH_MODE_S 18 18508c2ecf20Sopenharmony_ci#define SCMD_CIPH_MODE_M 0xf 18518c2ecf20Sopenharmony_ci#define SCMD_CIPH_MODE_V(x) ((x) << SCMD_CIPH_MODE_S) 18528c2ecf20Sopenharmony_ci#define SCMD_CIPH_MODE_G(x) \ 18538c2ecf20Sopenharmony_ci (((x) >> SCMD_CIPH_MODE_S) & SCMD_CIPH_MODE_M) 18548c2ecf20Sopenharmony_ci 18558c2ecf20Sopenharmony_ci/* AuthMode - Auth Mode. 0: NOP, 1:SHA1, 2:SHA2-224, 3:SHA2-256 18568c2ecf20Sopenharmony_ci * 4-15: Reserved 18578c2ecf20Sopenharmony_ci */ 18588c2ecf20Sopenharmony_ci#define SCMD_AUTH_MODE_S 14 18598c2ecf20Sopenharmony_ci#define SCMD_AUTH_MODE_M 0xf 18608c2ecf20Sopenharmony_ci#define SCMD_AUTH_MODE_V(x) ((x) << SCMD_AUTH_MODE_S) 18618c2ecf20Sopenharmony_ci#define SCMD_AUTH_MODE_G(x) \ 18628c2ecf20Sopenharmony_ci (((x) >> SCMD_AUTH_MODE_S) & SCMD_AUTH_MODE_M) 18638c2ecf20Sopenharmony_ci 18648c2ecf20Sopenharmony_ci/* HmacCtrl - HMAC Control. 0:NOP, 1:No truncation, 2:Support HMAC Truncation 18658c2ecf20Sopenharmony_ci * per RFC 4366, 3:IPSec 96 bits, 4-7:Reserved 18668c2ecf20Sopenharmony_ci */ 18678c2ecf20Sopenharmony_ci#define SCMD_HMAC_CTRL_S 11 18688c2ecf20Sopenharmony_ci#define SCMD_HMAC_CTRL_M 0x7 18698c2ecf20Sopenharmony_ci#define SCMD_HMAC_CTRL_V(x) ((x) << SCMD_HMAC_CTRL_S) 18708c2ecf20Sopenharmony_ci#define SCMD_HMAC_CTRL_G(x) \ 18718c2ecf20Sopenharmony_ci (((x) >> SCMD_HMAC_CTRL_S) & SCMD_HMAC_CTRL_M) 18728c2ecf20Sopenharmony_ci 18738c2ecf20Sopenharmony_ci/* IvSize - IV size in units of 2 bytes */ 18748c2ecf20Sopenharmony_ci#define SCMD_IV_SIZE_S 7 18758c2ecf20Sopenharmony_ci#define SCMD_IV_SIZE_M 0xf 18768c2ecf20Sopenharmony_ci#define SCMD_IV_SIZE_V(x) ((x) << SCMD_IV_SIZE_S) 18778c2ecf20Sopenharmony_ci#define SCMD_IV_SIZE_G(x) \ 18788c2ecf20Sopenharmony_ci (((x) >> SCMD_IV_SIZE_S) & SCMD_IV_SIZE_M) 18798c2ecf20Sopenharmony_ci 18808c2ecf20Sopenharmony_ci/* NumIVs - Number of IVs */ 18818c2ecf20Sopenharmony_ci#define SCMD_NUM_IVS_S 0 18828c2ecf20Sopenharmony_ci#define SCMD_NUM_IVS_M 0x7f 18838c2ecf20Sopenharmony_ci#define SCMD_NUM_IVS_V(x) ((x) << SCMD_NUM_IVS_S) 18848c2ecf20Sopenharmony_ci#define SCMD_NUM_IVS_G(x) \ 18858c2ecf20Sopenharmony_ci (((x) >> SCMD_NUM_IVS_S) & SCMD_NUM_IVS_M) 18868c2ecf20Sopenharmony_ci 18878c2ecf20Sopenharmony_ci/* EnbDbgId - If this is enabled upper 20 (63:44) bits if SeqNumber 18888c2ecf20Sopenharmony_ci * (below) are used as Cid (connection id for debug status), these 18898c2ecf20Sopenharmony_ci * bits are padded to zero for forming the 64 bit 18908c2ecf20Sopenharmony_ci * sequence number for TLS 18918c2ecf20Sopenharmony_ci */ 18928c2ecf20Sopenharmony_ci#define SCMD_ENB_DBGID_S 31 18938c2ecf20Sopenharmony_ci#define SCMD_ENB_DBGID_M 0x1 18948c2ecf20Sopenharmony_ci#define SCMD_ENB_DBGID_V(x) ((x) << SCMD_ENB_DBGID_S) 18958c2ecf20Sopenharmony_ci#define SCMD_ENB_DBGID_G(x) \ 18968c2ecf20Sopenharmony_ci (((x) >> SCMD_ENB_DBGID_S) & SCMD_ENB_DBGID_M) 18978c2ecf20Sopenharmony_ci 18988c2ecf20Sopenharmony_ci/* IV generation in SW. */ 18998c2ecf20Sopenharmony_ci#define SCMD_IV_GEN_CTRL_S 30 19008c2ecf20Sopenharmony_ci#define SCMD_IV_GEN_CTRL_M 0x1 19018c2ecf20Sopenharmony_ci#define SCMD_IV_GEN_CTRL_V(x) ((x) << SCMD_IV_GEN_CTRL_S) 19028c2ecf20Sopenharmony_ci#define SCMD_IV_GEN_CTRL_G(x) \ 19038c2ecf20Sopenharmony_ci (((x) >> SCMD_IV_GEN_CTRL_S) & SCMD_IV_GEN_CTRL_M) 19048c2ecf20Sopenharmony_ci#define SCMD_IV_GEN_CTRL_F SCMD_IV_GEN_CTRL_V(1U) 19058c2ecf20Sopenharmony_ci 19068c2ecf20Sopenharmony_ci/* More frags */ 19078c2ecf20Sopenharmony_ci#define SCMD_MORE_FRAGS_S 20 19088c2ecf20Sopenharmony_ci#define SCMD_MORE_FRAGS_M 0x1 19098c2ecf20Sopenharmony_ci#define SCMD_MORE_FRAGS_V(x) ((x) << SCMD_MORE_FRAGS_S) 19108c2ecf20Sopenharmony_ci#define SCMD_MORE_FRAGS_G(x) (((x) >> SCMD_MORE_FRAGS_S) & SCMD_MORE_FRAGS_M) 19118c2ecf20Sopenharmony_ci 19128c2ecf20Sopenharmony_ci/*last frag */ 19138c2ecf20Sopenharmony_ci#define SCMD_LAST_FRAG_S 19 19148c2ecf20Sopenharmony_ci#define SCMD_LAST_FRAG_M 0x1 19158c2ecf20Sopenharmony_ci#define SCMD_LAST_FRAG_V(x) ((x) << SCMD_LAST_FRAG_S) 19168c2ecf20Sopenharmony_ci#define SCMD_LAST_FRAG_G(x) (((x) >> SCMD_LAST_FRAG_S) & SCMD_LAST_FRAG_M) 19178c2ecf20Sopenharmony_ci 19188c2ecf20Sopenharmony_ci/* TlsCompPdu */ 19198c2ecf20Sopenharmony_ci#define SCMD_TLS_COMPPDU_S 18 19208c2ecf20Sopenharmony_ci#define SCMD_TLS_COMPPDU_M 0x1 19218c2ecf20Sopenharmony_ci#define SCMD_TLS_COMPPDU_V(x) ((x) << SCMD_TLS_COMPPDU_S) 19228c2ecf20Sopenharmony_ci#define SCMD_TLS_COMPPDU_G(x) (((x) >> SCMD_TLS_COMPPDU_S) & SCMD_TLS_COMPPDU_M) 19238c2ecf20Sopenharmony_ci 19248c2ecf20Sopenharmony_ci/* KeyCntxtInline - Key context inline after the scmd OR PayloadOnly*/ 19258c2ecf20Sopenharmony_ci#define SCMD_KEY_CTX_INLINE_S 17 19268c2ecf20Sopenharmony_ci#define SCMD_KEY_CTX_INLINE_M 0x1 19278c2ecf20Sopenharmony_ci#define SCMD_KEY_CTX_INLINE_V(x) ((x) << SCMD_KEY_CTX_INLINE_S) 19288c2ecf20Sopenharmony_ci#define SCMD_KEY_CTX_INLINE_G(x) \ 19298c2ecf20Sopenharmony_ci (((x) >> SCMD_KEY_CTX_INLINE_S) & SCMD_KEY_CTX_INLINE_M) 19308c2ecf20Sopenharmony_ci#define SCMD_KEY_CTX_INLINE_F SCMD_KEY_CTX_INLINE_V(1U) 19318c2ecf20Sopenharmony_ci 19328c2ecf20Sopenharmony_ci/* TLSFragEnable - 0: Host created TLS PDUs, 1: TLS Framgmentation in ASIC */ 19338c2ecf20Sopenharmony_ci#define SCMD_TLS_FRAG_ENABLE_S 16 19348c2ecf20Sopenharmony_ci#define SCMD_TLS_FRAG_ENABLE_M 0x1 19358c2ecf20Sopenharmony_ci#define SCMD_TLS_FRAG_ENABLE_V(x) ((x) << SCMD_TLS_FRAG_ENABLE_S) 19368c2ecf20Sopenharmony_ci#define SCMD_TLS_FRAG_ENABLE_G(x) \ 19378c2ecf20Sopenharmony_ci (((x) >> SCMD_TLS_FRAG_ENABLE_S) & SCMD_TLS_FRAG_ENABLE_M) 19388c2ecf20Sopenharmony_ci#define SCMD_TLS_FRAG_ENABLE_F SCMD_TLS_FRAG_ENABLE_V(1U) 19398c2ecf20Sopenharmony_ci 19408c2ecf20Sopenharmony_ci/* MacOnly - Only send the MAC and discard PDU. This is valid for hash only 19418c2ecf20Sopenharmony_ci * modes, in this case TLS_TX will drop the PDU and only 19428c2ecf20Sopenharmony_ci * send back the MAC bytes. 19438c2ecf20Sopenharmony_ci */ 19448c2ecf20Sopenharmony_ci#define SCMD_MAC_ONLY_S 15 19458c2ecf20Sopenharmony_ci#define SCMD_MAC_ONLY_M 0x1 19468c2ecf20Sopenharmony_ci#define SCMD_MAC_ONLY_V(x) ((x) << SCMD_MAC_ONLY_S) 19478c2ecf20Sopenharmony_ci#define SCMD_MAC_ONLY_G(x) \ 19488c2ecf20Sopenharmony_ci (((x) >> SCMD_MAC_ONLY_S) & SCMD_MAC_ONLY_M) 19498c2ecf20Sopenharmony_ci#define SCMD_MAC_ONLY_F SCMD_MAC_ONLY_V(1U) 19508c2ecf20Sopenharmony_ci 19518c2ecf20Sopenharmony_ci/* AadIVDrop - Drop the AAD and IV fields. Useful in protocols 19528c2ecf20Sopenharmony_ci * which have complex AAD and IV formations Eg:AES-CCM 19538c2ecf20Sopenharmony_ci */ 19548c2ecf20Sopenharmony_ci#define SCMD_AADIVDROP_S 14 19558c2ecf20Sopenharmony_ci#define SCMD_AADIVDROP_M 0x1 19568c2ecf20Sopenharmony_ci#define SCMD_AADIVDROP_V(x) ((x) << SCMD_AADIVDROP_S) 19578c2ecf20Sopenharmony_ci#define SCMD_AADIVDROP_G(x) \ 19588c2ecf20Sopenharmony_ci (((x) >> SCMD_AADIVDROP_S) & SCMD_AADIVDROP_M) 19598c2ecf20Sopenharmony_ci#define SCMD_AADIVDROP_F SCMD_AADIVDROP_V(1U) 19608c2ecf20Sopenharmony_ci 19618c2ecf20Sopenharmony_ci/* HdrLength - Length of all headers excluding TLS header 19628c2ecf20Sopenharmony_ci * present before start of crypto PDU/payload. 19638c2ecf20Sopenharmony_ci */ 19648c2ecf20Sopenharmony_ci#define SCMD_HDR_LEN_S 0 19658c2ecf20Sopenharmony_ci#define SCMD_HDR_LEN_M 0x3fff 19668c2ecf20Sopenharmony_ci#define SCMD_HDR_LEN_V(x) ((x) << SCMD_HDR_LEN_S) 19678c2ecf20Sopenharmony_ci#define SCMD_HDR_LEN_G(x) \ 19688c2ecf20Sopenharmony_ci (((x) >> SCMD_HDR_LEN_S) & SCMD_HDR_LEN_M) 19698c2ecf20Sopenharmony_ci 19708c2ecf20Sopenharmony_cistruct cpl_tx_sec_pdu { 19718c2ecf20Sopenharmony_ci __be32 op_ivinsrtofst; 19728c2ecf20Sopenharmony_ci __be32 pldlen; 19738c2ecf20Sopenharmony_ci __be32 aadstart_cipherstop_hi; 19748c2ecf20Sopenharmony_ci __be32 cipherstop_lo_authinsert; 19758c2ecf20Sopenharmony_ci __be32 seqno_numivs; 19768c2ecf20Sopenharmony_ci __be32 ivgen_hdrlen; 19778c2ecf20Sopenharmony_ci __be64 scmd1; 19788c2ecf20Sopenharmony_ci}; 19798c2ecf20Sopenharmony_ci 19808c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_OPCODE_S 24 19818c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_OPCODE_M 0xff 19828c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_OPCODE_V(x) ((x) << CPL_TX_SEC_PDU_OPCODE_S) 19838c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_OPCODE_G(x) \ 19848c2ecf20Sopenharmony_ci (((x) >> CPL_TX_SEC_PDU_OPCODE_S) & CPL_TX_SEC_PDU_OPCODE_M) 19858c2ecf20Sopenharmony_ci 19868c2ecf20Sopenharmony_ci/* RX Channel Id */ 19878c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_RXCHID_S 22 19888c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_RXCHID_M 0x1 19898c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_RXCHID_V(x) ((x) << CPL_TX_SEC_PDU_RXCHID_S) 19908c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_RXCHID_G(x) \ 19918c2ecf20Sopenharmony_ci (((x) >> CPL_TX_SEC_PDU_RXCHID_S) & CPL_TX_SEC_PDU_RXCHID_M) 19928c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_RXCHID_F CPL_TX_SEC_PDU_RXCHID_V(1U) 19938c2ecf20Sopenharmony_ci 19948c2ecf20Sopenharmony_ci/* Ack Follows */ 19958c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_ACKFOLLOWS_S 21 19968c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_ACKFOLLOWS_M 0x1 19978c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_ACKFOLLOWS_V(x) ((x) << CPL_TX_SEC_PDU_ACKFOLLOWS_S) 19988c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_ACKFOLLOWS_G(x) \ 19998c2ecf20Sopenharmony_ci (((x) >> CPL_TX_SEC_PDU_ACKFOLLOWS_S) & CPL_TX_SEC_PDU_ACKFOLLOWS_M) 20008c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_ACKFOLLOWS_F CPL_TX_SEC_PDU_ACKFOLLOWS_V(1U) 20018c2ecf20Sopenharmony_ci 20028c2ecf20Sopenharmony_ci/* Loopback bit in cpl_tx_sec_pdu */ 20038c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_ULPTXLPBK_S 20 20048c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_ULPTXLPBK_M 0x1 20058c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_ULPTXLPBK_V(x) ((x) << CPL_TX_SEC_PDU_ULPTXLPBK_S) 20068c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_ULPTXLPBK_G(x) \ 20078c2ecf20Sopenharmony_ci (((x) >> CPL_TX_SEC_PDU_ULPTXLPBK_S) & CPL_TX_SEC_PDU_ULPTXLPBK_M) 20088c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_ULPTXLPBK_F CPL_TX_SEC_PDU_ULPTXLPBK_V(1U) 20098c2ecf20Sopenharmony_ci 20108c2ecf20Sopenharmony_ci/* Length of cpl header encapsulated */ 20118c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_CPLLEN_S 16 20128c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_CPLLEN_M 0xf 20138c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_CPLLEN_V(x) ((x) << CPL_TX_SEC_PDU_CPLLEN_S) 20148c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_CPLLEN_G(x) \ 20158c2ecf20Sopenharmony_ci (((x) >> CPL_TX_SEC_PDU_CPLLEN_S) & CPL_TX_SEC_PDU_CPLLEN_M) 20168c2ecf20Sopenharmony_ci 20178c2ecf20Sopenharmony_ci/* PlaceHolder */ 20188c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_PLACEHOLDER_S 10 20198c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_PLACEHOLDER_M 0x1 20208c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_PLACEHOLDER_V(x) ((x) << CPL_TX_SEC_PDU_PLACEHOLDER_S) 20218c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_PLACEHOLDER_G(x) \ 20228c2ecf20Sopenharmony_ci (((x) >> CPL_TX_SEC_PDU_PLACEHOLDER_S) & \ 20238c2ecf20Sopenharmony_ci CPL_TX_SEC_PDU_PLACEHOLDER_M) 20248c2ecf20Sopenharmony_ci 20258c2ecf20Sopenharmony_ci/* IvInsrtOffset: Insertion location for IV */ 20268c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_IVINSRTOFST_S 0 20278c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_IVINSRTOFST_M 0x3ff 20288c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_IVINSRTOFST_V(x) ((x) << CPL_TX_SEC_PDU_IVINSRTOFST_S) 20298c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_IVINSRTOFST_G(x) \ 20308c2ecf20Sopenharmony_ci (((x) >> CPL_TX_SEC_PDU_IVINSRTOFST_S) & \ 20318c2ecf20Sopenharmony_ci CPL_TX_SEC_PDU_IVINSRTOFST_M) 20328c2ecf20Sopenharmony_ci 20338c2ecf20Sopenharmony_ci/* AadStartOffset: Offset in bytes for AAD start from 20348c2ecf20Sopenharmony_ci * the first byte following the pkt headers (0-255 bytes) 20358c2ecf20Sopenharmony_ci */ 20368c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_AADSTART_S 24 20378c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_AADSTART_M 0xff 20388c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_AADSTART_V(x) ((x) << CPL_TX_SEC_PDU_AADSTART_S) 20398c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_AADSTART_G(x) \ 20408c2ecf20Sopenharmony_ci (((x) >> CPL_TX_SEC_PDU_AADSTART_S) & \ 20418c2ecf20Sopenharmony_ci CPL_TX_SEC_PDU_AADSTART_M) 20428c2ecf20Sopenharmony_ci 20438c2ecf20Sopenharmony_ci/* AadStopOffset: offset in bytes for AAD stop/end from the first byte following 20448c2ecf20Sopenharmony_ci * the pkt headers (0-511 bytes) 20458c2ecf20Sopenharmony_ci */ 20468c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_AADSTOP_S 15 20478c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_AADSTOP_M 0x1ff 20488c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_AADSTOP_V(x) ((x) << CPL_TX_SEC_PDU_AADSTOP_S) 20498c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_AADSTOP_G(x) \ 20508c2ecf20Sopenharmony_ci (((x) >> CPL_TX_SEC_PDU_AADSTOP_S) & CPL_TX_SEC_PDU_AADSTOP_M) 20518c2ecf20Sopenharmony_ci 20528c2ecf20Sopenharmony_ci/* CipherStartOffset: offset in bytes for encryption/decryption start from the 20538c2ecf20Sopenharmony_ci * first byte following the pkt headers (0-1023 bytes) 20548c2ecf20Sopenharmony_ci */ 20558c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_CIPHERSTART_S 5 20568c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_CIPHERSTART_M 0x3ff 20578c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_CIPHERSTART_V(x) ((x) << CPL_TX_SEC_PDU_CIPHERSTART_S) 20588c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_CIPHERSTART_G(x) \ 20598c2ecf20Sopenharmony_ci (((x) >> CPL_TX_SEC_PDU_CIPHERSTART_S) & \ 20608c2ecf20Sopenharmony_ci CPL_TX_SEC_PDU_CIPHERSTART_M) 20618c2ecf20Sopenharmony_ci 20628c2ecf20Sopenharmony_ci/* CipherStopOffset: offset in bytes for encryption/decryption end 20638c2ecf20Sopenharmony_ci * from end of the payload of this command (0-511 bytes) 20648c2ecf20Sopenharmony_ci */ 20658c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_CIPHERSTOP_HI_S 0 20668c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_CIPHERSTOP_HI_M 0x1f 20678c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_CIPHERSTOP_HI_V(x) \ 20688c2ecf20Sopenharmony_ci ((x) << CPL_TX_SEC_PDU_CIPHERSTOP_HI_S) 20698c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_CIPHERSTOP_HI_G(x) \ 20708c2ecf20Sopenharmony_ci (((x) >> CPL_TX_SEC_PDU_CIPHERSTOP_HI_S) & \ 20718c2ecf20Sopenharmony_ci CPL_TX_SEC_PDU_CIPHERSTOP_HI_M) 20728c2ecf20Sopenharmony_ci 20738c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_CIPHERSTOP_LO_S 28 20748c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_CIPHERSTOP_LO_M 0xf 20758c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_CIPHERSTOP_LO_V(x) \ 20768c2ecf20Sopenharmony_ci ((x) << CPL_TX_SEC_PDU_CIPHERSTOP_LO_S) 20778c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_CIPHERSTOP_LO_G(x) \ 20788c2ecf20Sopenharmony_ci (((x) >> CPL_TX_SEC_PDU_CIPHERSTOP_LO_S) & \ 20798c2ecf20Sopenharmony_ci CPL_TX_SEC_PDU_CIPHERSTOP_LO_M) 20808c2ecf20Sopenharmony_ci 20818c2ecf20Sopenharmony_ci/* AuthStartOffset: offset in bytes for authentication start from 20828c2ecf20Sopenharmony_ci * the first byte following the pkt headers (0-1023) 20838c2ecf20Sopenharmony_ci */ 20848c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_AUTHSTART_S 18 20858c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_AUTHSTART_M 0x3ff 20868c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_AUTHSTART_V(x) ((x) << CPL_TX_SEC_PDU_AUTHSTART_S) 20878c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_AUTHSTART_G(x) \ 20888c2ecf20Sopenharmony_ci (((x) >> CPL_TX_SEC_PDU_AUTHSTART_S) & \ 20898c2ecf20Sopenharmony_ci CPL_TX_SEC_PDU_AUTHSTART_M) 20908c2ecf20Sopenharmony_ci 20918c2ecf20Sopenharmony_ci/* AuthStopOffset: offset in bytes for authentication 20928c2ecf20Sopenharmony_ci * end from end of the payload of this command (0-511 Bytes) 20938c2ecf20Sopenharmony_ci */ 20948c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_AUTHSTOP_S 9 20958c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_AUTHSTOP_M 0x1ff 20968c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_AUTHSTOP_V(x) ((x) << CPL_TX_SEC_PDU_AUTHSTOP_S) 20978c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_AUTHSTOP_G(x) \ 20988c2ecf20Sopenharmony_ci (((x) >> CPL_TX_SEC_PDU_AUTHSTOP_S) & \ 20998c2ecf20Sopenharmony_ci CPL_TX_SEC_PDU_AUTHSTOP_M) 21008c2ecf20Sopenharmony_ci 21018c2ecf20Sopenharmony_ci/* AuthInsrtOffset: offset in bytes for authentication insertion 21028c2ecf20Sopenharmony_ci * from end of the payload of this command (0-511 bytes) 21038c2ecf20Sopenharmony_ci */ 21048c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_AUTHINSERT_S 0 21058c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_AUTHINSERT_M 0x1ff 21068c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_AUTHINSERT_V(x) ((x) << CPL_TX_SEC_PDU_AUTHINSERT_S) 21078c2ecf20Sopenharmony_ci#define CPL_TX_SEC_PDU_AUTHINSERT_G(x) \ 21088c2ecf20Sopenharmony_ci (((x) >> CPL_TX_SEC_PDU_AUTHINSERT_S) & \ 21098c2ecf20Sopenharmony_ci CPL_TX_SEC_PDU_AUTHINSERT_M) 21108c2ecf20Sopenharmony_ci 21118c2ecf20Sopenharmony_cistruct cpl_rx_phys_dsgl { 21128c2ecf20Sopenharmony_ci __be32 op_to_tid; 21138c2ecf20Sopenharmony_ci __be32 pcirlxorder_to_noofsgentr; 21148c2ecf20Sopenharmony_ci struct rss_header rss_hdr_int; 21158c2ecf20Sopenharmony_ci}; 21168c2ecf20Sopenharmony_ci 21178c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_OPCODE_S 24 21188c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_OPCODE_M 0xff 21198c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_OPCODE_V(x) ((x) << CPL_RX_PHYS_DSGL_OPCODE_S) 21208c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_OPCODE_G(x) \ 21218c2ecf20Sopenharmony_ci (((x) >> CPL_RX_PHYS_DSGL_OPCODE_S) & CPL_RX_PHYS_DSGL_OPCODE_M) 21228c2ecf20Sopenharmony_ci 21238c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_ISRDMA_S 23 21248c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_ISRDMA_M 0x1 21258c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_ISRDMA_V(x) ((x) << CPL_RX_PHYS_DSGL_ISRDMA_S) 21268c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_ISRDMA_G(x) \ 21278c2ecf20Sopenharmony_ci (((x) >> CPL_RX_PHYS_DSGL_ISRDMA_S) & CPL_RX_PHYS_DSGL_ISRDMA_M) 21288c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_ISRDMA_F CPL_RX_PHYS_DSGL_ISRDMA_V(1U) 21298c2ecf20Sopenharmony_ci 21308c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_RSVD1_S 20 21318c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_RSVD1_M 0x7 21328c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_RSVD1_V(x) ((x) << CPL_RX_PHYS_DSGL_RSVD1_S) 21338c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_RSVD1_G(x) \ 21348c2ecf20Sopenharmony_ci (((x) >> CPL_RX_PHYS_DSGL_RSVD1_S) & \ 21358c2ecf20Sopenharmony_ci CPL_RX_PHYS_DSGL_RSVD1_M) 21368c2ecf20Sopenharmony_ci 21378c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_PCIRLXORDER_S 31 21388c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_PCIRLXORDER_M 0x1 21398c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_PCIRLXORDER_V(x) \ 21408c2ecf20Sopenharmony_ci ((x) << CPL_RX_PHYS_DSGL_PCIRLXORDER_S) 21418c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_PCIRLXORDER_G(x) \ 21428c2ecf20Sopenharmony_ci (((x) >> CPL_RX_PHYS_DSGL_PCIRLXORDER_S) & \ 21438c2ecf20Sopenharmony_ci CPL_RX_PHYS_DSGL_PCIRLXORDER_M) 21448c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_PCIRLXORDER_F CPL_RX_PHYS_DSGL_PCIRLXORDER_V(1U) 21458c2ecf20Sopenharmony_ci 21468c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_PCINOSNOOP_S 30 21478c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_PCINOSNOOP_M 0x1 21488c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_PCINOSNOOP_V(x) \ 21498c2ecf20Sopenharmony_ci ((x) << CPL_RX_PHYS_DSGL_PCINOSNOOP_S) 21508c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_PCINOSNOOP_G(x) \ 21518c2ecf20Sopenharmony_ci (((x) >> CPL_RX_PHYS_DSGL_PCINOSNOOP_S) & \ 21528c2ecf20Sopenharmony_ci CPL_RX_PHYS_DSGL_PCINOSNOOP_M) 21538c2ecf20Sopenharmony_ci 21548c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_PCINOSNOOP_F CPL_RX_PHYS_DSGL_PCINOSNOOP_V(1U) 21558c2ecf20Sopenharmony_ci 21568c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_PCITPHNTENB_S 29 21578c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_PCITPHNTENB_M 0x1 21588c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_PCITPHNTENB_V(x) \ 21598c2ecf20Sopenharmony_ci ((x) << CPL_RX_PHYS_DSGL_PCITPHNTENB_S) 21608c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_PCITPHNTENB_G(x) \ 21618c2ecf20Sopenharmony_ci (((x) >> CPL_RX_PHYS_DSGL_PCITPHNTENB_S) & \ 21628c2ecf20Sopenharmony_ci CPL_RX_PHYS_DSGL_PCITPHNTENB_M) 21638c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_PCITPHNTENB_F CPL_RX_PHYS_DSGL_PCITPHNTENB_V(1U) 21648c2ecf20Sopenharmony_ci 21658c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_PCITPHNT_S 27 21668c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_PCITPHNT_M 0x3 21678c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_PCITPHNT_V(x) ((x) << CPL_RX_PHYS_DSGL_PCITPHNT_S) 21688c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_PCITPHNT_G(x) \ 21698c2ecf20Sopenharmony_ci (((x) >> CPL_RX_PHYS_DSGL_PCITPHNT_S) & \ 21708c2ecf20Sopenharmony_ci CPL_RX_PHYS_DSGL_PCITPHNT_M) 21718c2ecf20Sopenharmony_ci 21728c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_DCAID_S 16 21738c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_DCAID_M 0x7ff 21748c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_DCAID_V(x) ((x) << CPL_RX_PHYS_DSGL_DCAID_S) 21758c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_DCAID_G(x) \ 21768c2ecf20Sopenharmony_ci (((x) >> CPL_RX_PHYS_DSGL_DCAID_S) & \ 21778c2ecf20Sopenharmony_ci CPL_RX_PHYS_DSGL_DCAID_M) 21788c2ecf20Sopenharmony_ci 21798c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_NOOFSGENTR_S 0 21808c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_NOOFSGENTR_M 0xffff 21818c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_NOOFSGENTR_V(x) \ 21828c2ecf20Sopenharmony_ci ((x) << CPL_RX_PHYS_DSGL_NOOFSGENTR_S) 21838c2ecf20Sopenharmony_ci#define CPL_RX_PHYS_DSGL_NOOFSGENTR_G(x) \ 21848c2ecf20Sopenharmony_ci (((x) >> CPL_RX_PHYS_DSGL_NOOFSGENTR_S) & \ 21858c2ecf20Sopenharmony_ci CPL_RX_PHYS_DSGL_NOOFSGENTR_M) 21868c2ecf20Sopenharmony_ci 21878c2ecf20Sopenharmony_cistruct cpl_rx_mps_pkt { 21888c2ecf20Sopenharmony_ci __be32 op_to_r1_hi; 21898c2ecf20Sopenharmony_ci __be32 r1_lo_length; 21908c2ecf20Sopenharmony_ci}; 21918c2ecf20Sopenharmony_ci 21928c2ecf20Sopenharmony_ci#define CPL_RX_MPS_PKT_OP_S 24 21938c2ecf20Sopenharmony_ci#define CPL_RX_MPS_PKT_OP_M 0xff 21948c2ecf20Sopenharmony_ci#define CPL_RX_MPS_PKT_OP_V(x) ((x) << CPL_RX_MPS_PKT_OP_S) 21958c2ecf20Sopenharmony_ci#define CPL_RX_MPS_PKT_OP_G(x) \ 21968c2ecf20Sopenharmony_ci (((x) >> CPL_RX_MPS_PKT_OP_S) & CPL_RX_MPS_PKT_OP_M) 21978c2ecf20Sopenharmony_ci 21988c2ecf20Sopenharmony_ci#define CPL_RX_MPS_PKT_TYPE_S 20 21998c2ecf20Sopenharmony_ci#define CPL_RX_MPS_PKT_TYPE_M 0xf 22008c2ecf20Sopenharmony_ci#define CPL_RX_MPS_PKT_TYPE_V(x) ((x) << CPL_RX_MPS_PKT_TYPE_S) 22018c2ecf20Sopenharmony_ci#define CPL_RX_MPS_PKT_TYPE_G(x) \ 22028c2ecf20Sopenharmony_ci (((x) >> CPL_RX_MPS_PKT_TYPE_S) & CPL_RX_MPS_PKT_TYPE_M) 22038c2ecf20Sopenharmony_ci 22048c2ecf20Sopenharmony_cienum { 22058c2ecf20Sopenharmony_ci X_CPL_RX_MPS_PKT_TYPE_PAUSE = 1 << 0, 22068c2ecf20Sopenharmony_ci X_CPL_RX_MPS_PKT_TYPE_PPP = 1 << 1, 22078c2ecf20Sopenharmony_ci X_CPL_RX_MPS_PKT_TYPE_QFC = 1 << 2, 22088c2ecf20Sopenharmony_ci X_CPL_RX_MPS_PKT_TYPE_PTP = 1 << 3 22098c2ecf20Sopenharmony_ci}; 22108c2ecf20Sopenharmony_ci 22118c2ecf20Sopenharmony_cistruct cpl_srq_table_req { 22128c2ecf20Sopenharmony_ci WR_HDR; 22138c2ecf20Sopenharmony_ci union opcode_tid ot; 22148c2ecf20Sopenharmony_ci __u8 status; 22158c2ecf20Sopenharmony_ci __u8 rsvd[2]; 22168c2ecf20Sopenharmony_ci __u8 idx; 22178c2ecf20Sopenharmony_ci __be64 rsvd_pdid; 22188c2ecf20Sopenharmony_ci __be32 qlen_qbase; 22198c2ecf20Sopenharmony_ci __be16 cur_msn; 22208c2ecf20Sopenharmony_ci __be16 max_msn; 22218c2ecf20Sopenharmony_ci}; 22228c2ecf20Sopenharmony_ci 22238c2ecf20Sopenharmony_cistruct cpl_srq_table_rpl { 22248c2ecf20Sopenharmony_ci union opcode_tid ot; 22258c2ecf20Sopenharmony_ci __u8 status; 22268c2ecf20Sopenharmony_ci __u8 rsvd[2]; 22278c2ecf20Sopenharmony_ci __u8 idx; 22288c2ecf20Sopenharmony_ci __be64 rsvd_pdid; 22298c2ecf20Sopenharmony_ci __be32 qlen_qbase; 22308c2ecf20Sopenharmony_ci __be16 cur_msn; 22318c2ecf20Sopenharmony_ci __be16 max_msn; 22328c2ecf20Sopenharmony_ci}; 22338c2ecf20Sopenharmony_ci 22348c2ecf20Sopenharmony_ci/* cpl_srq_table_{req,rpl}.params fields */ 22358c2ecf20Sopenharmony_ci#define SRQT_QLEN_S 28 22368c2ecf20Sopenharmony_ci#define SRQT_QLEN_M 0xF 22378c2ecf20Sopenharmony_ci#define SRQT_QLEN_V(x) ((x) << SRQT_QLEN_S) 22388c2ecf20Sopenharmony_ci#define SRQT_QLEN_G(x) (((x) >> SRQT_QLEN_S) & SRQT_QLEN_M) 22398c2ecf20Sopenharmony_ci 22408c2ecf20Sopenharmony_ci#define SRQT_QBASE_S 0 22418c2ecf20Sopenharmony_ci#define SRQT_QBASE_M 0x3FFFFFF 22428c2ecf20Sopenharmony_ci#define SRQT_QBASE_V(x) ((x) << SRQT_QBASE_S) 22438c2ecf20Sopenharmony_ci#define SRQT_QBASE_G(x) (((x) >> SRQT_QBASE_S) & SRQT_QBASE_M) 22448c2ecf20Sopenharmony_ci 22458c2ecf20Sopenharmony_ci#define SRQT_PDID_S 0 22468c2ecf20Sopenharmony_ci#define SRQT_PDID_M 0xFF 22478c2ecf20Sopenharmony_ci#define SRQT_PDID_V(x) ((x) << SRQT_PDID_S) 22488c2ecf20Sopenharmony_ci#define SRQT_PDID_G(x) (((x) >> SRQT_PDID_S) & SRQT_PDID_M) 22498c2ecf20Sopenharmony_ci 22508c2ecf20Sopenharmony_ci#define SRQT_IDX_S 0 22518c2ecf20Sopenharmony_ci#define SRQT_IDX_M 0xF 22528c2ecf20Sopenharmony_ci#define SRQT_IDX_V(x) ((x) << SRQT_IDX_S) 22538c2ecf20Sopenharmony_ci#define SRQT_IDX_G(x) (((x) >> SRQT_IDX_S) & SRQT_IDX_M) 22548c2ecf20Sopenharmony_ci 22558c2ecf20Sopenharmony_cistruct cpl_tx_tls_sfo { 22568c2ecf20Sopenharmony_ci __be32 op_to_seg_len; 22578c2ecf20Sopenharmony_ci __be32 pld_len; 22588c2ecf20Sopenharmony_ci __be32 type_protover; 22598c2ecf20Sopenharmony_ci __be32 r1_lo; 22608c2ecf20Sopenharmony_ci __be32 seqno_numivs; 22618c2ecf20Sopenharmony_ci __be32 ivgen_hdrlen; 22628c2ecf20Sopenharmony_ci __be64 scmd1; 22638c2ecf20Sopenharmony_ci}; 22648c2ecf20Sopenharmony_ci 22658c2ecf20Sopenharmony_ci/* cpl_tx_tls_sfo macros */ 22668c2ecf20Sopenharmony_ci#define CPL_TX_TLS_SFO_OPCODE_S 24 22678c2ecf20Sopenharmony_ci#define CPL_TX_TLS_SFO_OPCODE_V(x) ((x) << CPL_TX_TLS_SFO_OPCODE_S) 22688c2ecf20Sopenharmony_ci 22698c2ecf20Sopenharmony_ci#define CPL_TX_TLS_SFO_DATA_TYPE_S 20 22708c2ecf20Sopenharmony_ci#define CPL_TX_TLS_SFO_DATA_TYPE_V(x) ((x) << CPL_TX_TLS_SFO_DATA_TYPE_S) 22718c2ecf20Sopenharmony_ci 22728c2ecf20Sopenharmony_ci#define CPL_TX_TLS_SFO_CPL_LEN_S 16 22738c2ecf20Sopenharmony_ci#define CPL_TX_TLS_SFO_CPL_LEN_V(x) ((x) << CPL_TX_TLS_SFO_CPL_LEN_S) 22748c2ecf20Sopenharmony_ci 22758c2ecf20Sopenharmony_ci#define CPL_TX_TLS_SFO_SEG_LEN_S 0 22768c2ecf20Sopenharmony_ci#define CPL_TX_TLS_SFO_SEG_LEN_M 0xffff 22778c2ecf20Sopenharmony_ci#define CPL_TX_TLS_SFO_SEG_LEN_V(x) ((x) << CPL_TX_TLS_SFO_SEG_LEN_S) 22788c2ecf20Sopenharmony_ci#define CPL_TX_TLS_SFO_SEG_LEN_G(x) \ 22798c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TLS_SFO_SEG_LEN_S) & CPL_TX_TLS_SFO_SEG_LEN_M) 22808c2ecf20Sopenharmony_ci 22818c2ecf20Sopenharmony_ci#define CPL_TX_TLS_SFO_TYPE_S 24 22828c2ecf20Sopenharmony_ci#define CPL_TX_TLS_SFO_TYPE_M 0xff 22838c2ecf20Sopenharmony_ci#define CPL_TX_TLS_SFO_TYPE_V(x) ((x) << CPL_TX_TLS_SFO_TYPE_S) 22848c2ecf20Sopenharmony_ci#define CPL_TX_TLS_SFO_TYPE_G(x) \ 22858c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TLS_SFO_TYPE_S) & CPL_TX_TLS_SFO_TYPE_M) 22868c2ecf20Sopenharmony_ci 22878c2ecf20Sopenharmony_ci#define CPL_TX_TLS_SFO_PROTOVER_S 8 22888c2ecf20Sopenharmony_ci#define CPL_TX_TLS_SFO_PROTOVER_M 0xffff 22898c2ecf20Sopenharmony_ci#define CPL_TX_TLS_SFO_PROTOVER_V(x) ((x) << CPL_TX_TLS_SFO_PROTOVER_S) 22908c2ecf20Sopenharmony_ci#define CPL_TX_TLS_SFO_PROTOVER_G(x) \ 22918c2ecf20Sopenharmony_ci (((x) >> CPL_TX_TLS_SFO_PROTOVER_S) & CPL_TX_TLS_SFO_PROTOVER_M) 22928c2ecf20Sopenharmony_ci 22938c2ecf20Sopenharmony_cistruct cpl_tls_data { 22948c2ecf20Sopenharmony_ci struct rss_header rsshdr; 22958c2ecf20Sopenharmony_ci union opcode_tid ot; 22968c2ecf20Sopenharmony_ci __be32 length_pkd; 22978c2ecf20Sopenharmony_ci __be32 seq; 22988c2ecf20Sopenharmony_ci __be32 r1; 22998c2ecf20Sopenharmony_ci}; 23008c2ecf20Sopenharmony_ci 23018c2ecf20Sopenharmony_ci#define CPL_TLS_DATA_OPCODE_S 24 23028c2ecf20Sopenharmony_ci#define CPL_TLS_DATA_OPCODE_M 0xff 23038c2ecf20Sopenharmony_ci#define CPL_TLS_DATA_OPCODE_V(x) ((x) << CPL_TLS_DATA_OPCODE_S) 23048c2ecf20Sopenharmony_ci#define CPL_TLS_DATA_OPCODE_G(x) \ 23058c2ecf20Sopenharmony_ci (((x) >> CPL_TLS_DATA_OPCODE_S) & CPL_TLS_DATA_OPCODE_M) 23068c2ecf20Sopenharmony_ci 23078c2ecf20Sopenharmony_ci#define CPL_TLS_DATA_TID_S 0 23088c2ecf20Sopenharmony_ci#define CPL_TLS_DATA_TID_M 0xffffff 23098c2ecf20Sopenharmony_ci#define CPL_TLS_DATA_TID_V(x) ((x) << CPL_TLS_DATA_TID_S) 23108c2ecf20Sopenharmony_ci#define CPL_TLS_DATA_TID_G(x) \ 23118c2ecf20Sopenharmony_ci (((x) >> CPL_TLS_DATA_TID_S) & CPL_TLS_DATA_TID_M) 23128c2ecf20Sopenharmony_ci 23138c2ecf20Sopenharmony_ci#define CPL_TLS_DATA_LENGTH_S 0 23148c2ecf20Sopenharmony_ci#define CPL_TLS_DATA_LENGTH_M 0xffff 23158c2ecf20Sopenharmony_ci#define CPL_TLS_DATA_LENGTH_V(x) ((x) << CPL_TLS_DATA_LENGTH_S) 23168c2ecf20Sopenharmony_ci#define CPL_TLS_DATA_LENGTH_G(x) \ 23178c2ecf20Sopenharmony_ci (((x) >> CPL_TLS_DATA_LENGTH_S) & CPL_TLS_DATA_LENGTH_M) 23188c2ecf20Sopenharmony_ci 23198c2ecf20Sopenharmony_cistruct cpl_rx_tls_cmp { 23208c2ecf20Sopenharmony_ci struct rss_header rsshdr; 23218c2ecf20Sopenharmony_ci union opcode_tid ot; 23228c2ecf20Sopenharmony_ci __be32 pdulength_length; 23238c2ecf20Sopenharmony_ci __be32 seq; 23248c2ecf20Sopenharmony_ci __be32 ddp_report; 23258c2ecf20Sopenharmony_ci __be32 r; 23268c2ecf20Sopenharmony_ci __be32 ddp_valid; 23278c2ecf20Sopenharmony_ci}; 23288c2ecf20Sopenharmony_ci 23298c2ecf20Sopenharmony_ci#define CPL_RX_TLS_CMP_OPCODE_S 24 23308c2ecf20Sopenharmony_ci#define CPL_RX_TLS_CMP_OPCODE_M 0xff 23318c2ecf20Sopenharmony_ci#define CPL_RX_TLS_CMP_OPCODE_V(x) ((x) << CPL_RX_TLS_CMP_OPCODE_S) 23328c2ecf20Sopenharmony_ci#define CPL_RX_TLS_CMP_OPCODE_G(x) \ 23338c2ecf20Sopenharmony_ci (((x) >> CPL_RX_TLS_CMP_OPCODE_S) & CPL_RX_TLS_CMP_OPCODE_M) 23348c2ecf20Sopenharmony_ci 23358c2ecf20Sopenharmony_ci#define CPL_RX_TLS_CMP_TID_S 0 23368c2ecf20Sopenharmony_ci#define CPL_RX_TLS_CMP_TID_M 0xffffff 23378c2ecf20Sopenharmony_ci#define CPL_RX_TLS_CMP_TID_V(x) ((x) << CPL_RX_TLS_CMP_TID_S) 23388c2ecf20Sopenharmony_ci#define CPL_RX_TLS_CMP_TID_G(x) \ 23398c2ecf20Sopenharmony_ci (((x) >> CPL_RX_TLS_CMP_TID_S) & CPL_RX_TLS_CMP_TID_M) 23408c2ecf20Sopenharmony_ci 23418c2ecf20Sopenharmony_ci#define CPL_RX_TLS_CMP_PDULENGTH_S 16 23428c2ecf20Sopenharmony_ci#define CPL_RX_TLS_CMP_PDULENGTH_M 0xffff 23438c2ecf20Sopenharmony_ci#define CPL_RX_TLS_CMP_PDULENGTH_V(x) ((x) << CPL_RX_TLS_CMP_PDULENGTH_S) 23448c2ecf20Sopenharmony_ci#define CPL_RX_TLS_CMP_PDULENGTH_G(x) \ 23458c2ecf20Sopenharmony_ci (((x) >> CPL_RX_TLS_CMP_PDULENGTH_S) & CPL_RX_TLS_CMP_PDULENGTH_M) 23468c2ecf20Sopenharmony_ci 23478c2ecf20Sopenharmony_ci#define CPL_RX_TLS_CMP_LENGTH_S 0 23488c2ecf20Sopenharmony_ci#define CPL_RX_TLS_CMP_LENGTH_M 0xffff 23498c2ecf20Sopenharmony_ci#define CPL_RX_TLS_CMP_LENGTH_V(x) ((x) << CPL_RX_TLS_CMP_LENGTH_S) 23508c2ecf20Sopenharmony_ci#define CPL_RX_TLS_CMP_LENGTH_G(x) \ 23518c2ecf20Sopenharmony_ci (((x) >> CPL_RX_TLS_CMP_LENGTH_S) & CPL_RX_TLS_CMP_LENGTH_M) 23528c2ecf20Sopenharmony_ci#endif /* __T4_MSG_H */ 2353