drivers: rename register macro prefix
[dpdk.git] / drivers / crypto / null / null_crypto_pmd.c
index a4bb152..a7d3600 100644 (file)
@@ -33,7 +33,7 @@
 #include <rte_common.h>
 #include <rte_config.h>
 #include <rte_cryptodev_pmd.h>
-#include <rte_dev.h>
+#include <rte_vdev.h>
 #include <rte_malloc.h>
 
 #include "null_crypto_pmd_private.h"
@@ -51,7 +51,7 @@ create_unique_device_name(char *name, size_t size)
        if (name == NULL)
                return -EINVAL;
 
-       ret = snprintf(name, size, "%s_%u", CRYPTODEV_NAME_NULL_PMD,
+       ret = snprintf(name, size, "%s_%u", RTE_STR(CRYPTODEV_NAME_NULL_PMD),
                        unique_name_id++);
        if (ret < 0)
                return ret;
@@ -114,9 +114,9 @@ get_session(struct null_crypto_qp *qp, struct rte_crypto_sym_op *op)
 {
        struct null_crypto_session *sess;
 
-       if (op->type == RTE_CRYPTO_SYM_OP_WITH_SESSION) {
+       if (op->sess_type == RTE_CRYPTO_SYM_OP_WITH_SESSION) {
                if (unlikely(op->session == NULL ||
-                               op->session->type != RTE_CRYPTODEV_NULL_PMD))
+                            op->session->dev_type != RTE_CRYPTODEV_NULL_PMD))
                        return NULL;
 
                sess = (struct null_crypto_session *)op->session->_private;
@@ -182,7 +182,7 @@ null_crypto_pmd_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops,
        return nb_dequeued;
 }
 
-static int cryptodev_null_uninit(const char *name);
+static int cryptodev_null_remove(const char *name);
 
 /** Create crypto device */
 static int
@@ -215,6 +215,9 @@ cryptodev_null_create(const char *name,
        dev->dequeue_burst = null_crypto_pmd_dequeue_burst;
        dev->enqueue_burst = null_crypto_pmd_enqueue_burst;
 
+       dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO |
+                       RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING;
+
        internals = dev->data->dev_private;
 
        internals->max_nb_qpairs = init_params->max_nb_queue_pairs;
@@ -224,14 +227,14 @@ cryptodev_null_create(const char *name,
 
 init_error:
        NULL_CRYPTO_LOG_ERR("driver %s: cryptodev_null_create failed", name);
-       cryptodev_null_uninit(crypto_dev_name);
+       cryptodev_null_remove(crypto_dev_name);
 
        return -EFAULT;
 }
 
 /** Initialise null crypto device */
 static int
-cryptodev_null_init(const char *name,
+cryptodev_null_probe(const char *name,
                const char *input_args)
 {
        struct rte_crypto_vdev_init_params init_params = {
@@ -254,7 +257,7 @@ cryptodev_null_init(const char *name,
 
 /** Uninitialise null crypto device */
 static int
-cryptodev_null_uninit(const char *name)
+cryptodev_null_remove(const char *name)
 {
        if (name == NULL)
                return -EINVAL;
@@ -265,11 +268,13 @@ cryptodev_null_uninit(const char *name)
        return 0;
 }
 
-static struct rte_driver cryptodev_null_pmd_drv = {
-       .name = CRYPTODEV_NAME_NULL_PMD,
-       .type = PMD_VDEV,
-       .init = cryptodev_null_init,
-       .uninit = cryptodev_null_uninit
+static struct rte_vdev_driver cryptodev_null_pmd_drv = {
+       .probe = cryptodev_null_probe,
+       .remove = cryptodev_null_remove
 };
 
-PMD_REGISTER_DRIVER(cryptodev_null_pmd_drv);
+RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_NULL_PMD, cryptodev_null_pmd_drv);
+RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_NULL_PMD,
+       "max_nb_queue_pairs=<int> "
+       "max_nb_sessions=<int> "
+       "socket_id=<int>");