1 /*****************************************************************************
5 * $Date: 2005/06/21 18:29:47 $ *
7 * part of the Chelsio 10Gb Ethernet Driver. *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License, version 2, as *
11 * published by the Free Software Foundation. *
13 * You should have received a copy of the GNU General Public License along *
14 * with this program; if not, write to the Free Software Foundation, Inc., *
15 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED *
18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF *
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. *
21 * http://www.chelsio.com *
23 * Copyright (c) 2003 - 2005 Chelsio Communications, Inc. *
24 * All rights reserved. *
26 * Maintainers: maintainers@chelsio.com *
28 * Authors: Dimitrios Michailidis <dm@chelsio.com> *
29 * Tina Yang <tainay@chelsio.com> *
30 * Felix Marti <felix@chelsio.com> *
31 * Scott Bardone <sbardone@chelsio.com> *
32 * Kurt Ottaway <kottaway@chelsio.com> *
33 * Frank DiMambro <frank@chelsio.com> *
37 ****************************************************************************/
39 #ifndef _CXGB_CPL5_CMD_H_
40 #define _CXGB_CPL5_CMD_H_
42 #include <asm/byteorder.h>
44 #if !defined(__LITTLE_ENDIAN_BITFIELD) && !defined(__BIG_ENDIAN_BITFIELD)
45 #error "Adjust your <asm/byteorder.h> defines"
49 CPL_PASS_OPEN_REQ
= 0x1,
50 CPL_PASS_OPEN_RPL
= 0x2,
51 CPL_PASS_ESTABLISH
= 0x3,
52 CPL_PASS_ACCEPT_REQ
= 0xE,
53 CPL_PASS_ACCEPT_RPL
= 0x4,
54 CPL_ACT_OPEN_REQ
= 0x5,
55 CPL_ACT_OPEN_RPL
= 0x6,
56 CPL_CLOSE_CON_REQ
= 0x7,
57 CPL_CLOSE_CON_RPL
= 0x8,
58 CPL_CLOSE_LISTSRV_REQ
= 0x9,
59 CPL_CLOSE_LISTSRV_RPL
= 0xA,
63 CPL_ACT_ESTABLISH
= 0x17,
66 CPL_GET_TCB_RPL
= 0x25,
68 CPL_SET_TCB_FIELD
= 0x27,
69 CPL_SET_TCB_RPL
= 0x28,
73 CPL_PCMD_READ_RPL
= 0x32,
77 CPL_RX_DATA_DDP
= 0xA1,
78 CPL_RX_DATA_ACK
= 0xA3,
80 CPL_RX_ISCSI_HDR
= 0xAF,
81 CPL_TX_DATA_ACK
= 0xB0,
84 CPL_TX_PKT_LSO
= 0xB6,
86 CPL_RTE_DELETE_REQ
= 0xC0,
87 CPL_RTE_DELETE_RPL
= 0xC1,
88 CPL_RTE_WRITE_REQ
= 0xC2,
89 CPL_RTE_WRITE_RPL
= 0xD3,
90 CPL_RTE_READ_REQ
= 0xC3,
91 CPL_RTE_READ_RPL
= 0xC4,
92 CPL_L2T_WRITE_REQ
= 0xC5,
93 CPL_L2T_WRITE_RPL
= 0xD4,
94 CPL_L2T_READ_REQ
= 0xC6,
95 CPL_L2T_READ_RPL
= 0xC7,
96 CPL_SMT_WRITE_REQ
= 0xC8,
97 CPL_SMT_WRITE_RPL
= 0xD5,
98 CPL_SMT_READ_REQ
= 0xC9,
99 CPL_SMT_READ_RPL
= 0xCA,
100 CPL_ARP_MISS_REQ
= 0xCD,
101 CPL_ARP_MISS_RPL
= 0xCE,
102 CPL_MIGRATE_C2T_REQ
= 0xDC,
103 CPL_MIGRATE_C2T_RPL
= 0xDD,
106 /* internal: driver -> TOM */
107 CPL_MSS_CHANGE
= 0xE1
110 #define NUM_CPL_CMDS 256
114 CPL_ERR_TCAM_PARITY
= 1,
115 CPL_ERR_TCAM_FULL
= 3,
116 CPL_ERR_CONN_RESET
= 20,
117 CPL_ERR_CONN_EXIST
= 22,
118 CPL_ERR_ARP_MISS
= 23,
119 CPL_ERR_BAD_SYN
= 24,
120 CPL_ERR_CONN_TIMEDOUT
= 30,
121 CPL_ERR_XMIT_TIMEDOUT
= 31,
122 CPL_ERR_PERSIST_TIMEDOUT
= 32,
123 CPL_ERR_FINWAIT2_TIMEDOUT
= 33,
124 CPL_ERR_KEEPALIVE_TIMEDOUT
= 34,
125 CPL_ERR_ABORT_FAILED
= 42,
130 CPL_CONN_POLICY_AUTO
= 0,
131 CPL_CONN_POLICY_ASK
= 1,
132 CPL_CONN_POLICY_DENY
= 3
144 CPL_PASS_OPEN_ACCEPT
,
149 CPL_ABORT_SEND_RST
= 0,
151 CPL_ABORT_POST_CLOSE_REQ
= 2
154 enum { // TX_PKT_LSO ethernet types
167 #define V_OPCODE(x) ((x) << S_OPCODE)
168 #define G_OPCODE(x) (((x) >> S_OPCODE) & 0xFF)
169 #define G_TID(x) ((x) & 0xFFFFFF)
171 /* tid is assumed to be 24-bits */
172 #define MK_OPCODE_TID(opcode, tid) (V_OPCODE(opcode) | (tid))
174 #define OPCODE_TID(cmd) ((cmd)->ot.opcode_tid)
176 /* extract the TID from a CPL command */
177 #define GET_TID(cmd) (G_TID(ntohl(OPCODE_TID(cmd))))
182 #if defined(__LITTLE_ENDIAN_BITFIELD)
195 struct cpl_pass_open_req
{
207 struct cpl_pass_open_rpl
{
217 struct cpl_pass_establish
{
230 struct cpl_pass_accept_req
{
237 struct tcp_options tcp_options
;
243 u32 unknown_tcp_options
;
246 struct cpl_pass_accept_rpl
{
261 struct cpl_act_open_req
{
273 struct cpl_act_open_rpl
{
284 struct cpl_act_establish
{
301 struct cpl_get_tcb_rpl
{
314 struct cpl_set_tcb_field
{
322 struct cpl_set_tcb_rpl
{
335 struct cpl_pcmd_read
{
343 struct cpl_pcmd_read_rpl
{
348 struct cpl_close_con_req
{
353 struct cpl_close_con_rpl
{
361 struct cpl_close_listserv_req
{
366 struct cpl_close_listserv_rpl
{
372 struct cpl_abort_req
{
380 struct cpl_abort_rpl
{
388 struct cpl_peer_close
{
401 struct cpl_tx_data_ack
{
415 struct cpl_rx_data_ack
{
420 struct cpl_rx_data_ddp
{
432 * We want this header's alignment to be no more stringent than 2-byte aligned.
433 * All fields are u8 or u16 except for the length. However that field is not
434 * used so we break it into 2 16-bit parts to easily meet our alignment needs.
438 #if defined(__LITTLE_ENDIAN_BITFIELD)
456 struct cpl_tx_pkt_lso
{
458 #if defined(__LITTLE_ENDIAN_BITFIELD)
475 #if defined(__LITTLE_ENDIAN_BITFIELD)
487 #if defined(__LITTLE_ENDIAN_BITFIELD)
505 struct cpl_l2t_write_req
{
512 struct cpl_l2t_write_rpl
{
518 struct cpl_l2t_read_req
{
524 struct cpl_l2t_read_rpl
{
531 struct cpl_smt_write_req
{
534 #if defined(__LITTLE_ENDIAN_BITFIELD)
550 struct cpl_smt_write_rpl
{
556 struct cpl_smt_read_req
{
559 #if defined(__LITTLE_ENDIAN_BITFIELD)
569 struct cpl_smt_read_rpl
{
572 #if defined(__LITTLE_ENDIAN_BITFIELD)
588 struct cpl_rte_delete_req
{
593 struct cpl_rte_delete_rpl
{
599 struct cpl_rte_write_req
{
606 struct cpl_rte_write_rpl
{
612 struct cpl_rte_read_req
{
617 struct cpl_rte_read_rpl
{
622 #if defined(__LITTLE_ENDIAN_BITFIELD)
633 struct cpl_mss_change
{
638 #endif /* _CXGB_CPL5_CMD_H_ */