New upstream version 18.11-rc1
[deb_dpdk.git] / drivers / bus / fslmc / mc / fsl_dpci.h
index f69ed3f..9af9097 100644 (file)
@@ -6,6 +6,8 @@
 #ifndef __FSL_DPCI_H
 #define __FSL_DPCI_H
 
+#include <fsl_dpopr.h>
+
 /* Data Path Communication Interface API
  * Contains initialization APIs and runtime control APIs for DPCI
  */
@@ -17,7 +19,7 @@ struct fsl_mc_io;
 /**
  * Maximum number of Tx/Rx priorities per DPCI object
  */
-#define DPCI_PRIO_NUM          2
+#define DPCI_PRIO_NUM          4
 
 /**
  * Indicates an invalid frame queue
@@ -106,6 +108,27 @@ int dpci_get_attributes(struct fsl_mc_io *mc_io,
                        uint16_t token,
                        struct dpci_attr *attr);
 
+/**
+ * struct dpci_peer_attr - Structure representing the peer DPCI attributes
+ * @peer_id:           DPCI peer id; if no peer is connected returns (-1)
+ * @num_of_priorities: The pper's number of receive priorities; determines the
+ *                     number of transmit priorities for the local DPCI object
+ */
+struct dpci_peer_attr {
+       int peer_id;
+       uint8_t num_of_priorities;
+};
+
+int dpci_get_peer_attributes(struct fsl_mc_io *mc_io,
+                            uint32_t cmd_flags,
+                            uint16_t token,
+                            struct dpci_peer_attr *attr);
+
+int dpci_get_link_state(struct fsl_mc_io *mc_io,
+                       uint32_t cmd_flags,
+                       uint16_t token,
+                       int *up);
+
 /**
  * enum dpci_dest - DPCI destination types
  * @DPCI_DEST_NONE:    Unassigned destination; The queue is set in parked mode
@@ -153,6 +176,11 @@ struct dpci_dest_cfg {
  */
 #define DPCI_QUEUE_OPT_DEST            0x00000002
 
+/**
+ * Set the queue to hold active mode.
+ */
+#define DPCI_QUEUE_OPT_HOLD_ACTIVE     0x00000004
+
 /**
  * struct dpci_rx_queue_cfg - Structure representing RX queue configuration
  * @options:   Flags representing the suggested modifications to the queue;
@@ -163,11 +191,14 @@ struct dpci_dest_cfg {
  *             'options'
  * @dest_cfg:  Queue destination parameters;
  *             valid only if 'DPCI_QUEUE_OPT_DEST' is contained in 'options'
+ * @order_preservation_en: order preservation configuration for the rx queue
+ * valid only if 'DPCI_QUEUE_OPT_HOLD_ACTIVE' is contained in 'options'
  */
 struct dpci_rx_queue_cfg {
        uint32_t options;
        uint64_t user_ctx;
        struct dpci_dest_cfg dest_cfg;
+       int order_preservation_en;
 };
 
 int dpci_set_rx_queue(struct fsl_mc_io *mc_io,
@@ -217,4 +248,18 @@ int dpci_get_api_version(struct fsl_mc_io *mc_io,
                         uint16_t *major_ver,
                         uint16_t *minor_ver);
 
+int dpci_set_opr(struct fsl_mc_io *mc_io,
+                uint32_t cmd_flags,
+                uint16_t token,
+                uint8_t index,
+                uint8_t options,
+                struct opr_cfg *cfg);
+
+int dpci_get_opr(struct fsl_mc_io *mc_io,
+                uint32_t cmd_flags,
+                uint16_t token,
+                uint8_t index,
+                struct opr_cfg *cfg,
+                struct opr_qry *qry);
+
 #endif /* __FSL_DPCI_H */