drivers: use PCI registration macro
[dpdk.git] / lib / librte_cryptodev / rte_cryptodev.c
index ea75562..f591711 100644 (file)
@@ -318,7 +318,7 @@ rte_cryptodev_find_free_device_index(void)
 }
 
 struct rte_cryptodev *
-rte_cryptodev_pmd_allocate(const char *name, enum pmd_type type, int socket_id)
+rte_cryptodev_pmd_allocate(const char *name, int socket_id)
 {
        struct rte_cryptodev *cryptodev;
        uint8_t dev_id;
@@ -357,7 +357,6 @@ rte_cryptodev_pmd_allocate(const char *name, enum pmd_type type, int socket_id)
                cryptodev->data->dev_started = 0;
 
                cryptodev->attached = RTE_CRYPTODEV_ATTACHED;
-               cryptodev->pmd_type = type;
 
                cryptodev_globals.nb_devs++;
        }
@@ -406,7 +405,7 @@ rte_cryptodev_pmd_virtual_dev_init(const char *name, size_t dev_private_size,
        struct rte_cryptodev *cryptodev;
 
        /* allocate device structure */
-       cryptodev = rte_cryptodev_pmd_allocate(name, PMD_VDEV, socket_id);
+       cryptodev = rte_cryptodev_pmd_allocate(name, socket_id);
        if (cryptodev == NULL)
                return NULL;
 
@@ -429,9 +428,9 @@ rte_cryptodev_pmd_virtual_dev_init(const char *name, size_t dev_private_size,
        return cryptodev;
 }
 
-static int
-rte_cryptodev_init(struct rte_pci_driver *pci_drv,
-               struct rte_pci_device *pci_dev)
+int
+rte_cryptodev_pci_probe(struct rte_pci_driver *pci_drv,
+                       struct rte_pci_device *pci_dev)
 {
        struct rte_cryptodev_driver *cryptodrv;
        struct rte_cryptodev *cryptodev;
@@ -448,8 +447,7 @@ rte_cryptodev_init(struct rte_pci_driver *pci_drv,
        rte_cryptodev_create_unique_device_name(cryptodev_name,
                        sizeof(cryptodev_name), pci_dev);
 
-       cryptodev = rte_cryptodev_pmd_allocate(cryptodev_name, PMD_PDEV,
-                       rte_socket_id());
+       cryptodev = rte_cryptodev_pmd_allocate(cryptodev_name, rte_socket_id());
        if (cryptodev == NULL)
                return -ENOMEM;
 
@@ -491,8 +489,8 @@ rte_cryptodev_init(struct rte_pci_driver *pci_drv,
        return -ENXIO;
 }
 
-static int
-rte_cryptodev_uninit(struct rte_pci_device *pci_dev)
+int
+rte_cryptodev_pci_remove(struct rte_pci_device *pci_dev)
 {
        const struct rte_cryptodev_driver *cryptodrv;
        struct rte_cryptodev *cryptodev;
@@ -534,28 +532,6 @@ rte_cryptodev_uninit(struct rte_pci_device *pci_dev)
        return 0;
 }
 
-int
-rte_cryptodev_pmd_driver_register(struct rte_cryptodev_driver *cryptodrv,
-               enum pmd_type type)
-{
-       /* Call crypto device initialization directly if device is virtual */
-       if (type == PMD_VDEV)
-               return rte_cryptodev_init((struct rte_pci_driver *)cryptodrv,
-                               NULL);
-
-       /*
-        * Register PCI driver for physical device intialisation during
-        * PCI probing
-        */
-       cryptodrv->pci_drv.probe = rte_cryptodev_init;
-       cryptodrv->pci_drv.remove = rte_cryptodev_uninit;
-
-       rte_eal_pci_register(&cryptodrv->pci_drv);
-
-       return 0;
-}
-
-
 uint16_t
 rte_cryptodev_queue_pair_count(uint8_t dev_id)
 {