* PCI test
* ========
*
- * - Register a driver with a ``devinit()`` function.
+ * - Register a driver with a ``probe()`` function.
*
* - Dump all PCI devices.
*
- * - Check that the ``devinit()`` function is called at least once.
+ * - Check that the ``probe()`` function is called at least once.
*/
int test_pci_run = 0; /* value checked by the multiprocess test */
struct rte_pci_driver my_driver = {
.name = "test_driver",
- .devinit = my_driver_init,
+ .probe = my_driver_init,
.id_table = my_driver_id,
.drv_flags = 0,
};
struct rte_pci_driver my_driver2 = {
.name = "test_driver2",
- .devinit = my_driver_init,
+ .probe = my_driver_init,
.id_table = my_driver_id2,
.drv_flags = 0,
};
* 0 on success, negative errno value on failure.
*/
static int
-mlx4_pci_devinit(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
+mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
{
struct ibv_device **list;
struct ibv_device *ibv_dev;
.pci_drv = {
.name = MLX4_DRIVER_NAME,
.id_table = mlx4_pci_id_map,
- .devinit = mlx4_pci_devinit,
+ .probe = mlx4_pci_probe,
.drv_flags = RTE_PCI_DRV_INTR_LSC,
},
.dev_private_size = sizeof(struct priv)
* 0 on success, negative errno value on failure.
*/
static int
-mlx5_pci_devinit(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
+mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
{
struct ibv_device **list;
struct ibv_device *ibv_dev;
.pci_drv = {
.name = MLX5_DRIVER_NAME,
.id_table = mlx5_pci_id_map,
- .devinit = mlx5_pci_devinit,
+ .probe = mlx5_pci_probe,
.drv_flags = RTE_PCI_DRV_INTR_LSC,
},
.dev_private_size = sizeof(struct priv)
* Register PCI driver for physical device intialisation during
* PCI probing
*/
- cryptodrv->pci_drv.devinit = rte_cryptodev_init;
- cryptodrv->pci_drv.devuninit = rte_cryptodev_uninit;
+ cryptodrv->pci_drv.probe = rte_cryptodev_init;
+ cryptodrv->pci_drv.remove = rte_cryptodev_uninit;
rte_eal_pci_register(&cryptodrv->pci_drv);
* device, by invoking the rte_eal_pci_register() function to
* register the *pci_drv* structure embedded in the *crypto_drv*
* structure, after having stored the address of the
- * rte_cryptodev_init() function in the *devinit* field of the
+ * rte_cryptodev_init() function in the *probe* field of the
* *pci_drv* structure.
*
* During the PCI probing phase, the rte_cryptodev_init()
}
/*
- * If vendor/device ID match, call the devinit() function of the
+ * If vendor/device ID match, call the probe() function of the
* driver.
*/
static int
/* reference driver structure */
dev->driver = dr;
- /* call the driver devinit() function */
- return dr->devinit(dr, dev);
+ /* call the driver probe() function */
+ return dr->probe(dr, dev);
}
/* return positive value if driver doesn't support this device */
return 1;
}
/*
- * If vendor/device ID match, call the devuninit() function of the
+ * If vendor/device ID match, call the remove() function of the
* driver.
*/
static int
RTE_LOG(DEBUG, EAL, " remove driver: %x:%x %s\n", dev->id.vendor_id,
dev->id.device_id, dr->name);
- if (dr->devuninit && (dr->devuninit(dev) < 0))
+ if (dr->remove && (dr->remove(dev) < 0))
return -1; /* negative value is an error */
/* clear driver structure */
}
/*
- * If vendor/device ID match, call the devinit() function of all
+ * If vendor/device ID match, call the probe() function of all
* registered driver for the given device. Return -1 if initialization
* failed, return 1 if no driver is found for this device.
*/
}
/*
- * If vendor/device ID match, call the devuninit() function of all
+ * If vendor/device ID match, call the remove() function of all
* registered driver for the given device. Return -1 if initialization
* failed, return 1 if no driver is found for this device.
*/
}
/*
- * Scan the content of the PCI bus, and call the devinit() function for
+ * Scan the content of the PCI bus, and call the probe() function for
* all registered drivers that have a matching entry in its id_table
* for discovered devices.
*/
__attribute__((used)) = RTE_STR(name)
#define PMD_REGISTER_DRIVER(drv, nm)\
-void devinitfn_ ##drv(void);\
-void __attribute__((constructor, used)) devinitfn_ ##drv(void)\
+void probefn_ ##drv(void);\
+void __attribute__((constructor, used)) probefn_ ##drv(void)\
{\
(drv).name = RTE_STR(nm);\
rte_eal_driver_register(&drv);\
/**
* Initialisation function for the driver called during PCI probing.
*/
-typedef int (pci_devinit_t)(struct rte_pci_driver *, struct rte_pci_device *);
+typedef int (pci_probe_t)(struct rte_pci_driver *, struct rte_pci_device *);
/**
* Uninitialisation function for the driver called during hotplugging.
*/
-typedef int (pci_devuninit_t)(struct rte_pci_device *);
+typedef int (pci_remove_t)(struct rte_pci_device *);
/**
* A structure describing a PCI driver.
struct rte_pci_driver {
TAILQ_ENTRY(rte_pci_driver) next; /**< Next in list. */
const char *name; /**< Driver name. */
- pci_devinit_t *devinit; /**< Device init. function. */
- pci_devuninit_t *devuninit; /**< Device uninit function. */
+ pci_probe_t *probe; /**< Device Probe function. */
+ pci_remove_t *remove; /**< Device Remove function. */
const struct rte_pci_id *id_table; /**< ID table, NULL terminated. */
uint32_t drv_flags; /**< Flags contolling handling of device. */
};
* Close the single PCI device.
*
* Scan the content of the PCI bus, and find the pci device specified by pci
- * address, then call the devuninit() function for registered driver that has a
+ * address, then call the remove() function for registered driver that has a
* matching entry in its id_table for discovered device.
*
* @param addr
* Poll Mode Driver.
* Invokes the rte_eal_pci_register() function to register the *pci_drv*
* structure embedded in the *eth_drv* structure, after having stored the
- * address of the rte_eth_dev_init() function in the *devinit* field of
+ * address of the rte_eth_dev_init() function in the *probe* field of
* the *pci_drv* structure.
* During the PCI probing phase, the rte_eth_dev_init() function is
* invoked for each PCI [Ethernet device] matching the embedded PCI
void
rte_eth_driver_register(struct eth_driver *eth_drv)
{
- eth_drv->pci_drv.devinit = rte_eth_dev_init;
- eth_drv->pci_drv.devuninit = rte_eth_dev_uninit;
+ eth_drv->pci_drv.probe = rte_eth_dev_init;
+ eth_drv->pci_drv.remove = rte_eth_dev_uninit;
rte_eal_pci_register(ð_drv->pci_drv);
}
if (rte_eal_compare_pci_addr(&vp, &freed_addr) == 0)
goto err;
- /* invoke devuninit func of the pci driver,
+ /* invoke remove func of the pci driver,
* also remove the device from pci_device_list */
if (rte_eal_pci_detach(&freed_addr))
goto err;