18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * This file is part of the Chelsio T4/T5/T6 Ethernet driver for Linux.
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Copyright (c) 2017 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_TCB_H
368c2ecf20Sopenharmony_ci#define __T4_TCB_H
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci#define TCB_L2T_IX_W		0
398c2ecf20Sopenharmony_ci#define TCB_L2T_IX_S		12
408c2ecf20Sopenharmony_ci#define TCB_L2T_IX_M		0xfffULL
418c2ecf20Sopenharmony_ci#define TCB_L2T_IX_V(x)		((x) << TCB_L2T_IX_S)
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci#define TCB_T_FLAGS_W           1
448c2ecf20Sopenharmony_ci#define TCB_T_FLAGS_S           0
458c2ecf20Sopenharmony_ci#define TCB_T_FLAGS_M           0xffffffffffffffffULL
468c2ecf20Sopenharmony_ci#define TCB_T_FLAGS_V(x)        ((__u64)(x) << TCB_T_FLAGS_S)
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci#define TCB_FIELD_COOKIE_TFLAG	1
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci#define TCB_SMAC_SEL_W		0
518c2ecf20Sopenharmony_ci#define TCB_SMAC_SEL_S		24
528c2ecf20Sopenharmony_ci#define TCB_SMAC_SEL_M		0xffULL
538c2ecf20Sopenharmony_ci#define TCB_SMAC_SEL_V(x)	((x) << TCB_SMAC_SEL_S)
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci#define TCB_T_FLAGS_W		1
568c2ecf20Sopenharmony_ci#define TCB_T_FLAGS_S		0
578c2ecf20Sopenharmony_ci#define TCB_T_FLAGS_M		0xffffffffffffffffULL
588c2ecf20Sopenharmony_ci#define TCB_T_FLAGS_V(x)	((__u64)(x) << TCB_T_FLAGS_S)
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci#define TF_DROP_S		22
618c2ecf20Sopenharmony_ci#define TF_DIRECT_STEER_S	23
628c2ecf20Sopenharmony_ci#define TF_LPBK_S		59
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci#define TF_CCTRL_ECE_S		60
658c2ecf20Sopenharmony_ci#define TF_CCTRL_CWR_S		61
668c2ecf20Sopenharmony_ci#define TF_CCTRL_RFR_S		62
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci#define TCB_RSS_INFO_W		3
698c2ecf20Sopenharmony_ci#define TCB_RSS_INFO_S		0
708c2ecf20Sopenharmony_ci#define TCB_RSS_INFO_M		0x3ffULL
718c2ecf20Sopenharmony_ci#define TCB_RSS_INFO_V(x)	((x) << TCB_RSS_INFO_S)
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci#define TCB_T_STATE_W		3
748c2ecf20Sopenharmony_ci#define TCB_T_STATE_S		16
758c2ecf20Sopenharmony_ci#define TCB_T_STATE_M		0xfULL
768c2ecf20Sopenharmony_ci#define TCB_T_STATE_V(x)	((x) << TCB_T_STATE_S)
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci#define TCB_TIMESTAMP_W		5
798c2ecf20Sopenharmony_ci#define TCB_TIMESTAMP_S		0
808c2ecf20Sopenharmony_ci#define TCB_TIMESTAMP_M		0xffffffffULL
818c2ecf20Sopenharmony_ci#define TCB_TIMESTAMP_V(x)	((x) << TCB_TIMESTAMP_S)
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci#define TCB_RTT_TS_RECENT_AGE_W		6
848c2ecf20Sopenharmony_ci#define TCB_RTT_TS_RECENT_AGE_S		0
858c2ecf20Sopenharmony_ci#define TCB_RTT_TS_RECENT_AGE_M		0xffffffffULL
868c2ecf20Sopenharmony_ci#define TCB_RTT_TS_RECENT_AGE_V(x)	((x) << TCB_RTT_TS_RECENT_AGE_S)
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci#define TCB_T_RTSEQ_RECENT_W    7
898c2ecf20Sopenharmony_ci#define TCB_T_RTSEQ_RECENT_S    0
908c2ecf20Sopenharmony_ci#define TCB_T_RTSEQ_RECENT_M    0xffffffffULL
918c2ecf20Sopenharmony_ci#define TCB_T_RTSEQ_RECENT_V(x) ((x) << TCB_T_RTSEQ_RECENT_S)
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci#define TCB_TX_MAX_W		9
948c2ecf20Sopenharmony_ci#define TCB_TX_MAX_S		0
958c2ecf20Sopenharmony_ci#define TCB_TX_MAX_M		0xffffffffULL
968c2ecf20Sopenharmony_ci#define TCB_TX_MAX_V(x)		((x) << TCB_TX_MAX_S)
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci#define TCB_SND_UNA_RAW_W	10
998c2ecf20Sopenharmony_ci#define TCB_SND_UNA_RAW_S	0
1008c2ecf20Sopenharmony_ci#define TCB_SND_UNA_RAW_M	0xfffffffULL
1018c2ecf20Sopenharmony_ci#define TCB_SND_UNA_RAW_V(x)	((x) << TCB_SND_UNA_RAW_S)
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci#define TCB_SND_NXT_RAW_W	10
1048c2ecf20Sopenharmony_ci#define TCB_SND_NXT_RAW_S	28
1058c2ecf20Sopenharmony_ci#define TCB_SND_NXT_RAW_M	0xfffffffULL
1068c2ecf20Sopenharmony_ci#define TCB_SND_NXT_RAW_V(x)	((x) << TCB_SND_NXT_RAW_S)
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci#define TCB_SND_MAX_RAW_W	11
1098c2ecf20Sopenharmony_ci#define TCB_SND_MAX_RAW_S	24
1108c2ecf20Sopenharmony_ci#define TCB_SND_MAX_RAW_M	0xfffffffULL
1118c2ecf20Sopenharmony_ci#define TCB_SND_MAX_RAW_V(x)	((x) << TCB_SND_MAX_RAW_S)
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci#define TCB_RCV_NXT_W		16
1148c2ecf20Sopenharmony_ci#define TCB_RCV_NXT_S		10
1158c2ecf20Sopenharmony_ci#define TCB_RCV_NXT_M		0xffffffffULL
1168c2ecf20Sopenharmony_ci#define TCB_RCV_NXT_V(x)	((x) << TCB_RCV_NXT_S)
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci#define TCB_RCV_WND_W		17
1198c2ecf20Sopenharmony_ci#define TCB_RCV_WND_S		10
1208c2ecf20Sopenharmony_ci#define TCB_RCV_WND_M		0xffffffULL
1218c2ecf20Sopenharmony_ci#define TCB_RCV_WND_V(x)	((x) << TCB_RCV_WND_S)
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci#define TCB_RX_FRAG2_PTR_RAW_W	27
1248c2ecf20Sopenharmony_ci#define TCB_RX_FRAG3_LEN_RAW_W	29
1258c2ecf20Sopenharmony_ci#define TCB_RX_FRAG3_START_IDX_OFFSET_RAW_W	30
1268c2ecf20Sopenharmony_ci#define TCB_PDU_HDR_LEN_W	31
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_ci#define TCB_RQ_START_W		30
1298c2ecf20Sopenharmony_ci#define TCB_RQ_START_S		0
1308c2ecf20Sopenharmony_ci#define TCB_RQ_START_M		0x3ffffffULL
1318c2ecf20Sopenharmony_ci#define TCB_RQ_START_V(x)	((x) << TCB_RQ_START_S)
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci#define TF_RX_PDU_OUT_S		49
1348c2ecf20Sopenharmony_ci#define TF_RX_PDU_OUT_V(x)	((__u64)(x) << TF_RX_PDU_OUT_S)
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci#define TF_CORE_BYPASS_S	63
1378c2ecf20Sopenharmony_ci#define TF_CORE_BYPASS_V(x)	((__u64)(x) << TF_CORE_BYPASS_S)
1388c2ecf20Sopenharmony_ci#define TF_CORE_BYPASS_F	TF_CORE_BYPASS_V(1)
1398c2ecf20Sopenharmony_ci
1408c2ecf20Sopenharmony_ci#define TF_NON_OFFLOAD_S	1
1418c2ecf20Sopenharmony_ci#define TF_NON_OFFLOAD_V(x)	((x) << TF_NON_OFFLOAD_S)
1428c2ecf20Sopenharmony_ci#define TF_NON_OFFLOAD_F	TF_NON_OFFLOAD_V(1)
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ci#endif /* __T4_TCB_H */
145