1 /*
2  * This file is part of the Chelsio T4 Ethernet driver for Linux.
3  *
4  * Copyright (c) 2003-2014 Chelsio Communications, Inc. All rights reserved.
5  *
6  * This software is available to you under a choice of one of two
7  * licenses.  You may choose to be licensed under the terms of the GNU
8  * General Public License (GPL) Version 2, available from the file
9  * COPYING in the main directory of this source tree, or the
10  * OpenIB.org BSD license below:
11  *
12  *     Redistribution and use in source and binary forms, with or
13  *     without modification, are permitted provided that the following
14  *     conditions are met:
15  *
16  *      - Redistributions of source code must retain the above
17  *        copyright notice, this list of conditions and the following
18  *        disclaimer.
19  *
20  *      - Redistributions in binary form must reproduce the above
21  *        copyright notice, this list of conditions and the following
22  *        disclaimer in the documentation and/or other materials
23  *        provided with the distribution.
24  *
25  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32  * SOFTWARE.
33  */
34 
35 #ifndef __T4_MSG_H
36 #define __T4_MSG_H
37 
38 #include <linux/types.h>
39 
40 enum {
41 	CPL_PASS_OPEN_REQ     = 0x1,
42 	CPL_PASS_ACCEPT_RPL   = 0x2,
43 	CPL_ACT_OPEN_REQ      = 0x3,
44 	CPL_SET_TCB_FIELD     = 0x5,
45 	CPL_GET_TCB           = 0x6,
46 	CPL_CLOSE_CON_REQ     = 0x8,
47 	CPL_CLOSE_LISTSRV_REQ = 0x9,
48 	CPL_ABORT_REQ         = 0xA,
49 	CPL_ABORT_RPL         = 0xB,
50 	CPL_RX_DATA_ACK       = 0xD,
51 	CPL_TX_PKT            = 0xE,
52 	CPL_L2T_WRITE_REQ     = 0x12,
53 	CPL_SMT_WRITE_REQ     = 0x14,
54 	CPL_TID_RELEASE       = 0x1A,
55 	CPL_SRQ_TABLE_REQ     = 0x1C,
56 	CPL_TX_DATA_ISO	      = 0x1F,
57 
58 	CPL_CLOSE_LISTSRV_RPL = 0x20,
59 	CPL_GET_TCB_RPL       = 0x22,
60 	CPL_L2T_WRITE_RPL     = 0x23,
61 	CPL_PASS_OPEN_RPL     = 0x24,
62 	CPL_ACT_OPEN_RPL      = 0x25,
63 	CPL_PEER_CLOSE        = 0x26,
64 	CPL_ABORT_REQ_RSS     = 0x2B,
65 	CPL_ABORT_RPL_RSS     = 0x2D,
66 	CPL_SMT_WRITE_RPL     = 0x2E,
67 
68 	CPL_RX_PHYS_ADDR      = 0x30,
69 	CPL_CLOSE_CON_RPL     = 0x32,
70 	CPL_ISCSI_HDR         = 0x33,
71 	CPL_RDMA_CQE          = 0x35,
72 	CPL_RDMA_CQE_READ_RSP = 0x36,
73 	CPL_RDMA_CQE_ERR      = 0x37,
74 	CPL_RX_DATA           = 0x39,
75 	CPL_SET_TCB_RPL       = 0x3A,
76 	CPL_RX_PKT            = 0x3B,
77 	CPL_RX_DDP_COMPLETE   = 0x3F,
78 
79 	CPL_ACT_ESTABLISH     = 0x40,
80 	CPL_PASS_ESTABLISH    = 0x41,
81 	CPL_RX_DATA_DDP       = 0x42,
82 	CPL_PASS_ACCEPT_REQ   = 0x44,
83 	CPL_RX_ISCSI_CMP      = 0x45,
84 	CPL_TRACE_PKT_T5      = 0x48,
85 	CPL_RX_ISCSI_DDP      = 0x49,
86 	CPL_RX_TLS_CMP        = 0x4E,
87 
88 	CPL_RDMA_READ_REQ     = 0x60,
89 
90 	CPL_PASS_OPEN_REQ6    = 0x81,
91 	CPL_ACT_OPEN_REQ6     = 0x83,
92 
93 	CPL_TX_TLS_PDU        = 0x88,
94 	CPL_TX_TLS_SFO        = 0x89,
95 	CPL_TX_SEC_PDU        = 0x8A,
96 	CPL_TX_TLS_ACK        = 0x8B,
97 
98 	CPL_RDMA_TERMINATE    = 0xA2,
99 	CPL_RDMA_WRITE        = 0xA4,
100 	CPL_SGE_EGR_UPDATE    = 0xA5,
101 	CPL_RX_MPS_PKT        = 0xAF,
102 
103 	CPL_TRACE_PKT         = 0xB0,
104 	CPL_TLS_DATA          = 0xB1,
105 	CPL_ISCSI_DATA	      = 0xB2,
106 
107 	CPL_FW4_MSG           = 0xC0,
108 	CPL_FW4_PLD           = 0xC1,
109 	CPL_FW4_ACK           = 0xC3,
110 	CPL_SRQ_TABLE_RPL     = 0xCC,
111 
112 	CPL_RX_PHYS_DSGL      = 0xD0,
113 
114 	CPL_FW6_MSG           = 0xE0,
115 	CPL_FW6_PLD           = 0xE1,
116 	CPL_TX_TNL_LSO        = 0xEC,
117 	CPL_TX_PKT_LSO        = 0xED,
118 	CPL_TX_PKT_XT         = 0xEE,
119 
120 	NUM_CPL_CMDS
121 };
122 
123 enum CPL_error {
124 	CPL_ERR_NONE               = 0,
125 	CPL_ERR_TCAM_PARITY        = 1,
126 	CPL_ERR_TCAM_MISS          = 2,
127 	CPL_ERR_TCAM_FULL          = 3,
128 	CPL_ERR_BAD_LENGTH         = 15,
129 	CPL_ERR_BAD_ROUTE          = 18,
130 	CPL_ERR_CONN_RESET         = 20,
131 	CPL_ERR_CONN_EXIST_SYNRECV = 21,
132 	CPL_ERR_CONN_EXIST         = 22,
133 	CPL_ERR_ARP_MISS           = 23,
134 	CPL_ERR_BAD_SYN            = 24,
135 	CPL_ERR_CONN_TIMEDOUT      = 30,
136 	CPL_ERR_XMIT_TIMEDOUT      = 31,
137 	CPL_ERR_PERSIST_TIMEDOUT   = 32,
138 	CPL_ERR_FINWAIT2_TIMEDOUT  = 33,
139 	CPL_ERR_KEEPALIVE_TIMEDOUT = 34,
140 	CPL_ERR_RTX_NEG_ADVICE     = 35,
141 	CPL_ERR_PERSIST_NEG_ADVICE = 36,
142 	CPL_ERR_KEEPALV_NEG_ADVICE = 37,
143 	CPL_ERR_ABORT_FAILED       = 42,
144 	CPL_ERR_IWARP_FLM          = 50,
145 	CPL_CONTAINS_READ_RPL      = 60,
146 	CPL_CONTAINS_WRITE_RPL     = 61,
147 };
148 
149 enum {
150 	CPL_CONN_POLICY_AUTO = 0,
151 	CPL_CONN_POLICY_ASK  = 1,
152 	CPL_CONN_POLICY_FILTER = 2,
153 	CPL_CONN_POLICY_DENY = 3
154 };
155 
156 enum {
157 	ULP_MODE_NONE          = 0,
158 	ULP_MODE_ISCSI         = 2,
159 	ULP_MODE_RDMA          = 4,
160 	ULP_MODE_TCPDDP	       = 5,
161 	ULP_MODE_FCOE          = 6,
162 	ULP_MODE_TLS           = 8,
163 };
164 
165 enum {
166 	ULP_CRC_HEADER = 1 << 0,
167 	ULP_CRC_DATA   = 1 << 1
168 };
169 
170 enum {
171 	CPL_ABORT_SEND_RST = 0,
172 	CPL_ABORT_NO_RST,
173 };
174 
175 enum {                     /* TX_PKT_XT checksum types */
176 	TX_CSUM_TCP    = 0,
177 	TX_CSUM_UDP    = 1,
178 	TX_CSUM_CRC16  = 4,
179 	TX_CSUM_CRC32  = 5,
180 	TX_CSUM_CRC32C = 6,
181 	TX_CSUM_FCOE   = 7,
182 	TX_CSUM_TCPIP  = 8,
183 	TX_CSUM_UDPIP  = 9,
184 	TX_CSUM_TCPIP6 = 10,
185 	TX_CSUM_UDPIP6 = 11,
186 	TX_CSUM_IP     = 12,
187 };
188 
189 union opcode_tid {
190 	__be32 opcode_tid;
191 	u8 opcode;
192 };
193 
194 #define CPL_OPCODE_S    24
195 #define CPL_OPCODE_V(x) ((x) << CPL_OPCODE_S)
196 #define CPL_OPCODE_G(x) (((x) >> CPL_OPCODE_S) & 0xFF)
197 #define TID_G(x)    ((x) & 0xFFFFFF)
198 
199 /* tid is assumed to be 24-bits */
200 #define MK_OPCODE_TID(opcode, tid) (CPL_OPCODE_V(opcode) | (tid))
201 
202 #define OPCODE_TID(cmd) ((cmd)->ot.opcode_tid)
203 
204 /* extract the TID from a CPL command */
205 #define GET_TID(cmd) (TID_G(be32_to_cpu(OPCODE_TID(cmd))))
206 
207 /* partitioning of TID fields that also carry a queue id */
208 #define TID_TID_S    0
209 #define TID_TID_M    0x3fff
210 #define TID_TID_V(x) ((x) << TID_TID_S)
211 #define TID_TID_G(x) (((x) >> TID_TID_S) & TID_TID_M)
212 
213 #define TID_QID_S    14
214 #define TID_QID_M    0x3ff
215 #define TID_QID_V(x) ((x) << TID_QID_S)
216 #define TID_QID_G(x) (((x) >> TID_QID_S) & TID_QID_M)
217 
218 struct rss_header {
219 	u8 opcode;
220 #if defined(__LITTLE_ENDIAN_BITFIELD)
221 	u8 channel:2;
222 	u8 filter_hit:1;
223 	u8 filter_tid:1;
224 	u8 hash_type:2;
225 	u8 ipv6:1;
226 	u8 send2fw:1;
227 #else
228 	u8 send2fw:1;
229 	u8 ipv6:1;
230 	u8 hash_type:2;
231 	u8 filter_tid:1;
232 	u8 filter_hit:1;
233 	u8 channel:2;
234 #endif
235 	__be16 qid;
236 	__be32 hash_val;
237 };
238 
239 struct work_request_hdr {
240 	__be32 wr_hi;
241 	__be32 wr_mid;
242 	__be64 wr_lo;
243 };
244 
245 /* wr_hi fields */
246 #define WR_OP_S    24
247 #define WR_OP_V(x) ((__u64)(x) << WR_OP_S)
248 
249 #define WR_HDR struct work_request_hdr wr
250 
251 /* option 0 fields */
252 #define TX_CHAN_S    2
253 #define TX_CHAN_V(x) ((x) << TX_CHAN_S)
254 
255 #define ULP_MODE_S    8
256 #define ULP_MODE_V(x) ((x) << ULP_MODE_S)
257 
258 #define RCV_BUFSIZ_S    12
259 #define RCV_BUFSIZ_M    0x3FFU
260 #define RCV_BUFSIZ_V(x) ((x) << RCV_BUFSIZ_S)
261 
262 #define SMAC_SEL_S    28
263 #define SMAC_SEL_V(x) ((__u64)(x) << SMAC_SEL_S)
264 
265 #define L2T_IDX_S    36
266 #define L2T_IDX_V(x) ((__u64)(x) << L2T_IDX_S)
267 
268 #define WND_SCALE_S    50
269 #define WND_SCALE_V(x) ((__u64)(x) << WND_SCALE_S)
270 
271 #define KEEP_ALIVE_S    54
272 #define KEEP_ALIVE_V(x) ((__u64)(x) << KEEP_ALIVE_S)
273 #define KEEP_ALIVE_F    KEEP_ALIVE_V(1ULL)
274 
275 #define MSS_IDX_S    60
276 #define MSS_IDX_M    0xF
277 #define MSS_IDX_V(x) ((__u64)(x) << MSS_IDX_S)
278 #define MSS_IDX_G(x) (((x) >> MSS_IDX_S) & MSS_IDX_M)
279 
280 /* option 2 fields */
281 #define RSS_QUEUE_S    0
282 #define RSS_QUEUE_M    0x3FF
283 #define RSS_QUEUE_V(x) ((x) << RSS_QUEUE_S)
284 #define RSS_QUEUE_G(x) (((x) >> RSS_QUEUE_S) & RSS_QUEUE_M)
285 
286 #define RSS_QUEUE_VALID_S    10
287 #define RSS_QUEUE_VALID_V(x) ((x) << RSS_QUEUE_VALID_S)
288 #define RSS_QUEUE_VALID_F    RSS_QUEUE_VALID_V(1U)
289 
290 #define RX_FC_DISABLE_S    20
291 #define RX_FC_DISABLE_V(x) ((x) << RX_FC_DISABLE_S)
292 #define RX_FC_DISABLE_F    RX_FC_DISABLE_V(1U)
293 
294 #define RX_FC_VALID_S    22
295 #define RX_FC_VALID_V(x) ((x) << RX_FC_VALID_S)
296 #define RX_FC_VALID_F    RX_FC_VALID_V(1U)
297 
298 #define RX_CHANNEL_S    26
299 #define RX_CHANNEL_V(x) ((x) << RX_CHANNEL_S)
300 #define RX_CHANNEL_F	RX_CHANNEL_V(1U)
301 
302 #define WND_SCALE_EN_S    28
303 #define WND_SCALE_EN_V(x) ((x) << WND_SCALE_EN_S)
304 #define WND_SCALE_EN_F    WND_SCALE_EN_V(1U)
305 
306 #define T5_OPT_2_VALID_S    31
307 #define T5_OPT_2_VALID_V(x) ((x) << T5_OPT_2_VALID_S)
308 #define T5_OPT_2_VALID_F    T5_OPT_2_VALID_V(1U)
309 
310 struct cpl_pass_open_req {
311 	WR_HDR;
312 	union opcode_tid ot;
313 	__be16 local_port;
314 	__be16 peer_port;
315 	__be32 local_ip;
316 	__be32 peer_ip;
317 	__be64 opt0;
318 	__be64 opt1;
319 };
320 
321 /* option 0 fields */
322 #define NO_CONG_S    4
323 #define NO_CONG_V(x) ((x) << NO_CONG_S)
324 #define NO_CONG_F    NO_CONG_V(1U)
325 
326 #define DELACK_S    5
327 #define DELACK_V(x) ((x) << DELACK_S)
328 #define DELACK_F    DELACK_V(1U)
329 
330 #define NON_OFFLOAD_S		7
331 #define NON_OFFLOAD_V(x)	((x) << NON_OFFLOAD_S)
332 #define NON_OFFLOAD_F		NON_OFFLOAD_V(1U)
333 
334 #define DSCP_S    22
335 #define DSCP_M    0x3F
336 #define DSCP_V(x) ((x) << DSCP_S)
337 #define DSCP_G(x) (((x) >> DSCP_S) & DSCP_M)
338 
339 #define TCAM_BYPASS_S    48
340 #define TCAM_BYPASS_V(x) ((__u64)(x) << TCAM_BYPASS_S)
341 #define TCAM_BYPASS_F    TCAM_BYPASS_V(1ULL)
342 
343 #define NAGLE_S    49
344 #define NAGLE_V(x) ((__u64)(x) << NAGLE_S)
345 #define NAGLE_F    NAGLE_V(1ULL)
346 
347 /* option 1 fields */
348 #define SYN_RSS_ENABLE_S    0
349 #define SYN_RSS_ENABLE_V(x) ((x) << SYN_RSS_ENABLE_S)
350 #define SYN_RSS_ENABLE_F    SYN_RSS_ENABLE_V(1U)
351 
352 #define SYN_RSS_QUEUE_S    2
353 #define SYN_RSS_QUEUE_V(x) ((x) << SYN_RSS_QUEUE_S)
354 
355 #define CONN_POLICY_S    22
356 #define CONN_POLICY_V(x) ((x) << CONN_POLICY_S)
357 
358 struct cpl_pass_open_req6 {
359 	WR_HDR;
360 	union opcode_tid ot;
361 	__be16 local_port;
362 	__be16 peer_port;
363 	__be64 local_ip_hi;
364 	__be64 local_ip_lo;
365 	__be64 peer_ip_hi;
366 	__be64 peer_ip_lo;
367 	__be64 opt0;
368 	__be64 opt1;
369 };
370 
371 struct cpl_pass_open_rpl {
372 	union opcode_tid ot;
373 	u8 rsvd[3];
374 	u8 status;
375 };
376 
377 struct tcp_options {
378 	__be16 mss;
379 	__u8 wsf;
380 #if defined(__LITTLE_ENDIAN_BITFIELD)
381 	__u8:4;
382 	__u8 unknown:1;
383 	__u8:1;
384 	__u8 sack:1;
385 	__u8 tstamp:1;
386 #else
387 	__u8 tstamp:1;
388 	__u8 sack:1;
389 	__u8:1;
390 	__u8 unknown:1;
391 	__u8:4;
392 #endif
393 };
394 
395 struct cpl_pass_accept_req {
396 	union opcode_tid ot;
397 	__be16 rsvd;
398 	__be16 len;
399 	__be32 hdr_len;
400 	__be16 vlan;
401 	__be16 l2info;
402 	__be32 tos_stid;
403 	struct tcp_options tcpopt;
404 };
405 
406 /* cpl_pass_accept_req.hdr_len fields */
407 #define SYN_RX_CHAN_S    0
408 #define SYN_RX_CHAN_M    0xF
409 #define SYN_RX_CHAN_V(x) ((x) << SYN_RX_CHAN_S)
410 #define SYN_RX_CHAN_G(x) (((x) >> SYN_RX_CHAN_S) & SYN_RX_CHAN_M)
411 
412 #define TCP_HDR_LEN_S    10
413 #define TCP_HDR_LEN_M    0x3F
414 #define TCP_HDR_LEN_V(x) ((x) << TCP_HDR_LEN_S)
415 #define TCP_HDR_LEN_G(x) (((x) >> TCP_HDR_LEN_S) & TCP_HDR_LEN_M)
416 
417 #define IP_HDR_LEN_S    16
418 #define IP_HDR_LEN_M    0x3FF
419 #define IP_HDR_LEN_V(x) ((x) << IP_HDR_LEN_S)
420 #define IP_HDR_LEN_G(x) (((x) >> IP_HDR_LEN_S) & IP_HDR_LEN_M)
421 
422 #define ETH_HDR_LEN_S    26
423 #define ETH_HDR_LEN_M    0x1F
424 #define ETH_HDR_LEN_V(x) ((x) << ETH_HDR_LEN_S)
425 #define ETH_HDR_LEN_G(x) (((x) >> ETH_HDR_LEN_S) & ETH_HDR_LEN_M)
426 
427 /* cpl_pass_accept_req.l2info fields */
428 #define SYN_MAC_IDX_S    0
429 #define SYN_MAC_IDX_M    0x1FF
430 #define SYN_MAC_IDX_V(x) ((x) << SYN_MAC_IDX_S)
431 #define SYN_MAC_IDX_G(x) (((x) >> SYN_MAC_IDX_S) & SYN_MAC_IDX_M)
432 
433 #define SYN_XACT_MATCH_S    9
434 #define SYN_XACT_MATCH_V(x) ((x) << SYN_XACT_MATCH_S)
435 #define SYN_XACT_MATCH_F    SYN_XACT_MATCH_V(1U)
436 
437 #define SYN_INTF_S    12
438 #define SYN_INTF_M    0xF
439 #define SYN_INTF_V(x) ((x) << SYN_INTF_S)
440 #define SYN_INTF_G(x) (((x) >> SYN_INTF_S) & SYN_INTF_M)
441 
442 enum {                     /* TCP congestion control algorithms */
443 	CONG_ALG_RENO,
444 	CONG_ALG_TAHOE,
445 	CONG_ALG_NEWRENO,
446 	CONG_ALG_HIGHSPEED
447 };
448 
449 #define CONG_CNTRL_S    14
450 #define CONG_CNTRL_M    0x3
451 #define CONG_CNTRL_V(x) ((x) << CONG_CNTRL_S)
452 #define CONG_CNTRL_G(x) (((x) >> CONG_CNTRL_S) & CONG_CNTRL_M)
453 
454 #define T5_ISS_S    18
455 #define T5_ISS_V(x) ((x) << T5_ISS_S)
456 #define T5_ISS_F    T5_ISS_V(1U)
457 
458 struct cpl_pass_accept_rpl {
459 	WR_HDR;
460 	union opcode_tid ot;
461 	__be32 opt2;
462 	__be64 opt0;
463 };
464 
465 /* option 2 fields */
466 #define RX_COALESCE_VALID_S    11
467 #define RX_COALESCE_VALID_V(x) ((x) << RX_COALESCE_VALID_S)
468 #define RX_COALESCE_VALID_F    RX_COALESCE_VALID_V(1U)
469 
470 #define RX_COALESCE_S    12
471 #define RX_COALESCE_V(x) ((x) << RX_COALESCE_S)
472 
473 #define PACE_S    16
474 #define PACE_V(x) ((x) << PACE_S)
475 
476 #define TX_QUEUE_S    23
477 #define TX_QUEUE_M    0x7
478 #define TX_QUEUE_V(x) ((x) << TX_QUEUE_S)
479 #define TX_QUEUE_G(x) (((x) >> TX_QUEUE_S) & TX_QUEUE_M)
480 
481 #define CCTRL_ECN_S    27
482 #define CCTRL_ECN_V(x) ((x) << CCTRL_ECN_S)
483 #define CCTRL_ECN_F    CCTRL_ECN_V(1U)
484 
485 #define TSTAMPS_EN_S    29
486 #define TSTAMPS_EN_V(x) ((x) << TSTAMPS_EN_S)
487 #define TSTAMPS_EN_F    TSTAMPS_EN_V(1U)
488 
489 #define SACK_EN_S    30
490 #define SACK_EN_V(x) ((x) << SACK_EN_S)
491 #define SACK_EN_F    SACK_EN_V(1U)
492 
493 struct cpl_t5_pass_accept_rpl {
494 	WR_HDR;
495 	union opcode_tid ot;
496 	__be32 opt2;
497 	__be64 opt0;
498 	__be32 iss;
499 	__be32 rsvd;
500 };
501 
502 struct cpl_act_open_req {
503 	WR_HDR;
504 	union opcode_tid ot;
505 	__be16 local_port;
506 	__be16 peer_port;
507 	__be32 local_ip;
508 	__be32 peer_ip;
509 	__be64 opt0;
510 	__be32 params;
511 	__be32 opt2;
512 };
513 
514 #define FILTER_TUPLE_S  24
515 #define FILTER_TUPLE_M  0xFFFFFFFFFF
516 #define FILTER_TUPLE_V(x) ((x) << FILTER_TUPLE_S)
517 #define FILTER_TUPLE_G(x) (((x) >> FILTER_TUPLE_S) & FILTER_TUPLE_M)
518 struct cpl_t5_act_open_req {
519 	WR_HDR;
520 	union opcode_tid ot;
521 	__be16 local_port;
522 	__be16 peer_port;
523 	__be32 local_ip;
524 	__be32 peer_ip;
525 	__be64 opt0;
526 	__be32 rsvd;
527 	__be32 opt2;
528 	__be64 params;
529 };
530 
531 struct cpl_t6_act_open_req {
532 	WR_HDR;
533 	union opcode_tid ot;
534 	__be16 local_port;
535 	__be16 peer_port;
536 	__be32 local_ip;
537 	__be32 peer_ip;
538 	__be64 opt0;
539 	__be32 rsvd;
540 	__be32 opt2;
541 	__be64 params;
542 	__be32 rsvd2;
543 	__be32 opt3;
544 };
545 
546 struct cpl_act_open_req6 {
547 	WR_HDR;
548 	union opcode_tid ot;
549 	__be16 local_port;
550 	__be16 peer_port;
551 	__be64 local_ip_hi;
552 	__be64 local_ip_lo;
553 	__be64 peer_ip_hi;
554 	__be64 peer_ip_lo;
555 	__be64 opt0;
556 	__be32 params;
557 	__be32 opt2;
558 };
559 
560 struct cpl_t5_act_open_req6 {
561 	WR_HDR;
562 	union opcode_tid ot;
563 	__be16 local_port;
564 	__be16 peer_port;
565 	__be64 local_ip_hi;
566 	__be64 local_ip_lo;
567 	__be64 peer_ip_hi;
568 	__be64 peer_ip_lo;
569 	__be64 opt0;
570 	__be32 rsvd;
571 	__be32 opt2;
572 	__be64 params;
573 };
574 
575 struct cpl_t6_act_open_req6 {
576 	WR_HDR;
577 	union opcode_tid ot;
578 	__be16 local_port;
579 	__be16 peer_port;
580 	__be64 local_ip_hi;
581 	__be64 local_ip_lo;
582 	__be64 peer_ip_hi;
583 	__be64 peer_ip_lo;
584 	__be64 opt0;
585 	__be32 rsvd;
586 	__be32 opt2;
587 	__be64 params;
588 	__be32 rsvd2;
589 	__be32 opt3;
590 };
591 
592 struct cpl_act_open_rpl {
593 	union opcode_tid ot;
594 	__be32 atid_status;
595 };
596 
597 /* cpl_act_open_rpl.atid_status fields */
598 #define AOPEN_STATUS_S    0
599 #define AOPEN_STATUS_M    0xFF
600 #define AOPEN_STATUS_G(x) (((x) >> AOPEN_STATUS_S) & AOPEN_STATUS_M)
601 
602 #define AOPEN_ATID_S    8
603 #define AOPEN_ATID_M    0xFFFFFF
604 #define AOPEN_ATID_G(x) (((x) >> AOPEN_ATID_S) & AOPEN_ATID_M)
605 
606 struct cpl_pass_establish {
607 	union opcode_tid ot;
608 	__be32 rsvd;
609 	__be32 tos_stid;
610 	__be16 mac_idx;
611 	__be16 tcp_opt;
612 	__be32 snd_isn;
613 	__be32 rcv_isn;
614 };
615 
616 /* cpl_pass_establish.tos_stid fields */
617 #define PASS_OPEN_TID_S    0
618 #define PASS_OPEN_TID_M    0xFFFFFF
619 #define PASS_OPEN_TID_V(x) ((x) << PASS_OPEN_TID_S)
620 #define PASS_OPEN_TID_G(x) (((x) >> PASS_OPEN_TID_S) & PASS_OPEN_TID_M)
621 
622 #define PASS_OPEN_TOS_S    24
623 #define PASS_OPEN_TOS_M    0xFF
624 #define PASS_OPEN_TOS_V(x) ((x) << PASS_OPEN_TOS_S)
625 #define PASS_OPEN_TOS_G(x) (((x) >> PASS_OPEN_TOS_S) & PASS_OPEN_TOS_M)
626 
627 /* cpl_pass_establish.tcp_opt fields (also applies to act_open_establish) */
628 #define TCPOPT_WSCALE_OK_S	5
629 #define TCPOPT_WSCALE_OK_M	0x1
630 #define TCPOPT_WSCALE_OK_G(x)	\
631 	(((x) >> TCPOPT_WSCALE_OK_S) & TCPOPT_WSCALE_OK_M)
632 
633 #define TCPOPT_SACK_S		6
634 #define TCPOPT_SACK_M		0x1
635 #define TCPOPT_SACK_G(x)	(((x) >> TCPOPT_SACK_S) & TCPOPT_SACK_M)
636 
637 #define TCPOPT_TSTAMP_S		7
638 #define TCPOPT_TSTAMP_M		0x1
639 #define TCPOPT_TSTAMP_G(x)	(((x) >> TCPOPT_TSTAMP_S) & TCPOPT_TSTAMP_M)
640 
641 #define TCPOPT_SND_WSCALE_S	8
642 #define TCPOPT_SND_WSCALE_M	0xF
643 #define TCPOPT_SND_WSCALE_G(x)	\
644 	(((x) >> TCPOPT_SND_WSCALE_S) & TCPOPT_SND_WSCALE_M)
645 
646 #define TCPOPT_MSS_S	12
647 #define TCPOPT_MSS_M	0xF
648 #define TCPOPT_MSS_G(x)	(((x) >> TCPOPT_MSS_S) & TCPOPT_MSS_M)
649 
650 #define T6_TCP_HDR_LEN_S   8
651 #define T6_TCP_HDR_LEN_V(x) ((x) << T6_TCP_HDR_LEN_S)
652 #define T6_TCP_HDR_LEN_G(x) (((x) >> T6_TCP_HDR_LEN_S) & TCP_HDR_LEN_M)
653 
654 #define T6_IP_HDR_LEN_S    14
655 #define T6_IP_HDR_LEN_V(x) ((x) << T6_IP_HDR_LEN_S)
656 #define T6_IP_HDR_LEN_G(x) (((x) >> T6_IP_HDR_LEN_S) & IP_HDR_LEN_M)
657 
658 #define T6_ETH_HDR_LEN_S    24
659 #define T6_ETH_HDR_LEN_M    0xFF
660 #define T6_ETH_HDR_LEN_V(x) ((x) << T6_ETH_HDR_LEN_S)
661 #define T6_ETH_HDR_LEN_G(x) (((x) >> T6_ETH_HDR_LEN_S) & T6_ETH_HDR_LEN_M)
662 
663 struct cpl_act_establish {
664 	union opcode_tid ot;
665 	__be32 rsvd;
666 	__be32 tos_atid;
667 	__be16 mac_idx;
668 	__be16 tcp_opt;
669 	__be32 snd_isn;
670 	__be32 rcv_isn;
671 };
672 
673 struct cpl_get_tcb {
674 	WR_HDR;
675 	union opcode_tid ot;
676 	__be16 reply_ctrl;
677 	__be16 cookie;
678 };
679 
680 /* cpl_get_tcb.reply_ctrl fields */
681 #define QUEUENO_S    0
682 #define QUEUENO_V(x) ((x) << QUEUENO_S)
683 
684 #define REPLY_CHAN_S    14
685 #define REPLY_CHAN_V(x) ((x) << REPLY_CHAN_S)
686 #define REPLY_CHAN_F    REPLY_CHAN_V(1U)
687 
688 #define NO_REPLY_S    15
689 #define NO_REPLY_V(x) ((x) << NO_REPLY_S)
690 #define NO_REPLY_F    NO_REPLY_V(1U)
691 
692 struct cpl_get_tcb_rpl {
693 	union opcode_tid ot;
694 	__u8 cookie;
695 	__u8 status;
696 	__be16 len;
697 };
698 
699 struct cpl_set_tcb_field {
700 	WR_HDR;
701 	union opcode_tid ot;
702 	__be16 reply_ctrl;
703 	__be16 word_cookie;
704 	__be64 mask;
705 	__be64 val;
706 };
707 
708 /* cpl_set_tcb_field.word_cookie fields */
709 #define TCB_WORD_S	0
710 #define TCB_WORD_V(x)	((x) << TCB_WORD_S)
711 
712 #define TCB_COOKIE_S    5
713 #define TCB_COOKIE_M    0x7
714 #define TCB_COOKIE_V(x) ((x) << TCB_COOKIE_S)
715 #define TCB_COOKIE_G(x) (((x) >> TCB_COOKIE_S) & TCB_COOKIE_M)
716 
717 struct cpl_set_tcb_rpl {
718 	union opcode_tid ot;
719 	__be16 rsvd;
720 	u8 cookie;
721 	u8 status;
722 	__be64 oldval;
723 };
724 
725 struct cpl_close_con_req {
726 	WR_HDR;
727 	union opcode_tid ot;
728 	__be32 rsvd;
729 };
730 
731 struct cpl_close_con_rpl {
732 	union opcode_tid ot;
733 	u8 rsvd[3];
734 	u8 status;
735 	__be32 snd_nxt;
736 	__be32 rcv_nxt;
737 };
738 
739 struct cpl_close_listsvr_req {
740 	WR_HDR;
741 	union opcode_tid ot;
742 	__be16 reply_ctrl;
743 	__be16 rsvd;
744 };
745 
746 /* additional cpl_close_listsvr_req.reply_ctrl field */
747 #define LISTSVR_IPV6_S    14
748 #define LISTSVR_IPV6_V(x) ((x) << LISTSVR_IPV6_S)
749 #define LISTSVR_IPV6_F    LISTSVR_IPV6_V(1U)
750 
751 struct cpl_close_listsvr_rpl {
752 	union opcode_tid ot;
753 	u8 rsvd[3];
754 	u8 status;
755 };
756 
757 struct cpl_abort_req_rss {
758 	union opcode_tid ot;
759 	u8 rsvd[3];
760 	u8 status;
761 };
762 
763 struct cpl_abort_req_rss6 {
764 	union opcode_tid ot;
765 	__be32 srqidx_status;
766 };
767 
768 #define ABORT_RSS_STATUS_S    0
769 #define ABORT_RSS_STATUS_M    0xff
770 #define ABORT_RSS_STATUS_V(x) ((x) << ABORT_RSS_STATUS_S)
771 #define ABORT_RSS_STATUS_G(x) (((x) >> ABORT_RSS_STATUS_S) & ABORT_RSS_STATUS_M)
772 
773 #define ABORT_RSS_SRQIDX_S    8
774 #define ABORT_RSS_SRQIDX_M    0xffffff
775 #define ABORT_RSS_SRQIDX_V(x) ((x) << ABORT_RSS_SRQIDX_S)
776 #define ABORT_RSS_SRQIDX_G(x) (((x) >> ABORT_RSS_SRQIDX_S) & ABORT_RSS_SRQIDX_M)
777 
778 struct cpl_abort_req {
779 	WR_HDR;
780 	union opcode_tid ot;
781 	__be32 rsvd0;
782 	u8 rsvd1;
783 	u8 cmd;
784 	u8 rsvd2[6];
785 };
786 
787 struct cpl_abort_rpl_rss {
788 	union opcode_tid ot;
789 	u8 rsvd[3];
790 	u8 status;
791 };
792 
793 struct cpl_abort_rpl_rss6 {
794 	union opcode_tid ot;
795 	__be32 srqidx_status;
796 };
797 
798 struct cpl_abort_rpl {
799 	WR_HDR;
800 	union opcode_tid ot;
801 	__be32 rsvd0;
802 	u8 rsvd1;
803 	u8 cmd;
804 	u8 rsvd2[6];
805 };
806 
807 struct cpl_peer_close {
808 	union opcode_tid ot;
809 	__be32 rcv_nxt;
810 };
811 
812 struct cpl_tid_release {
813 	WR_HDR;
814 	union opcode_tid ot;
815 	__be32 rsvd;
816 };
817 
818 struct cpl_tx_pkt_core {
819 	__be32 ctrl0;
820 	__be16 pack;
821 	__be16 len;
822 	__be64 ctrl1;
823 };
824 
825 struct cpl_tx_pkt {
826 	WR_HDR;
827 	struct cpl_tx_pkt_core c;
828 };
829 
830 #define cpl_tx_pkt_xt cpl_tx_pkt
831 
832 /* cpl_tx_pkt_core.ctrl0 fields */
833 #define TXPKT_VF_S    0
834 #define TXPKT_VF_V(x) ((x) << TXPKT_VF_S)
835 
836 #define TXPKT_PF_S    8
837 #define TXPKT_PF_V(x) ((x) << TXPKT_PF_S)
838 
839 #define TXPKT_VF_VLD_S    11
840 #define TXPKT_VF_VLD_V(x) ((x) << TXPKT_VF_VLD_S)
841 #define TXPKT_VF_VLD_F    TXPKT_VF_VLD_V(1U)
842 
843 #define TXPKT_OVLAN_IDX_S    12
844 #define TXPKT_OVLAN_IDX_V(x) ((x) << TXPKT_OVLAN_IDX_S)
845 
846 #define TXPKT_T5_OVLAN_IDX_S	12
847 #define TXPKT_T5_OVLAN_IDX_V(x)	((x) << TXPKT_T5_OVLAN_IDX_S)
848 
849 #define TXPKT_INTF_S    16
850 #define TXPKT_INTF_V(x) ((x) << TXPKT_INTF_S)
851 
852 #define TXPKT_INS_OVLAN_S    21
853 #define TXPKT_INS_OVLAN_V(x) ((x) << TXPKT_INS_OVLAN_S)
854 #define TXPKT_INS_OVLAN_F    TXPKT_INS_OVLAN_V(1U)
855 
856 #define TXPKT_TSTAMP_S    23
857 #define TXPKT_TSTAMP_V(x) ((x) << TXPKT_TSTAMP_S)
858 #define TXPKT_TSTAMP_F    TXPKT_TSTAMP_V(1ULL)
859 
860 #define TXPKT_OPCODE_S    24
861 #define TXPKT_OPCODE_V(x) ((x) << TXPKT_OPCODE_S)
862 
863 /* cpl_tx_pkt_core.ctrl1 fields */
864 #define TXPKT_CSUM_END_S    12
865 #define TXPKT_CSUM_END_V(x) ((x) << TXPKT_CSUM_END_S)
866 
867 #define TXPKT_CSUM_START_S    20
868 #define TXPKT_CSUM_START_V(x) ((x) << TXPKT_CSUM_START_S)
869 
870 #define TXPKT_IPHDR_LEN_S    20
871 #define TXPKT_IPHDR_LEN_V(x) ((__u64)(x) << TXPKT_IPHDR_LEN_S)
872 
873 #define TXPKT_CSUM_LOC_S    30
874 #define TXPKT_CSUM_LOC_V(x) ((__u64)(x) << TXPKT_CSUM_LOC_S)
875 
876 #define TXPKT_ETHHDR_LEN_S    34
877 #define TXPKT_ETHHDR_LEN_V(x) ((__u64)(x) << TXPKT_ETHHDR_LEN_S)
878 
879 #define T6_TXPKT_ETHHDR_LEN_S    32
880 #define T6_TXPKT_ETHHDR_LEN_V(x) ((__u64)(x) << T6_TXPKT_ETHHDR_LEN_S)
881 
882 #define TXPKT_CSUM_TYPE_S    40
883 #define TXPKT_CSUM_TYPE_V(x) ((__u64)(x) << TXPKT_CSUM_TYPE_S)
884 
885 #define TXPKT_VLAN_S    44
886 #define TXPKT_VLAN_V(x) ((__u64)(x) << TXPKT_VLAN_S)
887 
888 #define TXPKT_VLAN_VLD_S    60
889 #define TXPKT_VLAN_VLD_V(x) ((__u64)(x) << TXPKT_VLAN_VLD_S)
890 #define TXPKT_VLAN_VLD_F    TXPKT_VLAN_VLD_V(1ULL)
891 
892 #define TXPKT_IPCSUM_DIS_S    62
893 #define TXPKT_IPCSUM_DIS_V(x) ((__u64)(x) << TXPKT_IPCSUM_DIS_S)
894 #define TXPKT_IPCSUM_DIS_F    TXPKT_IPCSUM_DIS_V(1ULL)
895 
896 #define TXPKT_L4CSUM_DIS_S    63
897 #define TXPKT_L4CSUM_DIS_V(x) ((__u64)(x) << TXPKT_L4CSUM_DIS_S)
898 #define TXPKT_L4CSUM_DIS_F    TXPKT_L4CSUM_DIS_V(1ULL)
899 
900 struct cpl_tx_pkt_lso_core {
901 	__be32 lso_ctrl;
902 	__be16 ipid_ofst;
903 	__be16 mss;
904 	__be32 seqno_offset;
905 	__be32 len;
906 	/* encapsulated CPL (TX_PKT, TX_PKT_XT or TX_DATA) follows here */
907 };
908 
909 /* cpl_tx_pkt_lso_core.lso_ctrl fields */
910 #define LSO_TCPHDR_LEN_S    0
911 #define LSO_TCPHDR_LEN_V(x) ((x) << LSO_TCPHDR_LEN_S)
912 
913 #define LSO_IPHDR_LEN_S    4
914 #define LSO_IPHDR_LEN_V(x) ((x) << LSO_IPHDR_LEN_S)
915 
916 #define LSO_ETHHDR_LEN_S    16
917 #define LSO_ETHHDR_LEN_V(x) ((x) << LSO_ETHHDR_LEN_S)
918 
919 #define LSO_IPV6_S    20
920 #define LSO_IPV6_V(x) ((x) << LSO_IPV6_S)
921 #define LSO_IPV6_F    LSO_IPV6_V(1U)
922 
923 #define LSO_LAST_SLICE_S    22
924 #define LSO_LAST_SLICE_V(x) ((x) << LSO_LAST_SLICE_S)
925 #define LSO_LAST_SLICE_F    LSO_LAST_SLICE_V(1U)
926 
927 #define LSO_FIRST_SLICE_S    23
928 #define LSO_FIRST_SLICE_V(x) ((x) << LSO_FIRST_SLICE_S)
929 #define LSO_FIRST_SLICE_F    LSO_FIRST_SLICE_V(1U)
930 
931 #define LSO_OPCODE_S    24
932 #define LSO_OPCODE_V(x) ((x) << LSO_OPCODE_S)
933 
934 #define LSO_T5_XFER_SIZE_S	   0
935 #define LSO_T5_XFER_SIZE_V(x) ((x) << LSO_T5_XFER_SIZE_S)
936 
937 struct cpl_tx_pkt_lso {
938 	WR_HDR;
939 	struct cpl_tx_pkt_lso_core c;
940 	/* encapsulated CPL (TX_PKT, TX_PKT_XT or TX_DATA) follows here */
941 };
942 
943 struct cpl_iscsi_hdr {
944 	union opcode_tid ot;
945 	__be16 pdu_len_ddp;
946 	__be16 len;
947 	__be32 seq;
948 	__be16 urg;
949 	u8 rsvd;
950 	u8 status;
951 };
952 
953 /* cpl_iscsi_hdr.pdu_len_ddp fields */
954 #define ISCSI_PDU_LEN_S    0
955 #define ISCSI_PDU_LEN_M    0x7FFF
956 #define ISCSI_PDU_LEN_V(x) ((x) << ISCSI_PDU_LEN_S)
957 #define ISCSI_PDU_LEN_G(x) (((x) >> ISCSI_PDU_LEN_S) & ISCSI_PDU_LEN_M)
958 
959 #define ISCSI_DDP_S    15
960 #define ISCSI_DDP_V(x) ((x) << ISCSI_DDP_S)
961 #define ISCSI_DDP_F    ISCSI_DDP_V(1U)
962 
963 struct cpl_rx_data_ddp {
964 	union opcode_tid ot;
965 	__be16 urg;
966 	__be16 len;
967 	__be32 seq;
968 	union {
969 		__be32 nxt_seq;
970 		__be32 ddp_report;
971 	};
972 	__be32 ulp_crc;
973 	__be32 ddpvld;
974 };
975 
976 #define cpl_rx_iscsi_ddp cpl_rx_data_ddp
977 
978 struct cpl_iscsi_data {
979 	union opcode_tid ot;
980 	__u8 rsvd0[2];
981 	__be16 len;
982 	__be32 seq;
983 	__be16 urg;
984 	__u8 rsvd1;
985 	__u8 status;
986 };
987 
988 struct cpl_rx_iscsi_cmp {
989 	union opcode_tid ot;
990 	__be16 pdu_len_ddp;
991 	__be16 len;
992 	__be32 seq;
993 	__be16 urg;
994 	__u8 rsvd;
995 	__u8 status;
996 	__be32 ulp_crc;
997 	__be32 ddpvld;
998 };
999 
1000 struct cpl_tx_data_iso {
1001 	__be32 op_to_scsi;
1002 	__u8   reserved1;
1003 	__u8   ahs_len;
1004 	__be16 mpdu;
1005 	__be32 burst_size;
1006 	__be32 len;
1007 	__be32 reserved2_seglen_offset;
1008 	__be32 datasn_offset;
1009 	__be32 buffer_offset;
1010 	__be32 reserved3;
1011 
1012 	/* encapsulated CPL_TX_DATA follows here */
1013 };
1014 
1015 /* cpl_tx_data_iso.op_to_scsi fields */
1016 #define CPL_TX_DATA_ISO_OP_S	24
1017 #define CPL_TX_DATA_ISO_OP_M	0xff
1018 #define CPL_TX_DATA_ISO_OP_V(x)	((x) << CPL_TX_DATA_ISO_OP_S)
1019 #define CPL_TX_DATA_ISO_OP_G(x)	\
1020 	(((x) >> CPL_TX_DATA_ISO_OP_S) & CPL_TX_DATA_ISO_OP_M)
1021 
1022 #define CPL_TX_DATA_ISO_FIRST_S		23
1023 #define CPL_TX_DATA_ISO_FIRST_M		0x1
1024 #define CPL_TX_DATA_ISO_FIRST_V(x)	((x) << CPL_TX_DATA_ISO_FIRST_S)
1025 #define CPL_TX_DATA_ISO_FIRST_G(x)	\
1026 	(((x) >> CPL_TX_DATA_ISO_FIRST_S) & CPL_TX_DATA_ISO_FIRST_M)
1027 #define CPL_TX_DATA_ISO_FIRST_F	CPL_TX_DATA_ISO_FIRST_V(1U)
1028 
1029 #define CPL_TX_DATA_ISO_LAST_S		22
1030 #define CPL_TX_DATA_ISO_LAST_M		0x1
1031 #define CPL_TX_DATA_ISO_LAST_V(x)	((x) << CPL_TX_DATA_ISO_LAST_S)
1032 #define CPL_TX_DATA_ISO_LAST_G(x)	\
1033 	(((x) >> CPL_TX_DATA_ISO_LAST_S) & CPL_TX_DATA_ISO_LAST_M)
1034 #define CPL_TX_DATA_ISO_LAST_F	CPL_TX_DATA_ISO_LAST_V(1U)
1035 
1036 #define CPL_TX_DATA_ISO_CPLHDRLEN_S	21
1037 #define CPL_TX_DATA_ISO_CPLHDRLEN_M	0x1
1038 #define CPL_TX_DATA_ISO_CPLHDRLEN_V(x)	((x) << CPL_TX_DATA_ISO_CPLHDRLEN_S)
1039 #define CPL_TX_DATA_ISO_CPLHDRLEN_G(x)	\
1040 	(((x) >> CPL_TX_DATA_ISO_CPLHDRLEN_S) & CPL_TX_DATA_ISO_CPLHDRLEN_M)
1041 #define CPL_TX_DATA_ISO_CPLHDRLEN_F	CPL_TX_DATA_ISO_CPLHDRLEN_V(1U)
1042 
1043 #define CPL_TX_DATA_ISO_HDRCRC_S	20
1044 #define CPL_TX_DATA_ISO_HDRCRC_M	0x1
1045 #define CPL_TX_DATA_ISO_HDRCRC_V(x)	((x) << CPL_TX_DATA_ISO_HDRCRC_S)
1046 #define CPL_TX_DATA_ISO_HDRCRC_G(x)	\
1047 	(((x) >> CPL_TX_DATA_ISO_HDRCRC_S) & CPL_TX_DATA_ISO_HDRCRC_M)
1048 #define CPL_TX_DATA_ISO_HDRCRC_F	CPL_TX_DATA_ISO_HDRCRC_V(1U)
1049 
1050 #define CPL_TX_DATA_ISO_PLDCRC_S	19
1051 #define CPL_TX_DATA_ISO_PLDCRC_M	0x1
1052 #define CPL_TX_DATA_ISO_PLDCRC_V(x)	((x) << CPL_TX_DATA_ISO_PLDCRC_S)
1053 #define CPL_TX_DATA_ISO_PLDCRC_G(x)	\
1054 	(((x) >> CPL_TX_DATA_ISO_PLDCRC_S) & CPL_TX_DATA_ISO_PLDCRC_M)
1055 #define CPL_TX_DATA_ISO_PLDCRC_F	CPL_TX_DATA_ISO_PLDCRC_V(1U)
1056 
1057 #define CPL_TX_DATA_ISO_IMMEDIATE_S	18
1058 #define CPL_TX_DATA_ISO_IMMEDIATE_M	0x1
1059 #define CPL_TX_DATA_ISO_IMMEDIATE_V(x)	((x) << CPL_TX_DATA_ISO_IMMEDIATE_S)
1060 #define CPL_TX_DATA_ISO_IMMEDIATE_G(x)	\
1061 	(((x) >> CPL_TX_DATA_ISO_IMMEDIATE_S) & CPL_TX_DATA_ISO_IMMEDIATE_M)
1062 #define CPL_TX_DATA_ISO_IMMEDIATE_F	CPL_TX_DATA_ISO_IMMEDIATE_V(1U)
1063 
1064 #define CPL_TX_DATA_ISO_SCSI_S		16
1065 #define CPL_TX_DATA_ISO_SCSI_M		0x3
1066 #define CPL_TX_DATA_ISO_SCSI_V(x)	((x) << CPL_TX_DATA_ISO_SCSI_S)
1067 #define CPL_TX_DATA_ISO_SCSI_G(x)	\
1068 	(((x) >> CPL_TX_DATA_ISO_SCSI_S) & CPL_TX_DATA_ISO_SCSI_M)
1069 
1070 /* cpl_tx_data_iso.reserved2_seglen_offset fields */
1071 #define CPL_TX_DATA_ISO_SEGLEN_OFFSET_S		0
1072 #define CPL_TX_DATA_ISO_SEGLEN_OFFSET_M		0xffffff
1073 #define CPL_TX_DATA_ISO_SEGLEN_OFFSET_V(x)	\
1074 	((x) << CPL_TX_DATA_ISO_SEGLEN_OFFSET_S)
1075 #define CPL_TX_DATA_ISO_SEGLEN_OFFSET_G(x)	\
1076 	(((x) >> CPL_TX_DATA_ISO_SEGLEN_OFFSET_S) & \
1077 	 CPL_TX_DATA_ISO_SEGLEN_OFFSET_M)
1078 
1079 struct cpl_rx_data {
1080 	union opcode_tid ot;
1081 	__be16 rsvd;
1082 	__be16 len;
1083 	__be32 seq;
1084 	__be16 urg;
1085 #if defined(__LITTLE_ENDIAN_BITFIELD)
1086 	u8 dack_mode:2;
1087 	u8 psh:1;
1088 	u8 heartbeat:1;
1089 	u8 ddp_off:1;
1090 	u8 :3;
1091 #else
1092 	u8 :3;
1093 	u8 ddp_off:1;
1094 	u8 heartbeat:1;
1095 	u8 psh:1;
1096 	u8 dack_mode:2;
1097 #endif
1098 	u8 status;
1099 };
1100 
1101 struct cpl_rx_data_ack {
1102 	WR_HDR;
1103 	union opcode_tid ot;
1104 	__be32 credit_dack;
1105 };
1106 
1107 /* cpl_rx_data_ack.ack_seq fields */
1108 #define RX_CREDITS_S    0
1109 #define RX_CREDITS_V(x) ((x) << RX_CREDITS_S)
1110 
1111 #define RX_FORCE_ACK_S    28
1112 #define RX_FORCE_ACK_V(x) ((x) << RX_FORCE_ACK_S)
1113 #define RX_FORCE_ACK_F    RX_FORCE_ACK_V(1U)
1114 
1115 #define RX_DACK_MODE_S    29
1116 #define RX_DACK_MODE_M    0x3
1117 #define RX_DACK_MODE_V(x) ((x) << RX_DACK_MODE_S)
1118 #define RX_DACK_MODE_G(x) (((x) >> RX_DACK_MODE_S) & RX_DACK_MODE_M)
1119 
1120 #define RX_DACK_CHANGE_S    31
1121 #define RX_DACK_CHANGE_V(x) ((x) << RX_DACK_CHANGE_S)
1122 #define RX_DACK_CHANGE_F    RX_DACK_CHANGE_V(1U)
1123 
1124 struct cpl_rx_pkt {
1125 	struct rss_header rsshdr;
1126 	u8 opcode;
1127 #if defined(__LITTLE_ENDIAN_BITFIELD)
1128 	u8 iff:4;
1129 	u8 csum_calc:1;
1130 	u8 ipmi_pkt:1;
1131 	u8 vlan_ex:1;
1132 	u8 ip_frag:1;
1133 #else
1134 	u8 ip_frag:1;
1135 	u8 vlan_ex:1;
1136 	u8 ipmi_pkt:1;
1137 	u8 csum_calc:1;
1138 	u8 iff:4;
1139 #endif
1140 	__be16 csum;
1141 	__be16 vlan;
1142 	__be16 len;
1143 	__be32 l2info;
1144 	__be16 hdr_len;
1145 	__be16 err_vec;
1146 };
1147 
1148 #define RX_T6_ETHHDR_LEN_M    0xFF
1149 #define RX_T6_ETHHDR_LEN_G(x) (((x) >> RX_ETHHDR_LEN_S) & RX_T6_ETHHDR_LEN_M)
1150 
1151 #define RXF_PSH_S    20
1152 #define RXF_PSH_V(x) ((x) << RXF_PSH_S)
1153 #define RXF_PSH_F    RXF_PSH_V(1U)
1154 
1155 #define RXF_SYN_S    21
1156 #define RXF_SYN_V(x) ((x) << RXF_SYN_S)
1157 #define RXF_SYN_F    RXF_SYN_V(1U)
1158 
1159 #define RXF_UDP_S    22
1160 #define RXF_UDP_V(x) ((x) << RXF_UDP_S)
1161 #define RXF_UDP_F    RXF_UDP_V(1U)
1162 
1163 #define RXF_TCP_S    23
1164 #define RXF_TCP_V(x) ((x) << RXF_TCP_S)
1165 #define RXF_TCP_F    RXF_TCP_V(1U)
1166 
1167 #define RXF_IP_S    24
1168 #define RXF_IP_V(x) ((x) << RXF_IP_S)
1169 #define RXF_IP_F    RXF_IP_V(1U)
1170 
1171 #define RXF_IP6_S    25
1172 #define RXF_IP6_V(x) ((x) << RXF_IP6_S)
1173 #define RXF_IP6_F    RXF_IP6_V(1U)
1174 
1175 #define RXF_SYN_COOKIE_S    26
1176 #define RXF_SYN_COOKIE_V(x) ((x) << RXF_SYN_COOKIE_S)
1177 #define RXF_SYN_COOKIE_F    RXF_SYN_COOKIE_V(1U)
1178 
1179 #define RXF_FCOE_S    26
1180 #define RXF_FCOE_V(x) ((x) << RXF_FCOE_S)
1181 #define RXF_FCOE_F    RXF_FCOE_V(1U)
1182 
1183 #define RXF_LRO_S    27
1184 #define RXF_LRO_V(x) ((x) << RXF_LRO_S)
1185 #define RXF_LRO_F    RXF_LRO_V(1U)
1186 
1187 /* rx_pkt.l2info fields */
1188 #define RX_ETHHDR_LEN_S    0
1189 #define RX_ETHHDR_LEN_M    0x1F
1190 #define RX_ETHHDR_LEN_V(x) ((x) << RX_ETHHDR_LEN_S)
1191 #define RX_ETHHDR_LEN_G(x) (((x) >> RX_ETHHDR_LEN_S) & RX_ETHHDR_LEN_M)
1192 
1193 #define RX_T5_ETHHDR_LEN_S    0
1194 #define RX_T5_ETHHDR_LEN_M    0x3F
1195 #define RX_T5_ETHHDR_LEN_V(x) ((x) << RX_T5_ETHHDR_LEN_S)
1196 #define RX_T5_ETHHDR_LEN_G(x) (((x) >> RX_T5_ETHHDR_LEN_S) & RX_T5_ETHHDR_LEN_M)
1197 
1198 #define RX_MACIDX_S    8
1199 #define RX_MACIDX_M    0x1FF
1200 #define RX_MACIDX_V(x) ((x) << RX_MACIDX_S)
1201 #define RX_MACIDX_G(x) (((x) >> RX_MACIDX_S) & RX_MACIDX_M)
1202 
1203 #define RXF_SYN_S    21
1204 #define RXF_SYN_V(x) ((x) << RXF_SYN_S)
1205 #define RXF_SYN_F    RXF_SYN_V(1U)
1206 
1207 #define RX_CHAN_S    28
1208 #define RX_CHAN_M    0xF
1209 #define RX_CHAN_V(x) ((x) << RX_CHAN_S)
1210 #define RX_CHAN_G(x) (((x) >> RX_CHAN_S) & RX_CHAN_M)
1211 
1212 /* rx_pkt.hdr_len fields */
1213 #define RX_TCPHDR_LEN_S    0
1214 #define RX_TCPHDR_LEN_M    0x3F
1215 #define RX_TCPHDR_LEN_V(x) ((x) << RX_TCPHDR_LEN_S)
1216 #define RX_TCPHDR_LEN_G(x) (((x) >> RX_TCPHDR_LEN_S) & RX_TCPHDR_LEN_M)
1217 
1218 #define RX_IPHDR_LEN_S    6
1219 #define RX_IPHDR_LEN_M    0x3FF
1220 #define RX_IPHDR_LEN_V(x) ((x) << RX_IPHDR_LEN_S)
1221 #define RX_IPHDR_LEN_G(x) (((x) >> RX_IPHDR_LEN_S) & RX_IPHDR_LEN_M)
1222 
1223 /* rx_pkt.err_vec fields */
1224 #define RXERR_CSUM_S    13
1225 #define RXERR_CSUM_V(x) ((x) << RXERR_CSUM_S)
1226 #define RXERR_CSUM_F    RXERR_CSUM_V(1U)
1227 
1228 #define T6_COMPR_RXERR_LEN_S    1
1229 #define T6_COMPR_RXERR_LEN_V(x) ((x) << T6_COMPR_RXERR_LEN_S)
1230 #define T6_COMPR_RXERR_LEN_F    T6_COMPR_RXERR_LEN_V(1U)
1231 
1232 #define T6_COMPR_RXERR_VEC_S    0
1233 #define T6_COMPR_RXERR_VEC_M    0x3F
1234 #define T6_COMPR_RXERR_VEC_V(x) ((x) << T6_COMPR_RXERR_LEN_S)
1235 #define T6_COMPR_RXERR_VEC_G(x) \
1236 		(((x) >> T6_COMPR_RXERR_VEC_S) & T6_COMPR_RXERR_VEC_M)
1237 
1238 /* Logical OR of RX_ERROR_CSUM, RX_ERROR_CSIP */
1239 #define T6_COMPR_RXERR_SUM_S    4
1240 #define T6_COMPR_RXERR_SUM_V(x) ((x) << T6_COMPR_RXERR_SUM_S)
1241 #define T6_COMPR_RXERR_SUM_F    T6_COMPR_RXERR_SUM_V(1U)
1242 
1243 #define T6_RX_TNLHDR_LEN_S    8
1244 #define T6_RX_TNLHDR_LEN_M    0xFF
1245 #define T6_RX_TNLHDR_LEN_V(x) ((x) << T6_RX_TNLHDR_LEN_S)
1246 #define T6_RX_TNLHDR_LEN_G(x) (((x) >> T6_RX_TNLHDR_LEN_S) & T6_RX_TNLHDR_LEN_M)
1247 
1248 struct cpl_trace_pkt {
1249 	u8 opcode;
1250 	u8 intf;
1251 #if defined(__LITTLE_ENDIAN_BITFIELD)
1252 	u8 runt:4;
1253 	u8 filter_hit:4;
1254 	u8 :6;
1255 	u8 err:1;
1256 	u8 trunc:1;
1257 #else
1258 	u8 filter_hit:4;
1259 	u8 runt:4;
1260 	u8 trunc:1;
1261 	u8 err:1;
1262 	u8 :6;
1263 #endif
1264 	__be16 rsvd;
1265 	__be16 len;
1266 	__be64 tstamp;
1267 };
1268 
1269 struct cpl_t5_trace_pkt {
1270 	__u8 opcode;
1271 	__u8 intf;
1272 #if defined(__LITTLE_ENDIAN_BITFIELD)
1273 	__u8 runt:4;
1274 	__u8 filter_hit:4;
1275 	__u8:6;
1276 	__u8 err:1;
1277 	__u8 trunc:1;
1278 #else
1279 	__u8 filter_hit:4;
1280 	__u8 runt:4;
1281 	__u8 trunc:1;
1282 	__u8 err:1;
1283 	__u8:6;
1284 #endif
1285 	__be16 rsvd;
1286 	__be16 len;
1287 	__be64 tstamp;
1288 	__be64 rsvd1;
1289 };
1290 
1291 struct cpl_l2t_write_req {
1292 	WR_HDR;
1293 	union opcode_tid ot;
1294 	__be16 params;
1295 	__be16 l2t_idx;
1296 	__be16 vlan;
1297 	u8 dst_mac[6];
1298 };
1299 
1300 /* cpl_l2t_write_req.params fields */
1301 #define L2T_W_INFO_S    2
1302 #define L2T_W_INFO_V(x) ((x) << L2T_W_INFO_S)
1303 
1304 #define L2T_W_PORT_S    8
1305 #define L2T_W_PORT_V(x) ((x) << L2T_W_PORT_S)
1306 
1307 #define L2T_W_NOREPLY_S    15
1308 #define L2T_W_NOREPLY_V(x) ((x) << L2T_W_NOREPLY_S)
1309 #define L2T_W_NOREPLY_F    L2T_W_NOREPLY_V(1U)
1310 
1311 #define CPL_L2T_VLAN_NONE 0xfff
1312 
1313 struct cpl_l2t_write_rpl {
1314 	union opcode_tid ot;
1315 	u8 status;
1316 	u8 rsvd[3];
1317 };
1318 
1319 struct cpl_smt_write_req {
1320 	WR_HDR;
1321 	union opcode_tid ot;
1322 	__be32 params;
1323 	__be16 pfvf1;
1324 	u8 src_mac1[6];
1325 	__be16 pfvf0;
1326 	u8 src_mac0[6];
1327 };
1328 
1329 struct cpl_t6_smt_write_req {
1330 	WR_HDR;
1331 	union opcode_tid ot;
1332 	__be32 params;
1333 	__be64 tag;
1334 	__be16 pfvf0;
1335 	u8 src_mac0[6];
1336 	__be32 local_ip;
1337 	__be32 rsvd;
1338 };
1339 
1340 struct cpl_smt_write_rpl {
1341 	union opcode_tid ot;
1342 	u8 status;
1343 	u8 rsvd[3];
1344 };
1345 
1346 /* cpl_smt_{read,write}_req.params fields */
1347 #define SMTW_OVLAN_IDX_S	16
1348 #define SMTW_OVLAN_IDX_V(x)	((x) << SMTW_OVLAN_IDX_S)
1349 
1350 #define SMTW_IDX_S	20
1351 #define SMTW_IDX_V(x)	((x) << SMTW_IDX_S)
1352 
1353 #define SMTW_NORPL_S	31
1354 #define SMTW_NORPL_V(x)	((x) << SMTW_NORPL_S)
1355 #define SMTW_NORPL_F	SMTW_NORPL_V(1U)
1356 
1357 struct cpl_rdma_terminate {
1358 	union opcode_tid ot;
1359 	__be16 rsvd;
1360 	__be16 len;
1361 };
1362 
1363 struct cpl_sge_egr_update {
1364 	__be32 opcode_qid;
1365 	__be16 cidx;
1366 	__be16 pidx;
1367 };
1368 
1369 /* cpl_sge_egr_update.ot fields */
1370 #define EGR_QID_S    0
1371 #define EGR_QID_M    0x1FFFF
1372 #define EGR_QID_G(x) (((x) >> EGR_QID_S) & EGR_QID_M)
1373 
1374 /* cpl_fw*.type values */
1375 enum {
1376 	FW_TYPE_CMD_RPL = 0,
1377 	FW_TYPE_WR_RPL = 1,
1378 	FW_TYPE_CQE = 2,
1379 	FW_TYPE_OFLD_CONNECTION_WR_RPL = 3,
1380 	FW_TYPE_RSSCPL = 4,
1381 };
1382 
1383 struct cpl_fw4_pld {
1384 	u8 opcode;
1385 	u8 rsvd0[3];
1386 	u8 type;
1387 	u8 rsvd1;
1388 	__be16 len;
1389 	__be64 data;
1390 	__be64 rsvd2;
1391 };
1392 
1393 struct cpl_fw6_pld {
1394 	u8 opcode;
1395 	u8 rsvd[5];
1396 	__be16 len;
1397 	__be64 data[4];
1398 };
1399 
1400 struct cpl_fw4_msg {
1401 	u8 opcode;
1402 	u8 type;
1403 	__be16 rsvd0;
1404 	__be32 rsvd1;
1405 	__be64 data[2];
1406 };
1407 
1408 struct cpl_fw4_ack {
1409 	union opcode_tid ot;
1410 	u8 credits;
1411 	u8 rsvd0[2];
1412 	u8 seq_vld;
1413 	__be32 snd_nxt;
1414 	__be32 snd_una;
1415 	__be64 rsvd1;
1416 };
1417 
1418 enum {
1419 	CPL_FW4_ACK_FLAGS_SEQVAL	= 0x1,	/* seqn valid */
1420 	CPL_FW4_ACK_FLAGS_CH		= 0x2,	/* channel change complete */
1421 	CPL_FW4_ACK_FLAGS_FLOWC		= 0x4,	/* fw_flowc_wr complete */
1422 };
1423 
1424 #define CPL_FW4_ACK_FLOWID_S    0
1425 #define CPL_FW4_ACK_FLOWID_M    0xffffff
1426 #define CPL_FW4_ACK_FLOWID_G(x) \
1427 	(((x) >> CPL_FW4_ACK_FLOWID_S) & CPL_FW4_ACK_FLOWID_M)
1428 
1429 struct cpl_fw6_msg {
1430 	u8 opcode;
1431 	u8 type;
1432 	__be16 rsvd0;
1433 	__be32 rsvd1;
1434 	__be64 data[4];
1435 };
1436 
1437 /* cpl_fw6_msg.type values */
1438 enum {
1439 	FW6_TYPE_CMD_RPL = 0,
1440 	FW6_TYPE_WR_RPL = 1,
1441 	FW6_TYPE_CQE = 2,
1442 	FW6_TYPE_OFLD_CONNECTION_WR_RPL = 3,
1443 	FW6_TYPE_RSSCPL = FW_TYPE_RSSCPL,
1444 };
1445 
1446 struct cpl_fw6_msg_ofld_connection_wr_rpl {
1447 	__u64   cookie;
1448 	__be32  tid;    /* or atid in case of active failure */
1449 	__u8    t_state;
1450 	__u8    retval;
1451 	__u8    rsvd[2];
1452 };
1453 
1454 struct cpl_tx_data {
1455 	union opcode_tid ot;
1456 	__be32 len;
1457 	__be32 rsvd;
1458 	__be32 flags;
1459 };
1460 
1461 /* cpl_tx_data.flags field */
1462 #define TX_FORCE_S	13
1463 #define TX_FORCE_V(x)	((x) << TX_FORCE_S)
1464 
1465 #define T6_TX_FORCE_S		20
1466 #define T6_TX_FORCE_V(x)	((x) << T6_TX_FORCE_S)
1467 #define T6_TX_FORCE_F		T6_TX_FORCE_V(1U)
1468 
1469 #define TX_URG_S    16
1470 #define TX_URG_V(x) ((x) << TX_URG_S)
1471 
1472 #define TX_SHOVE_S    14
1473 #define TX_SHOVE_V(x) ((x) << TX_SHOVE_S)
1474 
1475 #define TX_ULP_MODE_S    10
1476 #define TX_ULP_MODE_M    0x7
1477 #define TX_ULP_MODE_V(x) ((x) << TX_ULP_MODE_S)
1478 #define TX_ULP_MODE_G(x) (((x) >> TX_ULP_MODE_S) & TX_ULP_MODE_M)
1479 
1480 enum {
1481 	ULP_TX_MEM_READ = 2,
1482 	ULP_TX_MEM_WRITE = 3,
1483 	ULP_TX_PKT = 4
1484 };
1485 
1486 enum {
1487 	ULP_TX_SC_NOOP = 0x80,
1488 	ULP_TX_SC_IMM  = 0x81,
1489 	ULP_TX_SC_DSGL = 0x82,
1490 	ULP_TX_SC_ISGL = 0x83,
1491 	ULP_TX_SC_MEMRD = 0x86
1492 };
1493 
1494 #define ULPTX_CMD_S    24
1495 #define ULPTX_CMD_V(x) ((x) << ULPTX_CMD_S)
1496 
1497 #define ULPTX_LEN16_S    0
1498 #define ULPTX_LEN16_M    0xFF
1499 #define ULPTX_LEN16_V(x) ((x) << ULPTX_LEN16_S)
1500 
1501 #define ULP_TX_SC_MORE_S 23
1502 #define ULP_TX_SC_MORE_V(x) ((x) << ULP_TX_SC_MORE_S)
1503 #define ULP_TX_SC_MORE_F  ULP_TX_SC_MORE_V(1U)
1504 
1505 struct ulptx_sge_pair {
1506 	__be32 len[2];
1507 	__be64 addr[2];
1508 };
1509 
1510 struct ulptx_sgl {
1511 	__be32 cmd_nsge;
1512 	__be32 len0;
1513 	__be64 addr0;
1514 	struct ulptx_sge_pair sge[0];
1515 };
1516 
1517 struct ulptx_idata {
1518 	__be32 cmd_more;
1519 	__be32 len;
1520 };
1521 
1522 struct ulp_txpkt {
1523 	__be32 cmd_dest;
1524 	__be32 len;
1525 };
1526 
1527 #define ULPTX_CMD_S    24
1528 #define ULPTX_CMD_M    0xFF
1529 #define ULPTX_CMD_V(x) ((x) << ULPTX_CMD_S)
1530 
1531 #define ULPTX_NSGE_S    0
1532 #define ULPTX_NSGE_V(x) ((x) << ULPTX_NSGE_S)
1533 
1534 #define ULPTX_MORE_S	23
1535 #define ULPTX_MORE_V(x)	((x) << ULPTX_MORE_S)
1536 #define ULPTX_MORE_F	ULPTX_MORE_V(1U)
1537 
1538 #define ULP_TXPKT_DEST_S    16
1539 #define ULP_TXPKT_DEST_M    0x3
1540 #define ULP_TXPKT_DEST_V(x) ((x) << ULP_TXPKT_DEST_S)
1541 
1542 #define ULP_TXPKT_FID_S     4
1543 #define ULP_TXPKT_FID_M     0x7ff
1544 #define ULP_TXPKT_FID_V(x)  ((x) << ULP_TXPKT_FID_S)
1545 
1546 #define ULP_TXPKT_RO_S      3
1547 #define ULP_TXPKT_RO_V(x) ((x) << ULP_TXPKT_RO_S)
1548 #define ULP_TXPKT_RO_F ULP_TXPKT_RO_V(1U)
1549 
1550 enum cpl_tx_tnl_lso_type {
1551 	TX_TNL_TYPE_OPAQUE,
1552 	TX_TNL_TYPE_NVGRE,
1553 	TX_TNL_TYPE_VXLAN,
1554 	TX_TNL_TYPE_GENEVE,
1555 };
1556 
1557 struct cpl_tx_tnl_lso {
1558 	__be32 op_to_IpIdSplitOut;
1559 	__be16 IpIdOffsetOut;
1560 	__be16 UdpLenSetOut_to_TnlHdrLen;
1561 	__be64 r1;
1562 	__be32 Flow_to_TcpHdrLen;
1563 	__be16 IpIdOffset;
1564 	__be16 IpIdSplit_to_Mss;
1565 	__be32 TCPSeqOffset;
1566 	__be32 EthLenOffset_Size;
1567 	/* encapsulated CPL (TX_PKT_XT) follows here */
1568 };
1569 
1570 #define CPL_TX_TNL_LSO_OPCODE_S		24
1571 #define CPL_TX_TNL_LSO_OPCODE_M		0xff
1572 #define CPL_TX_TNL_LSO_OPCODE_V(x)      ((x) << CPL_TX_TNL_LSO_OPCODE_S)
1573 #define CPL_TX_TNL_LSO_OPCODE_G(x)      \
1574 	(((x) >> CPL_TX_TNL_LSO_OPCODE_S) & CPL_TX_TNL_LSO_OPCODE_M)
1575 
1576 #define CPL_TX_TNL_LSO_FIRST_S		23
1577 #define CPL_TX_TNL_LSO_FIRST_M		0x1
1578 #define CPL_TX_TNL_LSO_FIRST_V(x)	((x) << CPL_TX_TNL_LSO_FIRST_S)
1579 #define CPL_TX_TNL_LSO_FIRST_G(x)	\
1580 	(((x) >> CPL_TX_TNL_LSO_FIRST_S) & CPL_TX_TNL_LSO_FIRST_M)
1581 #define CPL_TX_TNL_LSO_FIRST_F		CPL_TX_TNL_LSO_FIRST_V(1U)
1582 
1583 #define CPL_TX_TNL_LSO_LAST_S		22
1584 #define CPL_TX_TNL_LSO_LAST_M		0x1
1585 #define CPL_TX_TNL_LSO_LAST_V(x)	((x) << CPL_TX_TNL_LSO_LAST_S)
1586 #define CPL_TX_TNL_LSO_LAST_G(x)	\
1587 	(((x) >> CPL_TX_TNL_LSO_LAST_S) & CPL_TX_TNL_LSO_LAST_M)
1588 #define CPL_TX_TNL_LSO_LAST_F		CPL_TX_TNL_LSO_LAST_V(1U)
1589 
1590 #define CPL_TX_TNL_LSO_ETHHDRLENXOUT_S	21
1591 #define CPL_TX_TNL_LSO_ETHHDRLENXOUT_M	0x1
1592 #define CPL_TX_TNL_LSO_ETHHDRLENXOUT_V(x) \
1593 	((x) << CPL_TX_TNL_LSO_ETHHDRLENXOUT_S)
1594 #define CPL_TX_TNL_LSO_ETHHDRLENXOUT_G(x) \
1595 	(((x) >> CPL_TX_TNL_LSO_ETHHDRLENXOUT_S) & \
1596 	 CPL_TX_TNL_LSO_ETHHDRLENXOUT_M)
1597 #define CPL_TX_TNL_LSO_ETHHDRLENXOUT_F CPL_TX_TNL_LSO_ETHHDRLENXOUT_V(1U)
1598 
1599 #define CPL_TX_TNL_LSO_IPV6OUT_S	20
1600 #define CPL_TX_TNL_LSO_IPV6OUT_M	0x1
1601 #define CPL_TX_TNL_LSO_IPV6OUT_V(x)	((x) << CPL_TX_TNL_LSO_IPV6OUT_S)
1602 #define CPL_TX_TNL_LSO_IPV6OUT_G(x)	\
1603 	(((x) >> CPL_TX_TNL_LSO_IPV6OUT_S) & CPL_TX_TNL_LSO_IPV6OUT_M)
1604 #define CPL_TX_TNL_LSO_IPV6OUT_F        CPL_TX_TNL_LSO_IPV6OUT_V(1U)
1605 
1606 #define CPL_TX_TNL_LSO_ETHHDRLEN_S	16
1607 #define CPL_TX_TNL_LSO_ETHHDRLEN_M	0xf
1608 #define CPL_TX_TNL_LSO_ETHHDRLEN_V(x)	((x) << CPL_TX_TNL_LSO_ETHHDRLEN_S)
1609 #define CPL_TX_TNL_LSO_ETHHDRLEN_G(x)	\
1610 	(((x) >> CPL_TX_TNL_LSO_ETHHDRLEN_S) & CPL_TX_TNL_LSO_ETHHDRLEN_M)
1611 
1612 #define CPL_TX_TNL_LSO_IPHDRLEN_S	4
1613 #define CPL_TX_TNL_LSO_IPHDRLEN_M	0xfff
1614 #define CPL_TX_TNL_LSO_IPHDRLEN_V(x)	((x) << CPL_TX_TNL_LSO_IPHDRLEN_S)
1615 #define CPL_TX_TNL_LSO_IPHDRLEN_G(x)    \
1616 	(((x) >> CPL_TX_TNL_LSO_IPHDRLEN_S) & CPL_TX_TNL_LSO_IPHDRLEN_M)
1617 
1618 #define CPL_TX_TNL_LSO_TCPHDRLEN_S	0
1619 #define CPL_TX_TNL_LSO_TCPHDRLEN_M	0xf
1620 #define CPL_TX_TNL_LSO_TCPHDRLEN_V(x)	((x) << CPL_TX_TNL_LSO_TCPHDRLEN_S)
1621 #define CPL_TX_TNL_LSO_TCPHDRLEN_G(x)   \
1622 	(((x) >> CPL_TX_TNL_LSO_TCPHDRLEN_S) & CPL_TX_TNL_LSO_TCPHDRLEN_M)
1623 
1624 #define CPL_TX_TNL_LSO_MSS_S            0
1625 #define CPL_TX_TNL_LSO_MSS_M            0x3fff
1626 #define CPL_TX_TNL_LSO_MSS_V(x)         ((x) << CPL_TX_TNL_LSO_MSS_S)
1627 #define CPL_TX_TNL_LSO_MSS_G(x)         \
1628 	(((x) >> CPL_TX_TNL_LSO_MSS_S) & CPL_TX_TNL_LSO_MSS_M)
1629 
1630 #define CPL_TX_TNL_LSO_SIZE_S		0
1631 #define CPL_TX_TNL_LSO_SIZE_M		0xfffffff
1632 #define CPL_TX_TNL_LSO_SIZE_V(x)	((x) << CPL_TX_TNL_LSO_SIZE_S)
1633 #define CPL_TX_TNL_LSO_SIZE_G(x)	\
1634 	(((x) >> CPL_TX_TNL_LSO_SIZE_S) & CPL_TX_TNL_LSO_SIZE_M)
1635 
1636 #define CPL_TX_TNL_LSO_ETHHDRLENOUT_S   16
1637 #define CPL_TX_TNL_LSO_ETHHDRLENOUT_M   0xf
1638 #define CPL_TX_TNL_LSO_ETHHDRLENOUT_V(x) \
1639 	((x) << CPL_TX_TNL_LSO_ETHHDRLENOUT_S)
1640 #define CPL_TX_TNL_LSO_ETHHDRLENOUT_G(x) \
1641 	(((x) >> CPL_TX_TNL_LSO_ETHHDRLENOUT_S) & CPL_TX_TNL_LSO_ETHHDRLENOUT_M)
1642 
1643 #define CPL_TX_TNL_LSO_IPHDRLENOUT_S    4
1644 #define CPL_TX_TNL_LSO_IPHDRLENOUT_M    0xfff
1645 #define CPL_TX_TNL_LSO_IPHDRLENOUT_V(x) ((x) << CPL_TX_TNL_LSO_IPHDRLENOUT_S)
1646 #define CPL_TX_TNL_LSO_IPHDRLENOUT_G(x) \
1647 	(((x) >> CPL_TX_TNL_LSO_IPHDRLENOUT_S) & CPL_TX_TNL_LSO_IPHDRLENOUT_M)
1648 
1649 #define CPL_TX_TNL_LSO_IPHDRCHKOUT_S    3
1650 #define CPL_TX_TNL_LSO_IPHDRCHKOUT_M    0x1
1651 #define CPL_TX_TNL_LSO_IPHDRCHKOUT_V(x) ((x) << CPL_TX_TNL_LSO_IPHDRCHKOUT_S)
1652 #define CPL_TX_TNL_LSO_IPHDRCHKOUT_G(x) \
1653 	(((x) >> CPL_TX_TNL_LSO_IPHDRCHKOUT_S) & CPL_TX_TNL_LSO_IPHDRCHKOUT_M)
1654 #define CPL_TX_TNL_LSO_IPHDRCHKOUT_F    CPL_TX_TNL_LSO_IPHDRCHKOUT_V(1U)
1655 
1656 #define CPL_TX_TNL_LSO_IPLENSETOUT_S	2
1657 #define CPL_TX_TNL_LSO_IPLENSETOUT_M	0x1
1658 #define CPL_TX_TNL_LSO_IPLENSETOUT_V(x) ((x) << CPL_TX_TNL_LSO_IPLENSETOUT_S)
1659 #define CPL_TX_TNL_LSO_IPLENSETOUT_G(x) \
1660 	(((x) >> CPL_TX_TNL_LSO_IPLENSETOUT_S) & CPL_TX_TNL_LSO_IPLENSETOUT_M)
1661 #define CPL_TX_TNL_LSO_IPLENSETOUT_F	CPL_TX_TNL_LSO_IPLENSETOUT_V(1U)
1662 
1663 #define CPL_TX_TNL_LSO_IPIDINCOUT_S	1
1664 #define CPL_TX_TNL_LSO_IPIDINCOUT_M	0x1
1665 #define CPL_TX_TNL_LSO_IPIDINCOUT_V(x)  ((x) << CPL_TX_TNL_LSO_IPIDINCOUT_S)
1666 #define CPL_TX_TNL_LSO_IPIDINCOUT_G(x)  \
1667 	(((x) >> CPL_TX_TNL_LSO_IPIDINCOUT_S) & CPL_TX_TNL_LSO_IPIDINCOUT_M)
1668 #define CPL_TX_TNL_LSO_IPIDINCOUT_F     CPL_TX_TNL_LSO_IPIDINCOUT_V(1U)
1669 
1670 #define CPL_TX_TNL_LSO_UDPCHKCLROUT_S   14
1671 #define CPL_TX_TNL_LSO_UDPCHKCLROUT_M   0x1
1672 #define CPL_TX_TNL_LSO_UDPCHKCLROUT_V(x) \
1673 	((x) << CPL_TX_TNL_LSO_UDPCHKCLROUT_S)
1674 #define CPL_TX_TNL_LSO_UDPCHKCLROUT_G(x) \
1675 	(((x) >> CPL_TX_TNL_LSO_UDPCHKCLROUT_S) & \
1676 	 CPL_TX_TNL_LSO_UDPCHKCLROUT_M)
1677 #define CPL_TX_TNL_LSO_UDPCHKCLROUT_F   CPL_TX_TNL_LSO_UDPCHKCLROUT_V(1U)
1678 
1679 #define CPL_TX_TNL_LSO_UDPLENSETOUT_S   15
1680 #define CPL_TX_TNL_LSO_UDPLENSETOUT_M   0x1
1681 #define CPL_TX_TNL_LSO_UDPLENSETOUT_V(x) \
1682 	((x) << CPL_TX_TNL_LSO_UDPLENSETOUT_S)
1683 #define CPL_TX_TNL_LSO_UDPLENSETOUT_G(x) \
1684 	(((x) >> CPL_TX_TNL_LSO_UDPLENSETOUT_S) & \
1685 	 CPL_TX_TNL_LSO_UDPLENSETOUT_M)
1686 #define CPL_TX_TNL_LSO_UDPLENSETOUT_F   CPL_TX_TNL_LSO_UDPLENSETOUT_V(1U)
1687 
1688 #define CPL_TX_TNL_LSO_TNLTYPE_S	12
1689 #define CPL_TX_TNL_LSO_TNLTYPE_M	0x3
1690 #define CPL_TX_TNL_LSO_TNLTYPE_V(x)	((x) << CPL_TX_TNL_LSO_TNLTYPE_S)
1691 #define CPL_TX_TNL_LSO_TNLTYPE_G(x)	\
1692 	(((x) >> CPL_TX_TNL_LSO_TNLTYPE_S) & CPL_TX_TNL_LSO_TNLTYPE_M)
1693 
1694 #define S_CPL_TX_TNL_LSO_ETHHDRLEN	16
1695 #define M_CPL_TX_TNL_LSO_ETHHDRLEN	0xf
1696 #define V_CPL_TX_TNL_LSO_ETHHDRLEN(x)	((x) << S_CPL_TX_TNL_LSO_ETHHDRLEN)
1697 #define G_CPL_TX_TNL_LSO_ETHHDRLEN(x)	\
1698 	(((x) >> S_CPL_TX_TNL_LSO_ETHHDRLEN) & M_CPL_TX_TNL_LSO_ETHHDRLEN)
1699 
1700 #define CPL_TX_TNL_LSO_TNLHDRLEN_S      0
1701 #define CPL_TX_TNL_LSO_TNLHDRLEN_M      0xfff
1702 #define CPL_TX_TNL_LSO_TNLHDRLEN_V(x)	((x) << CPL_TX_TNL_LSO_TNLHDRLEN_S)
1703 #define CPL_TX_TNL_LSO_TNLHDRLEN_G(x)   \
1704 	(((x) >> CPL_TX_TNL_LSO_TNLHDRLEN_S) & CPL_TX_TNL_LSO_TNLHDRLEN_M)
1705 
1706 #define CPL_TX_TNL_LSO_IPV6_S		20
1707 #define CPL_TX_TNL_LSO_IPV6_M		0x1
1708 #define CPL_TX_TNL_LSO_IPV6_V(x)	((x) << CPL_TX_TNL_LSO_IPV6_S)
1709 #define CPL_TX_TNL_LSO_IPV6_G(x)	\
1710 	(((x) >> CPL_TX_TNL_LSO_IPV6_S) & CPL_TX_TNL_LSO_IPV6_M)
1711 #define CPL_TX_TNL_LSO_IPV6_F		CPL_TX_TNL_LSO_IPV6_V(1U)
1712 
1713 #define ULP_TX_SC_MORE_S 23
1714 #define ULP_TX_SC_MORE_V(x) ((x) << ULP_TX_SC_MORE_S)
1715 #define ULP_TX_SC_MORE_F  ULP_TX_SC_MORE_V(1U)
1716 
1717 struct ulp_mem_io {
1718 	WR_HDR;
1719 	__be32 cmd;
1720 	__be32 len16;             /* command length */
1721 	__be32 dlen;              /* data length in 32-byte units */
1722 	__be32 lock_addr;
1723 };
1724 
1725 #define ULP_MEMIO_LOCK_S    31
1726 #define ULP_MEMIO_LOCK_V(x) ((x) << ULP_MEMIO_LOCK_S)
1727 #define ULP_MEMIO_LOCK_F    ULP_MEMIO_LOCK_V(1U)
1728 
1729 /* additional ulp_mem_io.cmd fields */
1730 #define ULP_MEMIO_ORDER_S    23
1731 #define ULP_MEMIO_ORDER_V(x) ((x) << ULP_MEMIO_ORDER_S)
1732 #define ULP_MEMIO_ORDER_F    ULP_MEMIO_ORDER_V(1U)
1733 
1734 #define T5_ULP_MEMIO_IMM_S    23
1735 #define T5_ULP_MEMIO_IMM_V(x) ((x) << T5_ULP_MEMIO_IMM_S)
1736 #define T5_ULP_MEMIO_IMM_F    T5_ULP_MEMIO_IMM_V(1U)
1737 
1738 #define T5_ULP_MEMIO_ORDER_S    22
1739 #define T5_ULP_MEMIO_ORDER_V(x) ((x) << T5_ULP_MEMIO_ORDER_S)
1740 #define T5_ULP_MEMIO_ORDER_F    T5_ULP_MEMIO_ORDER_V(1U)
1741 
1742 #define T5_ULP_MEMIO_FID_S	4
1743 #define T5_ULP_MEMIO_FID_M	0x7ff
1744 #define T5_ULP_MEMIO_FID_V(x)	((x) << T5_ULP_MEMIO_FID_S)
1745 
1746 /* ulp_mem_io.lock_addr fields */
1747 #define ULP_MEMIO_ADDR_S    0
1748 #define ULP_MEMIO_ADDR_V(x) ((x) << ULP_MEMIO_ADDR_S)
1749 
1750 /* ulp_mem_io.dlen fields */
1751 #define ULP_MEMIO_DATA_LEN_S    0
1752 #define ULP_MEMIO_DATA_LEN_V(x) ((x) << ULP_MEMIO_DATA_LEN_S)
1753 
1754 #define ULPTX_NSGE_S    0
1755 #define ULPTX_NSGE_M    0xFFFF
1756 #define ULPTX_NSGE_V(x) ((x) << ULPTX_NSGE_S)
1757 #define ULPTX_NSGE_G(x) (((x) >> ULPTX_NSGE_S) & ULPTX_NSGE_M)
1758 
1759 struct ulptx_sc_memrd {
1760 	__be32 cmd_to_len;
1761 	__be32 addr;
1762 };
1763 
1764 #define ULP_TXPKT_DATAMODIFY_S       23
1765 #define ULP_TXPKT_DATAMODIFY_M       0x1
1766 #define ULP_TXPKT_DATAMODIFY_V(x)    ((x) << ULP_TXPKT_DATAMODIFY_S)
1767 #define ULP_TXPKT_DATAMODIFY_G(x)    \
1768 	(((x) >> ULP_TXPKT_DATAMODIFY_S) & ULP_TXPKT_DATAMODIFY__M)
1769 #define ULP_TXPKT_DATAMODIFY_F       ULP_TXPKT_DATAMODIFY_V(1U)
1770 
1771 #define ULP_TXPKT_CHANNELID_S        22
1772 #define ULP_TXPKT_CHANNELID_M        0x1
1773 #define ULP_TXPKT_CHANNELID_V(x)     ((x) << ULP_TXPKT_CHANNELID_S)
1774 #define ULP_TXPKT_CHANNELID_G(x)     \
1775 	(((x) >> ULP_TXPKT_CHANNELID_S) & ULP_TXPKT_CHANNELID_M)
1776 #define ULP_TXPKT_CHANNELID_F        ULP_TXPKT_CHANNELID_V(1U)
1777 
1778 #define SCMD_SEQ_NO_CTRL_S      29
1779 #define SCMD_SEQ_NO_CTRL_M      0x3
1780 #define SCMD_SEQ_NO_CTRL_V(x)   ((x) << SCMD_SEQ_NO_CTRL_S)
1781 #define SCMD_SEQ_NO_CTRL_G(x)   \
1782 	(((x) >> SCMD_SEQ_NO_CTRL_S) & SCMD_SEQ_NO_CTRL_M)
1783 
1784 /* StsFieldPrsnt- Status field at the end of the TLS PDU */
1785 #define SCMD_STATUS_PRESENT_S   28
1786 #define SCMD_STATUS_PRESENT_M   0x1
1787 #define SCMD_STATUS_PRESENT_V(x)    ((x) << SCMD_STATUS_PRESENT_S)
1788 #define SCMD_STATUS_PRESENT_G(x)    \
1789 	(((x) >> SCMD_STATUS_PRESENT_S) & SCMD_STATUS_PRESENT_M)
1790 #define SCMD_STATUS_PRESENT_F   SCMD_STATUS_PRESENT_V(1U)
1791 
1792 /* ProtoVersion - Protocol Version 0: 1.2, 1:1.1, 2:DTLS, 3:Generic,
1793  * 3-15: Reserved.
1794  */
1795 #define SCMD_PROTO_VERSION_S    24
1796 #define SCMD_PROTO_VERSION_M    0xf
1797 #define SCMD_PROTO_VERSION_V(x) ((x) << SCMD_PROTO_VERSION_S)
1798 #define SCMD_PROTO_VERSION_G(x) \
1799 	(((x) >> SCMD_PROTO_VERSION_S) & SCMD_PROTO_VERSION_M)
1800 
1801 /* EncDecCtrl - Encryption/Decryption Control. 0: Encrypt, 1: Decrypt */
1802 #define SCMD_ENC_DEC_CTRL_S     23
1803 #define SCMD_ENC_DEC_CTRL_M     0x1
1804 #define SCMD_ENC_DEC_CTRL_V(x)  ((x) << SCMD_ENC_DEC_CTRL_S)
1805 #define SCMD_ENC_DEC_CTRL_G(x)  \
1806 	(((x) >> SCMD_ENC_DEC_CTRL_S) & SCMD_ENC_DEC_CTRL_M)
1807 #define SCMD_ENC_DEC_CTRL_F SCMD_ENC_DEC_CTRL_V(1U)
1808 
1809 /* CipherAuthSeqCtrl - Cipher Authentication Sequence Control. */
1810 #define SCMD_CIPH_AUTH_SEQ_CTRL_S       22
1811 #define SCMD_CIPH_AUTH_SEQ_CTRL_M       0x1
1812 #define SCMD_CIPH_AUTH_SEQ_CTRL_V(x)    \
1813 	((x) << SCMD_CIPH_AUTH_SEQ_CTRL_S)
1814 #define SCMD_CIPH_AUTH_SEQ_CTRL_G(x)    \
1815 	(((x) >> SCMD_CIPH_AUTH_SEQ_CTRL_S) & SCMD_CIPH_AUTH_SEQ_CTRL_M)
1816 #define SCMD_CIPH_AUTH_SEQ_CTRL_F   SCMD_CIPH_AUTH_SEQ_CTRL_V(1U)
1817 
1818 /* CiphMode -  Cipher Mode. 0: NOP, 1:AES-CBC, 2:AES-GCM, 3:AES-CTR,
1819  * 4:Generic-AES, 5-15: Reserved.
1820  */
1821 #define SCMD_CIPH_MODE_S    18
1822 #define SCMD_CIPH_MODE_M    0xf
1823 #define SCMD_CIPH_MODE_V(x) ((x) << SCMD_CIPH_MODE_S)
1824 #define SCMD_CIPH_MODE_G(x) \
1825 	(((x) >> SCMD_CIPH_MODE_S) & SCMD_CIPH_MODE_M)
1826 
1827 /* AuthMode - Auth Mode. 0: NOP, 1:SHA1, 2:SHA2-224, 3:SHA2-256
1828  * 4-15: Reserved
1829  */
1830 #define SCMD_AUTH_MODE_S    14
1831 #define SCMD_AUTH_MODE_M    0xf
1832 #define SCMD_AUTH_MODE_V(x) ((x) << SCMD_AUTH_MODE_S)
1833 #define SCMD_AUTH_MODE_G(x) \
1834 	(((x) >> SCMD_AUTH_MODE_S) & SCMD_AUTH_MODE_M)
1835 
1836 /* HmacCtrl - HMAC Control. 0:NOP, 1:No truncation, 2:Support HMAC Truncation
1837  * per RFC 4366, 3:IPSec 96 bits, 4-7:Reserved
1838  */
1839 #define SCMD_HMAC_CTRL_S    11
1840 #define SCMD_HMAC_CTRL_M    0x7
1841 #define SCMD_HMAC_CTRL_V(x) ((x) << SCMD_HMAC_CTRL_S)
1842 #define SCMD_HMAC_CTRL_G(x) \
1843 	(((x) >> SCMD_HMAC_CTRL_S) & SCMD_HMAC_CTRL_M)
1844 
1845 /* IvSize - IV size in units of 2 bytes */
1846 #define SCMD_IV_SIZE_S  7
1847 #define SCMD_IV_SIZE_M  0xf
1848 #define SCMD_IV_SIZE_V(x)   ((x) << SCMD_IV_SIZE_S)
1849 #define SCMD_IV_SIZE_G(x)   \
1850 	(((x) >> SCMD_IV_SIZE_S) & SCMD_IV_SIZE_M)
1851 
1852 /* NumIVs - Number of IVs */
1853 #define SCMD_NUM_IVS_S  0
1854 #define SCMD_NUM_IVS_M  0x7f
1855 #define SCMD_NUM_IVS_V(x)   ((x) << SCMD_NUM_IVS_S)
1856 #define SCMD_NUM_IVS_G(x)   \
1857 	(((x) >> SCMD_NUM_IVS_S) & SCMD_NUM_IVS_M)
1858 
1859 /* EnbDbgId - If this is enabled upper 20 (63:44) bits if SeqNumber
1860  * (below) are used as Cid (connection id for debug status), these
1861  * bits are padded to zero for forming the 64 bit
1862  * sequence number for TLS
1863  */
1864 #define SCMD_ENB_DBGID_S  31
1865 #define SCMD_ENB_DBGID_M  0x1
1866 #define SCMD_ENB_DBGID_V(x)   ((x) << SCMD_ENB_DBGID_S)
1867 #define SCMD_ENB_DBGID_G(x)   \
1868 	(((x) >> SCMD_ENB_DBGID_S) & SCMD_ENB_DBGID_M)
1869 
1870 /* IV generation in SW. */
1871 #define SCMD_IV_GEN_CTRL_S      30
1872 #define SCMD_IV_GEN_CTRL_M      0x1
1873 #define SCMD_IV_GEN_CTRL_V(x)   ((x) << SCMD_IV_GEN_CTRL_S)
1874 #define SCMD_IV_GEN_CTRL_G(x)   \
1875 	(((x) >> SCMD_IV_GEN_CTRL_S) & SCMD_IV_GEN_CTRL_M)
1876 #define SCMD_IV_GEN_CTRL_F  SCMD_IV_GEN_CTRL_V(1U)
1877 
1878 /* More frags */
1879 #define SCMD_MORE_FRAGS_S   20
1880 #define SCMD_MORE_FRAGS_M   0x1
1881 #define SCMD_MORE_FRAGS_V(x)    ((x) << SCMD_MORE_FRAGS_S)
1882 #define SCMD_MORE_FRAGS_G(x)    (((x) >> SCMD_MORE_FRAGS_S) & SCMD_MORE_FRAGS_M)
1883 
1884 /*last frag */
1885 #define SCMD_LAST_FRAG_S    19
1886 #define SCMD_LAST_FRAG_M    0x1
1887 #define SCMD_LAST_FRAG_V(x) ((x) << SCMD_LAST_FRAG_S)
1888 #define SCMD_LAST_FRAG_G(x) (((x) >> SCMD_LAST_FRAG_S) & SCMD_LAST_FRAG_M)
1889 
1890 /* TlsCompPdu */
1891 #define SCMD_TLS_COMPPDU_S    18
1892 #define SCMD_TLS_COMPPDU_M    0x1
1893 #define SCMD_TLS_COMPPDU_V(x) ((x) << SCMD_TLS_COMPPDU_S)
1894 #define SCMD_TLS_COMPPDU_G(x) (((x) >> SCMD_TLS_COMPPDU_S) & SCMD_TLS_COMPPDU_M)
1895 
1896 /* KeyCntxtInline - Key context inline after the scmd  OR PayloadOnly*/
1897 #define SCMD_KEY_CTX_INLINE_S   17
1898 #define SCMD_KEY_CTX_INLINE_M   0x1
1899 #define SCMD_KEY_CTX_INLINE_V(x)    ((x) << SCMD_KEY_CTX_INLINE_S)
1900 #define SCMD_KEY_CTX_INLINE_G(x)    \
1901 	(((x) >> SCMD_KEY_CTX_INLINE_S) & SCMD_KEY_CTX_INLINE_M)
1902 #define SCMD_KEY_CTX_INLINE_F   SCMD_KEY_CTX_INLINE_V(1U)
1903 
1904 /* TLSFragEnable - 0: Host created TLS PDUs, 1: TLS Framgmentation in ASIC */
1905 #define SCMD_TLS_FRAG_ENABLE_S  16
1906 #define SCMD_TLS_FRAG_ENABLE_M  0x1
1907 #define SCMD_TLS_FRAG_ENABLE_V(x)   ((x) << SCMD_TLS_FRAG_ENABLE_S)
1908 #define SCMD_TLS_FRAG_ENABLE_G(x)   \
1909 	(((x) >> SCMD_TLS_FRAG_ENABLE_S) & SCMD_TLS_FRAG_ENABLE_M)
1910 #define SCMD_TLS_FRAG_ENABLE_F  SCMD_TLS_FRAG_ENABLE_V(1U)
1911 
1912 /* MacOnly - Only send the MAC and discard PDU. This is valid for hash only
1913  * modes, in this case TLS_TX  will drop the PDU and only
1914  * send back the MAC bytes.
1915  */
1916 #define SCMD_MAC_ONLY_S 15
1917 #define SCMD_MAC_ONLY_M 0x1
1918 #define SCMD_MAC_ONLY_V(x)  ((x) << SCMD_MAC_ONLY_S)
1919 #define SCMD_MAC_ONLY_G(x)  \
1920 	(((x) >> SCMD_MAC_ONLY_S) & SCMD_MAC_ONLY_M)
1921 #define SCMD_MAC_ONLY_F SCMD_MAC_ONLY_V(1U)
1922 
1923 /* AadIVDrop - Drop the AAD and IV fields. Useful in protocols
1924  * which have complex AAD and IV formations Eg:AES-CCM
1925  */
1926 #define SCMD_AADIVDROP_S 14
1927 #define SCMD_AADIVDROP_M 0x1
1928 #define SCMD_AADIVDROP_V(x)  ((x) << SCMD_AADIVDROP_S)
1929 #define SCMD_AADIVDROP_G(x)  \
1930 	(((x) >> SCMD_AADIVDROP_S) & SCMD_AADIVDROP_M)
1931 #define SCMD_AADIVDROP_F SCMD_AADIVDROP_V(1U)
1932 
1933 /* HdrLength - Length of all headers excluding TLS header
1934  * present before start of crypto PDU/payload.
1935  */
1936 #define SCMD_HDR_LEN_S  0
1937 #define SCMD_HDR_LEN_M  0x3fff
1938 #define SCMD_HDR_LEN_V(x)   ((x) << SCMD_HDR_LEN_S)
1939 #define SCMD_HDR_LEN_G(x)   \
1940 	(((x) >> SCMD_HDR_LEN_S) & SCMD_HDR_LEN_M)
1941 
1942 struct cpl_tx_sec_pdu {
1943 	__be32 op_ivinsrtofst;
1944 	__be32 pldlen;
1945 	__be32 aadstart_cipherstop_hi;
1946 	__be32 cipherstop_lo_authinsert;
1947 	__be32 seqno_numivs;
1948 	__be32 ivgen_hdrlen;
1949 	__be64 scmd1;
1950 };
1951 
1952 #define CPL_TX_SEC_PDU_OPCODE_S     24
1953 #define CPL_TX_SEC_PDU_OPCODE_M     0xff
1954 #define CPL_TX_SEC_PDU_OPCODE_V(x)  ((x) << CPL_TX_SEC_PDU_OPCODE_S)
1955 #define CPL_TX_SEC_PDU_OPCODE_G(x)  \
1956 	(((x) >> CPL_TX_SEC_PDU_OPCODE_S) & CPL_TX_SEC_PDU_OPCODE_M)
1957 
1958 /* RX Channel Id */
1959 #define CPL_TX_SEC_PDU_RXCHID_S  22
1960 #define CPL_TX_SEC_PDU_RXCHID_M  0x1
1961 #define CPL_TX_SEC_PDU_RXCHID_V(x)   ((x) << CPL_TX_SEC_PDU_RXCHID_S)
1962 #define CPL_TX_SEC_PDU_RXCHID_G(x)   \
1963 	(((x) >> CPL_TX_SEC_PDU_RXCHID_S) & CPL_TX_SEC_PDU_RXCHID_M)
1964 #define CPL_TX_SEC_PDU_RXCHID_F  CPL_TX_SEC_PDU_RXCHID_V(1U)
1965 
1966 /* Ack Follows */
1967 #define CPL_TX_SEC_PDU_ACKFOLLOWS_S  21
1968 #define CPL_TX_SEC_PDU_ACKFOLLOWS_M  0x1
1969 #define CPL_TX_SEC_PDU_ACKFOLLOWS_V(x)   ((x) << CPL_TX_SEC_PDU_ACKFOLLOWS_S)
1970 #define CPL_TX_SEC_PDU_ACKFOLLOWS_G(x)   \
1971 	(((x) >> CPL_TX_SEC_PDU_ACKFOLLOWS_S) & CPL_TX_SEC_PDU_ACKFOLLOWS_M)
1972 #define CPL_TX_SEC_PDU_ACKFOLLOWS_F  CPL_TX_SEC_PDU_ACKFOLLOWS_V(1U)
1973 
1974 /* Loopback bit in cpl_tx_sec_pdu */
1975 #define CPL_TX_SEC_PDU_ULPTXLPBK_S  20
1976 #define CPL_TX_SEC_PDU_ULPTXLPBK_M  0x1
1977 #define CPL_TX_SEC_PDU_ULPTXLPBK_V(x)   ((x) << CPL_TX_SEC_PDU_ULPTXLPBK_S)
1978 #define CPL_TX_SEC_PDU_ULPTXLPBK_G(x)   \
1979 	(((x) >> CPL_TX_SEC_PDU_ULPTXLPBK_S) & CPL_TX_SEC_PDU_ULPTXLPBK_M)
1980 #define CPL_TX_SEC_PDU_ULPTXLPBK_F  CPL_TX_SEC_PDU_ULPTXLPBK_V(1U)
1981 
1982 /* Length of cpl header encapsulated */
1983 #define CPL_TX_SEC_PDU_CPLLEN_S     16
1984 #define CPL_TX_SEC_PDU_CPLLEN_M     0xf
1985 #define CPL_TX_SEC_PDU_CPLLEN_V(x)  ((x) << CPL_TX_SEC_PDU_CPLLEN_S)
1986 #define CPL_TX_SEC_PDU_CPLLEN_G(x)  \
1987 	(((x) >> CPL_TX_SEC_PDU_CPLLEN_S) & CPL_TX_SEC_PDU_CPLLEN_M)
1988 
1989 /* PlaceHolder */
1990 #define CPL_TX_SEC_PDU_PLACEHOLDER_S    10
1991 #define CPL_TX_SEC_PDU_PLACEHOLDER_M    0x1
1992 #define CPL_TX_SEC_PDU_PLACEHOLDER_V(x) ((x) << CPL_TX_SEC_PDU_PLACEHOLDER_S)
1993 #define CPL_TX_SEC_PDU_PLACEHOLDER_G(x) \
1994 	(((x) >> CPL_TX_SEC_PDU_PLACEHOLDER_S) & \
1995 	 CPL_TX_SEC_PDU_PLACEHOLDER_M)
1996 
1997 /* IvInsrtOffset: Insertion location for IV */
1998 #define CPL_TX_SEC_PDU_IVINSRTOFST_S    0
1999 #define CPL_TX_SEC_PDU_IVINSRTOFST_M    0x3ff
2000 #define CPL_TX_SEC_PDU_IVINSRTOFST_V(x) ((x) << CPL_TX_SEC_PDU_IVINSRTOFST_S)
2001 #define CPL_TX_SEC_PDU_IVINSRTOFST_G(x) \
2002 	(((x) >> CPL_TX_SEC_PDU_IVINSRTOFST_S) & \
2003 	 CPL_TX_SEC_PDU_IVINSRTOFST_M)
2004 
2005 /* AadStartOffset: Offset in bytes for AAD start from
2006  * the first byte following the pkt headers (0-255 bytes)
2007  */
2008 #define CPL_TX_SEC_PDU_AADSTART_S   24
2009 #define CPL_TX_SEC_PDU_AADSTART_M   0xff
2010 #define CPL_TX_SEC_PDU_AADSTART_V(x)    ((x) << CPL_TX_SEC_PDU_AADSTART_S)
2011 #define CPL_TX_SEC_PDU_AADSTART_G(x)    \
2012 	(((x) >> CPL_TX_SEC_PDU_AADSTART_S) & \
2013 	 CPL_TX_SEC_PDU_AADSTART_M)
2014 
2015 /* AadStopOffset: offset in bytes for AAD stop/end from the first byte following
2016  * the pkt headers (0-511 bytes)
2017  */
2018 #define CPL_TX_SEC_PDU_AADSTOP_S    15
2019 #define CPL_TX_SEC_PDU_AADSTOP_M    0x1ff
2020 #define CPL_TX_SEC_PDU_AADSTOP_V(x) ((x) << CPL_TX_SEC_PDU_AADSTOP_S)
2021 #define CPL_TX_SEC_PDU_AADSTOP_G(x) \
2022 	(((x) >> CPL_TX_SEC_PDU_AADSTOP_S) & CPL_TX_SEC_PDU_AADSTOP_M)
2023 
2024 /* CipherStartOffset: offset in bytes for encryption/decryption start from the
2025  * first byte following the pkt headers (0-1023 bytes)
2026  */
2027 #define CPL_TX_SEC_PDU_CIPHERSTART_S    5
2028 #define CPL_TX_SEC_PDU_CIPHERSTART_M    0x3ff
2029 #define CPL_TX_SEC_PDU_CIPHERSTART_V(x) ((x) << CPL_TX_SEC_PDU_CIPHERSTART_S)
2030 #define CPL_TX_SEC_PDU_CIPHERSTART_G(x) \
2031 	(((x) >> CPL_TX_SEC_PDU_CIPHERSTART_S) & \
2032 	 CPL_TX_SEC_PDU_CIPHERSTART_M)
2033 
2034 /* CipherStopOffset: offset in bytes for encryption/decryption end
2035  * from end of the payload of this command (0-511 bytes)
2036  */
2037 #define CPL_TX_SEC_PDU_CIPHERSTOP_HI_S      0
2038 #define CPL_TX_SEC_PDU_CIPHERSTOP_HI_M      0x1f
2039 #define CPL_TX_SEC_PDU_CIPHERSTOP_HI_V(x)   \
2040 	((x) << CPL_TX_SEC_PDU_CIPHERSTOP_HI_S)
2041 #define CPL_TX_SEC_PDU_CIPHERSTOP_HI_G(x)   \
2042 	(((x) >> CPL_TX_SEC_PDU_CIPHERSTOP_HI_S) & \
2043 	 CPL_TX_SEC_PDU_CIPHERSTOP_HI_M)
2044 
2045 #define CPL_TX_SEC_PDU_CIPHERSTOP_LO_S      28
2046 #define CPL_TX_SEC_PDU_CIPHERSTOP_LO_M      0xf
2047 #define CPL_TX_SEC_PDU_CIPHERSTOP_LO_V(x)   \
2048 	((x) << CPL_TX_SEC_PDU_CIPHERSTOP_LO_S)
2049 #define CPL_TX_SEC_PDU_CIPHERSTOP_LO_G(x)   \
2050 	(((x) >> CPL_TX_SEC_PDU_CIPHERSTOP_LO_S) & \
2051 	 CPL_TX_SEC_PDU_CIPHERSTOP_LO_M)
2052 
2053 /* AuthStartOffset: offset in bytes for authentication start from
2054  * the first byte following the pkt headers (0-1023)
2055  */
2056 #define CPL_TX_SEC_PDU_AUTHSTART_S  18
2057 #define CPL_TX_SEC_PDU_AUTHSTART_M  0x3ff
2058 #define CPL_TX_SEC_PDU_AUTHSTART_V(x)   ((x) << CPL_TX_SEC_PDU_AUTHSTART_S)
2059 #define CPL_TX_SEC_PDU_AUTHSTART_G(x)   \
2060 	(((x) >> CPL_TX_SEC_PDU_AUTHSTART_S) & \
2061 	 CPL_TX_SEC_PDU_AUTHSTART_M)
2062 
2063 /* AuthStopOffset: offset in bytes for authentication
2064  * end from end of the payload of this command (0-511 Bytes)
2065  */
2066 #define CPL_TX_SEC_PDU_AUTHSTOP_S   9
2067 #define CPL_TX_SEC_PDU_AUTHSTOP_M   0x1ff
2068 #define CPL_TX_SEC_PDU_AUTHSTOP_V(x)    ((x) << CPL_TX_SEC_PDU_AUTHSTOP_S)
2069 #define CPL_TX_SEC_PDU_AUTHSTOP_G(x)    \
2070 	(((x) >> CPL_TX_SEC_PDU_AUTHSTOP_S) & \
2071 	 CPL_TX_SEC_PDU_AUTHSTOP_M)
2072 
2073 /* AuthInsrtOffset: offset in bytes for authentication insertion
2074  * from end of the payload of this command (0-511 bytes)
2075  */
2076 #define CPL_TX_SEC_PDU_AUTHINSERT_S 0
2077 #define CPL_TX_SEC_PDU_AUTHINSERT_M 0x1ff
2078 #define CPL_TX_SEC_PDU_AUTHINSERT_V(x)  ((x) << CPL_TX_SEC_PDU_AUTHINSERT_S)
2079 #define CPL_TX_SEC_PDU_AUTHINSERT_G(x)  \
2080 	(((x) >> CPL_TX_SEC_PDU_AUTHINSERT_S) & \
2081 	 CPL_TX_SEC_PDU_AUTHINSERT_M)
2082 
2083 struct cpl_rx_phys_dsgl {
2084 	__be32 op_to_tid;
2085 	__be32 pcirlxorder_to_noofsgentr;
2086 	struct rss_header rss_hdr_int;
2087 };
2088 
2089 #define CPL_RX_PHYS_DSGL_OPCODE_S       24
2090 #define CPL_RX_PHYS_DSGL_OPCODE_M       0xff
2091 #define CPL_RX_PHYS_DSGL_OPCODE_V(x)    ((x) << CPL_RX_PHYS_DSGL_OPCODE_S)
2092 #define CPL_RX_PHYS_DSGL_OPCODE_G(x)    \
2093 	(((x) >> CPL_RX_PHYS_DSGL_OPCODE_S) & CPL_RX_PHYS_DSGL_OPCODE_M)
2094 
2095 #define CPL_RX_PHYS_DSGL_ISRDMA_S       23
2096 #define CPL_RX_PHYS_DSGL_ISRDMA_M       0x1
2097 #define CPL_RX_PHYS_DSGL_ISRDMA_V(x)    ((x) << CPL_RX_PHYS_DSGL_ISRDMA_S)
2098 #define CPL_RX_PHYS_DSGL_ISRDMA_G(x)    \
2099 	(((x) >> CPL_RX_PHYS_DSGL_ISRDMA_S) & CPL_RX_PHYS_DSGL_ISRDMA_M)
2100 #define CPL_RX_PHYS_DSGL_ISRDMA_F       CPL_RX_PHYS_DSGL_ISRDMA_V(1U)
2101 
2102 #define CPL_RX_PHYS_DSGL_RSVD1_S        20
2103 #define CPL_RX_PHYS_DSGL_RSVD1_M        0x7
2104 #define CPL_RX_PHYS_DSGL_RSVD1_V(x)     ((x) << CPL_RX_PHYS_DSGL_RSVD1_S)
2105 #define CPL_RX_PHYS_DSGL_RSVD1_G(x)     \
2106 	(((x) >> CPL_RX_PHYS_DSGL_RSVD1_S) & \
2107 	 CPL_RX_PHYS_DSGL_RSVD1_M)
2108 
2109 #define CPL_RX_PHYS_DSGL_PCIRLXORDER_S          31
2110 #define CPL_RX_PHYS_DSGL_PCIRLXORDER_M          0x1
2111 #define CPL_RX_PHYS_DSGL_PCIRLXORDER_V(x)       \
2112 	((x) << CPL_RX_PHYS_DSGL_PCIRLXORDER_S)
2113 #define CPL_RX_PHYS_DSGL_PCIRLXORDER_G(x)       \
2114 	(((x) >> CPL_RX_PHYS_DSGL_PCIRLXORDER_S) & \
2115 	 CPL_RX_PHYS_DSGL_PCIRLXORDER_M)
2116 #define CPL_RX_PHYS_DSGL_PCIRLXORDER_F  CPL_RX_PHYS_DSGL_PCIRLXORDER_V(1U)
2117 
2118 #define CPL_RX_PHYS_DSGL_PCINOSNOOP_S           30
2119 #define CPL_RX_PHYS_DSGL_PCINOSNOOP_M           0x1
2120 #define CPL_RX_PHYS_DSGL_PCINOSNOOP_V(x)        \
2121 	((x) << CPL_RX_PHYS_DSGL_PCINOSNOOP_S)
2122 #define CPL_RX_PHYS_DSGL_PCINOSNOOP_G(x)        \
2123 	(((x) >> CPL_RX_PHYS_DSGL_PCINOSNOOP_S) & \
2124 	 CPL_RX_PHYS_DSGL_PCINOSNOOP_M)
2125 
2126 #define CPL_RX_PHYS_DSGL_PCINOSNOOP_F   CPL_RX_PHYS_DSGL_PCINOSNOOP_V(1U)
2127 
2128 #define CPL_RX_PHYS_DSGL_PCITPHNTENB_S          29
2129 #define CPL_RX_PHYS_DSGL_PCITPHNTENB_M          0x1
2130 #define CPL_RX_PHYS_DSGL_PCITPHNTENB_V(x)       \
2131 	((x) << CPL_RX_PHYS_DSGL_PCITPHNTENB_S)
2132 #define CPL_RX_PHYS_DSGL_PCITPHNTENB_G(x)       \
2133 	(((x) >> CPL_RX_PHYS_DSGL_PCITPHNTENB_S) & \
2134 	 CPL_RX_PHYS_DSGL_PCITPHNTENB_M)
2135 #define CPL_RX_PHYS_DSGL_PCITPHNTENB_F  CPL_RX_PHYS_DSGL_PCITPHNTENB_V(1U)
2136 
2137 #define CPL_RX_PHYS_DSGL_PCITPHNT_S     27
2138 #define CPL_RX_PHYS_DSGL_PCITPHNT_M     0x3
2139 #define CPL_RX_PHYS_DSGL_PCITPHNT_V(x)  ((x) << CPL_RX_PHYS_DSGL_PCITPHNT_S)
2140 #define CPL_RX_PHYS_DSGL_PCITPHNT_G(x)  \
2141 	(((x) >> CPL_RX_PHYS_DSGL_PCITPHNT_S) & \
2142 	 CPL_RX_PHYS_DSGL_PCITPHNT_M)
2143 
2144 #define CPL_RX_PHYS_DSGL_DCAID_S        16
2145 #define CPL_RX_PHYS_DSGL_DCAID_M        0x7ff
2146 #define CPL_RX_PHYS_DSGL_DCAID_V(x)     ((x) << CPL_RX_PHYS_DSGL_DCAID_S)
2147 #define CPL_RX_PHYS_DSGL_DCAID_G(x)     \
2148 	(((x) >> CPL_RX_PHYS_DSGL_DCAID_S) & \
2149 	 CPL_RX_PHYS_DSGL_DCAID_M)
2150 
2151 #define CPL_RX_PHYS_DSGL_NOOFSGENTR_S           0
2152 #define CPL_RX_PHYS_DSGL_NOOFSGENTR_M           0xffff
2153 #define CPL_RX_PHYS_DSGL_NOOFSGENTR_V(x)        \
2154 	((x) << CPL_RX_PHYS_DSGL_NOOFSGENTR_S)
2155 #define CPL_RX_PHYS_DSGL_NOOFSGENTR_G(x)        \
2156 	(((x) >> CPL_RX_PHYS_DSGL_NOOFSGENTR_S) & \
2157 	 CPL_RX_PHYS_DSGL_NOOFSGENTR_M)
2158 
2159 struct cpl_rx_mps_pkt {
2160 	__be32 op_to_r1_hi;
2161 	__be32 r1_lo_length;
2162 };
2163 
2164 #define CPL_RX_MPS_PKT_OP_S     24
2165 #define CPL_RX_MPS_PKT_OP_M     0xff
2166 #define CPL_RX_MPS_PKT_OP_V(x)  ((x) << CPL_RX_MPS_PKT_OP_S)
2167 #define CPL_RX_MPS_PKT_OP_G(x)  \
2168 	(((x) >> CPL_RX_MPS_PKT_OP_S) & CPL_RX_MPS_PKT_OP_M)
2169 
2170 #define CPL_RX_MPS_PKT_TYPE_S           20
2171 #define CPL_RX_MPS_PKT_TYPE_M           0xf
2172 #define CPL_RX_MPS_PKT_TYPE_V(x)        ((x) << CPL_RX_MPS_PKT_TYPE_S)
2173 #define CPL_RX_MPS_PKT_TYPE_G(x)        \
2174 	(((x) >> CPL_RX_MPS_PKT_TYPE_S) & CPL_RX_MPS_PKT_TYPE_M)
2175 
2176 enum {
2177 	X_CPL_RX_MPS_PKT_TYPE_PAUSE = 1 << 0,
2178 	X_CPL_RX_MPS_PKT_TYPE_PPP   = 1 << 1,
2179 	X_CPL_RX_MPS_PKT_TYPE_QFC   = 1 << 2,
2180 	X_CPL_RX_MPS_PKT_TYPE_PTP   = 1 << 3
2181 };
2182 
2183 struct cpl_srq_table_req {
2184 	WR_HDR;
2185 	union opcode_tid ot;
2186 	__u8 status;
2187 	__u8 rsvd[2];
2188 	__u8 idx;
2189 	__be64 rsvd_pdid;
2190 	__be32 qlen_qbase;
2191 	__be16 cur_msn;
2192 	__be16 max_msn;
2193 };
2194 
2195 struct cpl_srq_table_rpl {
2196 	union opcode_tid ot;
2197 	__u8 status;
2198 	__u8 rsvd[2];
2199 	__u8 idx;
2200 	__be64 rsvd_pdid;
2201 	__be32 qlen_qbase;
2202 	__be16 cur_msn;
2203 	__be16 max_msn;
2204 };
2205 
2206 /* cpl_srq_table_{req,rpl}.params fields */
2207 #define SRQT_QLEN_S   28
2208 #define SRQT_QLEN_M   0xF
2209 #define SRQT_QLEN_V(x) ((x) << SRQT_QLEN_S)
2210 #define SRQT_QLEN_G(x) (((x) >> SRQT_QLEN_S) & SRQT_QLEN_M)
2211 
2212 #define SRQT_QBASE_S    0
2213 #define SRQT_QBASE_M   0x3FFFFFF
2214 #define SRQT_QBASE_V(x) ((x) << SRQT_QBASE_S)
2215 #define SRQT_QBASE_G(x) (((x) >> SRQT_QBASE_S) & SRQT_QBASE_M)
2216 
2217 #define SRQT_PDID_S    0
2218 #define SRQT_PDID_M   0xFF
2219 #define SRQT_PDID_V(x) ((x) << SRQT_PDID_S)
2220 #define SRQT_PDID_G(x) (((x) >> SRQT_PDID_S) & SRQT_PDID_M)
2221 
2222 #define SRQT_IDX_S    0
2223 #define SRQT_IDX_M    0xF
2224 #define SRQT_IDX_V(x) ((x) << SRQT_IDX_S)
2225 #define SRQT_IDX_G(x) (((x) >> SRQT_IDX_S) & SRQT_IDX_M)
2226 
2227 struct cpl_tx_tls_sfo {
2228 	__be32 op_to_seg_len;
2229 	__be32 pld_len;
2230 	__be32 type_protover;
2231 	__be32 r1_lo;
2232 	__be32 seqno_numivs;
2233 	__be32 ivgen_hdrlen;
2234 	__be64 scmd1;
2235 };
2236 
2237 /* cpl_tx_tls_sfo macros */
2238 #define CPL_TX_TLS_SFO_OPCODE_S         24
2239 #define CPL_TX_TLS_SFO_OPCODE_V(x)      ((x) << CPL_TX_TLS_SFO_OPCODE_S)
2240 
2241 #define CPL_TX_TLS_SFO_DATA_TYPE_S      20
2242 #define CPL_TX_TLS_SFO_DATA_TYPE_V(x)   ((x) << CPL_TX_TLS_SFO_DATA_TYPE_S)
2243 
2244 #define CPL_TX_TLS_SFO_CPL_LEN_S        16
2245 #define CPL_TX_TLS_SFO_CPL_LEN_V(x)     ((x) << CPL_TX_TLS_SFO_CPL_LEN_S)
2246 
2247 #define CPL_TX_TLS_SFO_SEG_LEN_S        0
2248 #define CPL_TX_TLS_SFO_SEG_LEN_M        0xffff
2249 #define CPL_TX_TLS_SFO_SEG_LEN_V(x)     ((x) << CPL_TX_TLS_SFO_SEG_LEN_S)
2250 #define CPL_TX_TLS_SFO_SEG_LEN_G(x)     \
2251 	(((x) >> CPL_TX_TLS_SFO_SEG_LEN_S) & CPL_TX_TLS_SFO_SEG_LEN_M)
2252 
2253 #define CPL_TX_TLS_SFO_TYPE_S           24
2254 #define CPL_TX_TLS_SFO_TYPE_M           0xff
2255 #define CPL_TX_TLS_SFO_TYPE_V(x)        ((x) << CPL_TX_TLS_SFO_TYPE_S)
2256 #define CPL_TX_TLS_SFO_TYPE_G(x)        \
2257 	(((x) >> CPL_TX_TLS_SFO_TYPE_S) & CPL_TX_TLS_SFO_TYPE_M)
2258 
2259 #define CPL_TX_TLS_SFO_PROTOVER_S       8
2260 #define CPL_TX_TLS_SFO_PROTOVER_M       0xffff
2261 #define CPL_TX_TLS_SFO_PROTOVER_V(x)    ((x) << CPL_TX_TLS_SFO_PROTOVER_S)
2262 #define CPL_TX_TLS_SFO_PROTOVER_G(x)    \
2263 	(((x) >> CPL_TX_TLS_SFO_PROTOVER_S) & CPL_TX_TLS_SFO_PROTOVER_M)
2264 
2265 struct cpl_tls_data {
2266 	struct rss_header rsshdr;
2267 	union opcode_tid ot;
2268 	__be32 length_pkd;
2269 	__be32 seq;
2270 	__be32 r1;
2271 };
2272 
2273 #define CPL_TLS_DATA_OPCODE_S           24
2274 #define CPL_TLS_DATA_OPCODE_M           0xff
2275 #define CPL_TLS_DATA_OPCODE_V(x)        ((x) << CPL_TLS_DATA_OPCODE_S)
2276 #define CPL_TLS_DATA_OPCODE_G(x)        \
2277 	(((x) >> CPL_TLS_DATA_OPCODE_S) & CPL_TLS_DATA_OPCODE_M)
2278 
2279 #define CPL_TLS_DATA_TID_S              0
2280 #define CPL_TLS_DATA_TID_M              0xffffff
2281 #define CPL_TLS_DATA_TID_V(x)           ((x) << CPL_TLS_DATA_TID_S)
2282 #define CPL_TLS_DATA_TID_G(x)           \
2283 	(((x) >> CPL_TLS_DATA_TID_S) & CPL_TLS_DATA_TID_M)
2284 
2285 #define CPL_TLS_DATA_LENGTH_S           0
2286 #define CPL_TLS_DATA_LENGTH_M           0xffff
2287 #define CPL_TLS_DATA_LENGTH_V(x)        ((x) << CPL_TLS_DATA_LENGTH_S)
2288 #define CPL_TLS_DATA_LENGTH_G(x)        \
2289 	(((x) >> CPL_TLS_DATA_LENGTH_S) & CPL_TLS_DATA_LENGTH_M)
2290 
2291 struct cpl_rx_tls_cmp {
2292 	struct rss_header rsshdr;
2293 	union opcode_tid ot;
2294 	__be32 pdulength_length;
2295 	__be32 seq;
2296 	__be32 ddp_report;
2297 	__be32 r;
2298 	__be32 ddp_valid;
2299 };
2300 
2301 #define CPL_RX_TLS_CMP_OPCODE_S         24
2302 #define CPL_RX_TLS_CMP_OPCODE_M         0xff
2303 #define CPL_RX_TLS_CMP_OPCODE_V(x)      ((x) << CPL_RX_TLS_CMP_OPCODE_S)
2304 #define CPL_RX_TLS_CMP_OPCODE_G(x)      \
2305 	(((x) >> CPL_RX_TLS_CMP_OPCODE_S) & CPL_RX_TLS_CMP_OPCODE_M)
2306 
2307 #define CPL_RX_TLS_CMP_TID_S            0
2308 #define CPL_RX_TLS_CMP_TID_M            0xffffff
2309 #define CPL_RX_TLS_CMP_TID_V(x)         ((x) << CPL_RX_TLS_CMP_TID_S)
2310 #define CPL_RX_TLS_CMP_TID_G(x)         \
2311 	(((x) >> CPL_RX_TLS_CMP_TID_S) & CPL_RX_TLS_CMP_TID_M)
2312 
2313 #define CPL_RX_TLS_CMP_PDULENGTH_S      16
2314 #define CPL_RX_TLS_CMP_PDULENGTH_M      0xffff
2315 #define CPL_RX_TLS_CMP_PDULENGTH_V(x)   ((x) << CPL_RX_TLS_CMP_PDULENGTH_S)
2316 #define CPL_RX_TLS_CMP_PDULENGTH_G(x)   \
2317 	(((x) >> CPL_RX_TLS_CMP_PDULENGTH_S) & CPL_RX_TLS_CMP_PDULENGTH_M)
2318 
2319 #define CPL_RX_TLS_CMP_LENGTH_S         0
2320 #define CPL_RX_TLS_CMP_LENGTH_M         0xffff
2321 #define CPL_RX_TLS_CMP_LENGTH_V(x)      ((x) << CPL_RX_TLS_CMP_LENGTH_S)
2322 #define CPL_RX_TLS_CMP_LENGTH_G(x)      \
2323 	(((x) >> CPL_RX_TLS_CMP_LENGTH_S) & CPL_RX_TLS_CMP_LENGTH_M)
2324 #endif  /* __T4_MSG_H */
2325