cryptodev: move vdev functions to a separate file
[dpdk.git] / drivers / crypto / null / null_crypto_pmd.c
index 023450a..53bdc3e 100644 (file)
@@ -33,6 +33,7 @@
 #include <rte_common.h>
 #include <rte_config.h>
 #include <rte_cryptodev_pmd.h>
+#include <rte_cryptodev_vdev.h>
 #include <rte_vdev.h>
 #include <rte_malloc.h>
 
@@ -166,6 +167,7 @@ static int cryptodev_null_remove(const char *name);
 /** Create crypto device */
 static int
 cryptodev_null_create(const char *name,
+               struct rte_vdev_device *vdev,
                struct rte_crypto_vdev_init_params *init_params)
 {
        struct rte_cryptodev *dev;
@@ -175,9 +177,10 @@ cryptodev_null_create(const char *name,
                snprintf(init_params->name, sizeof(init_params->name),
                                "%s", name);
 
-       dev = rte_cryptodev_pmd_virtual_dev_init(init_params->name,
+       dev = rte_cryptodev_vdev_pmd_init(init_params->name,
                        sizeof(struct null_crypto_private),
-                       init_params->socket_id);
+                       init_params->socket_id,
+                       vdev);
        if (dev == NULL) {
                NULL_CRYPTO_LOG_ERR("failed to create cryptodev vdev");
                goto init_error;
@@ -235,7 +238,7 @@ cryptodev_null_probe(struct rte_vdev_device *dev)
        RTE_LOG(INFO, PMD, "  Max number of sessions = %d\n",
                        init_params.max_nb_sessions);
 
-       return cryptodev_null_create(name, &init_params);
+       return cryptodev_null_create(name, dev, &init_params);
 }
 
 /** Uninitialise null crypto device */