40 #include <sys/queue.h>
44 struct rte_vdev_device {
45 TAILQ_ENTRY(rte_vdev_device) next;
53 #define RTE_DEV_TO_VDEV(ptr) \
54 container_of(ptr, struct rte_vdev_device, device)
56 static inline const char *
57 rte_vdev_device_name(
const struct rte_vdev_device *dev)
59 if (dev && dev->device.name)
60 return dev->device.name;
64 static inline const char *
65 rte_vdev_device_args(
const struct rte_vdev_device *dev)
67 if (dev && dev->device.devargs)
68 return dev->device.devargs->args;
78 typedef int (rte_vdev_probe_t)(
struct rte_vdev_device *dev);
83 typedef int (rte_vdev_remove_t)(
struct rte_vdev_device *dev);
92 rte_vdev_remove_t *
remove;
113 #define RTE_PMD_REGISTER_VDEV(nm, vdrv)\
114 RTE_INIT(vdrvinitfn_ ##vdrv);\
115 static const char *vdrvinit_ ## nm ## _alias;\
116 static void vdrvinitfn_ ##vdrv(void)\
118 (vdrv).driver.name = RTE_STR(nm);\
119 (vdrv).driver.alias = vdrvinit_ ## nm ## _alias;\
120 rte_vdev_register(&vdrv);\
122 RTE_PMD_EXPORT_NAME(nm, __COUNTER__)
124 #define RTE_PMD_REGISTER_ALIAS(nm, alias)\
125 static const char *vdrvinit_ ## nm ## _alias = RTE_STR(alias)