81830ed85f428eb705338a71d7a9eda42bc6389d
[dpdk.git] / drivers / net / dpaa2 / mc / fsl_dpni_cmd.h
1 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
2  *
3  * Copyright 2013-2016 Freescale Semiconductor Inc.
4  * Copyright 2016-2017 NXP
5  *
6  */
7 #ifndef _FSL_DPNI_CMD_H
8 #define _FSL_DPNI_CMD_H
9
10 /* DPNI Version */
11 #define DPNI_VER_MAJOR                          7
12 #define DPNI_VER_MINOR                          8
13
14 #define DPNI_CMD_BASE_VERSION                   1
15 #define DPNI_CMD_VERSION_2                      2
16 #define DPNI_CMD_VERSION_3                      3
17 #define DPNI_CMD_ID_OFFSET                      4
18
19 #define DPNI_CMD(id)    (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_BASE_VERSION)
20 #define DPNI_CMD_V2(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_VERSION_2)
21 #define DPNI_CMD_V3(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_VERSION_3)
22
23 /* Command IDs */
24 #define DPNI_CMDID_OPEN                         DPNI_CMD(0x801)
25 #define DPNI_CMDID_CLOSE                        DPNI_CMD(0x800)
26 #define DPNI_CMDID_CREATE                       DPNI_CMD_V2(0x901)
27 #define DPNI_CMDID_DESTROY                      DPNI_CMD(0x981)
28 #define DPNI_CMDID_GET_API_VERSION              DPNI_CMD(0xa01)
29
30 #define DPNI_CMDID_ENABLE                       DPNI_CMD(0x002)
31 #define DPNI_CMDID_DISABLE                      DPNI_CMD(0x003)
32 #define DPNI_CMDID_GET_ATTR                     DPNI_CMD_V2(0x004)
33 #define DPNI_CMDID_RESET                        DPNI_CMD(0x005)
34 #define DPNI_CMDID_IS_ENABLED                   DPNI_CMD(0x006)
35
36 #define DPNI_CMDID_SET_IRQ_ENABLE               DPNI_CMD(0x012)
37 #define DPNI_CMDID_GET_IRQ_ENABLE               DPNI_CMD(0x013)
38 #define DPNI_CMDID_SET_IRQ_MASK                 DPNI_CMD(0x014)
39 #define DPNI_CMDID_GET_IRQ_MASK                 DPNI_CMD(0x015)
40 #define DPNI_CMDID_GET_IRQ_STATUS               DPNI_CMD(0x016)
41 #define DPNI_CMDID_CLEAR_IRQ_STATUS             DPNI_CMD(0x017)
42
43 #define DPNI_CMDID_SET_POOLS                    DPNI_CMD_V2(0x200)
44 #define DPNI_CMDID_SET_ERRORS_BEHAVIOR          DPNI_CMD(0x20B)
45
46 #define DPNI_CMDID_GET_QDID                     DPNI_CMD(0x210)
47 #define DPNI_CMDID_GET_SP_INFO                  DPNI_CMD(0x211)
48 #define DPNI_CMDID_GET_TX_DATA_OFFSET           DPNI_CMD(0x212)
49 #define DPNI_CMDID_GET_LINK_STATE               DPNI_CMD_V2(0x215)
50 #define DPNI_CMDID_SET_MAX_FRAME_LENGTH         DPNI_CMD(0x216)
51 #define DPNI_CMDID_GET_MAX_FRAME_LENGTH         DPNI_CMD(0x217)
52 #define DPNI_CMDID_SET_LINK_CFG                 DPNI_CMD_V2(0x21A)
53 #define DPNI_CMDID_SET_TX_SHAPING               DPNI_CMD_V2(0x21B)
54
55 #define DPNI_CMDID_SET_MCAST_PROMISC            DPNI_CMD(0x220)
56 #define DPNI_CMDID_GET_MCAST_PROMISC            DPNI_CMD(0x221)
57 #define DPNI_CMDID_SET_UNICAST_PROMISC          DPNI_CMD(0x222)
58 #define DPNI_CMDID_GET_UNICAST_PROMISC          DPNI_CMD(0x223)
59 #define DPNI_CMDID_SET_PRIM_MAC                 DPNI_CMD(0x224)
60 #define DPNI_CMDID_GET_PRIM_MAC                 DPNI_CMD(0x225)
61 #define DPNI_CMDID_ADD_MAC_ADDR                 DPNI_CMD(0x226)
62 #define DPNI_CMDID_REMOVE_MAC_ADDR              DPNI_CMD(0x227)
63 #define DPNI_CMDID_CLR_MAC_FILTERS              DPNI_CMD(0x228)
64
65 #define DPNI_CMDID_ENABLE_VLAN_FILTER           DPNI_CMD(0x230)
66 #define DPNI_CMDID_ADD_VLAN_ID                  DPNI_CMD(0x231)
67 #define DPNI_CMDID_REMOVE_VLAN_ID               DPNI_CMD(0x232)
68 #define DPNI_CMDID_CLR_VLAN_FILTERS             DPNI_CMD(0x233)
69
70 #define DPNI_CMDID_SET_RX_TC_DIST               DPNI_CMD_V3(0x235)
71
72 #define DPNI_CMDID_GET_STATISTICS               DPNI_CMD_V2(0x25D)
73 #define DPNI_CMDID_RESET_STATISTICS             DPNI_CMD(0x25E)
74 #define DPNI_CMDID_GET_QUEUE                    DPNI_CMD(0x25F)
75 #define DPNI_CMDID_SET_QUEUE                    DPNI_CMD(0x260)
76 #define DPNI_CMDID_GET_TAILDROP                 DPNI_CMD_V2(0x261)
77 #define DPNI_CMDID_SET_TAILDROP                 DPNI_CMD_V2(0x262)
78
79 #define DPNI_CMDID_GET_PORT_MAC_ADDR            DPNI_CMD(0x263)
80
81 #define DPNI_CMDID_GET_BUFFER_LAYOUT            DPNI_CMD_V2(0x264)
82 #define DPNI_CMDID_SET_BUFFER_LAYOUT            DPNI_CMD_V2(0x265)
83
84 #define DPNI_CMDID_SET_CONGESTION_NOTIFICATION  DPNI_CMD(0x267)
85 #define DPNI_CMDID_GET_CONGESTION_NOTIFICATION  DPNI_CMD(0x268)
86 #define DPNI_CMDID_SET_EARLY_DROP               DPNI_CMD_V2(0x269)
87 #define DPNI_CMDID_GET_EARLY_DROP               DPNI_CMD_V2(0x26A)
88 #define DPNI_CMDID_GET_OFFLOAD                  DPNI_CMD(0x26B)
89 #define DPNI_CMDID_SET_OFFLOAD                  DPNI_CMD(0x26C)
90 #define DPNI_CMDID_SET_TX_CONFIRMATION_MODE     DPNI_CMD(0x266)
91 #define DPNI_CMDID_GET_TX_CONFIRMATION_MODE     DPNI_CMD(0x26D)
92 #define DPNI_CMDID_SET_OPR                      DPNI_CMD(0x26e)
93 #define DPNI_CMDID_GET_OPR                      DPNI_CMD(0x26f)
94 #define DPNI_CMDID_ADD_CUSTOM_TPID              DPNI_CMD(0x275)
95 #define DPNI_CMDID_REMOVE_CUSTOM_TPID           DPNI_CMD(0x276)
96 #define DPNI_CMDID_GET_CUSTOM_TPID              DPNI_CMD(0x277)
97
98 /* Macros for accessing command fields smaller than 1byte */
99 #define DPNI_MASK(field)        \
100         GENMASK(DPNI_##field##_SHIFT + DPNI_##field##_SIZE - 1, \
101                 DPNI_##field##_SHIFT)
102 #define dpni_set_field(var, field, val) \
103         ((var) |= (((val) << DPNI_##field##_SHIFT) & DPNI_MASK(field)))
104 #define dpni_get_field(var, field)      \
105         (((var) & DPNI_MASK(field)) >> DPNI_##field##_SHIFT)
106
107 #pragma pack(push, 1)
108 struct dpni_cmd_open {
109         uint32_t dpni_id;
110 };
111
112 struct dpni_cmd_create {
113         uint32_t options;
114         uint8_t num_queues;
115         uint8_t num_tcs;
116         uint8_t mac_filter_entries;
117         uint8_t pad1;
118         uint8_t vlan_filter_entries;
119         uint8_t pad2;
120         uint8_t qos_entries;
121         uint8_t pad3;
122         uint16_t fs_entries;
123         uint8_t num_rx_tcs;
124 };
125
126 struct dpni_cmd_destroy {
127         uint32_t dpsw_id;
128 };
129
130 #define DPNI_BACKUP_POOL(val, order)    (((val) & 0x1) << (order))
131
132 struct dpni_cmd_pool {
133         uint16_t dpbp_id;
134         uint8_t priority_mask;
135         uint8_t pad;
136 };
137
138 struct dpni_cmd_set_pools {
139         uint8_t num_dpbp;
140         uint8_t backup_pool_mask;
141         uint16_t pad;
142         struct dpni_cmd_pool pool[8];
143         uint16_t buffer_size[8];
144 };
145
146 /* The enable indication is always the least significant bit */
147 #define DPNI_ENABLE_SHIFT               0
148 #define DPNI_ENABLE_SIZE                1
149
150 struct dpni_rsp_is_enabled {
151         uint8_t enabled;
152 };
153
154 struct dpni_cmd_set_irq_enable {
155         uint8_t enable;
156         uint8_t pad[3];
157         uint8_t irq_index;
158 };
159
160 struct dpni_cmd_get_irq_enable {
161         uint32_t pad;
162         uint8_t irq_index;
163 };
164
165 struct dpni_rsp_get_irq_enable {
166         uint8_t enabled;
167 };
168
169 struct dpni_cmd_set_irq_mask {
170         uint32_t mask;
171         uint8_t irq_index;
172 };
173
174 struct dpni_cmd_get_irq_mask {
175         uint32_t pad;
176         uint8_t irq_index;
177 };
178
179 struct dpni_rsp_get_irq_mask {
180         uint32_t mask;
181 };
182
183 struct dpni_cmd_get_irq_status {
184         uint32_t status;
185         uint8_t irq_index;
186 };
187
188 struct dpni_rsp_get_irq_status {
189         uint32_t status;
190 };
191
192 struct dpni_cmd_clear_irq_status {
193         uint32_t status;
194         uint8_t irq_index;
195 };
196
197 struct dpni_rsp_get_attr {
198         /* response word 0 */
199         uint32_t options;
200         uint8_t num_queues;
201         uint8_t num_rx_tcs;
202         uint8_t mac_filter_entries;
203         uint8_t num_tx_tcs;
204         /* response word 1 */
205         uint8_t vlan_filter_entries;
206         uint8_t pad1;
207         uint8_t qos_entries;
208         uint8_t pad2;
209         uint16_t fs_entries;
210         uint16_t pad3;
211         /* response word 2 */
212         uint8_t qos_key_size;
213         uint8_t fs_key_size;
214         uint16_t wriop_version;
215 };
216
217 #define DPNI_ERROR_ACTION_SHIFT         0
218 #define DPNI_ERROR_ACTION_SIZE          4
219 #define DPNI_FRAME_ANN_SHIFT            4
220 #define DPNI_FRAME_ANN_SIZE             1
221
222 struct dpni_cmd_set_errors_behavior {
223         uint32_t errors;
224         /* from least significant bit: error_action:4, set_frame_annotation:1 */
225         uint8_t flags;
226 };
227
228 /* There are 3 separate commands for configuring Rx, Tx and Tx confirmation
229  * buffer layouts, but they all share the same parameters.
230  * If one of the functions changes, below structure needs to be split.
231  */
232
233 #define DPNI_PASS_TS_SHIFT              0
234 #define DPNI_PASS_TS_SIZE               1
235 #define DPNI_PASS_PR_SHIFT              1
236 #define DPNI_PASS_PR_SIZE               1
237 #define DPNI_PASS_FS_SHIFT              2
238 #define DPNI_PASS_FS_SIZE               1
239 #define DPNI_PASS_SWO_SHIFT             3
240 #define DPNI_PASS_SWO_SIZE              1
241
242 struct dpni_cmd_get_buffer_layout {
243         uint8_t qtype;
244 };
245
246 struct dpni_rsp_get_buffer_layout {
247         /* response word 0 */
248         uint8_t pad0[6];
249         /* from LSB: pass_timestamp:1, parser_result:1, frame_status:1 */
250         uint8_t flags;
251         uint8_t pad1;
252         /* response word 1 */
253         uint16_t private_data_size;
254         uint16_t data_align;
255         uint16_t head_room;
256         uint16_t tail_room;
257 };
258
259 struct dpni_cmd_set_buffer_layout {
260         /* cmd word 0 */
261         uint8_t qtype;
262         uint8_t pad0[3];
263         uint16_t options;
264         /* from LSB: pass_timestamp:1, parser_result:1, frame_status:1 */
265         uint8_t flags;
266         uint8_t pad1;
267         /* cmd word 1 */
268         uint16_t private_data_size;
269         uint16_t data_align;
270         uint16_t head_room;
271         uint16_t tail_room;
272 };
273
274 struct dpni_cmd_set_offload {
275         uint8_t pad[3];
276         uint8_t dpni_offload;
277         uint32_t config;
278 };
279
280 struct dpni_cmd_get_offload {
281         uint8_t pad[3];
282         uint8_t dpni_offload;
283 };
284
285 struct dpni_rsp_get_offload {
286         uint32_t pad;
287         uint32_t config;
288 };
289
290 struct dpni_cmd_get_qdid {
291         uint8_t qtype;
292 };
293
294 struct dpni_rsp_get_qdid {
295         uint16_t qdid;
296 };
297
298 struct dpni_rsp_get_sp_info {
299         uint16_t spids[2];
300 };
301
302 struct dpni_rsp_get_tx_data_offset {
303         uint16_t data_offset;
304 };
305
306 struct dpni_cmd_get_statistics {
307         uint8_t page_number;
308         uint8_t param;
309 };
310
311 struct dpni_rsp_get_statistics {
312         uint64_t counter[7];
313 };
314
315 struct dpni_cmd_set_link_cfg {
316         uint64_t pad0;
317         uint32_t rate;
318         uint32_t pad1;
319         uint64_t options;
320         uint64_t advertising;
321 };
322
323 #define DPNI_LINK_STATE_SHIFT           0
324 #define DPNI_LINK_STATE_SIZE            1
325 #define DPNI_STATE_VALID_SHIFT          1
326 #define DPNI_STATE_VALID_SIZE           1
327
328 struct dpni_rsp_get_link_state {
329         uint32_t pad0;
330         /* from LSB: up:1 */
331         uint8_t flags;
332         uint8_t pad1[3];
333         uint32_t rate;
334         uint32_t pad2;
335         uint64_t options;
336         uint64_t supported;
337         uint64_t advertising;
338 };
339
340 struct dpni_cmd_set_max_frame_length {
341         uint16_t max_frame_length;
342 };
343
344 struct dpni_rsp_get_max_frame_length {
345         uint16_t max_frame_length;
346 };
347
348 struct dpni_cmd_set_multicast_promisc {
349         uint8_t enable;
350 };
351
352 struct dpni_rsp_get_multicast_promisc {
353         uint8_t enabled;
354 };
355
356 struct dpni_cmd_set_unicast_promisc {
357         uint8_t enable;
358 };
359
360 struct dpni_rsp_get_unicast_promisc {
361         uint8_t enabled;
362 };
363
364 struct dpni_cmd_set_primary_mac_addr {
365         uint16_t pad;
366         uint8_t mac_addr[6];
367 };
368
369 struct dpni_rsp_get_primary_mac_addr {
370         uint16_t pad;
371         uint8_t mac_addr[6];
372 };
373
374 struct dpni_rsp_get_port_mac_addr {
375         uint16_t pad;
376         uint8_t mac_addr[6];
377 };
378
379 struct dpni_cmd_add_mac_addr {
380         uint16_t pad;
381         uint8_t mac_addr[6];
382 };
383
384 struct dpni_cmd_remove_mac_addr {
385         uint16_t pad;
386         uint8_t mac_addr[6];
387 };
388
389 #define DPNI_UNICAST_FILTERS_SHIFT      0
390 #define DPNI_UNICAST_FILTERS_SIZE       1
391 #define DPNI_MULTICAST_FILTERS_SHIFT    1
392 #define DPNI_MULTICAST_FILTERS_SIZE     1
393
394 struct dpni_cmd_clear_mac_filters {
395         /* from LSB: unicast:1, multicast:1 */
396         uint8_t flags;
397 };
398
399 struct dpni_cmd_enable_vlan_filter {
400         /* only the LSB */
401         uint8_t en;
402 };
403
404 struct dpni_cmd_vlan_id {
405         uint32_t pad;
406         uint16_t vlan_id;
407 };
408
409 #define DPNI_SEPARATE_GRP_SHIFT 0
410 #define DPNI_SEPARATE_GRP_SIZE  1
411 #define DPNI_MODE_1_SHIFT               0
412 #define DPNI_MODE_1_SIZE                4
413 #define DPNI_MODE_2_SHIFT               4
414 #define DPNI_MODE_2_SIZE                4
415
416 struct dpni_cmd_set_tx_priorities {
417         uint16_t flags;
418         uint8_t prio_group_A;
419         uint8_t prio_group_B;
420         uint32_t pad0;
421         uint8_t modes[4];
422         uint32_t pad1;
423         uint64_t pad2;
424         uint16_t delta_bandwidth[8];
425 };
426
427 #define DPNI_DIST_MODE_SHIFT            0
428 #define DPNI_DIST_MODE_SIZE             4
429 #define DPNI_MISS_ACTION_SHIFT          4
430 #define DPNI_MISS_ACTION_SIZE           4
431 #define DPNI_KEEP_HASH_KEY_SHIFT        7
432 #define DPNI_KEEP_HASH_KEY_SIZE         1
433 #define DPNI_KEEP_ENTRIES_SHIFT         6
434 #define DPNI_KEEP_ENTRIES_SIZE          1
435
436 struct dpni_cmd_set_rx_tc_dist {
437         uint16_t dist_size;
438         uint8_t tc_id;
439         /* from LSB: dist_mode:4, miss_action:4 */
440         uint8_t flags;
441         uint8_t pad0;
442         /* only the LSB */
443         uint8_t keep_hash_key;
444         uint16_t default_flow_id;
445         uint64_t pad1[5];
446         uint64_t key_cfg_iova;
447 };
448
449 struct dpni_cmd_get_queue {
450         uint8_t qtype;
451         uint8_t tc;
452         uint8_t index;
453 };
454
455 #define DPNI_DEST_TYPE_SHIFT            0
456 #define DPNI_DEST_TYPE_SIZE             4
457 #define DPNI_STASH_CTRL_SHIFT           6
458 #define DPNI_STASH_CTRL_SIZE            1
459 #define DPNI_HOLD_ACTIVE_SHIFT          7
460 #define DPNI_HOLD_ACTIVE_SIZE           1
461
462 struct dpni_rsp_get_queue {
463         /* response word 0 */
464         uint64_t pad0;
465         /* response word 1 */
466         uint32_t dest_id;
467         uint16_t pad1;
468         uint8_t dest_prio;
469         /* From LSB: dest_type:4, pad:2, flc_stash_ctrl:1, hold_active:1 */
470         uint8_t flags;
471         /* response word 2 */
472         uint64_t flc;
473         /* response word 3 */
474         uint64_t user_context;
475         /* response word 4 */
476         uint32_t fqid;
477         uint16_t qdbin;
478 };
479
480 struct dpni_cmd_set_queue {
481         /* cmd word 0 */
482         uint8_t qtype;
483         uint8_t tc;
484         uint8_t index;
485         uint8_t options;
486         uint32_t pad0;
487         /* cmd word 1 */
488         uint32_t dest_id;
489         uint16_t pad1;
490         uint8_t dest_prio;
491         uint8_t flags;
492         /* cmd word 2 */
493         uint64_t flc;
494         /* cmd word 3 */
495         uint64_t user_context;
496 };
497
498 #define DPNI_DROP_ENABLE_SHIFT  0
499 #define DPNI_DROP_ENABLE_SIZE   1
500 #define DPNI_DROP_UNITS_SHIFT   2
501 #define DPNI_DROP_UNITS_SIZE    2
502
503 struct dpni_early_drop {
504         /* from LSB: enable:1 units:2 */
505         uint8_t flags;
506         uint8_t pad0[3];
507         uint32_t pad1;
508         uint8_t green_drop_probability;
509         uint8_t pad2[7];
510         uint64_t green_max_threshold;
511         uint64_t green_min_threshold;
512         uint64_t pad3;
513         uint8_t yellow_drop_probability;
514         uint8_t pad4[7];
515         uint64_t yellow_max_threshold;
516         uint64_t yellow_min_threshold;
517         uint64_t pad5;
518         uint8_t red_drop_probability;
519         uint8_t pad6[7];
520         uint64_t red_max_threshold;
521         uint64_t red_min_threshold;
522 };
523
524 struct dpni_cmd_early_drop {
525         uint8_t qtype;
526         uint8_t tc;
527         uint8_t pad[6];
528         uint64_t early_drop_iova;
529 };
530
531 struct dpni_rsp_get_api_version {
532         uint16_t major;
533         uint16_t minor;
534 };
535
536 struct dpni_cmd_get_taildrop {
537         uint8_t congestion_point;
538         uint8_t qtype;
539         uint8_t tc;
540         uint8_t index;
541 };
542
543 struct dpni_rsp_get_taildrop {
544         /* cmd word 0 */
545         uint64_t pad0;
546         /* cmd word 1 */
547         /* from LSB: enable:1 oal_lo:7 */
548         uint8_t enable_oal_lo;
549         /* from LSB: oal_hi:5 */
550         uint8_t oal_hi;
551         uint8_t units;
552         uint8_t pad2;
553         uint32_t threshold;
554 };
555
556 #define DPNI_OAL_LO_SHIFT       1
557 #define DPNI_OAL_LO_SIZE        7
558 #define DPNI_OAL_HI_SHIFT       0
559 #define DPNI_OAL_HI_SIZE        5
560
561 struct dpni_cmd_set_taildrop {
562         /* cmd word 0 */
563         uint8_t congestion_point;
564         uint8_t qtype;
565         uint8_t tc;
566         uint8_t index;
567         uint32_t pad0;
568         /* cmd word 1 */
569         /* from LSB: enable:1 oal_lo:7 */
570         uint8_t enable_oal_lo;
571         /* from LSB: oal_hi:5 */
572         uint8_t oal_hi;
573         uint8_t units;
574         uint8_t pad2;
575         uint32_t threshold;
576 };
577
578 struct dpni_tx_confirmation_mode {
579         uint32_t pad;
580         uint8_t confirmation_mode;
581 };
582
583 #define DPNI_DEST_TYPE_SHIFT            0
584 #define DPNI_DEST_TYPE_SIZE             4
585 #define DPNI_CONG_UNITS_SHIFT           4
586 #define DPNI_CONG_UNITS_SIZE            2
587
588 struct dpni_cmd_set_congestion_notification {
589         uint8_t qtype;
590         uint8_t tc;
591         uint8_t pad[6];
592         uint32_t dest_id;
593         uint16_t notification_mode;
594         uint8_t dest_priority;
595         /* from LSB: dest_type: 4 units:2 */
596         uint8_t type_units;
597         uint64_t message_iova;
598         uint64_t message_ctx;
599         uint32_t threshold_entry;
600         uint32_t threshold_exit;
601 };
602
603 struct dpni_cmd_get_congestion_notification {
604         uint8_t qtype;
605         uint8_t tc;
606 };
607
608 struct dpni_rsp_get_congestion_notification {
609         uint64_t pad;
610         uint32_t dest_id;
611         uint16_t notification_mode;
612         uint8_t dest_priority;
613         /* from LSB: dest_type: 4 units:2 */
614         uint8_t type_units;
615         uint64_t message_iova;
616         uint64_t message_ctx;
617         uint32_t threshold_entry;
618         uint32_t threshold_exit;
619 };
620
621 struct dpni_cmd_set_opr {
622         uint8_t pad0;
623         uint8_t tc_id;
624         uint8_t index;
625         uint8_t options;
626         uint8_t pad1[7];
627         uint8_t oloe;
628         uint8_t oeane;
629         uint8_t olws;
630         uint8_t oa;
631         uint8_t oprrws;
632 };
633
634 struct dpni_cmd_get_opr {
635         uint8_t pad;
636         uint8_t tc_id;
637         uint8_t index;
638 };
639
640 #define DPNI_RIP_SHIFT  0
641 #define DPNI_RIP_SIZE           1
642 #define DPNI_OPR_ENABLE_SHIFT   1
643 #define DPNI_OPR_ENABLE_SIZE    1
644 #define DPNI_TSEQ_NLIS_SHIFT    0
645 #define DPNI_TSEQ_NLIS_SIZE     1
646 #define DPNI_HSEQ_NLIS_SHIFT    0
647 #define DPNI_HSEQ_NLIS_SIZE     1
648
649 struct dpni_rsp_get_opr {
650         uint64_t pad0;
651         /* from LSB: rip:1 enable:1 */
652         uint8_t flags;
653         uint16_t pad1;
654         uint8_t oloe;
655         uint8_t oeane;
656         uint8_t olws;
657         uint8_t oa;
658         uint8_t oprrws;
659         uint16_t nesn;
660         uint16_t pad8;
661         uint16_t ndsn;
662         uint16_t pad2;
663         uint16_t ea_tseq;
664         /* only the LSB */
665         uint8_t tseq_nlis;
666         uint8_t pad3;
667         uint16_t ea_hseq;
668         /* only the LSB */
669         uint8_t hseq_nlis;
670         uint8_t pad4;
671         uint16_t ea_hptr;
672         uint16_t pad5;
673         uint16_t ea_tptr;
674         uint16_t pad6;
675         uint16_t opr_vid;
676         uint16_t pad7;
677         uint16_t opr_id;
678 };
679
680 struct dpni_cmd_add_custom_tpid {
681         uint16_t        pad;
682         uint16_t        tpid;
683 };
684
685 struct dpni_cmd_remove_custom_tpid {
686         uint16_t        pad;
687         uint16_t        tpid;
688 };
689
690 struct dpni_rsp_get_custom_tpid {
691         uint16_t        tpid1;
692         uint16_t        tpid2;
693 };
694
695 #pragma pack(pop)
696 #endif /* _FSL_DPNI_CMD_H */