New upstream version 18.11-rc1
[deb_dpdk.git] / drivers / net / dpaa2 / mc / fsl_dpni.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_H
8 #define __FSL_DPNI_H
9
10 #include <fsl_dpkg.h>
11 #include <fsl_dpopr.h>
12
13 struct fsl_mc_io;
14
15 /**
16  * Data Path Network Interface API
17  * Contains initialization APIs and runtime control APIs for DPNI
18  */
19
20 /** General DPNI macros */
21
22 /**
23  * Maximum number of traffic classes
24  */
25 #define DPNI_MAX_TC                             8
26 /**
27  * Maximum number of buffer pools per DPNI
28  */
29 #define DPNI_MAX_DPBP                           8
30 /**
31  * Maximum number of storage-profiles per DPNI
32  */
33 #define DPNI_MAX_SP                             2
34
35 /**
36  * All traffic classes considered; see dpni_set_queue()
37  */
38 #define DPNI_ALL_TCS                            (uint8_t)(-1)
39 /**
40  * All flows within traffic class considered; see dpni_set_queue()
41  */
42 #define DPNI_ALL_TC_FLOWS                       (uint16_t)(-1)
43
44 /**
45  * Tx traffic is always released to a buffer pool on transmit, there are no
46  * resources allocated to have the frames confirmed back to the source after
47  * transmission.
48  */
49 #define DPNI_OPT_TX_FRM_RELEASE                 0x000001
50 /**
51  * Disables support for MAC address filtering for addresses other than primary
52  * MAC address. This affects both unicast and multicast. Promiscuous mode can
53  * still be enabled/disabled for both unicast and multicast. If promiscuous mode
54  * is disabled, only traffic matching the primary MAC address will be accepted.
55  */
56 #define DPNI_OPT_NO_MAC_FILTER                  0x000002
57 /**
58  * Allocate policers for this DPNI. They can be used to rate-limit traffic per
59  * traffic class (TC) basis.
60  */
61 #define DPNI_OPT_HAS_POLICING                   0x000004
62 /**
63  * Congestion can be managed in several ways, allowing the buffer pool to
64  * deplete on ingress, taildrop on each queue or use congestion groups for sets
65  * of queues. If set, it configures a single congestion groups across all TCs.
66  * If reset, a congestion group is allocated for each TC. Only relevant if the
67  * DPNI has multiple traffic classes.
68  */
69 #define DPNI_OPT_SHARED_CONGESTION              0x000008
70 /**
71  * Enables TCAM for Flow Steering and QoS look-ups. If not specified, all
72  * look-ups are exact match. Note that TCAM is not available on LS1088 and its
73  * variants. Setting this bit on these SoCs will trigger an error.
74  */
75 #define DPNI_OPT_HAS_KEY_MASKING                0x000010
76 /**
77  * Disables the flow steering table.
78  */
79 #define DPNI_OPT_NO_FS                          0x000020
80
81 /**
82  * Enable the Order Restoration support
83  */
84 #define DPNI_OPT_HAS_OPR                                0x000040
85
86 /**
87  * Order Point Records are shared for the entire TC
88  */
89 #define DPNI_OPT_OPR_PER_TC                             0x000080
90 /**
91  * All Tx traffic classes will use a single sender (ignore num_queueus for tx)
92  */
93 #define DPNI_OPT_SINGLE_SENDER                  0x000100
94
95 int dpni_open(struct fsl_mc_io *mc_io,
96               uint32_t cmd_flags,
97               int dpni_id,
98               uint16_t *token);
99
100 int dpni_close(struct fsl_mc_io *mc_io,
101                uint32_t cmd_flags,
102                uint16_t token);
103
104 /**
105  * struct dpni_cfg - Structure representing DPNI configuration
106  * @options: Any combination of the following options:
107  *              DPNI_OPT_TX_FRM_RELEASE
108  *              DPNI_OPT_NO_MAC_FILTER
109  *              DPNI_OPT_HAS_POLICING
110  *              DPNI_OPT_SHARED_CONGESTION
111  *              DPNI_OPT_HAS_KEY_MASKING
112  *              DPNI_OPT_NO_FS
113  *              DPNI_OPT_SINGLE_SENDER
114  * @fs_entries: Number of entries in the flow steering table.
115  *              This table is used to select the ingress queue for
116  *              ingress traffic, targeting a GPP core or another.
117  *              In addition it can be used to discard traffic that
118  *              matches the set rule. It is either an exact match table
119  *              or a TCAM table, depending on DPNI_OPT_ HAS_KEY_MASKING
120  *              bit in OPTIONS field. This field is ignored if
121  *              DPNI_OPT_NO_FS bit is set in OPTIONS field. Otherwise,
122  *              value 0 defaults to 64. Maximum supported value is 1024.
123  *              Note that the total number of entries is limited on the
124  *              SoC to as low as 512 entries if TCAM is used.
125  * @vlan_filter_entries: Number of entries in the VLAN address filtering
126  *              table. This is an exact match table used to filter
127  *              ingress traffic based on VLAN IDs. Value 0 disables VLAN
128  *              filtering. Maximum supported value is 16.
129  * @mac_filter_entries: Number of entries in the MAC address filtering
130  *              table. This is an exact match table and allows both
131  *              unicast and multicast entries. The primary MAC address
132  *              of the network interface is not part of this table,
133  *              this contains only entries in addition to it. This
134  *              field is ignored if DPNI_OPT_ NO_MAC_FILTER is set in
135  *              OPTIONS field. Otherwise, value 0 defaults to 80.
136  *              Maximum supported value is 80.
137  * @num_queues: Number of Tx and Rx queues used for traffic
138  *              distribution. This is orthogonal to QoS and is only
139  *              used to distribute traffic to multiple GPP cores.
140  *              This configuration affects the number of Tx queues
141  *              (logical FQs, all associated with a single CEETM queue),
142  *              Rx queues and Tx confirmation queues, if applicable.
143  *              Value 0 defaults to one queue. Maximum supported value
144  *              is 8.
145  * @num_tcs: Number of traffic classes (TCs), reserved for the DPNI.
146  *              TCs can have different priority levels for the purpose
147  *              of Tx scheduling (see DPNI_SET_TX_PRIORITIES), different
148  *              BPs (DPNI_ SET_POOLS), policers. There are dedicated QM
149  *              queues for traffic classes (including class queues on
150  *              Tx). Value 0 defaults to one TC. Maximum supported value
151  *              is 16. There are maximum 16 TCs for Tx and 8 TCs for Rx.
152  *              When num_tcs>8 Tx will use this value but Rx will have
153  *              only 8 traffic classes.
154  * @num_rx_tcs: if set to other value than zero represents number
155  *              of TCs used for Rx. Maximum value is 8. If set to zero the
156  *              number of Rx TCs will be initialized with the value provided
157  *              in num_tcs parameter.
158  * @qos_entries: Number of entries in the QoS classification table. This
159  *              table is used to select the TC for ingress traffic. It
160  *              is either an exact match or a TCAM table, depending on
161  *              DPNI_OPT_ HAS_KEY_MASKING bit in OPTIONS field. This
162  *              field is ignored if the DPNI has a single TC. Otherwise,
163  *              a value of 0 defaults to 64. Maximum supported value
164  *              is 64.
165  */
166 struct dpni_cfg {
167         uint32_t options;
168         uint16_t fs_entries;
169         uint8_t  vlan_filter_entries;
170         uint8_t  mac_filter_entries;
171         uint8_t  num_queues;
172         uint8_t  num_tcs;
173         uint8_t  num_rx_tcs;
174         uint8_t  qos_entries;
175 };
176
177 int dpni_create(struct fsl_mc_io *mc_io,
178                 uint16_t dprc_token,
179                 uint32_t cmd_flags,
180                 const struct dpni_cfg *cfg,
181                 uint32_t *obj_id);
182
183 int dpni_destroy(struct fsl_mc_io *mc_io,
184                  uint16_t dprc_token,
185                  uint32_t cmd_flags,
186                  uint32_t object_id);
187
188 /**
189  * struct dpni_pools_cfg - Structure representing buffer pools configuration
190  * @num_dpbp:   Number of DPBPs
191  * @pools:      Array of buffer pools parameters; The number of valid entries
192  *              must match 'num_dpbp' value
193  * @pools.dpbp_id:     DPBP object ID
194  * @pools.priority:    Priority mask that indicates TC's used with this buffer.
195  *                     I set to 0x00 MC will assume value 0xff.
196  * @pools.buffer_size: Buffer size
197  * @pools.backup_pool: Backup pool
198  */
199 struct dpni_pools_cfg {
200         uint8_t num_dpbp;
201         struct {
202                 int             dpbp_id;
203                 uint8_t         priority_mask;
204                 uint16_t        buffer_size;
205                 int             backup_pool;
206         } pools[DPNI_MAX_DPBP];
207 };
208
209 int dpni_set_pools(struct fsl_mc_io *mc_io,
210                    uint32_t cmd_flags,
211                    uint16_t token,
212                    const struct dpni_pools_cfg *cfg);
213
214 int dpni_enable(struct fsl_mc_io *mc_io,
215                 uint32_t cmd_flags,
216                 uint16_t token);
217
218 int dpni_disable(struct fsl_mc_io *mc_io,
219                  uint32_t cmd_flags,
220                  uint16_t token);
221
222 int dpni_is_enabled(struct fsl_mc_io *mc_io,
223                     uint32_t cmd_flags,
224                     uint16_t token,
225                     int *en);
226
227 int dpni_reset(struct fsl_mc_io *mc_io,
228                uint32_t cmd_flags,
229                uint16_t token);
230
231 /**
232  * DPNI IRQ Index and Events
233  */
234
235 /**
236  * IRQ index
237  */
238 #define DPNI_IRQ_INDEX                          0
239 /**
240  * IRQ event - indicates a change in link state
241  */
242 #define DPNI_IRQ_EVENT_LINK_CHANGED             0x00000001
243
244 int dpni_set_irq_enable(struct fsl_mc_io *mc_io,
245                         uint32_t cmd_flags,
246                         uint16_t token,
247                         uint8_t irq_index,
248                         uint8_t en);
249
250 int dpni_get_irq_enable(struct fsl_mc_io *mc_io,
251                         uint32_t cmd_flags,
252                         uint16_t token,
253                         uint8_t irq_index,
254                         uint8_t *en);
255
256 int dpni_set_irq_mask(struct fsl_mc_io *mc_io,
257                       uint32_t cmd_flags,
258                       uint16_t token,
259                       uint8_t irq_index,
260                       uint32_t mask);
261
262 int dpni_get_irq_mask(struct fsl_mc_io *mc_io,
263                       uint32_t cmd_flags,
264                       uint16_t token,
265                       uint8_t irq_index,
266                       uint32_t *mask);
267
268 int dpni_get_irq_status(struct fsl_mc_io *mc_io,
269                         uint32_t cmd_flags,
270                         uint16_t token,
271                         uint8_t irq_index,
272                         uint32_t *status);
273
274 int dpni_clear_irq_status(struct fsl_mc_io *mc_io,
275                           uint32_t cmd_flags,
276                           uint16_t token,
277                           uint8_t irq_index,
278                           uint32_t status);
279
280 /**
281  * struct dpni_attr - Structure representing DPNI attributes
282  * @options: Any combination of the following options:
283  *              DPNI_OPT_TX_FRM_RELEASE
284  *              DPNI_OPT_NO_MAC_FILTER
285  *              DPNI_OPT_HAS_POLICING
286  *              DPNI_OPT_SHARED_CONGESTION
287  *              DPNI_OPT_HAS_KEY_MASKING
288  *              DPNI_OPT_NO_FS
289  * @num_queues: Number of Tx and Rx queues used for traffic distribution.
290  * @num_rx_tcs: Number of RX traffic classes (TCs), reserved for the DPNI.
291  * @num_tx_tcs: Number of TX traffic classes (TCs), reserved for the DPNI.
292  * @mac_filter_entries: Number of entries in the MAC address filtering
293  *              table.
294  * @vlan_filter_entries: Number of entries in the VLAN address filtering
295  *              table.
296  * @qos_entries: Number of entries in the QoS classification table.
297  * @fs_entries: Number of entries in the flow steering table.
298  * @qos_key_size: Size, in bytes, of the QoS look-up key. Defining a key larger
299  *                      than this when adding QoS entries will result
300  *                      in an error.
301  * @fs_key_size: Size, in bytes, of the flow steering look-up key. Defining a
302  *                      key larger than this when composing the hash + FS key
303  *                      will result in an error.
304  * @wriop_version: Version of WRIOP HW block.
305  *                      The 3 version values are stored on 6, 5, 5 bits
306  *                      respectively.
307  *                      Values returned:
308  *                      - 0x400 - WRIOP version 1.0.0, used on LS2080 and
309  *                      variants,
310  *                      - 0x421 - WRIOP version 1.1.1, used on LS2088 and
311  *                      variants,
312  *                      - 0x422 - WRIOP version 1.1.2, used on LS1088 and
313  *                      variants.
314  *                      - 0xC00 - WRIOP version 3.0.0, used on LX2160 and
315  *                      variants.
316  */
317 struct dpni_attr {
318         uint32_t options;
319         uint8_t  num_queues;
320         uint8_t  num_rx_tcs;
321         uint8_t  num_tx_tcs;
322         uint8_t  mac_filter_entries;
323         uint8_t  vlan_filter_entries;
324         uint8_t  qos_entries;
325         uint16_t fs_entries;
326         uint8_t  qos_key_size;
327         uint8_t  fs_key_size;
328         uint16_t wriop_version;
329 };
330
331 int dpni_get_attributes(struct fsl_mc_io *mc_io,
332                         uint32_t cmd_flags,
333                         uint16_t token,
334                         struct dpni_attr *attr);
335
336 /**
337  * DPNI errors
338  */
339
340 /**
341  * Discard error. When set all discarded frames in wriop will be enqueued to
342  * error queue. To be used in dpni_set_errors_behavior() only if error_action
343  * parameter is set to DPNI_ERROR_ACTION_SEND_TO_ERROR_QUEUE.
344  */
345 #define DPNI_ERROR_DISC         0x80000000
346
347 /**
348  * Extract out of frame header error
349  */
350 #define DPNI_ERROR_EOFHE        0x00020000
351 /**
352  * Frame length error
353  */
354 #define DPNI_ERROR_FLE          0x00002000
355 /**
356  * Frame physical error
357  */
358 #define DPNI_ERROR_FPE          0x00001000
359 /**
360  * Parsing header error
361  */
362 #define DPNI_ERROR_PHE          0x00000020
363 /**
364  * Parser L3 checksum error
365  */
366 #define DPNI_ERROR_L3CE         0x00000004
367 /**
368  * Parser L3 checksum error
369  */
370 #define DPNI_ERROR_L4CE         0x00000001
371
372 /**
373  * enum dpni_error_action - Defines DPNI behavior for errors
374  * @DPNI_ERROR_ACTION_DISCARD: Discard the frame
375  * @DPNI_ERROR_ACTION_CONTINUE: Continue with the normal flow
376  * @DPNI_ERROR_ACTION_SEND_TO_ERROR_QUEUE: Send the frame to the error queue
377  */
378 enum dpni_error_action {
379         DPNI_ERROR_ACTION_DISCARD = 0,
380         DPNI_ERROR_ACTION_CONTINUE = 1,
381         DPNI_ERROR_ACTION_SEND_TO_ERROR_QUEUE = 2
382 };
383
384 /**
385  * struct dpni_error_cfg - Structure representing DPNI errors treatment
386  * @errors:                     Errors mask; use 'DPNI_ERROR__<X>
387  * @error_action:               The desired action for the errors mask
388  * @set_frame_annotation:       Set to '1' to mark the errors in frame
389  *                              annotation status (FAS); relevant only
390  *                              for the non-discard action
391  */
392 struct dpni_error_cfg {
393         uint32_t errors;
394         enum dpni_error_action error_action;
395         int set_frame_annotation;
396 };
397
398 int dpni_set_errors_behavior(struct fsl_mc_io *mc_io,
399                              uint32_t cmd_flags,
400                              uint16_t token,
401                              struct dpni_error_cfg *cfg);
402
403 /**
404  * DPNI buffer layout modification options
405  */
406
407 /**
408  * Select to modify the time-stamp setting
409  */
410 #define DPNI_BUF_LAYOUT_OPT_TIMESTAMP           0x00000001
411 /**
412  * Select to modify the parser-result setting; not applicable for Tx
413  */
414 #define DPNI_BUF_LAYOUT_OPT_PARSER_RESULT       0x00000002
415 /**
416  * Select to modify the frame-status setting
417  */
418 #define DPNI_BUF_LAYOUT_OPT_FRAME_STATUS        0x00000004
419 /**
420  * Select to modify the private-data-size setting
421  */
422 #define DPNI_BUF_LAYOUT_OPT_PRIVATE_DATA_SIZE   0x00000008
423 /**
424  * Select to modify the data-alignment setting
425  */
426 #define DPNI_BUF_LAYOUT_OPT_DATA_ALIGN          0x00000010
427 /**
428  * Select to modify the data-head-room setting
429  */
430 #define DPNI_BUF_LAYOUT_OPT_DATA_HEAD_ROOM      0x00000020
431 /**
432  * Select to modify the data-tail-room setting
433  */
434 #define DPNI_BUF_LAYOUT_OPT_DATA_TAIL_ROOM      0x00000040
435 /**
436  * Select to modify the sw-opaque value setting
437  */
438 #define DPNI_BUF_LAYOUT_OPT_SW_OPAQUE           0x00000080
439
440 /**
441  * struct dpni_buffer_layout - Structure representing DPNI buffer layout
442  * @options:            Flags representing the suggested modifications to the
443  *                      buffer layout;
444  *                      Use any combination of 'DPNI_BUF_LAYOUT_OPT_<X>' flags
445  * @pass_timestamp:     Pass timestamp value
446  * @pass_parser_result: Pass parser results
447  * @pass_frame_status:  Pass frame status
448  * @private_data_size:  Size kept for private data (in bytes)
449  * @data_align:         Data alignment
450  * @data_head_room:     Data head room
451  * @data_tail_room:     Data tail room
452  */
453 struct dpni_buffer_layout {
454         uint32_t options;
455         int pass_timestamp;
456         int pass_parser_result;
457         int pass_frame_status;
458         int pass_sw_opaque;
459         uint16_t private_data_size;
460         uint16_t data_align;
461         uint16_t data_head_room;
462         uint16_t data_tail_room;
463 };
464
465 /**
466  * enum dpni_queue_type - Identifies a type of queue targeted by the command
467  * @DPNI_QUEUE_RX: Rx queue
468  * @DPNI_QUEUE_TX: Tx queue
469  * @DPNI_QUEUE_TX_CONFIRM: Tx confirmation queue
470  * @DPNI_QUEUE_RX_ERR: Rx error queue
471  */
472 enum dpni_queue_type {
473         DPNI_QUEUE_RX,
474         DPNI_QUEUE_TX,
475         DPNI_QUEUE_TX_CONFIRM,
476         DPNI_QUEUE_RX_ERR,
477 };
478
479 int dpni_get_buffer_layout(struct fsl_mc_io *mc_io,
480                            uint32_t cmd_flags,
481                            uint16_t token,
482                            enum dpni_queue_type qtype,
483                            struct dpni_buffer_layout *layout);
484
485 int dpni_set_buffer_layout(struct fsl_mc_io *mc_io,
486                            uint32_t cmd_flags,
487                            uint16_t token,
488                            enum dpni_queue_type qtype,
489                            const struct dpni_buffer_layout *layout);
490
491 /**
492  * enum dpni_offload - Identifies a type of offload targeted by the command
493  * @DPNI_OFF_RX_L3_CSUM: Rx L3 checksum validation
494  * @DPNI_OFF_RX_L4_CSUM: Rx L4 checksum validation
495  * @DPNI_OFF_TX_L3_CSUM: Tx L3 checksum generation
496  * @DPNI_OFF_TX_L4_CSUM: Tx L4 checksum generation
497  * @DPNI_OPT_FLCTYPE_HASH: flow context will be generated by WRIOP for AIOP or
498  *                         for CPU
499  */
500 enum dpni_offload {
501         DPNI_OFF_RX_L3_CSUM,
502         DPNI_OFF_RX_L4_CSUM,
503         DPNI_OFF_TX_L3_CSUM,
504         DPNI_OFF_TX_L4_CSUM,
505         DPNI_FLCTYPE_HASH,
506 };
507
508 int dpni_set_offload(struct fsl_mc_io *mc_io,
509                      uint32_t cmd_flags,
510                      uint16_t token,
511                      enum dpni_offload type,
512                      uint32_t config);
513
514 int dpni_get_offload(struct fsl_mc_io *mc_io,
515                      uint32_t cmd_flags,
516                      uint16_t token,
517                      enum dpni_offload type,
518                      uint32_t *config);
519
520 int dpni_get_qdid(struct fsl_mc_io *mc_io,
521                   uint32_t cmd_flags,
522                   uint16_t token,
523                   enum dpni_queue_type qtype,
524                   uint16_t *qdid);
525
526 int dpni_get_tx_data_offset(struct fsl_mc_io *mc_io,
527                             uint32_t cmd_flags,
528                             uint16_t token,
529                             uint16_t *data_offset);
530
531 #define DPNI_STATISTICS_CNT             7
532
533 /**
534  * union dpni_statistics - Union describing the DPNI statistics
535  * @page_0: Page_0 statistics structure
536  * @page_0.ingress_all_frames: Ingress frame count
537  * @page_0.ingress_all_bytes: Ingress byte count
538  * @page_0.ingress_multicast_frames: Ingress multicast frame count
539  * @page_0.ingress_multicast_bytes: Ingress multicast byte count
540  * @page_0.ingress_broadcast_frames: Ingress broadcast frame count
541  * @page_0.ingress_broadcast_bytes: Ingress broadcast byte count
542  * @page_1: Page_1 statistics structure
543  * @page_1.egress_all_frames: Egress frame count
544  * @page_1.egress_all_bytes: Egress byte count
545  * @page_1.egress_multicast_frames: Egress multicast frame count
546  * @page_1.egress_multicast_bytes: Egress multicast byte count
547  * @page_1.egress_broadcast_frames: Egress broadcast frame count
548  * @page_1.egress_broadcast_bytes: Egress broadcast byte count
549  * @page_2: Page_2 statistics structure
550  * @page_2.ingress_filtered_frames: Ingress filtered frame count
551  * @page_2.ingress_discarded_frames: Ingress discarded frame count
552  * @page_2.ingress_nobuffer_discards: Ingress discarded frame count due to
553  *      lack of buffers
554  * @page_2.egress_discarded_frames: Egress discarded frame count
555  * @page_2.egress_confirmed_frames: Egress confirmed frame count
556  * @page_3: Page_3 statistics structure with values for the selected TC
557  * @page_3.ceetm_dequeue_bytes: Cumulative count of the number of bytes dequeued
558  * @page_3.ceetm_dequeue_frames: Cumulative count of the number of frames
559  *      dequeued
560  * @page_3.ceetm_reject_bytes: Cumulative count of the number of bytes in all
561  *      frames whose enqueue was rejected
562  * @page_3.ceetm_reject_frames: Cumulative count of all frame enqueues rejected
563  * @page_4: congestion point drops for seleted TC
564  * @page_4.cgr_reject_frames: number of rejected frames due to congestion point
565  * @page_4.cgr_reject_bytes: number of rejected bytes due to congestion point
566  * @page_5: policer statistics per TC
567  * @page_5.policer_cnt_red: NUmber of red colored frames
568  * @page_5.policer_cnt_yellow: number of yellow colored frames
569  * @page_5.policer_cnt_green: number of green colored frames
570  * @page_5.policer_cnt_re_red: number of recolored red frames
571  * @page_5.policer_cnt_re_yellow: number of recolored yellow frames
572  * @raw: raw statistics structure, used to index counters
573  */
574 union dpni_statistics {
575         struct {
576                 uint64_t ingress_all_frames;
577                 uint64_t ingress_all_bytes;
578                 uint64_t ingress_multicast_frames;
579                 uint64_t ingress_multicast_bytes;
580                 uint64_t ingress_broadcast_frames;
581                 uint64_t ingress_broadcast_bytes;
582         } page_0;
583         struct {
584                 uint64_t egress_all_frames;
585                 uint64_t egress_all_bytes;
586                 uint64_t egress_multicast_frames;
587                 uint64_t egress_multicast_bytes;
588                 uint64_t egress_broadcast_frames;
589                 uint64_t egress_broadcast_bytes;
590         } page_1;
591         struct {
592                 uint64_t ingress_filtered_frames;
593                 uint64_t ingress_discarded_frames;
594                 uint64_t ingress_nobuffer_discards;
595                 uint64_t egress_discarded_frames;
596                 uint64_t egress_confirmed_frames;
597         } page_2;
598         struct {
599                 uint64_t ceetm_dequeue_bytes;
600                 uint64_t ceetm_dequeue_frames;
601                 uint64_t ceetm_reject_bytes;
602                 uint64_t ceetm_reject_frames;
603         } page_3;
604         struct {
605                 uint64_t cgr_reject_frames;
606                 uint64_t cgr_reject_bytes;
607         } page_4;
608         struct {
609                 uint64_t policer_cnt_red;
610                 uint64_t policer_cnt_yellow;
611                 uint64_t policer_cnt_green;
612                 uint64_t policer_cnt_re_red;
613                 uint64_t policer_cnt_re_yellow;
614         } page_5;
615         struct {
616                 uint64_t counter[DPNI_STATISTICS_CNT];
617         } raw;
618 };
619
620 /**
621  * Enable auto-negotiation
622  */
623 #define DPNI_LINK_OPT_AUTONEG           0x0000000000000001ULL
624 /**
625  * Enable half-duplex mode
626  */
627 #define DPNI_LINK_OPT_HALF_DUPLEX       0x0000000000000002ULL
628 /**
629  * Enable pause frames
630  */
631 #define DPNI_LINK_OPT_PAUSE             0x0000000000000004ULL
632 /**
633  * Enable a-symmetric pause frames
634  */
635 #define DPNI_LINK_OPT_ASYM_PAUSE        0x0000000000000008ULL
636 /**
637  * Enable priority flow control pause frames
638  */
639 #define DPNI_LINK_OPT_PFC_PAUSE 0x0000000000000010ULL
640
641 /**
642  * struct - Structure representing DPNI link configuration
643  * @rate: Rate
644  * @options: Mask of available options; use 'DPNI_LINK_OPT_<X>' values
645  * @advertising: Speeds that are advertised for autoneg (bitmap)
646  */
647 struct dpni_link_cfg {
648         uint32_t rate;
649         uint64_t options;
650         uint64_t advertising;
651 };
652
653 int dpni_set_link_cfg(struct fsl_mc_io *mc_io,
654                       uint32_t cmd_flags,
655                       uint16_t token,
656                       const struct dpni_link_cfg *cfg);
657
658 /**
659  * struct dpni_link_state - Structure representing DPNI link state
660  * @rate:       Rate
661  * @options:    Mask of available options; use 'DPNI_LINK_OPT_<X>' values
662  * @up:         Link state; '0' for down, '1' for up
663  * @state_valid: Ignore/Update the state of the link
664  * @supported: Speeds capability of the phy (bitmap)
665  * @advertising: Speeds that are advertised for autoneg (bitmap)
666  */
667 struct dpni_link_state {
668         uint32_t rate;
669         uint64_t options;
670         int up;
671         int     state_valid;
672         uint64_t supported;
673         uint64_t advertising;
674 };
675
676 int dpni_get_link_state(struct fsl_mc_io *mc_io,
677                         uint32_t cmd_flags,
678                         uint16_t token,
679                         struct dpni_link_state *state);
680
681 int dpni_set_max_frame_length(struct fsl_mc_io *mc_io,
682                               uint32_t cmd_flags,
683                               uint16_t token,
684                               uint16_t max_frame_length);
685
686 int dpni_get_max_frame_length(struct fsl_mc_io *mc_io,
687                               uint32_t cmd_flags,
688                               uint16_t token,
689                               uint16_t *max_frame_length);
690
691 int dpni_set_mtu(struct fsl_mc_io *mc_io,
692                  uint32_t cmd_flags,
693                  uint16_t token,
694                  uint16_t mtu);
695
696 int dpni_get_mtu(struct fsl_mc_io *mc_io,
697                  uint32_t cmd_flags,
698                  uint16_t token,
699                  uint16_t *mtu);
700
701 int dpni_set_multicast_promisc(struct fsl_mc_io *mc_io,
702                                uint32_t cmd_flags,
703                                uint16_t token,
704                                int en);
705
706 int dpni_get_multicast_promisc(struct fsl_mc_io *mc_io,
707                                uint32_t cmd_flags,
708                                uint16_t token,
709                                int *en);
710
711 int dpni_set_unicast_promisc(struct fsl_mc_io *mc_io,
712                              uint32_t cmd_flags,
713                              uint16_t token,
714                              int en);
715
716 int dpni_get_unicast_promisc(struct fsl_mc_io *mc_io,
717                              uint32_t cmd_flags,
718                              uint16_t token,
719                              int *en);
720
721 int dpni_set_primary_mac_addr(struct fsl_mc_io *mc_io,
722                               uint32_t cmd_flags,
723                               uint16_t token,
724                               const uint8_t mac_addr[6]);
725
726 int dpni_get_primary_mac_addr(struct fsl_mc_io *mc_io,
727                               uint32_t cmd_flags,
728                               uint16_t token,
729                               uint8_t mac_addr[6]);
730
731 int dpni_add_mac_addr(struct fsl_mc_io *mc_io,
732                       uint32_t cmd_flags,
733                       uint16_t token,
734                       const uint8_t mac_addr[6]);
735
736 int dpni_remove_mac_addr(struct fsl_mc_io *mc_io,
737                          uint32_t cmd_flags,
738                          uint16_t token,
739                          const uint8_t mac_addr[6]);
740
741 int dpni_clear_mac_filters(struct fsl_mc_io *mc_io,
742                            uint32_t cmd_flags,
743                            uint16_t token,
744                            int unicast,
745                            int multicast);
746
747 int dpni_get_port_mac_addr(struct fsl_mc_io *mc_io,
748                            uint32_t cmd_flags,
749                            uint16_t token,
750                            uint8_t mac_addr[6]);
751
752 int dpni_enable_vlan_filter(struct fsl_mc_io *mc_io,
753                             uint32_t cmd_flags,
754                             uint16_t token,
755                             int en);
756
757 int dpni_add_vlan_id(struct fsl_mc_io *mc_io,
758                      uint32_t cmd_flags,
759                      uint16_t token,
760                      uint16_t vlan_id);
761
762 int dpni_remove_vlan_id(struct fsl_mc_io *mc_io,
763                         uint32_t cmd_flags,
764                         uint16_t token,
765                         uint16_t vlan_id);
766
767 int dpni_clear_vlan_filters(struct fsl_mc_io *mc_io,
768                             uint32_t cmd_flags,
769                             uint16_t token);
770
771 /**
772  * enum dpni_dist_mode - DPNI distribution mode
773  * @DPNI_DIST_MODE_NONE: No distribution
774  * @DPNI_DIST_MODE_HASH: Use hash distribution; only relevant if
775  *              the 'DPNI_OPT_DIST_HASH' option was set at DPNI creation
776  * @DPNI_DIST_MODE_FS:  Use explicit flow steering; only relevant if
777  *       the 'DPNI_OPT_DIST_FS' option was set at DPNI creation
778  */
779 enum dpni_dist_mode {
780         DPNI_DIST_MODE_NONE = 0,
781         DPNI_DIST_MODE_HASH = 1,
782         DPNI_DIST_MODE_FS = 2
783 };
784
785 /**
786  * enum dpni_fs_miss_action -   DPNI Flow Steering miss action
787  * @DPNI_FS_MISS_DROP: In case of no-match, drop the frame
788  * @DPNI_FS_MISS_EXPLICIT_FLOWID: In case of no-match, use explicit flow-id
789  * @DPNI_FS_MISS_HASH: In case of no-match, distribute using hash
790  */
791 enum dpni_fs_miss_action {
792         DPNI_FS_MISS_DROP = 0,
793         DPNI_FS_MISS_EXPLICIT_FLOWID = 1,
794         DPNI_FS_MISS_HASH = 2
795 };
796
797 /**
798  * struct dpni_fs_tbl_cfg - Flow Steering table configuration
799  * @miss_action:        Miss action selection
800  * @default_flow_id:    Used when 'miss_action = DPNI_FS_MISS_EXPLICIT_FLOWID'
801  * @keep_hash_key: used only when miss_action is set to DPNI_FS_MISS_HASH. When
802  *      set to one unclassified frames will be distributed according to previous
803  *      used hash key. If set to zero hash key will be replaced with the key
804  *      provided for flow steering.
805  * @keep_entries: if set to one command will not delete the entries that already
806  *      exist into FS table. Use this option with caution: if the table
807  *      entries are not compatible with the distribution key the packets
808  *      will not be classified properly.
809  */
810 struct dpni_fs_tbl_cfg {
811         enum dpni_fs_miss_action miss_action;
812         uint16_t default_flow_id;
813         char keep_hash_key;
814         uint8_t keep_entries;
815 };
816
817 /**
818  * struct dpni_rx_tc_dist_cfg - Rx traffic class distribution configuration
819  * @dist_size: Set the distribution size;
820  *      supported values: 1,2,3,4,6,7,8,12,14,16,24,28,32,48,56,64,96,
821  *      112,128,192,224,256,384,448,512,768,896,1024
822  * @dist_mode: Distribution mode
823  * @key_cfg_iova: I/O virtual address of 256 bytes DMA-able memory filled with
824  *              the extractions to be used for the distribution key by calling
825  *              dpkg_prepare_key_cfg() relevant only when
826  *              'dist_mode != DPNI_DIST_MODE_NONE', otherwise it can be '0'
827  * @fs_cfg: Flow Steering table configuration; only relevant if
828  *              'dist_mode = DPNI_DIST_MODE_FS'
829  */
830 struct dpni_rx_tc_dist_cfg {
831         uint16_t dist_size;
832         enum dpni_dist_mode dist_mode;
833         uint64_t key_cfg_iova;
834         struct dpni_fs_tbl_cfg fs_cfg;
835 };
836
837 int dpni_set_rx_tc_dist(struct fsl_mc_io *mc_io,
838                         uint32_t cmd_flags,
839                         uint16_t token,
840                         uint8_t tc_id,
841                         const struct dpni_rx_tc_dist_cfg *cfg);
842
843 /**
844  * enum dpni_congestion_unit - DPNI congestion units
845  * @DPNI_CONGESTION_UNIT_BYTES: bytes units
846  * @DPNI_CONGESTION_UNIT_FRAMES: frames units
847  */
848 enum dpni_congestion_unit {
849         DPNI_CONGESTION_UNIT_BYTES = 0,
850         DPNI_CONGESTION_UNIT_FRAMES
851 };
852
853
854 /**
855  * enum dpni_dest - DPNI destination types
856  * @DPNI_DEST_NONE: Unassigned destination; The queue is set in parked mode and
857  *              does not generate FQDAN notifications; user is expected to
858  *              dequeue from the queue based on polling or other user-defined
859  *              method
860  * @DPNI_DEST_DPIO: The queue is set in schedule mode and generates FQDAN
861  *              notifications to the specified DPIO; user is expected to dequeue
862  *              from the queue only after notification is received
863  * @DPNI_DEST_DPCON: The queue is set in schedule mode and does not generate
864  *              FQDAN notifications, but is connected to the specified DPCON
865  *              object; user is expected to dequeue from the DPCON channel
866  */
867 enum dpni_dest {
868         DPNI_DEST_NONE = 0,
869         DPNI_DEST_DPIO = 1,
870         DPNI_DEST_DPCON = 2
871 };
872
873 /**
874  * struct dpni_dest_cfg - Structure representing DPNI destination parameters
875  * @dest_type: Destination type
876  * @dest_id: Either DPIO ID or DPCON ID, depending on the destination type
877  * @priority: Priority selection within the DPIO or DPCON channel; valid values
878  *              are 0-1 or 0-7, depending on the number of priorities in that
879  *              channel; not relevant for 'DPNI_DEST_NONE' option
880  */
881 struct dpni_dest_cfg {
882         enum dpni_dest dest_type;
883         int dest_id;
884         uint8_t priority;
885 };
886
887 /* DPNI congestion options */
888
889 /**
890  * CSCN message is written to message_iova once entering a
891  * congestion state (see 'threshold_entry')
892  */
893 #define DPNI_CONG_OPT_WRITE_MEM_ON_ENTER        0x00000001
894 /**
895  * CSCN message is written to message_iova once exiting a
896  * congestion state (see 'threshold_exit')
897  */
898 #define DPNI_CONG_OPT_WRITE_MEM_ON_EXIT         0x00000002
899 /**
900  * CSCN write will attempt to allocate into a cache (coherent write);
901  * valid only if 'DPNI_CONG_OPT_WRITE_MEM_<X>' is selected
902  */
903 #define DPNI_CONG_OPT_COHERENT_WRITE            0x00000004
904 /**
905  * if 'dest_cfg.dest_type != DPNI_DEST_NONE' CSCN message is sent to
906  * DPIO/DPCON's WQ channel once entering a congestion state
907  * (see 'threshold_entry')
908  */
909 #define DPNI_CONG_OPT_NOTIFY_DEST_ON_ENTER      0x00000008
910 /**
911  * if 'dest_cfg.dest_type != DPNI_DEST_NONE' CSCN message is sent to
912  * DPIO/DPCON's WQ channel once exiting a congestion state
913  * (see 'threshold_exit')
914  */
915 #define DPNI_CONG_OPT_NOTIFY_DEST_ON_EXIT       0x00000010
916 /**
917  * if 'dest_cfg.dest_type != DPNI_DEST_NONE' when the CSCN is written to the
918  * sw-portal's DQRR, the DQRI interrupt is asserted immediately (if enabled)
919  */
920 #define DPNI_CONG_OPT_INTR_COALESCING_DISABLED  0x00000020
921 /**
922  * This congestion will trigger flow control or priority flow control. This
923  * will have effect only if flow control is enabled with dpni_set_link_cfg()
924  */
925 #define DPNI_CONG_OPT_FLOW_CONTROL      0x00000040
926
927 /**
928  * struct dpni_congestion_notification_cfg - congestion notification
929  *              configuration
930  * @units: units type
931  * @threshold_entry: above this threshold we enter a congestion state.
932  *      set it to '0' to disable it
933  * @threshold_exit: below this threshold we exit the congestion state.
934  * @message_ctx: The context that will be part of the CSCN message
935  * @message_iova: I/O virtual address (must be in DMA-able memory),
936  *      must be 16B aligned; valid only if 'DPNI_CONG_OPT_WRITE_MEM_<X>' is
937  *      contained in 'options'
938  * @dest_cfg: CSCN can be send to either DPIO or DPCON WQ channel
939  * @notification_mode: Mask of available options; use 'DPNI_CONG_OPT_<X>' values
940  */
941
942 struct dpni_congestion_notification_cfg {
943         enum dpni_congestion_unit units;
944         uint32_t threshold_entry;
945         uint32_t threshold_exit;
946         uint64_t message_ctx;
947         uint64_t message_iova;
948         struct dpni_dest_cfg dest_cfg;
949         uint16_t notification_mode;
950 };
951
952 int dpni_set_congestion_notification(struct fsl_mc_io *mc_io,
953                                      uint32_t cmd_flags,
954                                      uint16_t token,
955                                      enum dpni_queue_type qtype,
956                                      uint8_t tc_id,
957                         const struct dpni_congestion_notification_cfg *cfg);
958
959 int dpni_get_congestion_notification(struct fsl_mc_io *mc_io,
960                                      uint32_t cmd_flags,
961                                      uint16_t token,
962                                      enum dpni_queue_type qtype,
963                                      uint8_t tc_id,
964                                 struct dpni_congestion_notification_cfg *cfg);
965
966 /* DPNI FLC stash options */
967
968 /**
969  * stashes the whole annotation area (up to 192 bytes)
970  */
971 #define DPNI_FLC_STASH_FRAME_ANNOTATION 0x00000001
972
973 /**
974  * struct dpni_queue - Queue structure
975  * @destination - Destination structure
976  * @destination.id: ID of the destination, only relevant if DEST_TYPE is > 0.
977  *      Identifies either a DPIO or a DPCON object.
978  *      Not relevant for Tx queues.
979  * @destination.type:   May be one of the following:
980  *      0 - No destination, queue can be manually
981  *              queried, but will not push traffic or
982  *              notifications to a DPIO;
983  *      1 - The destination is a DPIO. When traffic
984  *              becomes available in the queue a FQDAN
985  *              (FQ data available notification) will be
986  *              generated to selected DPIO;
987  *      2 - The destination is a DPCON. The queue is
988  *              associated with a DPCON object for the
989  *              purpose of scheduling between multiple
990  *              queues. The DPCON may be independently
991  *              configured to generate notifications.
992  *              Not relevant for Tx queues.
993  * @destination.hold_active: Hold active, maintains a queue scheduled for longer
994  *      in a DPIO during dequeue to reduce spread of traffic.
995  *      Only relevant if queues are
996  *      not affined to a single DPIO.
997  * @user_context: User data, presented to the user along with any frames
998  *      from this queue. Not relevant for Tx queues.
999  * @flc: FD FLow Context structure
1000  * @flc.value: Default FLC value for traffic dequeued from
1001  *      this queue.  Please check description of FD
1002  *      structure for more information.
1003  *      Note that FLC values set using dpni_add_fs_entry,
1004  *      if any, take precedence over values per queue.
1005  * @flc.stash_control: Boolean, indicates whether the 6 lowest
1006  *      - significant bits are used for stash control.
1007  *      significant bits are used for stash control.  If set, the 6
1008  *      least significant bits in value are interpreted as follows:
1009  *      - bits 0-1: indicates the number of 64 byte units of context
1010  *      that are stashed.  FLC value is interpreted as a memory address
1011  *      in this case, excluding the 6 LS bits.
1012  *      - bits 2-3: indicates the number of 64 byte units of frame
1013  *      annotation to be stashed.  Annotation is placed at FD[ADDR].
1014  *      - bits 4-5: indicates the number of 64 byte units of frame
1015  *      data to be stashed.  Frame data is placed at FD[ADDR] +
1016  *      FD[OFFSET].
1017  *      For more details check the Frame Descriptor section in the
1018  *      hardware documentation.
1019  */
1020 struct dpni_queue {
1021         struct {
1022                 uint16_t id;
1023                 enum dpni_dest type;
1024                 char hold_active;
1025                 uint8_t priority;
1026         } destination;
1027         uint64_t user_context;
1028         struct {
1029                 uint64_t value;
1030                 char stash_control;
1031         } flc;
1032 };
1033
1034 /**
1035  * struct dpni_queue_id - Queue identification, used for enqueue commands
1036  *                              or queue control
1037  * @fqid:       FQID used for enqueueing to and/or configuration of this
1038  *                      specific FQ
1039  * @qdbin:      Queueing bin, used to enqueue using QDID, DQBIN, QPRI.
1040  *                      Only relevant for Tx queues.
1041  */
1042 struct dpni_queue_id {
1043         uint32_t fqid;
1044         uint16_t qdbin;
1045 };
1046
1047 /**
1048  * enum dpni_confirmation_mode - Defines DPNI options supported for Tx
1049  * confirmation
1050  * @DPNI_CONF_AFFINE: For each Tx queue set associated with a sender there is
1051  * an affine Tx Confirmation queue
1052  * @DPNI_CONF_SINGLE: All Tx queues are associated with a single Tx
1053  * confirmation queue
1054  * @DPNI_CONF_DISABLE: Tx frames are not confirmed.  This must be associated
1055  * with proper FD set-up to have buffers release to a Buffer Pool, otherwise
1056  * buffers will be leaked
1057  */
1058 enum dpni_confirmation_mode {
1059         DPNI_CONF_AFFINE,
1060         DPNI_CONF_SINGLE,
1061         DPNI_CONF_DISABLE,
1062 };
1063
1064 int dpni_set_tx_confirmation_mode(struct fsl_mc_io *mc_io,
1065                                   uint32_t cmd_flags,
1066                                   uint16_t token,
1067                                   enum dpni_confirmation_mode mode);
1068
1069 int dpni_get_tx_confirmation_mode(struct fsl_mc_io *mc_io,
1070                                   uint32_t cmd_flags,
1071                                   uint16_t token,
1072                                   enum dpni_confirmation_mode *mode);
1073
1074 int dpni_get_api_version(struct fsl_mc_io *mc_io,
1075                          uint32_t cmd_flags,
1076                          uint16_t *major_ver,
1077                          uint16_t *minor_ver);
1078
1079 /**
1080  * Set User Context
1081  */
1082 #define DPNI_QUEUE_OPT_USER_CTX         0x00000001
1083
1084 /**
1085  * Set queue destination configuration
1086  */
1087 #define DPNI_QUEUE_OPT_DEST             0x00000002
1088
1089 /**
1090  * Set FD[FLC] configuration for traffic on this queue.  Note that FLC values
1091  * set with dpni_add_fs_entry, if any, take precedence over values per queue.
1092  */
1093 #define DPNI_QUEUE_OPT_FLC              0x00000004
1094
1095 /**
1096  * Set the queue to hold active mode.  This prevents the queue from being
1097  * rescheduled between DPIOs while it carries traffic and is active on one
1098  * DPNI.  Can help reduce reordering when servicing one queue on multiple
1099  * CPUs, but the queue is also less likely to push data to multiple CPUs
1100  * especially when congested.
1101  */
1102 #define DPNI_QUEUE_OPT_HOLD_ACTIVE      0x00000008
1103
1104 int dpni_set_queue(struct fsl_mc_io *mc_io,
1105                    uint32_t cmd_flags,
1106                    uint16_t token,
1107                    enum dpni_queue_type qtype,
1108                    uint8_t tc,
1109                    uint8_t index,
1110                    uint8_t options,
1111                    const struct dpni_queue *queue);
1112
1113 int dpni_get_queue(struct fsl_mc_io *mc_io,
1114                    uint32_t cmd_flags,
1115                    uint16_t token,
1116                    enum dpni_queue_type qtype,
1117                    uint8_t tc,
1118                    uint8_t index,
1119                    struct dpni_queue *queue,
1120                    struct dpni_queue_id *qid);
1121
1122 int dpni_get_statistics(struct fsl_mc_io *mc_io,
1123                         uint32_t cmd_flags,
1124                         uint16_t token,
1125                         uint8_t page,
1126                         uint8_t param,
1127                         union dpni_statistics *stat);
1128
1129 int dpni_reset_statistics(struct fsl_mc_io *mc_io,
1130                           uint32_t cmd_flags,
1131                           uint16_t token);
1132
1133 /**
1134  * enum dpni_congestion_point - Structure representing congestion point
1135  * @DPNI_CP_QUEUE:      Set taildrop per queue, identified by QUEUE_TYPE, TC and
1136  *                              QUEUE_INDEX
1137  * @DPNI_CP_GROUP:      Set taildrop per queue group. Depending on options used
1138  *                              to define the DPNI this can be either per
1139  *                              TC (default) or per interface
1140  *                              (DPNI_OPT_SHARED_CONGESTION set at DPNI create).
1141  *                              QUEUE_INDEX is ignored if this type is used.
1142  */
1143 enum dpni_congestion_point {
1144         DPNI_CP_QUEUE,
1145         DPNI_CP_GROUP,
1146 };
1147
1148 /**
1149  * struct dpni_taildrop - Structure representing the taildrop
1150  * @enable:     Indicates whether the taildrop is active or not.
1151  * @units:      Indicates the unit of THRESHOLD. Queue taildrop only
1152  *              supports byte units, this field is ignored and
1153  *              assumed = 0 if CONGESTION_POINT is 0.
1154  * @threshold:  Threshold value, in units identified by UNITS field. Value 0
1155  *              cannot be used as a valid taildrop threshold,
1156  *              THRESHOLD must be > 0 if the taildrop is
1157  *              enabled.
1158  * @oal :       Overhead Accounting Length, a 12-bit, 2's complement value
1159  *              with range (-2048 to +2047) representing a fixed per-frame
1160  *              overhead to be added to the actual length of a frame when
1161  *              performing WRED and tail drop calculations and threshold
1162  *              comparisons.
1163  */
1164 struct dpni_taildrop {
1165         char enable;
1166         enum dpni_congestion_unit units;
1167         uint32_t threshold;
1168         int16_t oal;
1169 };
1170
1171 int dpni_set_taildrop(struct fsl_mc_io *mc_io,
1172                       uint32_t cmd_flags,
1173                       uint16_t token,
1174                       enum dpni_congestion_point cg_point,
1175                       enum dpni_queue_type q_type,
1176                       uint8_t tc,
1177                       uint8_t q_index,
1178                       struct dpni_taildrop *taildrop);
1179
1180 int dpni_get_taildrop(struct fsl_mc_io *mc_io,
1181                       uint32_t cmd_flags,
1182                       uint16_t token,
1183                       enum dpni_congestion_point cg_point,
1184                       enum dpni_queue_type q_type,
1185                       uint8_t tc,
1186                       uint8_t q_index,
1187                       struct dpni_taildrop *taildrop);
1188
1189 int dpni_set_opr(struct fsl_mc_io *mc_io,
1190                  uint32_t cmd_flags,
1191                  uint16_t token,
1192                  uint8_t tc,
1193                  uint8_t index,
1194                  uint8_t options,
1195                  struct opr_cfg *cfg);
1196
1197 int dpni_get_opr(struct fsl_mc_io *mc_io,
1198                  uint32_t cmd_flags,
1199                  uint16_t token,
1200                  uint8_t tc,
1201                  uint8_t index,
1202                  struct opr_cfg *cfg,
1203                  struct opr_qry *qry);
1204
1205 #endif /* __FSL_DPNI_H */