1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2020 Mellanox Technologies, Ltd
11 * eCPRI headers definition.
13 * eCPRI (Common Public Radio Interface) is used in internal interfaces
14 * of radio base station in a 5G infrastructure.
18 #include <rte_byteorder.h>
25 * eCPRI Protocol Revision 1.0, 1.1, 1.2, 2.0: 0001b
26 * Other values are reserved for future
28 #define RTE_ECPRI_REV_UP_TO_20 1
31 * eCPRI message types in specifications
32 * IWF* types will only be supported from rev.2
33 * 12-63: Reserved for future revision
34 * 64-255: Vendor Specific
36 #define RTE_ECPRI_MSG_TYPE_IQ_DATA 0
37 #define RTE_ECPRI_MSG_TYPE_BIT_SEQ 1
38 #define RTE_ECPRI_MSG_TYPE_RTC_CTRL 2
39 #define RTE_ECPRI_MSG_TYPE_GEN_DATA 3
40 #define RTE_ECPRI_MSG_TYPE_RM_ACC 4
41 #define RTE_ECPRI_MSG_TYPE_DLY_MSR 5
42 #define RTE_ECPRI_MSG_TYPE_RMT_RST 6
43 #define RTE_ECPRI_MSG_TYPE_EVT_IND 7
44 #define RTE_ECPRI_MSG_TYPE_IWF_UP 8
45 #define RTE_ECPRI_MSG_TYPE_IWF_OPT 9
46 #define RTE_ECPRI_MSG_TYPE_IWF_MAP 10
47 #define RTE_ECPRI_MSG_TYPE_IWF_DCTRL 11
50 * Event Type of Message Type #7: Event Indication
51 * 0x00: Fault(s) Indication
52 * 0x01: Fault(s) Indication Acknowledge
53 * 0x02: Notification(s) Indication
54 * 0x03: Synchronization Request
55 * 0x04: Synchronization Acknowledge
56 * 0x05: Synchronization End Indication
57 * 0x06...0xFF: Reserved
59 #define RTE_ECPRI_EVT_IND_FAULT_IND 0x00
60 #define RTE_ECPRI_EVT_IND_FAULT_ACK 0x01
61 #define RTE_ECPRI_EVT_IND_NTFY_IND 0x02
62 #define RTE_ECPRI_EVT_IND_SYNC_REQ 0x03
63 #define RTE_ECPRI_EVT_IND_SYNC_ACK 0x04
64 #define RTE_ECPRI_EVT_IND_SYNC_END 0x05
70 struct rte_ecpri_common_hdr {
72 rte_be32_t u32; /**< 4B common header in BE */
74 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
75 uint32_t size:16; /**< Payload Size */
76 uint32_t type:8; /**< Message Type */
77 uint32_t c:1; /**< Concatenation Indicator */
78 uint32_t res:3; /**< Reserved */
79 uint32_t revision:4; /**< Protocol Revision */
80 #elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
81 uint32_t revision:4; /**< Protocol Revision */
82 uint32_t res:3; /**< Reserved */
83 uint32_t c:1; /**< Concatenation Indicator */
84 uint32_t type:8; /**< Message Type */
85 uint32_t size:16; /**< Payload Size */
92 * eCPRI Message Header of Type #0: IQ Data
94 struct rte_ecpri_msg_iq_data {
95 rte_be16_t pc_id; /**< Physical channel ID */
96 rte_be16_t seq_id; /**< Sequence ID */
100 * eCPRI Message Header of Type #1: Bit Sequence
102 struct rte_ecpri_msg_bit_seq {
103 rte_be16_t pc_id; /**< Physical channel ID */
104 rte_be16_t seq_id; /**< Sequence ID */
108 * eCPRI Message Header of Type #2: Real-Time Control Data
110 struct rte_ecpri_msg_rtc_ctrl {
111 rte_be16_t rtc_id; /**< Real-Time Control Data ID */
112 rte_be16_t seq_id; /**< Sequence ID */
116 * eCPRI Message Header of Type #3: Generic Data Transfer
118 struct rte_ecpri_msg_gen_data {
119 rte_be32_t pc_id; /**< Physical channel ID */
120 rte_be32_t seq_id; /**< Sequence ID */
124 * eCPRI Message Header of Type #4: Remote Memory Access
127 struct rte_ecpri_msg_rm_access {
128 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
129 uint32_t ele_id:16; /**< Element ID */
130 uint32_t rr:4; /**< Req/Resp */
131 uint32_t rw:4; /**< Read/Write */
132 uint32_t rma_id:8; /**< Remote Memory Access ID */
133 #elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
134 uint32_t rma_id:8; /**< Remote Memory Access ID */
135 uint32_t rw:4; /**< Read/Write */
136 uint32_t rr:4; /**< Req/Resp */
137 uint32_t ele_id:16; /**< Element ID */
139 uint8_t addr[6]; /**< 48-bits address */
140 rte_be16_t length; /**< number of bytes */
144 * eCPRI Message Header of Type #5: One-Way Delay Measurement
146 struct rte_ecpri_msg_delay_measure {
147 uint8_t msr_id; /**< Measurement ID */
148 uint8_t act_type; /**< Action Type */
152 * eCPRI Message Header of Type #6: Remote Reset
154 struct rte_ecpri_msg_remote_reset {
155 rte_be16_t rst_id; /**< Reset ID */
156 uint8_t rst_op; /**< Reset Code Op */
160 * eCPRI Message Header of Type #7: Event Indication
162 struct rte_ecpri_msg_event_ind {
163 uint8_t evt_id; /**< Event ID */
164 uint8_t evt_type; /**< Event Type */
165 uint8_t seq; /**< Sequence Number */
166 uint8_t number; /**< Number of Faults/Notif */
170 * eCPRI Combined Message Header Format: Common Header + Message Types
173 struct rte_ecpri_combined_msg_hdr {
174 struct rte_ecpri_common_hdr common;
176 struct rte_ecpri_msg_iq_data type0;
177 struct rte_ecpri_msg_bit_seq type1;
178 struct rte_ecpri_msg_rtc_ctrl type2;
179 struct rte_ecpri_msg_gen_data type3;
180 struct rte_ecpri_msg_rm_access type4;
181 struct rte_ecpri_msg_delay_measure type5;
182 struct rte_ecpri_msg_remote_reset type6;
183 struct rte_ecpri_msg_event_ind type7;
192 #endif /* _RTE_ECPRI_H_ */