pci: remove virtio-specific attach functions
As a part of cleanup they're replaced by a device-agnostic attach API, which is easier for us to manage. Change-Id: I2ec68f20ba209f02ee5c2de4b6fe5330a4bc0853 Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-on: https://review.gerrithub.io/436480 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
41130653b7
commit
76a7517caa
@ -633,6 +633,13 @@ struct spdk_pci_driver *spdk_pci_nvme_get_driver(void);
|
|||||||
*/
|
*/
|
||||||
struct spdk_pci_driver *spdk_pci_ioat_get_driver(void);
|
struct spdk_pci_driver *spdk_pci_ioat_get_driver(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Virtio PCI driver object.
|
||||||
|
*
|
||||||
|
* \return PCI driver.
|
||||||
|
*/
|
||||||
|
struct spdk_pci_driver *spdk_pci_virtio_get_driver(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enumerate all PCI devices supported by the provided driver and try to
|
* Enumerate all PCI devices supported by the provided driver and try to
|
||||||
* attach those that weren't attached yet. The provided callback will be
|
* attach those that weren't attached yet. The provided callback will be
|
||||||
@ -653,14 +660,6 @@ struct spdk_pci_driver *spdk_pci_ioat_get_driver(void);
|
|||||||
*/
|
*/
|
||||||
int spdk_pci_enumerate(struct spdk_pci_driver *driver, spdk_pci_enum_cb enum_cb, void *enum_ctx);
|
int spdk_pci_enumerate(struct spdk_pci_driver *driver, spdk_pci_enum_cb enum_cb, void *enum_ctx);
|
||||||
|
|
||||||
/**
|
|
||||||
* Enumerate all Virtio devices on the PCI bus and try to attach those that
|
|
||||||
* weren't attached yet.
|
|
||||||
*
|
|
||||||
* \see spdk_pci_enumerate
|
|
||||||
*/
|
|
||||||
int spdk_pci_virtio_enumerate(spdk_pci_enum_cb enum_cb, void *enum_ctx);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map a PCI BAR in the current process.
|
* Map a PCI BAR in the current process.
|
||||||
*
|
*
|
||||||
@ -846,14 +845,6 @@ void spdk_pci_device_detach(struct spdk_pci_device *device);
|
|||||||
int spdk_pci_device_attach(struct spdk_pci_driver *driver, spdk_pci_enum_cb enum_cb,
|
int spdk_pci_device_attach(struct spdk_pci_driver *driver, spdk_pci_enum_cb enum_cb,
|
||||||
void *enum_ctx, struct spdk_pci_addr *pci_address);
|
void *enum_ctx, struct spdk_pci_addr *pci_address);
|
||||||
|
|
||||||
/**
|
|
||||||
* Attach a PCI Virtio device.
|
|
||||||
*
|
|
||||||
* \see spdk_pci_device_attach
|
|
||||||
*/
|
|
||||||
int spdk_pci_virtio_device_attach(spdk_pci_enum_cb enum_cb, void *enum_ctx,
|
|
||||||
struct spdk_pci_addr *pci_address);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read \c len bytes from the PCI configuration space.
|
* Read \c len bytes from the PCI configuration space.
|
||||||
*
|
*
|
||||||
|
@ -59,17 +59,10 @@ static struct spdk_pci_driver g_virtio_pci_drv = {
|
|||||||
.is_registered = false,
|
.is_registered = false,
|
||||||
};
|
};
|
||||||
|
|
||||||
int
|
struct spdk_pci_driver *
|
||||||
spdk_pci_virtio_device_attach(spdk_pci_enum_cb enum_cb,
|
spdk_pci_virtio_get_driver(void)
|
||||||
void *enum_ctx, struct spdk_pci_addr *pci_address)
|
|
||||||
{
|
{
|
||||||
return spdk_pci_device_attach(&g_virtio_pci_drv, enum_cb, enum_ctx, pci_address);
|
return &g_virtio_pci_drv;
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
spdk_pci_virtio_enumerate(spdk_pci_enum_cb enum_cb, void *enum_ctx)
|
|
||||||
{
|
|
||||||
return spdk_pci_enumerate(&g_virtio_pci_drv, enum_cb, enum_ctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SPDK_PMD_REGISTER_PCI(g_virtio_pci_drv);
|
SPDK_PMD_REGISTER_PCI(g_virtio_pci_drv);
|
||||||
|
@ -549,7 +549,8 @@ virtio_pci_dev_enumerate(virtio_pci_create_cb enum_cb, void *enum_ctx,
|
|||||||
ctx.enum_ctx = enum_ctx;
|
ctx.enum_ctx = enum_ctx;
|
||||||
ctx.device_id = pci_device_id;
|
ctx.device_id = pci_device_id;
|
||||||
|
|
||||||
return spdk_pci_virtio_enumerate(virtio_pci_dev_probe_cb, &ctx);
|
return spdk_pci_enumerate(spdk_pci_virtio_get_driver(),
|
||||||
|
virtio_pci_dev_probe_cb, &ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -567,7 +568,8 @@ virtio_pci_dev_attach(virtio_pci_create_cb enum_cb, void *enum_ctx,
|
|||||||
ctx.enum_ctx = enum_ctx;
|
ctx.enum_ctx = enum_ctx;
|
||||||
ctx.device_id = pci_device_id;
|
ctx.device_id = pci_device_id;
|
||||||
|
|
||||||
return spdk_pci_virtio_device_attach(virtio_pci_dev_probe_cb, &ctx, pci_address);
|
return spdk_pci_device_attach(spdk_pci_virtio_get_driver(),
|
||||||
|
virtio_pci_dev_probe_cb, &ctx, pci_address);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -42,6 +42,7 @@ DEFINE_STUB(spdk_process_is_primary, bool, (void), true)
|
|||||||
DEFINE_STUB(spdk_memzone_lookup, void *, (const char *name), NULL)
|
DEFINE_STUB(spdk_memzone_lookup, void *, (const char *name), NULL)
|
||||||
DEFINE_STUB(spdk_pci_nvme_get_driver, struct spdk_pci_driver *, (void), NULL)
|
DEFINE_STUB(spdk_pci_nvme_get_driver, struct spdk_pci_driver *, (void), NULL)
|
||||||
DEFINE_STUB(spdk_pci_ioat_get_driver, struct spdk_pci_driver *, (void), NULL)
|
DEFINE_STUB(spdk_pci_ioat_get_driver, struct spdk_pci_driver *, (void), NULL)
|
||||||
|
DEFINE_STUB(spdk_pci_virtio_get_driver, struct spdk_pci_driver *, (void), NULL)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These mocks don't use the DEFINE_STUB macros because
|
* These mocks don't use the DEFINE_STUB macros because
|
||||||
|
Loading…
Reference in New Issue
Block a user