xref: /f-stack/dpdk/drivers/net/dpaa2/mc/fsl_dpni_cmd.h (revision 031be553)
1 /*-
2  * This file is provided under a dual BSD/GPLv2 license. When using or
3  * redistributing this file, you may do so under either license.
4  *
5  *   BSD LICENSE
6  *
7  * Copyright 2013-2016 Freescale Semiconductor Inc.
8  * Copyright 2016-2017 NXP.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions are met:
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the distribution.
17  * * Neither the name of the above-listed copyright holders nor the
18  * names of any contributors may be used to endorse or promote products
19  * derived from this software without specific prior written permission.
20  *
21  *   GPL LICENSE SUMMARY
22  *
23  * ALTERNATIVELY, this software may be distributed under the terms of the
24  * GNU General Public License ("GPL") as published by the Free Software
25  * Foundation, either version 2 of that License or (at your option) any
26  * later version.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
32  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
33  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38  * POSSIBILITY OF SUCH DAMAGE.
39  */
40 #ifndef _FSL_DPNI_CMD_H
41 #define _FSL_DPNI_CMD_H
42 
43 /* DPNI Version */
44 #define DPNI_VER_MAJOR				7
45 #define DPNI_VER_MINOR				3
46 
47 #define DPNI_CMD_BASE_VERSION			1
48 #define DPNI_CMD_VERSION_2			2
49 #define DPNI_CMD_ID_OFFSET			4
50 
51 #define DPNI_CMD(id)	(((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_BASE_VERSION)
52 #define DPNI_CMD_V2(id)	(((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_VERSION_2)
53 
54 /* Command IDs */
55 #define DPNI_CMDID_OPEN				DPNI_CMD(0x801)
56 #define DPNI_CMDID_CLOSE			DPNI_CMD(0x800)
57 #define DPNI_CMDID_CREATE			DPNI_CMD(0x901)
58 #define DPNI_CMDID_DESTROY			DPNI_CMD(0x981)
59 #define DPNI_CMDID_GET_API_VERSION		DPNI_CMD(0xa01)
60 
61 #define DPNI_CMDID_ENABLE			DPNI_CMD(0x002)
62 #define DPNI_CMDID_DISABLE			DPNI_CMD(0x003)
63 #define DPNI_CMDID_GET_ATTR			DPNI_CMD_V2(0x004)
64 #define DPNI_CMDID_RESET			DPNI_CMD(0x005)
65 #define DPNI_CMDID_IS_ENABLED			DPNI_CMD(0x006)
66 
67 #define DPNI_CMDID_SET_IRQ_ENABLE		DPNI_CMD(0x012)
68 #define DPNI_CMDID_GET_IRQ_ENABLE		DPNI_CMD(0x013)
69 #define DPNI_CMDID_SET_IRQ_MASK			DPNI_CMD(0x014)
70 #define DPNI_CMDID_GET_IRQ_MASK			DPNI_CMD(0x015)
71 #define DPNI_CMDID_GET_IRQ_STATUS		DPNI_CMD(0x016)
72 #define DPNI_CMDID_CLEAR_IRQ_STATUS		DPNI_CMD(0x017)
73 
74 #define DPNI_CMDID_SET_POOLS			DPNI_CMD_V2(0x200)
75 #define DPNI_CMDID_SET_ERRORS_BEHAVIOR		DPNI_CMD(0x20B)
76 
77 #define DPNI_CMDID_GET_QDID			DPNI_CMD(0x210)
78 #define DPNI_CMDID_GET_SP_INFO			DPNI_CMD(0x211)
79 #define DPNI_CMDID_GET_TX_DATA_OFFSET		DPNI_CMD(0x212)
80 #define DPNI_CMDID_GET_LINK_STATE		DPNI_CMD(0x215)
81 #define DPNI_CMDID_SET_MAX_FRAME_LENGTH		DPNI_CMD(0x216)
82 #define DPNI_CMDID_GET_MAX_FRAME_LENGTH		DPNI_CMD(0x217)
83 #define DPNI_CMDID_SET_LINK_CFG			DPNI_CMD(0x21A)
84 #define DPNI_CMDID_SET_TX_SHAPING		DPNI_CMD_V2(0x21B)
85 
86 #define DPNI_CMDID_SET_MCAST_PROMISC		DPNI_CMD(0x220)
87 #define DPNI_CMDID_GET_MCAST_PROMISC		DPNI_CMD(0x221)
88 #define DPNI_CMDID_SET_UNICAST_PROMISC		DPNI_CMD(0x222)
89 #define DPNI_CMDID_GET_UNICAST_PROMISC		DPNI_CMD(0x223)
90 #define DPNI_CMDID_SET_PRIM_MAC			DPNI_CMD(0x224)
91 #define DPNI_CMDID_GET_PRIM_MAC			DPNI_CMD(0x225)
92 #define DPNI_CMDID_ADD_MAC_ADDR			DPNI_CMD(0x226)
93 #define DPNI_CMDID_REMOVE_MAC_ADDR		DPNI_CMD(0x227)
94 #define DPNI_CMDID_CLR_MAC_FILTERS		DPNI_CMD(0x228)
95 
96 #define DPNI_CMDID_ENABLE_VLAN_FILTER		DPNI_CMD(0x230)
97 #define DPNI_CMDID_ADD_VLAN_ID			DPNI_CMD(0x231)
98 #define DPNI_CMDID_REMOVE_VLAN_ID		DPNI_CMD(0x232)
99 #define DPNI_CMDID_CLR_VLAN_FILTERS		DPNI_CMD(0x233)
100 
101 #define DPNI_CMDID_SET_RX_TC_DIST		DPNI_CMD_V2(0x235)
102 
103 #define DPNI_CMDID_GET_STATISTICS		DPNI_CMD_V2(0x25D)
104 #define DPNI_CMDID_RESET_STATISTICS		DPNI_CMD(0x25E)
105 #define DPNI_CMDID_GET_QUEUE			DPNI_CMD(0x25F)
106 #define DPNI_CMDID_SET_QUEUE			DPNI_CMD(0x260)
107 #define DPNI_CMDID_GET_TAILDROP			DPNI_CMD_V2(0x261)
108 #define DPNI_CMDID_SET_TAILDROP			DPNI_CMD_V2(0x262)
109 
110 #define DPNI_CMDID_GET_PORT_MAC_ADDR		DPNI_CMD(0x263)
111 
112 #define DPNI_CMDID_GET_BUFFER_LAYOUT		DPNI_CMD(0x264)
113 #define DPNI_CMDID_SET_BUFFER_LAYOUT		DPNI_CMD(0x265)
114 
115 #define DPNI_CMDID_SET_CONGESTION_NOTIFICATION	DPNI_CMD(0x267)
116 #define DPNI_CMDID_GET_CONGESTION_NOTIFICATION	DPNI_CMD(0x268)
117 #define DPNI_CMDID_SET_EARLY_DROP		DPNI_CMD_V2(0x269)
118 #define DPNI_CMDID_GET_EARLY_DROP		DPNI_CMD_V2(0x26A)
119 #define DPNI_CMDID_GET_OFFLOAD			DPNI_CMD(0x26B)
120 #define DPNI_CMDID_SET_OFFLOAD			DPNI_CMD(0x26C)
121 #define DPNI_CMDID_SET_TX_CONFIRMATION_MODE	DPNI_CMD(0x266)
122 #define DPNI_CMDID_GET_TX_CONFIRMATION_MODE	DPNI_CMD(0x26D)
123 
124 /* Macros for accessing command fields smaller than 1byte */
125 #define DPNI_MASK(field)	\
126 	GENMASK(DPNI_##field##_SHIFT + DPNI_##field##_SIZE - 1, \
127 		DPNI_##field##_SHIFT)
128 #define dpni_set_field(var, field, val)	\
129 	((var) |= (((val) << DPNI_##field##_SHIFT) & DPNI_MASK(field)))
130 #define dpni_get_field(var, field)	\
131 	(((var) & DPNI_MASK(field)) >> DPNI_##field##_SHIFT)
132 
133 #pragma pack(push, 1)
134 struct dpni_cmd_open {
135 	uint32_t dpni_id;
136 };
137 
138 struct dpni_cmd_create {
139 	uint32_t options;
140 	uint8_t num_queues;
141 	uint8_t num_tcs;
142 	uint8_t mac_filter_entries;
143 	uint8_t pad1;
144 	uint8_t vlan_filter_entries;
145 	uint8_t pad2;
146 	uint8_t qos_entries;
147 	uint8_t pad3;
148 	uint16_t fs_entries;
149 };
150 
151 struct dpni_cmd_destroy {
152 	uint32_t dpsw_id;
153 };
154 
155 #define DPNI_BACKUP_POOL(val, order)	(((val) & 0x1) << (order))
156 
157 struct dpni_cmd_pool {
158 	uint16_t dpbp_id;
159 	uint8_t priority_mask;
160 	uint8_t pad;
161 };
162 
163 struct dpni_cmd_set_pools {
164 	uint8_t num_dpbp;
165 	uint8_t backup_pool_mask;
166 	uint16_t pad;
167 	struct dpni_cmd_pool pool[8];
168 	uint16_t buffer_size[8];
169 };
170 
171 /* The enable indication is always the least significant bit */
172 #define DPNI_ENABLE_SHIFT		0
173 #define DPNI_ENABLE_SIZE		1
174 
175 struct dpni_rsp_is_enabled {
176 	uint8_t enabled;
177 };
178 
179 struct dpni_cmd_set_irq_enable {
180 	uint8_t enable;
181 	uint8_t pad[3];
182 	uint8_t irq_index;
183 };
184 
185 struct dpni_cmd_get_irq_enable {
186 	uint32_t pad;
187 	uint8_t irq_index;
188 };
189 
190 struct dpni_rsp_get_irq_enable {
191 	uint8_t enabled;
192 };
193 
194 struct dpni_cmd_set_irq_mask {
195 	uint32_t mask;
196 	uint8_t irq_index;
197 };
198 
199 struct dpni_cmd_get_irq_mask {
200 	uint32_t pad;
201 	uint8_t irq_index;
202 };
203 
204 struct dpni_rsp_get_irq_mask {
205 	uint32_t mask;
206 };
207 
208 struct dpni_cmd_get_irq_status {
209 	uint32_t status;
210 	uint8_t irq_index;
211 };
212 
213 struct dpni_rsp_get_irq_status {
214 	uint32_t status;
215 };
216 
217 struct dpni_cmd_clear_irq_status {
218 	uint32_t status;
219 	uint8_t irq_index;
220 };
221 
222 struct dpni_rsp_get_attr {
223 	/* response word 0 */
224 	uint32_t options;
225 	uint8_t num_queues;
226 	uint8_t num_rx_tcs;
227 	uint8_t mac_filter_entries;
228 	uint8_t num_tx_tcs;
229 	/* response word 1 */
230 	uint8_t vlan_filter_entries;
231 	uint8_t pad1;
232 	uint8_t qos_entries;
233 	uint8_t pad2;
234 	uint16_t fs_entries;
235 	uint16_t pad3;
236 	/* response word 2 */
237 	uint8_t qos_key_size;
238 	uint8_t fs_key_size;
239 	uint16_t wriop_version;
240 };
241 
242 #define DPNI_ERROR_ACTION_SHIFT		0
243 #define DPNI_ERROR_ACTION_SIZE		4
244 #define DPNI_FRAME_ANN_SHIFT		4
245 #define DPNI_FRAME_ANN_SIZE		1
246 
247 struct dpni_cmd_set_errors_behavior {
248 	uint32_t errors;
249 	/* from least significant bit: error_action:4, set_frame_annotation:1 */
250 	uint8_t flags;
251 };
252 
253 /* There are 3 separate commands for configuring Rx, Tx and Tx confirmation
254  * buffer layouts, but they all share the same parameters.
255  * If one of the functions changes, below structure needs to be split.
256  */
257 
258 #define DPNI_PASS_TS_SHIFT		0
259 #define DPNI_PASS_TS_SIZE		1
260 #define DPNI_PASS_PR_SHIFT		1
261 #define DPNI_PASS_PR_SIZE		1
262 #define DPNI_PASS_FS_SHIFT		2
263 #define DPNI_PASS_FS_SIZE		1
264 
265 struct dpni_cmd_get_buffer_layout {
266 	uint8_t qtype;
267 };
268 
269 struct dpni_rsp_get_buffer_layout {
270 	/* response word 0 */
271 	uint8_t pad0[6];
272 	/* from LSB: pass_timestamp:1, parser_result:1, frame_status:1 */
273 	uint8_t flags;
274 	uint8_t pad1;
275 	/* response word 1 */
276 	uint16_t private_data_size;
277 	uint16_t data_align;
278 	uint16_t head_room;
279 	uint16_t tail_room;
280 };
281 
282 struct dpni_cmd_set_buffer_layout {
283 	/* cmd word 0 */
284 	uint8_t qtype;
285 	uint8_t pad0[3];
286 	uint16_t options;
287 	/* from LSB: pass_timestamp:1, parser_result:1, frame_status:1 */
288 	uint8_t flags;
289 	uint8_t pad1;
290 	/* cmd word 1 */
291 	uint16_t private_data_size;
292 	uint16_t data_align;
293 	uint16_t head_room;
294 	uint16_t tail_room;
295 };
296 
297 struct dpni_cmd_set_offload {
298 	uint8_t pad[3];
299 	uint8_t dpni_offload;
300 	uint32_t config;
301 };
302 
303 struct dpni_cmd_get_offload {
304 	uint8_t pad[3];
305 	uint8_t dpni_offload;
306 };
307 
308 struct dpni_rsp_get_offload {
309 	uint32_t pad;
310 	uint32_t config;
311 };
312 
313 struct dpni_cmd_get_qdid {
314 	uint8_t qtype;
315 };
316 
317 struct dpni_rsp_get_qdid {
318 	uint16_t qdid;
319 };
320 
321 struct dpni_rsp_get_sp_info {
322 	uint16_t spids[2];
323 };
324 
325 struct dpni_rsp_get_tx_data_offset {
326 	uint16_t data_offset;
327 };
328 
329 struct dpni_cmd_get_statistics {
330 	uint8_t page_number;
331 	uint8_t param;
332 };
333 
334 struct dpni_rsp_get_statistics {
335 	uint64_t counter[7];
336 };
337 
338 struct dpni_cmd_set_link_cfg {
339 	uint64_t pad0;
340 	uint32_t rate;
341 	uint32_t pad1;
342 	uint64_t options;
343 };
344 
345 #define DPNI_LINK_STATE_SHIFT		0
346 #define DPNI_LINK_STATE_SIZE		1
347 
348 struct dpni_rsp_get_link_state {
349 	uint32_t pad0;
350 	/* from LSB: up:1 */
351 	uint8_t flags;
352 	uint8_t pad1[3];
353 	uint32_t rate;
354 	uint32_t pad2;
355 	uint64_t options;
356 };
357 
358 struct dpni_cmd_set_max_frame_length {
359 	uint16_t max_frame_length;
360 };
361 
362 struct dpni_rsp_get_max_frame_length {
363 	uint16_t max_frame_length;
364 };
365 
366 struct dpni_cmd_set_multicast_promisc {
367 	uint8_t enable;
368 };
369 
370 struct dpni_rsp_get_multicast_promisc {
371 	uint8_t enabled;
372 };
373 
374 struct dpni_cmd_set_unicast_promisc {
375 	uint8_t enable;
376 };
377 
378 struct dpni_rsp_get_unicast_promisc {
379 	uint8_t enabled;
380 };
381 
382 struct dpni_cmd_set_primary_mac_addr {
383 	uint16_t pad;
384 	uint8_t mac_addr[6];
385 };
386 
387 struct dpni_rsp_get_primary_mac_addr {
388 	uint16_t pad;
389 	uint8_t mac_addr[6];
390 };
391 
392 struct dpni_rsp_get_port_mac_addr {
393 	uint16_t pad;
394 	uint8_t mac_addr[6];
395 };
396 
397 struct dpni_cmd_add_mac_addr {
398 	uint16_t pad;
399 	uint8_t mac_addr[6];
400 };
401 
402 struct dpni_cmd_remove_mac_addr {
403 	uint16_t pad;
404 	uint8_t mac_addr[6];
405 };
406 
407 #define DPNI_UNICAST_FILTERS_SHIFT	0
408 #define DPNI_UNICAST_FILTERS_SIZE	1
409 #define DPNI_MULTICAST_FILTERS_SHIFT	1
410 #define DPNI_MULTICAST_FILTERS_SIZE	1
411 
412 struct dpni_cmd_clear_mac_filters {
413 	/* from LSB: unicast:1, multicast:1 */
414 	uint8_t flags;
415 };
416 
417 struct dpni_cmd_enable_vlan_filter {
418 	/* only the LSB */
419 	uint8_t en;
420 };
421 
422 struct dpni_cmd_vlan_id {
423 	uint32_t pad;
424 	uint16_t vlan_id;
425 };
426 
427 #define DPNI_SEPARATE_GRP_SHIFT 0
428 #define DPNI_SEPARATE_GRP_SIZE  1
429 #define DPNI_MODE_1_SHIFT		0
430 #define DPNI_MODE_1_SIZE		4
431 #define DPNI_MODE_2_SHIFT		4
432 #define DPNI_MODE_2_SIZE		4
433 
434 struct dpni_cmd_set_tx_priorities {
435 	uint16_t flags;
436 	uint8_t prio_group_A;
437 	uint8_t prio_group_B;
438 	uint32_t pad0;
439 	uint8_t modes[4];
440 	uint32_t pad1;
441 	uint64_t pad2;
442 	uint16_t delta_bandwidth[8];
443 };
444 
445 #define DPNI_DIST_MODE_SHIFT		0
446 #define DPNI_DIST_MODE_SIZE		4
447 #define DPNI_MISS_ACTION_SHIFT		4
448 #define DPNI_MISS_ACTION_SIZE		4
449 #define DPNI_KEEP_HASH_KEY_SHIFT	7
450 #define DPNI_KEEP_HASH_KEY_SIZE		1
451 
452 struct dpni_cmd_set_rx_tc_dist {
453 	uint16_t dist_size;
454 	uint8_t tc_id;
455 	/* from LSB: dist_mode:4, miss_action:4 */
456 	uint8_t flags;
457 	uint8_t pad0;
458 	/* only the LSB */
459 	uint8_t keep_hash_key;
460 	uint16_t default_flow_id;
461 	uint64_t pad1[5];
462 	uint64_t key_cfg_iova;
463 };
464 
465 struct dpni_cmd_get_queue {
466 	uint8_t qtype;
467 	uint8_t tc;
468 	uint8_t index;
469 };
470 
471 #define DPNI_DEST_TYPE_SHIFT		0
472 #define DPNI_DEST_TYPE_SIZE		4
473 #define DPNI_STASH_CTRL_SHIFT		6
474 #define DPNI_STASH_CTRL_SIZE		1
475 #define DPNI_HOLD_ACTIVE_SHIFT		7
476 #define DPNI_HOLD_ACTIVE_SIZE		1
477 
478 struct dpni_rsp_get_queue {
479 	/* response word 0 */
480 	uint64_t pad0;
481 	/* response word 1 */
482 	uint32_t dest_id;
483 	uint16_t pad1;
484 	uint8_t dest_prio;
485 	/* From LSB: dest_type:4, pad:2, flc_stash_ctrl:1, hold_active:1 */
486 	uint8_t flags;
487 	/* response word 2 */
488 	uint64_t flc;
489 	/* response word 3 */
490 	uint64_t user_context;
491 	/* response word 4 */
492 	uint32_t fqid;
493 	uint16_t qdbin;
494 };
495 
496 struct dpni_cmd_set_queue {
497 	/* cmd word 0 */
498 	uint8_t qtype;
499 	uint8_t tc;
500 	uint8_t index;
501 	uint8_t options;
502 	uint32_t pad0;
503 	/* cmd word 1 */
504 	uint32_t dest_id;
505 	uint16_t pad1;
506 	uint8_t dest_prio;
507 	uint8_t flags;
508 	/* cmd word 2 */
509 	uint64_t flc;
510 	/* cmd word 3 */
511 	uint64_t user_context;
512 };
513 
514 #define DPNI_DROP_ENABLE_SHIFT	0
515 #define DPNI_DROP_ENABLE_SIZE	1
516 #define DPNI_DROP_UNITS_SHIFT	2
517 #define DPNI_DROP_UNITS_SIZE	2
518 
519 struct dpni_early_drop {
520 	/* from LSB: enable:1 units:2 */
521 	uint8_t flags;
522 	uint8_t pad0[3];
523 	uint32_t pad1;
524 	uint8_t green_drop_probability;
525 	uint8_t pad2[7];
526 	uint64_t green_max_threshold;
527 	uint64_t green_min_threshold;
528 	uint64_t pad3;
529 	uint8_t yellow_drop_probability;
530 	uint8_t pad4[7];
531 	uint64_t yellow_max_threshold;
532 	uint64_t yellow_min_threshold;
533 	uint64_t pad5;
534 	uint8_t red_drop_probability;
535 	uint8_t pad6[7];
536 	uint64_t red_max_threshold;
537 	uint64_t red_min_threshold;
538 };
539 
540 struct dpni_cmd_early_drop {
541 	uint8_t qtype;
542 	uint8_t tc;
543 	uint8_t pad[6];
544 	uint64_t early_drop_iova;
545 };
546 
547 struct dpni_rsp_get_api_version {
548 	uint16_t major;
549 	uint16_t minor;
550 };
551 
552 struct dpni_cmd_get_taildrop {
553 	uint8_t congestion_point;
554 	uint8_t qtype;
555 	uint8_t tc;
556 	uint8_t index;
557 };
558 
559 struct dpni_rsp_get_taildrop {
560 	/* cmd word 0 */
561 	uint64_t pad0;
562 	/* cmd word 1 */
563 	/* from LSB: enable:1 oal_lo:7 */
564 	uint8_t enable_oal_lo;
565 	/* from LSB: oal_hi:5 */
566 	uint8_t oal_hi;
567 	uint8_t units;
568 	uint8_t pad2;
569 	uint32_t threshold;
570 };
571 
572 #define DPNI_OAL_LO_SHIFT	1
573 #define DPNI_OAL_LO_SIZE	7
574 #define DPNI_OAL_HI_SHIFT	0
575 #define DPNI_OAL_HI_SIZE	5
576 
577 struct dpni_cmd_set_taildrop {
578 	/* cmd word 0 */
579 	uint8_t congestion_point;
580 	uint8_t qtype;
581 	uint8_t tc;
582 	uint8_t index;
583 	uint32_t pad0;
584 	/* cmd word 1 */
585 	/* from LSB: enable:1 oal_lo:7 */
586 	uint8_t enable_oal_lo;
587 	/* from LSB: oal_hi:5 */
588 	uint8_t oal_hi;
589 	uint8_t units;
590 	uint8_t pad2;
591 	uint32_t threshold;
592 };
593 
594 struct dpni_tx_confirmation_mode {
595 	uint32_t pad;
596 	uint8_t confirmation_mode;
597 };
598 
599 #define DPNI_DEST_TYPE_SHIFT		0
600 #define DPNI_DEST_TYPE_SIZE		4
601 #define DPNI_CONG_UNITS_SHIFT		4
602 #define DPNI_CONG_UNITS_SIZE		2
603 
604 struct dpni_cmd_set_congestion_notification {
605 	uint8_t qtype;
606 	uint8_t tc;
607 	uint8_t pad[6];
608 	uint32_t dest_id;
609 	uint16_t notification_mode;
610 	uint8_t dest_priority;
611 	/* from LSB: dest_type: 4 units:2 */
612 	uint8_t type_units;
613 	uint64_t message_iova;
614 	uint64_t message_ctx;
615 	uint32_t threshold_entry;
616 	uint32_t threshold_exit;
617 };
618 
619 struct dpni_cmd_get_congestion_notification {
620 	uint8_t qtype;
621 	uint8_t tc;
622 };
623 
624 struct dpni_rsp_get_congestion_notification {
625 	uint64_t pad;
626 	uint32_t dest_id;
627 	uint16_t notification_mode;
628 	uint8_t dest_priority;
629 	/* from LSB: dest_type: 4 units:2 */
630 	uint8_t type_units;
631 	uint64_t message_iova;
632 	uint64_t message_ctx;
633 	uint32_t threshold_entry;
634 	uint32_t threshold_exit;
635 };
636 
637 #pragma pack(pop)
638 #endif /* _FSL_DPNI_CMD_H */
639