dmadev: add device iterator
[dpdk.git] / drivers / crypto / bcmfs / bcmfs_device.h
index 1a4d0cf..e5ca866 100644 (file)
@@ -8,9 +8,11 @@
 
 #include <sys/queue.h>
 
+#include <rte_spinlock.h>
 #include <rte_bus_vdev.h>
 
 #include "bcmfs_logs.h"
+#include "bcmfs_qp.h"
 
 /* max number of dev nodes */
 #define BCMFS_MAX_NODES                4
@@ -30,6 +32,19 @@ enum bcmfs_device_type {
        BCMFS_UNKNOWN
 };
 
+/* A table to store registered queue pair opertations */
+struct bcmfs_hw_queue_pair_ops_table {
+       rte_spinlock_t tl;
+       /* Number of used ops structs in the table. */
+       uint32_t num_ops;
+        /*  Storage for all possible ops structs. */
+       struct bcmfs_hw_queue_pair_ops qp_ops[BCMFS_MAX_NODES];
+};
+
+/* HW queue pair ops register function */
+int
+bcmfs_hw_queue_pair_register_ops(const struct bcmfs_hw_queue_pair_ops *qp_ops);
+
 struct bcmfs_device {
        TAILQ_ENTRY(bcmfs_device) next;
        /* Directory path for vfio */
@@ -38,6 +53,24 @@ struct bcmfs_device {
        char name[BCMFS_DEV_NAME_LEN];
        /* Parent vdev */
        struct rte_vdev_device *vdev;
+       /* vfio handle */
+       int vfio_dev_fd;
+       /* mapped address */
+       uint8_t *mmap_addr;
+       /* mapped size */
+       uint32_t mmap_size;
+       /* max number of h/w queue pairs detected */
+       uint16_t max_hw_qps;
+       /* current qpairs in use */
+       struct bcmfs_qp *qps_in_use[BCMFS_MAX_HW_QUEUES];
+       /* queue pair ops exported by symmetric crypto hw */
+       struct bcmfs_hw_queue_pair_ops *sym_hw_qp_ops;
+       /* a cryptodevice attached to bcmfs device */
+       struct rte_cryptodev *cdev;
+       /* a rte_device to register with cryptodev */
+       struct rte_device sym_rte_dev;
+       /* private info to keep with cryptodev */
+       struct bcmfs_sym_dev_private *sym_dev;
 };
 
 #endif /* _BCMFS_DEVICE_H_ */