From 4793391448e92a113a20265997ad60438e329da1 Mon Sep 17 00:00:00 2001 From: Jacek Kalwas Date: Mon, 9 Nov 2020 09:48:46 -0500 Subject: [PATCH] env: move attach cb description where typedef is specified Signed-off-by: Jacek Kalwas 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 Reviewed-by: Jim Harris Reviewed-by: Tomasz Zawadzki --- include/spdk/env.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/include/spdk/env.h b/include/spdk/env.h index 49fe27c1a..9bee0fbcb 100644 --- a/include/spdk/env.h +++ b/include/spdk/env.h @@ -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. *