2 * Copyright (C) 2013-2015 Freescale Semiconductor
4 * SPDX-License-Identifier: GPL-2.0+
10 #define DPNI_VER_MAJOR 5
11 #define DPNI_VER_MINOR 0
14 #define DPNI_CMDID_OPEN 0x801
15 #define DPNI_CMDID_CLOSE 0x800
17 #define DPNI_CMDID_ENABLE 0x002
18 #define DPNI_CMDID_DISABLE 0x003
19 #define DPNI_CMDID_GET_ATTR 0x004
20 #define DPNI_CMDID_RESET 0x005
22 #define DPNI_CMDID_SET_POOLS 0x200
23 #define DPNI_CMDID_GET_RX_BUFFER_LAYOUT 0x201
24 #define DPNI_CMDID_SET_RX_BUFFER_LAYOUT 0x202
25 #define DPNI_CMDID_GET_TX_BUFFER_LAYOUT 0x203
26 #define DPNI_CMDID_SET_TX_BUFFER_LAYOUT 0x204
27 #define DPNI_CMDID_SET_TX_CONF_BUFFER_LAYOUT 0x205
28 #define DPNI_CMDID_GET_TX_CONF_BUFFER_LAYOUT 0x206
30 #define DPNI_CMDID_GET_QDID 0x210
31 #define DPNI_CMDID_GET_TX_DATA_OFFSET 0x212
32 #define DPNI_CMDID_GET_COUNTER 0x213
33 #define DPNI_CMDID_SET_COUNTER 0x214
34 #define DPNI_CMDID_GET_LINK_STATE 0x215
35 #define DPNI_CMDID_SET_LINK_CFG 0x21A
37 #define DPNI_CMDID_SET_PRIM_MAC 0x224
38 #define DPNI_CMDID_GET_PRIM_MAC 0x225
39 #define DPNI_CMDID_ADD_MAC_ADDR 0x226
40 #define DPNI_CMDID_REMOVE_MAC_ADDR 0x227
42 #define DPNI_CMDID_SET_TX_FLOW 0x236
43 #define DPNI_CMDID_GET_TX_FLOW 0x237
44 #define DPNI_CMDID_SET_RX_FLOW 0x238
45 #define DPNI_CMDID_GET_RX_FLOW 0x239
47 /* cmd, param, offset, width, type, arg_name */
48 #define DPNI_CMD_OPEN(cmd, dpni_id) \
49 MC_CMD_OP(cmd, 0, 0, 32, int, dpni_id)
52 /* cmd, param, offset, width, type, arg_name */
53 #define DPNI_CMD_SET_POOLS(cmd, cfg) \
55 MC_CMD_OP(cmd, 0, 0, 8, uint8_t, cfg->num_dpbp); \
56 MC_CMD_OP(cmd, 0, 32, 32, int, cfg->pools[0].dpbp_id); \
57 MC_CMD_OP(cmd, 4, 32, 16, uint16_t, cfg->pools[0].buffer_size);\
58 MC_CMD_OP(cmd, 1, 0, 32, int, cfg->pools[1].dpbp_id); \
59 MC_CMD_OP(cmd, 4, 48, 16, uint16_t, cfg->pools[1].buffer_size);\
60 MC_CMD_OP(cmd, 1, 32, 32, int, cfg->pools[2].dpbp_id); \
61 MC_CMD_OP(cmd, 5, 0, 16, uint16_t, cfg->pools[2].buffer_size);\
62 MC_CMD_OP(cmd, 2, 0, 32, int, cfg->pools[3].dpbp_id); \
63 MC_CMD_OP(cmd, 5, 16, 16, uint16_t, cfg->pools[3].buffer_size);\
64 MC_CMD_OP(cmd, 2, 32, 32, int, cfg->pools[4].dpbp_id); \
65 MC_CMD_OP(cmd, 5, 32, 16, uint16_t, cfg->pools[4].buffer_size);\
66 MC_CMD_OP(cmd, 3, 0, 32, int, cfg->pools[5].dpbp_id); \
67 MC_CMD_OP(cmd, 5, 48, 16, uint16_t, cfg->pools[5].buffer_size);\
68 MC_CMD_OP(cmd, 3, 32, 32, int, cfg->pools[6].dpbp_id); \
69 MC_CMD_OP(cmd, 6, 0, 16, uint16_t, cfg->pools[6].buffer_size);\
70 MC_CMD_OP(cmd, 4, 0, 32, int, cfg->pools[7].dpbp_id); \
71 MC_CMD_OP(cmd, 6, 16, 16, uint16_t, cfg->pools[7].buffer_size);\
74 /* cmd, param, offset, width, type, arg_name */
75 #define DPNI_RSP_GET_ATTR(cmd, attr) \
77 MC_RSP_OP(cmd, 0, 0, 32, int, attr->id);\
78 MC_RSP_OP(cmd, 0, 32, 8, uint8_t, attr->max_tcs); \
79 MC_RSP_OP(cmd, 0, 40, 8, uint8_t, attr->max_senders); \
80 MC_RSP_OP(cmd, 0, 48, 8, enum net_prot, attr->start_hdr); \
81 MC_RSP_OP(cmd, 1, 0, 32, uint32_t, attr->options); \
82 MC_RSP_OP(cmd, 2, 0, 8, uint8_t, attr->max_unicast_filters); \
83 MC_RSP_OP(cmd, 2, 8, 8, uint8_t, attr->max_multicast_filters);\
84 MC_RSP_OP(cmd, 2, 16, 8, uint8_t, attr->max_vlan_filters); \
85 MC_RSP_OP(cmd, 2, 24, 8, uint8_t, attr->max_qos_entries); \
86 MC_RSP_OP(cmd, 2, 32, 8, uint8_t, attr->max_qos_key_size); \
87 MC_RSP_OP(cmd, 2, 40, 8, uint8_t, attr->max_dist_key_size); \
88 MC_RSP_OP(cmd, 3, 0, 8, uint8_t, attr->max_dist_per_tc[0]); \
89 MC_RSP_OP(cmd, 3, 8, 8, uint8_t, attr->max_dist_per_tc[1]); \
90 MC_RSP_OP(cmd, 3, 16, 8, uint8_t, attr->max_dist_per_tc[2]); \
91 MC_RSP_OP(cmd, 3, 24, 8, uint8_t, attr->max_dist_per_tc[3]); \
92 MC_RSP_OP(cmd, 3, 32, 8, uint8_t, attr->max_dist_per_tc[4]); \
93 MC_RSP_OP(cmd, 3, 40, 8, uint8_t, attr->max_dist_per_tc[5]); \
94 MC_RSP_OP(cmd, 3, 48, 8, uint8_t, attr->max_dist_per_tc[6]); \
95 MC_RSP_OP(cmd, 3, 56, 8, uint8_t, attr->max_dist_per_tc[7]); \
96 MC_RSP_OP(cmd, 4, 0, 16, uint16_t, \
97 attr->ipr_cfg.max_reass_frm_size); \
98 MC_RSP_OP(cmd, 4, 16, 16, uint16_t, \
99 attr->ipr_cfg.min_frag_size_ipv4); \
100 MC_RSP_OP(cmd, 4, 32, 16, uint16_t, \
101 attr->ipr_cfg.min_frag_size_ipv6);\
102 MC_RSP_OP(cmd, 4, 48, 8, uint8_t, attr->max_policers); \
103 MC_RSP_OP(cmd, 4, 56, 8, uint8_t, attr->max_congestion_ctrl); \
104 MC_RSP_OP(cmd, 5, 0, 16, uint16_t, \
105 attr->ipr_cfg.max_open_frames_ipv4); \
106 MC_RSP_OP(cmd, 5, 16, 16, uint16_t, \
107 attr->ipr_cfg.max_open_frames_ipv6); \
108 MC_RSP_OP(cmd, 5, 32, 16, uint16_t, attr->version.major);\
109 MC_RSP_OP(cmd, 5, 48, 16, uint16_t, attr->version.minor);\
112 /* cmd, param, offset, width, type, arg_name */
113 #define DPNI_RSP_GET_RX_BUFFER_LAYOUT(cmd, layout) \
115 MC_RSP_OP(cmd, 0, 0, 16, uint16_t, layout->private_data_size); \
116 MC_RSP_OP(cmd, 0, 16, 16, uint16_t, layout->data_align); \
117 MC_RSP_OP(cmd, 1, 0, 1, int, layout->pass_timestamp); \
118 MC_RSP_OP(cmd, 1, 1, 1, int, layout->pass_parser_result); \
119 MC_RSP_OP(cmd, 1, 2, 1, int, layout->pass_frame_status); \
120 MC_RSP_OP(cmd, 1, 16, 16, uint16_t, layout->data_head_room); \
121 MC_RSP_OP(cmd, 1, 32, 16, uint16_t, layout->data_tail_room); \
124 /* cmd, param, offset, width, type, arg_name */
125 #define DPNI_CMD_SET_RX_BUFFER_LAYOUT(cmd, layout) \
127 MC_CMD_OP(cmd, 0, 0, 16, uint16_t, layout->private_data_size); \
128 MC_CMD_OP(cmd, 0, 16, 16, uint16_t, layout->data_align); \
129 MC_CMD_OP(cmd, 0, 32, 32, uint32_t, layout->options); \
130 MC_CMD_OP(cmd, 1, 0, 1, int, layout->pass_timestamp); \
131 MC_CMD_OP(cmd, 1, 1, 1, int, layout->pass_parser_result); \
132 MC_CMD_OP(cmd, 1, 2, 1, int, layout->pass_frame_status); \
133 MC_CMD_OP(cmd, 1, 16, 16, uint16_t, layout->data_head_room); \
134 MC_CMD_OP(cmd, 1, 32, 16, uint16_t, layout->data_tail_room); \
137 /* cmd, param, offset, width, type, arg_name */
138 #define DPNI_RSP_GET_TX_BUFFER_LAYOUT(cmd, layout) \
140 MC_RSP_OP(cmd, 0, 0, 16, uint16_t, layout->private_data_size); \
141 MC_RSP_OP(cmd, 0, 16, 16, uint16_t, layout->data_align); \
142 MC_RSP_OP(cmd, 1, 0, 1, int, layout->pass_timestamp); \
143 MC_RSP_OP(cmd, 1, 1, 1, int, layout->pass_parser_result); \
144 MC_RSP_OP(cmd, 1, 2, 1, int, layout->pass_frame_status); \
145 MC_RSP_OP(cmd, 1, 16, 16, uint16_t, layout->data_head_room); \
146 MC_RSP_OP(cmd, 1, 32, 16, uint16_t, layout->data_tail_room); \
149 /* cmd, param, offset, width, type, arg_name */
150 #define DPNI_CMD_SET_TX_BUFFER_LAYOUT(cmd, layout) \
152 MC_CMD_OP(cmd, 0, 0, 16, uint16_t, layout->private_data_size); \
153 MC_CMD_OP(cmd, 0, 16, 16, uint16_t, layout->data_align); \
154 MC_CMD_OP(cmd, 0, 32, 32, uint32_t, layout->options); \
155 MC_CMD_OP(cmd, 1, 0, 1, int, layout->pass_timestamp); \
156 MC_CMD_OP(cmd, 1, 1, 1, int, layout->pass_parser_result); \
157 MC_CMD_OP(cmd, 1, 2, 1, int, layout->pass_frame_status); \
158 MC_CMD_OP(cmd, 1, 16, 16, uint16_t, layout->data_head_room); \
159 MC_CMD_OP(cmd, 1, 32, 16, uint16_t, layout->data_tail_room); \
162 /* cmd, param, offset, width, type, arg_name */
163 #define DPNI_RSP_GET_TX_CONF_BUFFER_LAYOUT(cmd, layout) \
165 MC_RSP_OP(cmd, 0, 0, 16, uint16_t, layout->private_data_size); \
166 MC_RSP_OP(cmd, 0, 16, 16, uint16_t, layout->data_align); \
167 MC_RSP_OP(cmd, 1, 0, 1, int, layout->pass_timestamp); \
168 MC_RSP_OP(cmd, 1, 1, 1, int, layout->pass_parser_result); \
169 MC_RSP_OP(cmd, 1, 2, 1, int, layout->pass_frame_status); \
170 MC_RSP_OP(cmd, 1, 16, 16, uint16_t, layout->data_head_room); \
171 MC_RSP_OP(cmd, 1, 32, 16, uint16_t, layout->data_tail_room); \
174 /* cmd, param, offset, width, type, arg_name */
175 #define DPNI_CMD_SET_TX_CONF_BUFFER_LAYOUT(cmd, layout) \
177 MC_CMD_OP(cmd, 0, 0, 16, uint16_t, layout->private_data_size); \
178 MC_CMD_OP(cmd, 0, 16, 16, uint16_t, layout->data_align); \
179 MC_CMD_OP(cmd, 0, 32, 32, uint32_t, layout->options); \
180 MC_CMD_OP(cmd, 1, 0, 1, int, layout->pass_timestamp); \
181 MC_CMD_OP(cmd, 1, 1, 1, int, layout->pass_parser_result); \
182 MC_CMD_OP(cmd, 1, 2, 1, int, layout->pass_frame_status); \
183 MC_CMD_OP(cmd, 1, 16, 16, uint16_t, layout->data_head_room); \
184 MC_CMD_OP(cmd, 1, 32, 16, uint16_t, layout->data_tail_room); \
187 /* cmd, param, offset, width, type, arg_name */
188 #define DPNI_RSP_GET_QDID(cmd, qdid) \
189 MC_RSP_OP(cmd, 0, 0, 16, uint16_t, qdid)
191 /* cmd, param, offset, width, type, arg_name */
192 #define DPNI_RSP_GET_TX_DATA_OFFSET(cmd, data_offset) \
193 MC_RSP_OP(cmd, 0, 0, 16, uint16_t, data_offset)
195 /* cmd, param, offset, width, type, arg_name */
196 #define DPNI_CMD_GET_COUNTER(cmd, counter) \
197 MC_CMD_OP(cmd, 0, 0, 16, enum dpni_counter, counter)
199 /* cmd, param, offset, width, type, arg_name */
200 #define DPNI_RSP_GET_COUNTER(cmd, value) \
201 MC_RSP_OP(cmd, 1, 0, 64, uint64_t, value)
203 /* cmd, param, offset, width, type, arg_name */
204 #define DPNI_CMD_SET_COUNTER(cmd, counter, value) \
206 MC_CMD_OP(cmd, 0, 0, 16, enum dpni_counter, counter); \
207 MC_CMD_OP(cmd, 1, 0, 64, uint64_t, value); \
210 /* cmd, param, offset, width, type, arg_name */
211 #define DPNI_CMD_SET_LINK_CFG(cmd, cfg) \
213 MC_CMD_OP(cmd, 1, 0, 32, uint32_t, cfg->rate);\
214 MC_CMD_OP(cmd, 2, 0, 64, uint64_t, cfg->options);\
217 /* cmd, param, offset, width, type, arg_name */
218 #define DPNI_RSP_GET_LINK_STATE(cmd, state) \
220 MC_RSP_OP(cmd, 0, 32, 1, int, state->up);\
221 MC_RSP_OP(cmd, 1, 0, 32, uint32_t, state->rate);\
222 MC_RSP_OP(cmd, 2, 0, 64, uint64_t, state->options);\
227 /* cmd, param, offset, width, type, arg_name */
228 #define DPNI_CMD_SET_PRIMARY_MAC_ADDR(cmd, mac_addr) \
230 MC_CMD_OP(cmd, 0, 16, 8, uint8_t, mac_addr[5]); \
231 MC_CMD_OP(cmd, 0, 24, 8, uint8_t, mac_addr[4]); \
232 MC_CMD_OP(cmd, 0, 32, 8, uint8_t, mac_addr[3]); \
233 MC_CMD_OP(cmd, 0, 40, 8, uint8_t, mac_addr[2]); \
234 MC_CMD_OP(cmd, 0, 48, 8, uint8_t, mac_addr[1]); \
235 MC_CMD_OP(cmd, 0, 56, 8, uint8_t, mac_addr[0]); \
238 /* cmd, param, offset, width, type, arg_name */
239 #define DPNI_RSP_GET_PRIMARY_MAC_ADDR(cmd, mac_addr) \
241 MC_RSP_OP(cmd, 0, 16, 8, uint8_t, mac_addr[5]); \
242 MC_RSP_OP(cmd, 0, 24, 8, uint8_t, mac_addr[4]); \
243 MC_RSP_OP(cmd, 0, 32, 8, uint8_t, mac_addr[3]); \
244 MC_RSP_OP(cmd, 0, 40, 8, uint8_t, mac_addr[2]); \
245 MC_RSP_OP(cmd, 0, 48, 8, uint8_t, mac_addr[1]); \
246 MC_RSP_OP(cmd, 0, 56, 8, uint8_t, mac_addr[0]); \
249 /* cmd, param, offset, width, type, arg_name */
250 #define DPNI_CMD_ADD_MAC_ADDR(cmd, mac_addr) \
252 MC_CMD_OP(cmd, 0, 16, 8, uint8_t, mac_addr[5]); \
253 MC_CMD_OP(cmd, 0, 24, 8, uint8_t, mac_addr[4]); \
254 MC_CMD_OP(cmd, 0, 32, 8, uint8_t, mac_addr[3]); \
255 MC_CMD_OP(cmd, 0, 40, 8, uint8_t, mac_addr[2]); \
256 MC_CMD_OP(cmd, 0, 48, 8, uint8_t, mac_addr[1]); \
257 MC_CMD_OP(cmd, 0, 56, 8, uint8_t, mac_addr[0]); \
260 /* cmd, param, offset, width, type, arg_name */
261 #define DPNI_CMD_REMOVE_MAC_ADDR(cmd, mac_addr) \
263 MC_CMD_OP(cmd, 0, 16, 8, uint8_t, mac_addr[5]); \
264 MC_CMD_OP(cmd, 0, 24, 8, uint8_t, mac_addr[4]); \
265 MC_CMD_OP(cmd, 0, 32, 8, uint8_t, mac_addr[3]); \
266 MC_CMD_OP(cmd, 0, 40, 8, uint8_t, mac_addr[2]); \
267 MC_CMD_OP(cmd, 0, 48, 8, uint8_t, mac_addr[1]); \
268 MC_CMD_OP(cmd, 0, 56, 8, uint8_t, mac_addr[0]); \
271 /* cmd, param, offset, width, type, arg_name */
272 #define DPNI_CMD_SET_TX_FLOW(cmd, flow_id, cfg) \
274 MC_CMD_OP(cmd, 0, 0, 32, int, \
275 cfg->conf_err_cfg.queue_cfg.dest_cfg.dest_id);\
276 MC_CMD_OP(cmd, 0, 32, 8, uint8_t, \
277 cfg->conf_err_cfg.queue_cfg.dest_cfg.priority);\
278 MC_CMD_OP(cmd, 0, 40, 2, enum dpni_dest, \
279 cfg->conf_err_cfg.queue_cfg.dest_cfg.dest_type);\
280 MC_CMD_OP(cmd, 0, 42, 1, int, cfg->conf_err_cfg.errors_only);\
281 MC_CMD_OP(cmd, 0, 43, 1, int, cfg->l3_chksum_gen);\
282 MC_CMD_OP(cmd, 0, 44, 1, int, cfg->l4_chksum_gen);\
283 MC_CMD_OP(cmd, 0, 45, 1, int, \
284 cfg->conf_err_cfg.use_default_queue);\
285 MC_CMD_OP(cmd, 0, 48, 16, uint16_t, flow_id);\
286 MC_CMD_OP(cmd, 1, 0, 64, uint64_t, \
287 cfg->conf_err_cfg.queue_cfg.user_ctx);\
288 MC_CMD_OP(cmd, 2, 0, 32, uint32_t, cfg->options);\
289 MC_CMD_OP(cmd, 2, 32, 32, uint32_t, \
290 cfg->conf_err_cfg.queue_cfg.options);\
293 /* cmd, param, offset, width, type, arg_name */
294 #define DPNI_RSP_SET_TX_FLOW(cmd, flow_id) \
295 MC_RSP_OP(cmd, 0, 48, 16, uint16_t, flow_id)
297 /* cmd, param, offset, width, type, arg_name */
298 #define DPNI_CMD_GET_TX_FLOW(cmd, flow_id) \
299 MC_CMD_OP(cmd, 0, 48, 16, uint16_t, flow_id)
301 /* cmd, param, offset, width, type, arg_name */
302 #define DPNI_RSP_GET_TX_FLOW(cmd, attr) \
304 MC_RSP_OP(cmd, 0, 0, 32, int, \
305 attr->conf_err_attr.queue_attr.dest_cfg.dest_id);\
306 MC_RSP_OP(cmd, 0, 32, 8, uint8_t, \
307 attr->conf_err_attr.queue_attr.dest_cfg.priority);\
308 MC_RSP_OP(cmd, 0, 40, 2, enum dpni_dest, \
309 attr->conf_err_attr.queue_attr.dest_cfg.dest_type);\
310 MC_RSP_OP(cmd, 0, 42, 1, int, attr->conf_err_attr.errors_only);\
311 MC_RSP_OP(cmd, 0, 43, 1, int, attr->l3_chksum_gen);\
312 MC_RSP_OP(cmd, 0, 44, 1, int, attr->l4_chksum_gen);\
313 MC_RSP_OP(cmd, 0, 45, 1, int, \
314 attr->conf_err_attr.use_default_queue);\
315 MC_RSP_OP(cmd, 1, 0, 64, uint64_t, \
316 attr->conf_err_attr.queue_attr.user_ctx);\
317 MC_RSP_OP(cmd, 2, 32, 32, uint32_t, \
318 attr->conf_err_attr.queue_attr.fqid);\
321 /* cmd, param, offset, width, type, arg_name */
322 #define DPNI_CMD_SET_RX_FLOW(cmd, tc_id, flow_id, cfg) \
324 MC_CMD_OP(cmd, 0, 0, 32, int, cfg->dest_cfg.dest_id); \
325 MC_CMD_OP(cmd, 0, 32, 8, uint8_t, cfg->dest_cfg.priority);\
326 MC_CMD_OP(cmd, 0, 40, 2, enum dpni_dest, cfg->dest_cfg.dest_type);\
327 MC_CMD_OP(cmd, 0, 48, 16, uint16_t, flow_id); \
328 MC_CMD_OP(cmd, 1, 0, 64, uint64_t, cfg->user_ctx); \
329 MC_CMD_OP(cmd, 2, 16, 8, uint8_t, tc_id); \
330 MC_CMD_OP(cmd, 2, 32, 32, uint32_t, cfg->options); \
331 MC_CMD_OP(cmd, 3, 0, 4, enum dpni_flc_type, cfg->flc_cfg.flc_type); \
332 MC_CMD_OP(cmd, 3, 4, 4, enum dpni_stash_size, \
333 cfg->flc_cfg.frame_data_size);\
334 MC_CMD_OP(cmd, 3, 8, 4, enum dpni_stash_size, \
335 cfg->flc_cfg.flow_context_size);\
336 MC_CMD_OP(cmd, 3, 32, 32, uint32_t, cfg->flc_cfg.options);\
337 MC_CMD_OP(cmd, 4, 0, 64, uint64_t, cfg->flc_cfg.flow_context);\
340 /* cmd, param, offset, width, type, arg_name */
341 #define DPNI_CMD_GET_RX_FLOW(cmd, tc_id, flow_id) \
343 MC_CMD_OP(cmd, 0, 16, 8, uint8_t, tc_id); \
344 MC_CMD_OP(cmd, 0, 48, 16, uint16_t, flow_id); \
347 /* cmd, param, offset, width, type, arg_name */
348 #define DPNI_RSP_GET_RX_FLOW(cmd, attr) \
350 MC_RSP_OP(cmd, 0, 0, 32, int, attr->dest_cfg.dest_id); \
351 MC_RSP_OP(cmd, 0, 32, 8, uint8_t, attr->dest_cfg.priority);\
352 MC_RSP_OP(cmd, 0, 40, 2, enum dpni_dest, attr->dest_cfg.dest_type); \
353 MC_RSP_OP(cmd, 1, 0, 64, uint64_t, attr->user_ctx); \
354 MC_RSP_OP(cmd, 2, 32, 32, uint32_t, attr->fqid); \
355 MC_RSP_OP(cmd, 3, 0, 4, enum dpni_flc_type, attr->flc_cfg.flc_type); \
356 MC_RSP_OP(cmd, 3, 4, 4, enum dpni_stash_size, \
357 attr->flc_cfg.frame_data_size);\
358 MC_RSP_OP(cmd, 3, 8, 4, enum dpni_stash_size, \
359 attr->flc_cfg.flow_context_size);\
360 MC_RSP_OP(cmd, 3, 32, 32, uint32_t, attr->flc_cfg.options);\
361 MC_RSP_OP(cmd, 4, 0, 64, uint64_t, attr->flc_cfg.flow_context);\
377 NET_PROT_SCTP_CHUNK_DATA,
381 NET_PROT_PPPMUX_SUBFRM,
383 NET_PROT_L2TPV3_CTRL,
384 NET_PROT_L2TPV3_SESS,
392 NET_PROT_UDP_ENC_ESP, /* RFC 3948 */
400 NET_PROT_CAPWAP_DATA,
401 NET_PROT_CAPWAP_CTRL,
408 NET_PROT_USER_DEFINED_L2,
409 NET_PROT_USER_DEFINED_L3,
410 NET_PROT_USER_DEFINED_L4,
411 NET_PROT_USER_DEFINED_L5,
412 NET_PROT_USER_DEFINED_SHIM1,
413 NET_PROT_USER_DEFINED_SHIM2,
419 * Data Path Network Interface API
420 * Contains initialization APIs and runtime control APIs for DPNI
425 /* General DPNI macros */
427 /* Maximum number of traffic classes */
428 #define DPNI_MAX_TC 8
429 /* Maximum number of buffer pools per DPNI */
430 #define DPNI_MAX_DPBP 8
432 /* All traffic classes considered; see dpni_set_rx_flow() */
433 #define DPNI_ALL_TCS (uint8_t)(-1)
434 /* All flows within traffic class considered; see dpni_set_rx_flow() */
435 #define DPNI_ALL_TC_FLOWS (uint16_t)(-1)
436 /* Generate new flow ID; see dpni_set_tx_flow() */
437 #define DPNI_NEW_FLOW_ID (uint16_t)(-1)
440 * dpni_open() - Open a control session for the specified object
441 * @mc_io: Pointer to MC portal's I/O object
442 * @dpni_id: DPNI unique ID
443 * @token: Returned token; use in subsequent API calls
445 * This function can be used to open a control session for an
446 * already created object; an object may have been declared in
447 * the DPL or by calling the dpni_create() function.
448 * This function returns a unique authentication token,
449 * associated with the specific object ID and the specific MC
450 * portal; this token must be used in all subsequent commands for
451 * this specific object.
453 * Return: '0' on Success; Error code otherwise.
455 int dpni_open(struct fsl_mc_io *mc_io, int dpni_id, uint16_t *token);
458 * dpni_close() - Close the control session of the object
459 * @mc_io: Pointer to MC portal's I/O object
460 * @token: Token of DPNI object
462 * After this function is called, no further operations are
463 * allowed on the object without opening a new control session.
465 * Return: '0' on Success; Error code otherwise.
467 int dpni_close(struct fsl_mc_io *mc_io, uint16_t token);
470 * struct dpni_ipr_cfg - Structure representing IP reassembly configuration
471 * @max_reass_frm_size: Maximum size of the reassembled frame
472 * @min_frag_size_ipv4: Minimum fragment size of IPv4 fragments
473 * @min_frag_size_ipv6: Minimum fragment size of IPv6 fragments
474 * @max_open_frames_ipv4: Maximum concurrent IPv4 packets in reassembly process
475 * @max_open_frames_ipv6: Maximum concurrent IPv6 packets in reassembly process
477 struct dpni_ipr_cfg {
478 uint16_t max_reass_frm_size;
479 uint16_t min_frag_size_ipv4;
480 uint16_t min_frag_size_ipv6;
481 uint16_t max_open_frames_ipv4;
482 uint16_t max_open_frames_ipv6;
486 * struct dpni_pools_cfg - Structure representing buffer pools configuration
487 * @num_dpbp: Number of DPBPs
488 * @pools: Array of buffer pools parameters; The number of valid entries
489 * must match 'num_dpbp' value
491 struct dpni_pools_cfg {
494 * struct pools - Buffer pools parameters
495 * @dpbp_id: DPBP object ID
496 * @buffer_size: Buffer size
500 uint16_t buffer_size;
501 } pools[DPNI_MAX_DPBP];
505 * dpni_set_pools() - Set buffer pools configuration
506 * @mc_io: Pointer to MC portal's I/O object
507 * @token: Token of DPNI object
508 * @cfg: Buffer pools configuration
510 * mandatory for DPNI operation
511 * warning:Allowed only when DPNI is disabled
513 * Return: '0' on Success; Error code otherwise.
515 int dpni_set_pools(struct fsl_mc_io *mc_io,
517 const struct dpni_pools_cfg *cfg);
520 * dpni_enable() - Enable the DPNI, allow sending and receiving frames.
521 * @mc_io: Pointer to MC portal's I/O object
522 * @token: Token of DPNI object
524 * Return: '0' on Success; Error code otherwise.
526 int dpni_enable(struct fsl_mc_io *mc_io, uint16_t token);
529 * dpni_disable() - Disable the DPNI, stop sending and receiving frames.
530 * @mc_io: Pointer to MC portal's I/O object
531 * @token: Token of DPNI object
533 * Return: '0' on Success; Error code otherwise.
535 int dpni_disable(struct fsl_mc_io *mc_io, uint16_t token);
539 * @dpni_reset() - Reset the DPNI, returns the object to initial state.
540 * @mc_io: Pointer to MC portal's I/O object
541 * @token: Token of DPNI object
543 * Return: '0' on Success; Error code otherwise.
545 int dpni_reset(struct fsl_mc_io *mc_io, uint16_t token);
548 * struct dpni_attr - Structure representing DPNI attributes
549 * @id: DPNI object ID
550 * @version: DPNI version
551 * @start_hdr: Indicates the packet starting header for parsing
552 * @options: Mask of available options; reflects the value as was given in
554 * @max_senders: Maximum number of different senders; used as the number
555 * of dedicated Tx flows;
556 * @max_tcs: Maximum number of traffic classes (for both Tx and Rx)
557 * @max_dist_per_tc: Maximum distribution size per Rx traffic class;
558 * Set to the required value minus 1
559 * @max_unicast_filters: Maximum number of unicast filters
560 * @max_multicast_filters: Maximum number of multicast filters
561 * @max_vlan_filters: Maximum number of VLAN filters
562 * @max_qos_entries: if 'max_tcs > 1', declares the maximum entries in QoS table
563 * @max_qos_key_size: Maximum key size for the QoS look-up
564 * @max_dist_key_size: Maximum key size for the distribution look-up
565 * @max_policers: Maximum number of policers;
566 * @max_congestion_ctrl: Maximum number of congestion control groups (CGs);
567 * @ipr_cfg: IP reassembly configuration
572 * struct version - DPNI version
573 * @major: DPNI major version
574 * @minor: DPNI minor version
580 enum net_prot start_hdr;
584 uint8_t max_dist_per_tc[DPNI_MAX_TC];
585 uint8_t max_unicast_filters;
586 uint8_t max_multicast_filters;
587 uint8_t max_vlan_filters;
588 uint8_t max_qos_entries;
589 uint8_t max_qos_key_size;
590 uint8_t max_dist_key_size;
591 uint8_t max_policers;
592 uint8_t max_congestion_ctrl;
593 struct dpni_ipr_cfg ipr_cfg;
597 * dpni_get_attributes() - Retrieve DPNI attributes.
598 * @mc_io: Pointer to MC portal's I/O objec
599 * @token: Token of DPNI object
600 * @attr: Returned object's attributes
602 * Return: '0' on Success; Error code otherwise.
604 int dpni_get_attributes(struct fsl_mc_io *mc_io,
606 struct dpni_attr *attr);
608 /* DPNI buffer layout modification options */
610 /* Select to modify the time-stamp setting */
611 #define DPNI_BUF_LAYOUT_OPT_TIMESTAMP 0x00000001
612 /* Select to modify the parser-result setting; not applicable for Tx */
613 #define DPNI_BUF_LAYOUT_OPT_PARSER_RESULT 0x00000002
614 /* Select to modify the frame-status setting */
615 #define DPNI_BUF_LAYOUT_OPT_FRAME_STATUS 0x00000004
616 /* Select to modify the private-data-size setting */
617 #define DPNI_BUF_LAYOUT_OPT_PRIVATE_DATA_SIZE 0x00000008
618 /* Select to modify the data-alignment setting */
619 #define DPNI_BUF_LAYOUT_OPT_DATA_ALIGN 0x00000010
620 /* Select to modify the data-head-room setting */
621 #define DPNI_BUF_LAYOUT_OPT_DATA_HEAD_ROOM 0x00000020
622 /*!< Select to modify the data-tail-room setting */
623 #define DPNI_BUF_LAYOUT_OPT_DATA_TAIL_ROOM 0x00000040
626 * struct dpni_buffer_layout - Structure representing DPNI buffer layout
627 * @options: Flags representing the suggested modifications to the buffer
628 * layout; Use any combination of 'DPNI_BUF_LAYOUT_OPT_<X>' flags
629 * @pass_timestamp: Pass timestamp value
630 * @pass_parser_result: Pass parser results
631 * @pass_frame_status: Pass frame status
632 * @private_data_size: Size kept for private data (in bytes)
633 * @data_align: Data alignment
634 * @data_head_room: Data head room
635 * @data_tail_room: Data tail room
637 struct dpni_buffer_layout {
640 int pass_parser_result;
641 int pass_frame_status;
642 uint16_t private_data_size;
644 uint16_t data_head_room;
645 uint16_t data_tail_room;
649 * dpni_get_rx_buffer_layout() - Retrieve Rx buffer layout attributes.
650 * @mc_io: Pointer to MC portal's I/O object
651 * @token: Token of DPNI object
652 * @layout: Returns buffer layout attributes
654 * Return: '0' on Success; Error code otherwise.
656 int dpni_get_rx_buffer_layout(struct fsl_mc_io *mc_io,
658 struct dpni_buffer_layout *layout);
661 * dpni_set_rx_buffer_layout() - Set Rx buffer layout configuration.
662 * @mc_io: Pointer to MC portal's I/O object
663 * @token: Token of DPNI object
664 * @layout: Buffer layout configuration
666 * Return: '0' on Success; Error code otherwise.
668 * @warning Allowed only when DPNI is disabled
670 int dpni_set_rx_buffer_layout(struct fsl_mc_io *mc_io,
672 const struct dpni_buffer_layout *layout);
675 * dpni_get_tx_buffer_layout() - Retrieve Tx buffer layout attributes.
676 * @mc_io: Pointer to MC portal's I/O object
677 * @token: Token of DPNI object
678 * @layout: Returns buffer layout attributes
680 * Return: '0' on Success; Error code otherwise.
682 int dpni_get_tx_buffer_layout(struct fsl_mc_io *mc_io,
684 struct dpni_buffer_layout *layout);
687 * dpni_set_tx_buffer_layout() - Set Tx buffer layout configuration.
688 * @mc_io: Pointer to MC portal's I/O object
689 * @token: Token of DPNI object
690 * @layout: Buffer layout configuration
692 * Return: '0' on Success; Error code otherwise.
694 * @warning Allowed only when DPNI is disabled
696 int dpni_set_tx_buffer_layout(struct fsl_mc_io *mc_io,
698 const struct dpni_buffer_layout *layout);
701 * dpni_get_tx_conf_buffer_layout() - Retrieve Tx confirmation buffer layout
703 * @mc_io: Pointer to MC portal's I/O object
704 * @token: Token of DPNI object
705 * @layout: Returns buffer layout attributes
707 * Return: '0' on Success; Error code otherwise.
709 int dpni_get_tx_conf_buffer_layout(struct fsl_mc_io *mc_io,
711 struct dpni_buffer_layout *layout);
714 * dpni_set_tx_conf_buffer_layout() - Set Tx confirmation buffer layout
716 * @mc_io: Pointer to MC portal's I/O object
717 * @token: Token of DPNI object
718 * @layout: Buffer layout configuration
720 * Return: '0' on Success; Error code otherwise.
722 * @warning Allowed only when DPNI is disabled
724 int dpni_set_tx_conf_buffer_layout(struct fsl_mc_io *mc_io,
726 const struct dpni_buffer_layout *layout);
729 * dpni_get_qdid() - Get the Queuing Destination ID (QDID) that should be used
730 * for enqueue operations
731 * @mc_io: Pointer to MC portal's I/O object
732 * @token: Token of DPNI object
733 * @qdid: Returned virtual QDID value that should be used as an argument
734 * in all enqueue operations
736 * Return: '0' on Success; Error code otherwise.
738 int dpni_get_qdid(struct fsl_mc_io *mc_io, uint16_t token, uint16_t *qdid);
741 * dpni_get_tx_data_offset() - Get the Tx data offset (from start of buffer)
742 * @mc_io: Pointer to MC portal's I/O object
743 * @token: Token of DPNI object
744 * @data_offset: Tx data offset (from start of buffer)
746 * Return: '0' on Success; Error code otherwise.
748 int dpni_get_tx_data_offset(struct fsl_mc_io *mc_io,
750 uint16_t *data_offset);
753 * enum dpni_counter - DPNI counter types
754 * @DPNI_CNT_ING_FRAME: Counts ingress frames
755 * @DPNI_CNT_ING_BYTE: Counts ingress bytes
756 * @DPNI_CNT_ING_FRAME_DROP: Counts ingress frames dropped due to explicit
758 * @DPNI_CNT_ING_FRAME_DISCARD: Counts ingress frames discarded due to errors
759 * @DPNI_CNT_ING_MCAST_FRAME: Counts ingress multicast frames
760 * @DPNI_CNT_ING_MCAST_BYTE: Counts ingress multicast bytes
761 * @DPNI_CNT_ING_BCAST_FRAME: Counts ingress broadcast frames
762 * @DPNI_CNT_ING_BCAST_BYTES: Counts ingress broadcast bytes
763 * @DPNI_CNT_EGR_FRAME: Counts egress frames
764 * @DPNI_CNT_EGR_BYTE: Counts egress bytes
765 * @DPNI_CNT_EGR_FRAME_DISCARD: Counts egress frames discarded due to errors
768 DPNI_CNT_ING_FRAME = 0x0,
769 DPNI_CNT_ING_BYTE = 0x1,
770 DPNI_CNT_ING_FRAME_DROP = 0x2,
771 DPNI_CNT_ING_FRAME_DISCARD = 0x3,
772 DPNI_CNT_ING_MCAST_FRAME = 0x4,
773 DPNI_CNT_ING_MCAST_BYTE = 0x5,
774 DPNI_CNT_ING_BCAST_FRAME = 0x6,
775 DPNI_CNT_ING_BCAST_BYTES = 0x7,
776 DPNI_CNT_EGR_FRAME = 0x8,
777 DPNI_CNT_EGR_BYTE = 0x9,
778 DPNI_CNT_EGR_FRAME_DISCARD = 0xa
782 * dpni_get_counter() - Read a specific DPNI counter
783 * @mc_io: Pointer to MC portal's I/O object
784 * @token: Token of DPNI object
785 * @counter: The requested counter
786 * @value: Returned counter's current value
788 * Return: '0' on Success; Error code otherwise.
790 int dpni_get_counter(struct fsl_mc_io *mc_io,
792 enum dpni_counter counter,
796 * dpni_set_counter() - Set (or clear) a specific DPNI counter
797 * @mc_io: Pointer to MC portal's I/O object
798 * @token: Token of DPNI object
799 * @counter: The requested counter
800 * @value: New counter value; typically pass '0' for resetting
803 * Return: '0' on Success; Error code otherwise.
805 int dpni_set_counter(struct fsl_mc_io *mc_io,
807 enum dpni_counter counter,
810 /* Enable auto-negotiation */
811 #define DPNI_LINK_OPT_AUTONEG 0x0000000000000001ULL
812 /* Enable half-duplex mode */
813 #define DPNI_LINK_OPT_HALF_DUPLEX 0x0000000000000002ULL
814 /* Enable pause frames */
815 #define DPNI_LINK_OPT_PAUSE 0x0000000000000004ULL
816 /* Enable a-symmetric pause frames */
817 #define DPNI_LINK_OPT_ASYM_PAUSE 0x0000000000000008ULL
820 * struct - Structure representing DPNI link configuration
822 * @options: Mask of available options; use 'DPNI_LINK_OPT_<X>' values
824 struct dpni_link_cfg {
830 * dpni_set_link_cfg() - set the link configuration.
831 * @mc_io: Pointer to MC portal's I/O object
832 * @token: Token of DPNI object
833 * @cfg: Link configuration
835 * Return: '0' on Success; Error code otherwise.
837 int dpni_set_link_cfg(struct fsl_mc_io *mc_io,
839 const struct dpni_link_cfg *cfg);
842 * struct dpni_link_state - Structure representing DPNI link state
844 * @options: Mask of available options; use 'DPNI_LINK_OPT_<X>' values
845 * @up: Link state; '0' for down, '1' for up
847 struct dpni_link_state {
854 * dpni_get_link_state() - Return the link state (either up or down)
855 * @mc_io: Pointer to MC portal's I/O object
856 * @token: Token of DPNI object
857 * @state: Returned link state;
859 * Return: '0' on Success; Error code otherwise.
861 int dpni_get_link_state(struct fsl_mc_io *mc_io,
863 struct dpni_link_state *state);
866 * dpni_set_primary_mac_addr() - Set the primary MAC address
867 * @mc_io: Pointer to MC portal's I/O object
868 * @token: Token of DPNI object
869 * @mac_addr: MAC address to set as primary address
871 * Return: '0' on Success; Error code otherwise.
873 int dpni_set_primary_mac_addr(struct fsl_mc_io *mc_io,
875 const uint8_t mac_addr[6]);
878 * dpni_get_primary_mac_addr() - Get the primary MAC address
879 * @mc_io: Pointer to MC portal's I/O object
880 * @token: Token of DPNI object
881 * @mac_addr: Returned MAC address
883 * Return: '0' on Success; Error code otherwise.
885 int dpni_get_primary_mac_addr(struct fsl_mc_io *mc_io,
887 uint8_t mac_addr[6]);
890 * dpni_add_mac_addr() - Add MAC address filter
891 * @mc_io: Pointer to MC portal's I/O object
892 * @token: Token of DPNI object
893 * @mac_addr: MAC address to add
895 * Return: '0' on Success; Error code otherwise.
897 int dpni_add_mac_addr(struct fsl_mc_io *mc_io,
899 const uint8_t mac_addr[6]);
902 * dpni_remove_mac_addr() - Remove MAC address filter
903 * @mc_io: Pointer to MC portal's I/O object
904 * @token: Token of DPNI object
905 * @mac_addr: MAC address to remove
907 * Return: '0' on Success; Error code otherwise.
909 int dpni_remove_mac_addr(struct fsl_mc_io *mc_io,
911 const uint8_t mac_addr[6]);
914 * enum dpni_dest - DPNI destination types
915 * @DPNI_DEST_NONE: Unassigned destination; The queue is set in parked mode and
916 * does not generate FQDAN notifications; user is expected to
917 * dequeue from the queue based on polling or other user-defined
919 * @DPNI_DEST_DPIO: The queue is set in schedule mode and generates FQDAN
920 * notifications to the specified DPIO; user is expected to dequeue
921 * from the queue only after notification is received
922 * @DPNI_DEST_DPCON: The queue is set in schedule mode and does not generate
923 * FQDAN notifications, but is connected to the specified DPCON
924 * object; user is expected to dequeue from the DPCON channel
933 * struct dpni_dest_cfg - Structure representing DPNI destination parameters
934 * @dest_type: Destination type
935 * @dest_id: Either DPIO ID or DPCON ID, depending on the destination type
936 * @priority: Priority selection within the DPIO or DPCON channel; valid values
937 * are 0-1 or 0-7, depending on the number of priorities in that
938 * channel; not relevant for 'DPNI_DEST_NONE' option
940 struct dpni_dest_cfg {
941 enum dpni_dest dest_type;
947 * enum dpni_flc_type - DPNI FLC types
948 * @DPNI_FLC_USER_DEFINED: select the FLC to be used for user defined value
949 * @DPNI_FLC_STASH: select the FLC to be used for stash control
952 DPNI_FLC_USER_DEFINED = 0,
957 * enum dpni_stash_size - DPNI FLC stashing size
958 * @DPNI_STASH_SIZE_0B: no stash
959 * @DPNI_STASH_SIZE_64B: stashes 64 bytes
960 * @DPNI_STASH_SIZE_128B: stashes 128 bytes
961 * @DPNI_STASH_SIZE_192B: stashes 192 bytes
963 enum dpni_stash_size {
964 DPNI_STASH_SIZE_0B = 0,
965 DPNI_STASH_SIZE_64B = 1,
966 DPNI_STASH_SIZE_128B = 2,
967 DPNI_STASH_SIZE_192B = 3,
970 /* DPNI FLC stash options */
972 /* stashes the whole annotation area (up to 192 bytes) */
973 #define DPNI_FLC_STASH_FRAME_ANNOTATION 0x00000001
976 * struct dpni_flc_cfg - Structure representing DPNI FLC configuration
977 * @flc_type: FLC type
978 * @options: Mask of available options;
979 * use 'DPNI_FLC_STASH_<X>' values
980 * @frame_data_size: Size of frame data to be stashed
981 * @flow_context_size: Size of flow context to be stashed
982 * @flow_context: 1. In case flc_type is 'DPNI_FLC_USER_DEFINED':
983 * this value will be provided in the frame descriptor
985 * 2. In case flc_type is 'DPNI_FLC_STASH':
986 * this value will be I/O virtual address of the
988 * Must be cacheline-aligned and DMA-able memory
990 struct dpni_flc_cfg {
991 enum dpni_flc_type flc_type;
993 enum dpni_stash_size frame_data_size;
994 enum dpni_stash_size flow_context_size;
995 uint64_t flow_context;
998 /* DPNI queue modification options */
1000 /* Select to modify the user's context associated with the queue */
1001 #define DPNI_QUEUE_OPT_USER_CTX 0x00000001
1002 /* Select to modify the queue's destination */
1003 #define DPNI_QUEUE_OPT_DEST 0x00000002
1004 /** Select to modify the flow-context parameters;
1005 * not applicable for Tx-conf/Err queues as the FD comes from the user
1007 #define DPNI_QUEUE_OPT_FLC 0x00000004
1011 * struct dpni_queue_cfg - Structure representing queue configuration
1012 * @options: Flags representing the suggested modifications to the queue;
1013 * Use any combination of 'DPNI_QUEUE_OPT_<X>' flags
1014 * @user_ctx: User context value provided in the frame descriptor of each
1015 * dequeued frame; valid only if 'DPNI_QUEUE_OPT_USER_CTX'
1016 * is contained in 'options'
1017 * @dest_cfg: Queue destination parameters;
1018 * valid only if 'DPNI_QUEUE_OPT_DEST' is contained in 'options'
1019 * @flc_cfg: Flow context configuration; in case the TC's distribution
1020 * is either NONE or HASH the FLC's settings of flow#0 are used.
1021 * in the case of FS (flow-steering) the flow's FLC settings
1023 * valid only if 'DPNI_QUEUE_OPT_FLC' is contained in 'options'
1025 struct dpni_queue_cfg {
1028 struct dpni_dest_cfg dest_cfg;
1029 struct dpni_flc_cfg flc_cfg;
1033 * struct dpni_queue_attr - Structure representing queue attributes
1034 * @user_ctx: User context value provided in the frame descriptor of each
1036 * @dest_cfg: Queue destination configuration
1037 * @flc_cfg: Flow context configuration
1038 * @fqid: Virtual fqid value to be used for dequeue operations
1040 struct dpni_queue_attr {
1042 struct dpni_dest_cfg dest_cfg;
1043 struct dpni_flc_cfg flc_cfg;
1047 /* DPNI Tx flow modification options */
1049 /* Select to modify the settings for dedicate Tx confirmation/error */
1050 #define DPNI_TX_FLOW_OPT_TX_CONF_ERROR 0x00000001
1051 /*!< Select to modify the Tx confirmation and/or error setting */
1052 #define DPNI_TX_FLOW_OPT_ONLY_TX_ERROR 0x00000002
1053 /*!< Select to modify the queue configuration */
1054 #define DPNI_TX_FLOW_OPT_QUEUE 0x00000004
1055 /*!< Select to modify the L3 checksum generation setting */
1056 #define DPNI_TX_FLOW_OPT_L3_CHKSUM_GEN 0x00000010
1057 /*!< Select to modify the L4 checksum generation setting */
1058 #define DPNI_TX_FLOW_OPT_L4_CHKSUM_GEN 0x00000020
1061 * struct dpni_tx_flow_cfg - Structure representing Tx flow configuration
1062 * @options: Flags representing the suggested modifications to the Tx flow;
1063 * Use any combination 'DPNI_TX_FLOW_OPT_<X>' flags
1064 * @conf_err_cfg: Tx confirmation and error configuration; these settings are
1065 * ignored if 'DPNI_OPT_PRIVATE_TX_CONF_ERROR_DISABLED' was set at
1067 * @l3_chksum_gen: Set to '1' to enable L3 checksum generation; '0' to disable;
1068 * valid only if 'DPNI_TX_FLOW_OPT_L3_CHKSUM_GEN' is contained in
1070 * @l4_chksum_gen: Set to '1' to enable L4 checksum generation; '0' to disable;
1071 * valid only if 'DPNI_TX_FLOW_OPT_L4_CHKSUM_GEN' is contained in
1074 struct dpni_tx_flow_cfg {
1077 * struct cnf_err_cfg - Tx confirmation and error configuration
1078 * @use_default_queue: Set to '1' to use the common (default) Tx
1079 * confirmation and error queue; Set to '0' to use the
1080 * private Tx confirmation and error queue; valid only if
1081 * 'DPNI_TX_FLOW_OPT_TX_CONF_ERROR' is contained in
1083 * @errors_only: Set to '1' to report back only error frames;
1084 * Set to '0' to confirm transmission/error for all
1085 * transmitted frames;
1086 * valid only if 'DPNI_TX_FLOW_OPT_ONLY_TX_ERROR' is
1087 * contained in 'options' and 'use_default_queue = 0';
1088 * @queue_cfg: Queue configuration; valid only if
1089 * 'DPNI_TX_FLOW_OPT_QUEUE' is contained in 'options'
1092 int use_default_queue;
1094 struct dpni_queue_cfg queue_cfg;
1101 * dpni_set_tx_flow() - Set Tx flow configuration
1102 * @mc_io: Pointer to MC portal's I/O object
1103 * @token: Token of DPNI object
1104 * @flow_id: Provides (or returns) the sender's flow ID;
1105 * for each new sender set (*flow_id) to
1106 * 'DPNI_NEW_FLOW_ID' to generate a new flow_id;
1107 * this ID should be used as the QDBIN argument
1108 * in enqueue operations
1109 * @cfg: Tx flow configuration
1111 * Return: '0' on Success; Error code otherwise.
1113 int dpni_set_tx_flow(struct fsl_mc_io *mc_io,
1116 const struct dpni_tx_flow_cfg *cfg);
1119 * struct dpni_tx_flow_attr - Structure representing Tx flow attributes
1120 * @conf_err_attr: Tx confirmation and error attributes
1121 * @l3_chksum_gen: '1' if L3 checksum generation is enabled; '0' if disabled
1122 * @l4_chksum_gen: '1' if L4 checksum generation is enabled; '0' if disabled
1124 struct dpni_tx_flow_attr {
1126 * struct conf_err_attr - Tx confirmation and error attributes
1127 * @use_default_queue: '1' if using common (default) Tx confirmation and
1129 * '0' if using private Tx confirmation and error
1131 * @errors_only: '1' if only error frames are reported back; '0' if all
1132 * transmitted frames are confirmed
1133 * @queue_attr: Queue attributes
1136 int use_default_queue;
1138 struct dpni_queue_attr queue_attr;
1145 * dpni_get_tx_flow() - Get Tx flow attributes
1146 * @mc_io: Pointer to MC portal's I/O object
1147 * @token: Token of DPNI object
1148 * @flow_id: The sender's flow ID, as returned by the
1149 * dpni_set_tx_flow() function
1150 * @attr: Returned Tx flow attributes
1152 * Return: '0' on Success; Error code otherwise.
1154 int dpni_get_tx_flow(struct fsl_mc_io *mc_io,
1157 struct dpni_tx_flow_attr *attr);
1160 * dpni_set_rx_flow() - Set Rx flow configuration
1161 * @mc_io: Pointer to MC portal's I/O object
1162 * @token: Token of DPNI object
1163 * @tc_id: Traffic class selection (0-7);
1164 * use 'DPNI_ALL_TCS' to set all TCs and all flows
1165 * @flow_id Rx flow id within the traffic class; use
1166 * 'DPNI_ALL_TC_FLOWS' to set all flows within
1167 * this tc_id; ignored if tc_id is set to
1169 * @cfg: Rx flow configuration
1171 * Return: '0' on Success; Error code otherwise.
1173 int dpni_set_rx_flow(struct fsl_mc_io *mc_io,
1177 const struct dpni_queue_cfg *cfg);
1180 * dpni_get_rx_flow() - Get Rx flow attributes
1181 * @mc_io: Pointer to MC portal's I/O object
1182 * @token: Token of DPNI object
1183 * @tc_id: Traffic class selection (0-7)
1184 * @flow_id: Rx flow id within the traffic class
1185 * @attr: Returned Rx flow attributes
1187 * Return: '0' on Success; Error code otherwise.
1189 int dpni_get_rx_flow(struct fsl_mc_io *mc_io,
1193 struct dpni_queue_attr *attr);
1195 #endif /* _FSL_DPNI_H */