162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright (c) 2017 Oracle.  All rights reserved.
462306a36Sopenharmony_ci */
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci/*
762306a36Sopenharmony_ci * enum ib_event_type, from include/rdma/ib_verbs.h
862306a36Sopenharmony_ci */
962306a36Sopenharmony_ci#define IB_EVENT_LIST				\
1062306a36Sopenharmony_ci	ib_event(CQ_ERR)			\
1162306a36Sopenharmony_ci	ib_event(QP_FATAL)			\
1262306a36Sopenharmony_ci	ib_event(QP_REQ_ERR)			\
1362306a36Sopenharmony_ci	ib_event(QP_ACCESS_ERR)			\
1462306a36Sopenharmony_ci	ib_event(COMM_EST)			\
1562306a36Sopenharmony_ci	ib_event(SQ_DRAINED)			\
1662306a36Sopenharmony_ci	ib_event(PATH_MIG)			\
1762306a36Sopenharmony_ci	ib_event(PATH_MIG_ERR)			\
1862306a36Sopenharmony_ci	ib_event(DEVICE_FATAL)			\
1962306a36Sopenharmony_ci	ib_event(PORT_ACTIVE)			\
2062306a36Sopenharmony_ci	ib_event(PORT_ERR)			\
2162306a36Sopenharmony_ci	ib_event(LID_CHANGE)			\
2262306a36Sopenharmony_ci	ib_event(PKEY_CHANGE)			\
2362306a36Sopenharmony_ci	ib_event(SM_CHANGE)			\
2462306a36Sopenharmony_ci	ib_event(SRQ_ERR)			\
2562306a36Sopenharmony_ci	ib_event(SRQ_LIMIT_REACHED)		\
2662306a36Sopenharmony_ci	ib_event(QP_LAST_WQE_REACHED)		\
2762306a36Sopenharmony_ci	ib_event(CLIENT_REREGISTER)		\
2862306a36Sopenharmony_ci	ib_event(GID_CHANGE)			\
2962306a36Sopenharmony_ci	ib_event_end(WQ_FATAL)
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci#undef ib_event
3262306a36Sopenharmony_ci#undef ib_event_end
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci#define ib_event(x)		TRACE_DEFINE_ENUM(IB_EVENT_##x);
3562306a36Sopenharmony_ci#define ib_event_end(x)		TRACE_DEFINE_ENUM(IB_EVENT_##x);
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ciIB_EVENT_LIST
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci#undef ib_event
4062306a36Sopenharmony_ci#undef ib_event_end
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ci#define ib_event(x)		{ IB_EVENT_##x, #x },
4362306a36Sopenharmony_ci#define ib_event_end(x)		{ IB_EVENT_##x, #x }
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci#define rdma_show_ib_event(x) \
4662306a36Sopenharmony_ci		__print_symbolic(x, IB_EVENT_LIST)
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ci/*
4962306a36Sopenharmony_ci * enum ib_wc_status type, from include/rdma/ib_verbs.h
5062306a36Sopenharmony_ci */
5162306a36Sopenharmony_ci#define IB_WC_STATUS_LIST			\
5262306a36Sopenharmony_ci	ib_wc_status(SUCCESS)			\
5362306a36Sopenharmony_ci	ib_wc_status(LOC_LEN_ERR)		\
5462306a36Sopenharmony_ci	ib_wc_status(LOC_QP_OP_ERR)		\
5562306a36Sopenharmony_ci	ib_wc_status(LOC_EEC_OP_ERR)		\
5662306a36Sopenharmony_ci	ib_wc_status(LOC_PROT_ERR)		\
5762306a36Sopenharmony_ci	ib_wc_status(WR_FLUSH_ERR)		\
5862306a36Sopenharmony_ci	ib_wc_status(MW_BIND_ERR)		\
5962306a36Sopenharmony_ci	ib_wc_status(BAD_RESP_ERR)		\
6062306a36Sopenharmony_ci	ib_wc_status(LOC_ACCESS_ERR)		\
6162306a36Sopenharmony_ci	ib_wc_status(REM_INV_REQ_ERR)		\
6262306a36Sopenharmony_ci	ib_wc_status(REM_ACCESS_ERR)		\
6362306a36Sopenharmony_ci	ib_wc_status(REM_OP_ERR)		\
6462306a36Sopenharmony_ci	ib_wc_status(RETRY_EXC_ERR)		\
6562306a36Sopenharmony_ci	ib_wc_status(RNR_RETRY_EXC_ERR)		\
6662306a36Sopenharmony_ci	ib_wc_status(LOC_RDD_VIOL_ERR)		\
6762306a36Sopenharmony_ci	ib_wc_status(REM_INV_RD_REQ_ERR)	\
6862306a36Sopenharmony_ci	ib_wc_status(REM_ABORT_ERR)		\
6962306a36Sopenharmony_ci	ib_wc_status(INV_EECN_ERR)		\
7062306a36Sopenharmony_ci	ib_wc_status(INV_EEC_STATE_ERR)		\
7162306a36Sopenharmony_ci	ib_wc_status(FATAL_ERR)			\
7262306a36Sopenharmony_ci	ib_wc_status(RESP_TIMEOUT_ERR)		\
7362306a36Sopenharmony_ci	ib_wc_status_end(GENERAL_ERR)
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ci#undef ib_wc_status
7662306a36Sopenharmony_ci#undef ib_wc_status_end
7762306a36Sopenharmony_ci
7862306a36Sopenharmony_ci#define ib_wc_status(x)		TRACE_DEFINE_ENUM(IB_WC_##x);
7962306a36Sopenharmony_ci#define ib_wc_status_end(x)	TRACE_DEFINE_ENUM(IB_WC_##x);
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ciIB_WC_STATUS_LIST
8262306a36Sopenharmony_ci
8362306a36Sopenharmony_ci#undef ib_wc_status
8462306a36Sopenharmony_ci#undef ib_wc_status_end
8562306a36Sopenharmony_ci
8662306a36Sopenharmony_ci#define ib_wc_status(x)		{ IB_WC_##x, #x },
8762306a36Sopenharmony_ci#define ib_wc_status_end(x)	{ IB_WC_##x, #x }
8862306a36Sopenharmony_ci
8962306a36Sopenharmony_ci#define rdma_show_wc_status(x) \
9062306a36Sopenharmony_ci		__print_symbolic(x, IB_WC_STATUS_LIST)
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_ci/*
9362306a36Sopenharmony_ci * enum ib_cm_event_type, from include/rdma/ib_cm.h
9462306a36Sopenharmony_ci */
9562306a36Sopenharmony_ci#define IB_CM_EVENT_LIST			\
9662306a36Sopenharmony_ci	ib_cm_event(REQ_ERROR)			\
9762306a36Sopenharmony_ci	ib_cm_event(REQ_RECEIVED)		\
9862306a36Sopenharmony_ci	ib_cm_event(REP_ERROR)			\
9962306a36Sopenharmony_ci	ib_cm_event(REP_RECEIVED)		\
10062306a36Sopenharmony_ci	ib_cm_event(RTU_RECEIVED)		\
10162306a36Sopenharmony_ci	ib_cm_event(USER_ESTABLISHED)		\
10262306a36Sopenharmony_ci	ib_cm_event(DREQ_ERROR)			\
10362306a36Sopenharmony_ci	ib_cm_event(DREQ_RECEIVED)		\
10462306a36Sopenharmony_ci	ib_cm_event(DREP_RECEIVED)		\
10562306a36Sopenharmony_ci	ib_cm_event(TIMEWAIT_EXIT)		\
10662306a36Sopenharmony_ci	ib_cm_event(MRA_RECEIVED)		\
10762306a36Sopenharmony_ci	ib_cm_event(REJ_RECEIVED)		\
10862306a36Sopenharmony_ci	ib_cm_event(LAP_ERROR)			\
10962306a36Sopenharmony_ci	ib_cm_event(LAP_RECEIVED)		\
11062306a36Sopenharmony_ci	ib_cm_event(APR_RECEIVED)		\
11162306a36Sopenharmony_ci	ib_cm_event(SIDR_REQ_ERROR)		\
11262306a36Sopenharmony_ci	ib_cm_event(SIDR_REQ_RECEIVED)		\
11362306a36Sopenharmony_ci	ib_cm_event_end(SIDR_REP_RECEIVED)
11462306a36Sopenharmony_ci
11562306a36Sopenharmony_ci#undef ib_cm_event
11662306a36Sopenharmony_ci#undef ib_cm_event_end
11762306a36Sopenharmony_ci
11862306a36Sopenharmony_ci#define ib_cm_event(x)		TRACE_DEFINE_ENUM(IB_CM_##x);
11962306a36Sopenharmony_ci#define ib_cm_event_end(x)	TRACE_DEFINE_ENUM(IB_CM_##x);
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ciIB_CM_EVENT_LIST
12262306a36Sopenharmony_ci
12362306a36Sopenharmony_ci#undef ib_cm_event
12462306a36Sopenharmony_ci#undef ib_cm_event_end
12562306a36Sopenharmony_ci
12662306a36Sopenharmony_ci#define ib_cm_event(x)		{ IB_CM_##x, #x },
12762306a36Sopenharmony_ci#define ib_cm_event_end(x)	{ IB_CM_##x, #x }
12862306a36Sopenharmony_ci
12962306a36Sopenharmony_ci#define rdma_show_ib_cm_event(x) \
13062306a36Sopenharmony_ci		__print_symbolic(x, IB_CM_EVENT_LIST)
13162306a36Sopenharmony_ci
13262306a36Sopenharmony_ci/*
13362306a36Sopenharmony_ci * enum rdma_cm_event_type, from include/rdma/rdma_cm.h
13462306a36Sopenharmony_ci */
13562306a36Sopenharmony_ci#define RDMA_CM_EVENT_LIST			\
13662306a36Sopenharmony_ci	rdma_cm_event(ADDR_RESOLVED)		\
13762306a36Sopenharmony_ci	rdma_cm_event(ADDR_ERROR)		\
13862306a36Sopenharmony_ci	rdma_cm_event(ROUTE_RESOLVED)		\
13962306a36Sopenharmony_ci	rdma_cm_event(ROUTE_ERROR)		\
14062306a36Sopenharmony_ci	rdma_cm_event(CONNECT_REQUEST)		\
14162306a36Sopenharmony_ci	rdma_cm_event(CONNECT_RESPONSE)		\
14262306a36Sopenharmony_ci	rdma_cm_event(CONNECT_ERROR)		\
14362306a36Sopenharmony_ci	rdma_cm_event(UNREACHABLE)		\
14462306a36Sopenharmony_ci	rdma_cm_event(REJECTED)			\
14562306a36Sopenharmony_ci	rdma_cm_event(ESTABLISHED)		\
14662306a36Sopenharmony_ci	rdma_cm_event(DISCONNECTED)		\
14762306a36Sopenharmony_ci	rdma_cm_event(DEVICE_REMOVAL)		\
14862306a36Sopenharmony_ci	rdma_cm_event(MULTICAST_JOIN)		\
14962306a36Sopenharmony_ci	rdma_cm_event(MULTICAST_ERROR)		\
15062306a36Sopenharmony_ci	rdma_cm_event(ADDR_CHANGE)		\
15162306a36Sopenharmony_ci	rdma_cm_event_end(TIMEWAIT_EXIT)
15262306a36Sopenharmony_ci
15362306a36Sopenharmony_ci#undef rdma_cm_event
15462306a36Sopenharmony_ci#undef rdma_cm_event_end
15562306a36Sopenharmony_ci
15662306a36Sopenharmony_ci#define rdma_cm_event(x)	TRACE_DEFINE_ENUM(RDMA_CM_EVENT_##x);
15762306a36Sopenharmony_ci#define rdma_cm_event_end(x)	TRACE_DEFINE_ENUM(RDMA_CM_EVENT_##x);
15862306a36Sopenharmony_ci
15962306a36Sopenharmony_ciRDMA_CM_EVENT_LIST
16062306a36Sopenharmony_ci
16162306a36Sopenharmony_ci#undef rdma_cm_event
16262306a36Sopenharmony_ci#undef rdma_cm_event_end
16362306a36Sopenharmony_ci
16462306a36Sopenharmony_ci#define rdma_cm_event(x)	{ RDMA_CM_EVENT_##x, #x },
16562306a36Sopenharmony_ci#define rdma_cm_event_end(x)	{ RDMA_CM_EVENT_##x, #x }
16662306a36Sopenharmony_ci
16762306a36Sopenharmony_ci#define rdma_show_cm_event(x) \
16862306a36Sopenharmony_ci		__print_symbolic(x, RDMA_CM_EVENT_LIST)
169