env: move attach cb description where typedef is specified

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I148b4b1608b4287add0e7d3b88b676950d44a9a8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5059
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Jacek Kalwas 2020-11-09 09:48:46 -05:00 committed by Tomasz Zawadzki
parent 714a3bc3da
commit 4793391448

View File

@ -697,7 +697,17 @@ struct spdk_pci_device {
} internal;
};
typedef int (*spdk_pci_enum_cb)(void *enum_ctx, struct spdk_pci_device *pci_dev);
/**
* Callback for device attach handling.
*
* \param enum_ctx Opaque value.
* \param dev PCI device.
*
* \return -1 if an error occurred,
* 0 if device attached successfully,
* 1 if device not attached.
*/
typedef int (*spdk_pci_enum_cb)(void *enum_ctx, struct spdk_pci_device *dev);
#define SPDK_PCI_DEVICE(vend, dev) \
.class_id = SPDK_PCI_CLASS_ANY_ID, \
@ -766,13 +776,9 @@ struct spdk_pci_driver *spdk_pci_nvme_get_driver(void);
*
* \param driver Driver for a specific device type.
* \param enum_cb Callback to be called for each non-attached PCI device.
* The return code can be as follows:
* -1 - device was not attached, the enumeration is stopped
* 0 - device attached successfully, enumeration continues
* 1 - device was not attached, enumeration continues
* \param enum_ctx Additional context passed to the callback function.
*
* \return -1 if an internal error occured or the provided callback returned -1,
* \return -1 if an internal error occurred or the provided callback returned -1,
* 0 otherwise
*/
int spdk_pci_enumerate(struct spdk_pci_driver *driver, spdk_pci_enum_cb enum_cb, void *enum_ctx);
@ -978,9 +984,6 @@ void spdk_pci_device_detach(struct spdk_pci_device *device);
* \param driver Driver for a specific device type. The device will only be
* attached if it's supported by this driver.
* \param enum_cb Callback to be called for the PCI device once it's found.
* The return code can be as follows:
* -1, 1 - an error occurred, fail the attach request entirely
* 0 - device attached successfully
* \param enum_ctx Additional context passed to the callback function.
* \param pci_address Address of the device to attach.
*